]> git.mxchange.org Git - flightgear.git/commitdiff
Added a smarter check for external timezone and daylight variables in
authorcurt <curt>
Wed, 17 Jun 1998 21:31:04 +0000 (21:31 +0000)
committercurt <curt>
Wed, 17 Jun 1998 21:31:04 +0000 (21:31 +0000)
#include <time.h> -- Thomas Gellekum <tg@ihf.rwth-aachen.de>

aclocal.m4
acsite.m4
configure.in

index 6163ea140e509439d796d64188f57910db970b54..f988bcede327cb008653360552642e3e246ede4c 100644 (file)
@@ -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,
index aa69e2d97a113b00152aeac0ca7b4b547aab7610..6a845b801a14a35f878f65fb34510637e01fe45d 100644 (file)
--- 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 <time.h>], [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 <time.h>],
+        [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 <time.h>],
+        [extern time_t timezone;
+         timezone += 1;
+         exit (0);],
+        [have_timezone=yes
+         AC_MSG_RESULT(yes)],
+         AC_MSG_RESULT(no))
+fi
+])dnl
index 816b58f77e6197e3ca8617a60ed50d373477cfc9..cfd6fe7a10b2d5603f076694bd449a161c77422e 100644 (file)
@@ -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 Linux style audio support
 
-AM_CONDITIONAL(HAVE_DAYLIGHT, grep daylight /usr/include/time.h )
+dnl Check for external variables daylight and timezone.
+AC_EXT_DAYLIGHT
+AM_CONDITIONAL(HAVE_DAYLIGHT, test "$have_daylight" = yes )
 
-AM_CONDITIONAL(HAVE_TIMEZONE, grep timezone /usr/include/time.h )
+AC_EXT_TIMEZONE
+AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes )
 
-AM_CONDITIONAL(HAVE_OSS_AUDIO, \
-       test -r /usr/include/soundcard.h -o -r /usr/include/linux/soundcard.h )
+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" )
 
-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 \