1 dnl @synopsis AC_CHECK_SYMBOL(SYMBOL, HEADER... [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
3 dnl a wrapper around AC_EGREP_HEADER the shellvar $ac_found will hold
4 dnl the HEADER-name that had been containing the symbol. This value is
8 dnl @author Guido U. Draheim <guidod@gmx.de>
9 dnl @version 2006-10-13
10 dnl @license GPLWithACException
12 AC_DEFUN([AC_CHECK_SYMBOL],
13 [AC_MSG_CHECKING([for $1 in $2])
14 AC_CACHE_VAL(ac_cv_func_$1,
17 symbol="[^a-zA-Z_0-9]$1[^a-zA-Z_0-9]"
20 for ac_header in $2 ; do
21 ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%' `
22 if test $ac_found != "yes" ; then
23 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
24 AC_EGREP_HEADER( $symbol, $ac_header, [ac_found="$ac_header"] )
28 if test "$ac_found" != "no" ; then
29 AC_MSG_RESULT($ac_found)
30 ifelse([$3], , :, [$3])
38 dnl AC_CHECK_SYMBOLS( symbol..., header... [, action-if-found [, action-if-not-found]])
39 AC_DEFUN([AC_CHECK_SYMBOLS],
42 P4_CHECK_SYMBOL($ac_func, $2,
44 ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:'`
46 AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl