diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-04-08 16:59:24 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-04-08 16:59:24 +0200 |
commit | 9c3dc90d16a40789081c84e46620f4d66689fec1 (patch) | |
tree | 69fba13dafd13f1429b8539cba097ea18d2beb10 /openbsc/configure.ac | |
parent | a334c296e02852880148abf92abf12c63ed49b3b (diff) |
introduce HAVE_TM_GMTOFF_IN_TM
Not all architectures have the tm.tm_gmtoff member. This fixes cygwin
builds.
Diffstat (limited to 'openbsc/configure.ac')
-rw-r--r-- | openbsc/configure.ac | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 56e4b60ad..16eb732b6 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -83,6 +83,30 @@ if test "$enable_coverage" = "yes"; then AC_SUBST([COVERAGE_LDFLAGS]) fi +AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ + AC_CACHE_CHECK( + [whether struct tm has tm_gmtoff member], + osmo_cv_tm_includes_tm_gmtoff, + [AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + #include <time.h> + ], [ + time_t t = time(NULL); + struct tm* lt = localtime(&t); + int off = lt->tm_gmtoff; + ]) + ], + osmo_cv_tm_includes_tm_gmtoff=yes, + osmo_cv_tm_includes_tm_gmtoff=no + )] + ) + if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then + AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1, + [Define if struct tm has tm_gmtoff member.]) + fi +]) + +CHECK_TM_INCLUDES_TM_GMTOFF dnl Generate the output AM_CONFIG_HEADER(bscconfig.h) |