Added a smarter check for external timezone and daylight variables in
#include <time.h> -- Thomas Gellekum <tg@ihf.rwth-aachen.de>
This commit is contained in:
parent
f4098fd8d0
commit
64961cd294
3 changed files with 66 additions and 22 deletions
13
aclocal.m4
vendored
13
aclocal.m4
vendored
|
@ -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.
|
# Define a conditional.
|
||||||
|
|
||||||
AC_DEFUN(AM_CONDITIONAL,
|
AC_DEFUN(AM_CONDITIONAL,
|
||||||
|
|
43
acsite.m4
43
acsite.m4
|
@ -349,3 +349,46 @@ fi
|
||||||
dnl
|
dnl
|
||||||
dnl
|
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
|
||||||
|
|
32
configure.in
32
configure.in
|
@ -20,8 +20,14 @@ AM_PROG_LIBTOOL
|
||||||
dnl Initialize maintainer mode
|
dnl Initialize maintainer mode
|
||||||
AM_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
|
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 Using AM_CONDITIONAL is a step out of the protected little
|
||||||
dnl automake fold so it is potentially dangerous. But, we are
|
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 enough. AM_CONDITIONALS are then referenced to conditionally
|
||||||
dnl build a Makefile.in from a Makefile.am which lets us define custom
|
dnl build a Makefile.in from a Makefile.am which lets us define custom
|
||||||
dnl includes, compile alternative source files, etc.
|
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
|
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_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
dnl extra library and include directories
|
dnl extra library and include directories
|
||||||
EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
|
EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6"
|
||||||
|
@ -153,6 +165,8 @@ AC_OUTPUT( \
|
||||||
Include/Makefile \
|
Include/Makefile \
|
||||||
Lib/Makefile \
|
Lib/Makefile \
|
||||||
Lib/Audio/Makefile \
|
Lib/Audio/Makefile \
|
||||||
|
Lib/Audio/src/Makefile \
|
||||||
|
Lib/Audio/example/Makefile \
|
||||||
Lib/Bucket/Makefile \
|
Lib/Bucket/Makefile \
|
||||||
Lib/Debug/Makefile \
|
Lib/Debug/Makefile \
|
||||||
Lib/DEM/Makefile \
|
Lib/DEM/Makefile \
|
||||||
|
|
Loading…
Reference in a new issue