check that link() doesn't cause statinfo to be corrupted/reverted for
[arla.git] / cf / have-type.m4
bloba0ab9988ffd667a9a3f0f925a7da3919cb2e8fed
1 dnl $Id$
2 dnl
3 dnl check for existance of a type
5 dnl AC_HAVE_TYPE(TYPE,INCLUDES)
6 AC_DEFUN([AC_HAVE_TYPE], [
7 AC_REQUIRE([AC_HEADER_STDC])
8 cv=`echo "$1" | sed 'y%./+- %__p__%'`
9 AC_MSG_CHECKING(for $1)
10 AC_CACHE_VAL([ac_cv_type_$cv],
11 AC_TRY_COMPILE(
12 [#include <sys/types.h>
13 #ifdef HAVE_STDINT_H
14 #include <stdint.h>
15 #endif
16 #if STDC_HEADERS
17 #include <stdlib.h>
18 #include <stddef.h>
19 #endif
20 $2],
21 [$1 foo;],
22 eval "ac_cv_type_$cv=yes",
23 eval "ac_cv_type_$cv=no"))dnl
24 ac_foo=`eval echo \\$ac_cv_type_$cv`
25 AC_MSG_RESULT($ac_foo)
26 if test "$ac_foo" = yes; then
27   ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
28 if false; then
29         AC_CHECK_TYPES($1)
31   AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])