1dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false) 2dnl exec action-if-true if typedef_name is a typedef to type else exec 3dnl action-if-false 4dnl currently work only with type typedef'ed in stddef.h 5AC_DEFUN([AX_CHECK_TYPEDEF], [ 6dnl AC_LANG_PUSH(C) not in autoconf 2.13 7AC_LANG_SAVE 8AC_LANG_C 9SAVE_CFLAGS=$CFLAGS 10CFLAGS="-Werror $CFLAGS" 11 12AC_TRY_COMPILE( 13 [ 14 #include <stddef.h> 15 ], 16 [ 17 typedef void (*fct1)($1); 18 typedef void (*fct2)($2); 19 fct1 f1 = 0; 20 fct2 f2 = 0; 21 if (f1 == f2) {} 22 ], 23[$3],[$4]) 24 25CFLAGS=$SAVE_CFLAGS 26AC_LANG_RESTORE 27]) 28 29 30dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name) 31dnl set var_name to the typedef name of $1 which must be in canditate_list 32dnl else produce a fatal error 33AC_DEFUN([AX_TYPEDEFED_NAME], [ 34 AC_MSG_CHECKING([type of $1]) 35 for f in $2; do 36 AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="") 37 if test -n "${$3}"; then 38 break 39 fi 40 done 41 if test -n "${$3}"; then 42 AC_MSG_RESULT([${$3}]) 43 else 44 AC_MSG_ERROR([not found]) 45 fi 46]) 47