diff options
author | Derrick Brashear <shadow@gmail.com> | 2005-03-12 20:37:50 +0000 |
---|---|---|
committer | Derrick Brashear <shadow@gmail.com> | 2005-03-12 20:37:50 +0000 |
commit | 1d6c037f9a0cc0405f503f7f858545ca6847c5c1 (patch) | |
tree | df0029d539824d8f3c07eceacba348afc47b7b40 /configure.ac | |
parent | af41b2d13107d52ed53b546b3a2869cd6cd81aac (diff) | |
download | gpsd-1d6c037f9a0cc0405f503f7f858545ca6847c5c1.tar.gz |
Three small fixes.
serial.c needs sys/aio.h on macos (O_SYNC)
configure.ac needs to test for externed timezone and daylight
nmea_parse.c needs to not use daylight and timezone when they don't exist
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 8c0471a3..6b6d56ac 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,43 @@ if eval "test x$GCC = xyes"; then dnl -Wcast-qual -Wextra fi -AC_CHECK_HEADERS(termios.h sys/termios.h sys/select.h strings.h sys/filio.h sys/time.h X11/xpm.h xpm.h getopt.h sys/modem.h) +AC_CHECK_HEADERS(termios.h sys/termios.h sys/select.h strings.h sys/filio.h sys/time.h X11/xpm.h xpm.h getopt.h sys/modem.h sys/aio.h) + +AC_HEADER_TIME +AC_STRUCT_TIMEZONE + +AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone, + AC_TRY_COMPILE([ +#include <time.h> + ], [ + timezone = 1; + ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)) +if test $ac_cv_var_timezone = yes; then + AC_DEFINE(HAVE_TIMEZONE, [], [Have timezone variable]) +else + AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, + AC_TRY_COMPILE([ +#include <time.h> + ], [ + struct tm tm; + tm.tm_gmtoff = 1; + ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no +)) + if test $ac_cv_struct_tm_gmtoff = yes; then + AC_DEFINE(HAVE_TM_GMTOFF, [], [struct tm has tm_gmtoff]) + else + AC_ERROR(unable to find a way to determine timezone) + fi +fi +AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight, +[ AC_TRY_LINK([#include <time.h>], [return (int)daylight;], + mb_cv_var_daylight=yes, + mb_cv_var_daylight=no) +]) +if test $mb_cv_var_daylight = yes; then + AC_DEFINE([HAVE_DAYLIGHT], 1, + [Define if you have the external `daylight' variable.]) +fi AC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl") AC_SUBST(LIBNSL) |