source: trunk/essentials/sys-apps/grep/m4/decl.m4

Last change on this file was 2557, checked in by bird, 19 years ago

grep 2.5.1a

File size: 910 bytes
Line 
1#serial 5
2
3AC_DEFUN(jm_CHECK_DECLARATION,
4[
5 AC_MSG_CHECKING([whether $1 is declared])
6 AC_CACHE_VAL(jm_cv_func_decl_$1,
7 [AC_TRY_COMPILE([$2],
8 [
9#ifndef $1
10char *(*pfn) = (char *(*)) $1
11#endif
12 ],
13 eval "jm_cv_func_decl_$1=yes",
14 eval "jm_cv_func_decl_$1=no")])
15
16 if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
17 AC_MSG_RESULT(yes)
18 ifelse([$3], , :, [$3])
19 else
20 AC_MSG_RESULT(no)
21 ifelse([$4], , , [$4
22])dnl
23 fi
24])dnl
25
26dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
27dnl [, ACTION-IF-NOT-DECLARED]])
28AC_DEFUN(jm_CHECK_DECLARATIONS,
29[
30 for jm_func in $2
31 do
32 jm_CHECK_DECLARATION($jm_func, [$1],
33 [
34 jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
35 AC_DEFINE_UNQUOTED($jm_tr_func, 1, [Define if your system declares $1]) $3], [$4])dnl
36 done
37])
Note: See TracBrowser for help on using the repository browser.