diff options
| author | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
| commit | 0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch) | |
| tree | af916a30553c78ce9d4f2d8658656a175c5b6921 /ac/check-type.m4 | |
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'ac/check-type.m4')
| -rw-r--r-- | ac/check-type.m4 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ac/check-type.m4 b/ac/check-type.m4 new file mode 100644 index 0000000..e65ea03 --- /dev/null +++ b/ac/check-type.m4 | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | dnl SYLPHEED_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES, COMMENT]) | ||
| 2 | dnl | ||
| 3 | dnl Like AC_CHECK_TYPE, but in addition to `sys/types.h', `stdlib.h' and | ||
| 4 | dnl `stddef.h' checks files included by INCLUDES, which should be a | ||
| 5 | dnl series of #include statements. If TYPE is not defined, define it | ||
| 6 | dnl to DEFAULT. | ||
| 7 | dnl | ||
| 8 | AC_DEFUN([SYLPHEED_CHECK_TYPE], | ||
| 9 | [AC_REQUIRE([AC_HEADER_STDC])dnl | ||
| 10 | AC_MSG_CHECKING(for $1) | ||
| 11 | AC_CACHE_VAL(sylpheed_cv_type_$1, | ||
| 12 | [AC_TRY_COMPILE([ | ||
| 13 | #include <sys/types.h> | ||
| 14 | #if STDC_HEADERS | ||
| 15 | #include <stdlib.h> | ||
| 16 | #include <stddef.h> | ||
| 17 | #endif | ||
| 18 | $3 | ||
| 19 | ], [ | ||
| 20 | #undef $1 | ||
| 21 | int a = sizeof($1); | ||
| 22 | ], sylpheed_cv_type_$1=yes, sylpheed_cv_type_$1=no)])dnl | ||
| 23 | AC_MSG_RESULT($sylpheed_cv_type_$1) | ||
| 24 | if test $sylpheed_cv_type_$1 = no; then | ||
| 25 | AC_DEFINE($1, $2, $4) | ||
| 26 | fi | ||
| 27 | ]) | ||
