From 64961cd294c7e500adb96ad63368a8b24a837837 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 17 Jun 1998 21:31:04 +0000 Subject: [PATCH] Added a smarter check for external timezone and daylight variables in #include -- Thomas Gellekum --- aclocal.m4 | 13 ------------- acsite.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ configure.in | 32 +++++++++++++++++++++++--------- 3 files changed, 66 insertions(+), 22 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 6163ea140..f988bcede 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -372,19 +372,6 @@ AC_DEFUN(AM_MAINTAINER_MODE, ] ) -# Check to see if we're running under Cygwin32, without using -# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes". -# Otherwise set it to "no". - -dnl AM_CYGWIN32() -AC_DEFUN(AM_CYGWIN32, -[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, -[AC_TRY_COMPILE(,[return __CYGWIN32__;], -am_cv_cygwin32=yes, am_cv_cygwin32=no) -rm -f conftest*]) -CYGWIN32= -test "$am_cv_cygwin32" = yes && CYGWIN32=yes]) - # Define a conditional. AC_DEFUN(AM_CONDITIONAL, diff --git a/acsite.m4 b/acsite.m4 index aa69e2d97..6a845b801 100644 --- a/acsite.m4 +++ b/acsite.m4 @@ -349,3 +349,46 @@ fi dnl dnl dnl + +dnl AC_EXT_DAYLIGHT +dnl Check for an external variable daylight. Stolen from w3c-libwww. +AC_DEFUN(AC_EXT_DAYLIGHT, +[ AC_MSG_CHECKING(int daylight variable) +AC_TRY_COMPILE([#include ], [return daylight;], + have_daylight=yes, + have_daylight=no) +AC_MSG_RESULT($have_daylight) +])dnl + +dnl AC_EXT_TIMEZONE +dnl Check for an external variable timezone. Stolen from tcl-8.0. +AC_DEFUN(AC_EXT_TIMEZONE, +[ +# +# Its important to include time.h in this check, as some systems (like convex) +# have timezone functions, etc. +# +have_timezone=no +AC_MSG_CHECKING([long timezone variable]) +AC_TRY_COMPILE([#include ], + [extern long timezone; + timezone += 1; + exit (0);], + [have_timezone=yes + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no)) + +# +# On some systems (eg IRIX 6.2), timezone is a time_t and not a long. +# +if test "$have_timezone" = no; then + AC_MSG_CHECKING([time_t timezone variable]) + AC_TRY_COMPILE([#include ], + [extern time_t timezone; + timezone += 1; + exit (0);], + [have_timezone=yes + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no)) +fi +])dnl diff --git a/configure.in b/configure.in index 816b58f77..cfd6fe7a1 100644 --- a/configure.in +++ b/configure.in @@ -20,8 +20,14 @@ AM_PROG_LIBTOOL dnl Initialize maintainer mode AM_MAINTAINER_MODE +dnl This is needed for AC_TRY_COMPILE later +AC_ISC_POSIX + dnl Check to see if this `configure' is being run in the `Cygwin32' environment -AM_CYGWIN32 +dnl AM_CYGWIN32 + +dnl Check for MS Windows environment +AC_CHECK_HEADER(windows.h) dnl Using AM_CONDITIONAL is a step out of the protected little dnl automake fold so it is potentially dangerous. But, we are @@ -29,16 +35,22 @@ dnl beginning to run into cases where the standard checks are not dnl enough. AM_CONDITIONALS are then referenced to conditionally dnl build a Makefile.in from a Makefile.am which lets us define custom dnl includes, compile alternative source files, etc. + +dnl Check for external variables daylight and timezone. +AC_EXT_DAYLIGHT +AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes ) + +AC_EXT_TIMEZONE +AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes ) + dnl Check for Linux style audio support +AM_CONDITIONAL(HAVE_AUDIO_SUPPORT, \ + test -r /usr/include/soundcard.h \ + -o -r /usr/include/linux/soundcard.h \ + -o -r /usr/include/machine/soundcard.h \ + -o "x$ac_cv_header_windows_h" = "xyes" ) -AM_CONDITIONAL(HAVE_DAYLIGHT, grep daylight /usr/include/time.h ) - -AM_CONDITIONAL(HAVE_TIMEZONE, grep timezone /usr/include/time.h ) - -AM_CONDITIONAL(HAVE_OSS_AUDIO, \ - test -r /usr/include/soundcard.h -o -r /usr/include/linux/soundcard.h ) - -AC_CHECK_HEADER(windows.h) +AM_CONDITIONAL(HAVE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes") dnl extra library and include directories EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6" @@ -153,6 +165,8 @@ AC_OUTPUT( \ Include/Makefile \ Lib/Makefile \ Lib/Audio/Makefile \ + Lib/Audio/src/Makefile \ + Lib/Audio/example/Makefile \ Lib/Bucket/Makefile \ Lib/Debug/Makefile \ Lib/DEM/Makefile \