diff options
author | Jim Meyering <jim@meyering.net> | 1998-10-18 01:07:17 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-10-18 01:07:17 +0000 |
commit | 2b69ce2d89a9b573ac96cbc5266101accc4a294e (patch) | |
tree | cce8668fb143218665b360e1af26c839edc8ef68 /m4 | |
parent | 0a25bc498dd58956197f827533a239ab4f3a1e14 (diff) | |
download | coreutils-2b69ce2d89a9b573ac96cbc5266101accc4a294e.tar.xz |
(jm_CHECK_DECLARATION): Don't hard-code which headers to
include, though we still hard-code the `require'-like AC_CHECK_HEADERS
calls for those previously hard-coded headers. Instead, take a new parameter.
(jm_CHECK_DECLARATIONS): Reflect interface change.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/decl.m4 | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/m4/decl.m4 b/m4/decl.m4 index 781afa1b2..69438b706 100644 --- a/m4/decl.m4 +++ b/m4/decl.m4 @@ -1,4 +1,4 @@ -#serial 2 +#serial 3 AC_DEFUN(jm_CHECK_DECLARATION, [ @@ -10,24 +10,7 @@ AC_DEFUN(jm_CHECK_DECLARATION, test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h) AC_MSG_CHECKING([whether $1 is declared]) AC_CACHE_VAL(jm_cv_func_decl_$1, - [AC_TRY_COMPILE([ -#include <stdio.h> -#ifdef HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#else -# ifdef HAVE_STRINGS_H -# include <strings.h> -# endif -#endif -#ifdef HAVE_STDLIB_H -# include <stdlib.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif], + [AC_TRY_COMPILE($2, [ #ifndef $1 char *(*pfn) = (char *(*)) $1 @@ -38,23 +21,23 @@ char *(*pfn) = (char *(*)) $1 if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) + ifelse([$3], , :, [$3]) else AC_MSG_RESULT(no) - ifelse([$3], , , [$3 + ifelse([$4], , , [$4 ])dnl fi ])dnl -dnl jm_CHECK_DECLARATIONS(FUNCTION... [, ACTION-IF-DECLARED +dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED dnl [, ACTION-IF-NOT-DECLARED]]) AC_DEFUN(jm_CHECK_DECLARATIONS, [ - for jm_func in $1 + for jm_func in $2 do - jm_CHECK_DECLARATION($jm_func, + jm_CHECK_DECLARATION($jm_func, $1, [ jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` - AC_DEFINE_UNQUOTED($jm_tr_func) $2], $3)dnl + AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl done ]) |