]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/file/acinclude.m4
This commit was generated by cvs2svn to compensate for changes in r94536,
[FreeBSD/FreeBSD.git] / contrib / file / acinclude.m4
1 dnl cloned from autoconf 2.13 acspecific.m4
2 AC_DEFUN(AC_C_LONG_LONG,
3 [AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
4 [if test "$GCC" = yes; then
5   ac_cv_c_long_long=yes
6 else
7 AC_TRY_RUN([int main() {
8 long long foo = 0;
9 exit(sizeof(long long) < sizeof(long)); }],
10 ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
11 fi])
12 if test $ac_cv_c_long_long = yes; then
13   AC_DEFINE(HAVE_LONG_LONG)
14 fi
15 ])
16
17 dnl from autoconf 2.13 acgeneral.m4, with patch:
18 dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
19 dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
20 dnl From: eggert@twinsun.com (Paul Eggert)
21 dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
22 dnl Newsgroups: gnu.utils.bug
23
24 dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
25
26 AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
27 [AC_REQUIRE([AC_STRUCT_TM])dnl
28 AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
29 [AC_TRY_COMPILE([#include <sys/types.h>
30 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
31   ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
32 if test "$ac_cv_struct_tm_zone" = yes; then
33   AC_DEFINE(HAVE_TM_ZONE)
34 fi
35 AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
36 [AC_TRY_LINK(
37 changequote(<<, >>)dnl
38 <<#include <time.h>
39 #ifndef tzname /* For SGI.  */
40 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
41 #endif>>,
42 changequote([, ])dnl
43 [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
44   if test $ac_cv_var_tzname = yes; then
45     AC_DEFINE(HAVE_TZNAME)
46   fi
47
48 AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
49 [AC_TRY_COMPILE([#include <sys/types.h>
50 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
51   ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
52 if test "$ac_cv_struct_tm_isdst" = yes; then
53   AC_DEFINE(HAVE_TM_ISDST)
54 fi
55 AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
56 [AC_TRY_LINK(
57 changequote(<<, >>)dnl
58 <<#include <time.h>
59 #ifndef daylight /* In case IRIX #defines this, too  */
60 extern int daylight;
61 #endif>>,
62 changequote([, ])dnl
63 [atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
64   if test $ac_cv_var_daylight = yes; then
65     AC_DEFINE(HAVE_DAYLIGHT)
66   fi
67 ])
68
69 dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
70 AC_DEFUN(AC_CHECK_TYPE2,
71 [AC_REQUIRE([AC_HEADER_STDC])dnl
72 AC_MSG_CHECKING(for $1)
73 AC_CACHE_VAL(ac_cv_type_$1,
74 [AC_EGREP_CPP(dnl
75 changequote(<<,>>)dnl
76 <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
77 changequote([,]), [#include <sys/types.h>
78 #if STDC_HEADERS
79 #include <stdlib.h>
80 #include <stddef.h>
81 #endif], eval "ac_cv_type_$1=yes", eval "ac_cv_type_$1=no")])dnl
82 if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
83   AC_MSG_RESULT(yes)
84 else
85   AC_MSG_RESULT(no)
86   AC_DEFINE_UNQUOTED($1, $2)
87 fi
88 ])
89
90 dnl from autoconf 2.13 acgeneral.m4, with additional third argument
91 dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE, [INCLUDES]])
92 AC_DEFUN(AC_CHECK_SIZEOF_INCLUDES,
93 [changequote(<<, >>)dnl
94 dnl The name to #define.
95 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
96 dnl The cache variable name.
97 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
98 changequote([, ])dnl
99 AC_MSG_CHECKING(size of $1)
100 AC_CACHE_VAL(AC_CV_NAME,
101 [AC_TRY_RUN([$3
102 #include <stdio.h>
103 main()
104 {
105   FILE *f=fopen("conftestval", "w");
106   if (!f) exit(1);
107   fprintf(f, "%d\n", sizeof($1));
108   exit(0);
109 }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
110 AC_MSG_RESULT($AC_CV_NAME)
111 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
112 undefine([AC_TYPE_NAME])dnl
113 undefine([AC_CV_NAME])dnl
114 ])
115
116 dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
117 AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS,
118 [AC_CHECK_SIZEOF_INCLUDES($1, $2,
119 [#include <sys/types.h>
120 #ifdef STDC_HEADERS
121 #include <stdlib.h>
122 #endif
123 ])
124 ])