]> gcc.gnu.org Git - gcc.git/blame - libgfortran/acinclude.m4
acinclude.m4: Properly quote AC_CACHE_CHECK.
[gcc.git] / libgfortran / acinclude.m4
CommitLineData
6de9cd9a
DN
1dnl Check:
2dnl * If we have gettimeofday;
3dnl * If we have struct timezone for use in calling it;
4dnl * If calling it with a timezone pointer actually works -- this is deemed
5dnl obsolete or undefined on some systems which say you should use a null
6dnl pointer -- and undefine HAVE_TIMEZONE if so;
7dnl * Whether it only takes one arg.
8AC_DEFUN([LIBGFOR_GETTIMEOFDAY], [
9 AC_CHECK_FUNCS(gettimeofday)
10 if test "$ac_cv_func_gettimeofday" = yes; then
11 AC_CACHE_CHECK([for struct timezone], gfor_cv_struct_timezone,
12 [AC_TRY_COMPILE([#include <sys/time.h>],
13 [struct timezone tz;],
14 gfor_cv_struct_timezone=yes, gfor_cv_struct_timezone=no)])
15 if test $gfor_cv_struct_timezone = yes; then
16 dnl It may be that we can't call gettimeofday with a non-null pointer.
17 dnl In that case we'll lie about struct timezone.
18 AC_TRY_RUN([
19#ifdef TIME_WITH_SYS_TIME
20#include <sys/time.h>
21#include <time.h>
22#else
23#ifdef HAVE_SYS_TIME_H
24#include <sys/time.h>
25#else
26#include <time.h>
27#endif
28#endif
29main ()
30{
31 struct timeval time;
32 struct timezone dummy;
33 if (gettimeofday (&time, &dummy))
34 exit (1);
35 else
36 exit (0);
37}],
38 [gfor_have_struct_timezone=yes], [gfor_have_struct_timezone=no],
39 [gfor_have_struct_timezone=yes])
40 if test $gfor_have_struct_timezone = yes; then
41 AC_DEFINE(HAVE_TIMEZONE, 1, [Do we have struct timezone])
42 fi
43 fi
44 AC_REQUIRE([AC_HEADER_TIME])
d49ec2d1 45 AC_CACHE_CHECK([whether gettimeofday can accept two arguments],
6de9cd9a 46 emacs_cv_gettimeofday_two_arguments,
d49ec2d1 47 [AC_TRY_LINK([
6de9cd9a
DN
48#ifdef TIME_WITH_SYS_TIME
49#include <sys/time.h>
50#include <time.h>
51#else
52#ifdef HAVE_SYS_TIME_H
53#include <sys/time.h>
54#else
55#include <time.h>
56#endif
57#endif
58 ],
59 [
60 struct timeval time;
61#ifdef HAVE_TIMEZONE
62 struct timezone dummy;
63#define DUMMY &dummy
64#else
65#define DUMMY NULL
66#endif
67 gettimeofday (&time, DUMMY);],
68 emacs_cv_gettimeofday_two_arguments=yes,
d49ec2d1 69 emacs_cv_gettimeofday_two_arguments=no)])
6de9cd9a
DN
70 if test $emacs_cv_gettimeofday_two_arguments = no; then
71 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
72 [Does gettimeofday take a single argument])
73 fi
74 fi])
75
76sinclude(../libtool.m4)
77dnl The lines below arrange for aclocal not to bring an installed
78dnl libtool.m4 into aclocal.m4, while still arranging for automake to
79dnl add a definition of LIBTOOL to Makefile.in.
80ifelse(,,,[AC_SUBST(LIBTOOL)
81AC_DEFUN([AM_PROG_LIBTOOL])
82AC_DEFUN([AC_LIBTOOL_DLOPEN])
83AC_DEFUN([AC_PROG_LD])
84])
85
This page took 0.09688 seconds and 5 git commands to generate.