acinclude.m4 revision 84685
1dnl cloned from autoconf 2.13 acspecific.m4
2AC_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
6else
7AC_TRY_RUN([int main() {
8long long foo = 0;
9exit(sizeof(long long) < sizeof(long)); }],
10ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
11fi])
12if test $ac_cv_c_long_long = yes; then
13  AC_DEFINE(HAVE_LONG_LONG)
14fi
15])
16
17dnl from autoconf 2.13 acgeneral.m4, with patch:
18dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
19dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
20dnl From: eggert@twinsun.com (Paul Eggert)
21dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
22dnl Newsgroups: gnu.utils.bug
23
24dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
25
26AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
27[AC_REQUIRE([AC_STRUCT_TM])dnl
28AC_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)])
32if test "$ac_cv_struct_tm_zone" = yes; then
33  AC_DEFINE(HAVE_TM_ZONE)
34fi
35AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
36[AC_TRY_LINK(
37changequote(<<, >>)dnl
38<<#include <time.h>
39#ifndef tzname /* For SGI.  */
40extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
41#endif>>,
42changequote([, ])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
48AC_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)])
52if test "$ac_cv_struct_tm_isdst" = yes; then
53  AC_DEFINE(HAVE_TM_ISDST)
54fi
55AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
56[AC_TRY_LINK(
57changequote(<<, >>)dnl
58<<#include <time.h>
59#ifndef daylight /* In case IRIX #defines this, too  */
60extern int daylight;
61#endif>>,
62changequote([, ])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
69dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
70AC_DEFUN(AC_CHECK_TYPE2,
71[AC_REQUIRE([AC_HEADER_STDC])dnl
72AC_MSG_CHECKING(for $1)
73AC_CACHE_VAL(ac_cv_type_$1,
74[AC_EGREP_CPP(dnl
75changequote(<<,>>)dnl
76<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
77changequote([,]), [#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
82if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
83  AC_MSG_RESULT(yes)
84else
85  AC_MSG_RESULT(no)
86  AC_DEFINE_UNQUOTED($1, $2)
87fi
88])
89
90dnl from autoconf 2.13 acgeneral.m4, with additional third argument
91dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE, [INCLUDES]])
92AC_DEFUN(AC_CHECK_SIZEOF_INCLUDES,
93[changequote(<<, >>)dnl
94dnl The name to #define.
95define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
96dnl The cache variable name.
97define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
98changequote([, ])dnl
99AC_MSG_CHECKING(size of $1)
100AC_CACHE_VAL(AC_CV_NAME,
101[AC_TRY_RUN([$3
102#include <stdio.h>
103main()
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
110AC_MSG_RESULT($AC_CV_NAME)
111AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
112undefine([AC_TYPE_NAME])dnl
113undefine([AC_CV_NAME])dnl
114])
115
116dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
117AC_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])
125