From 7c8e2cc7aca1a789bbcf989a14be177d59041959 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 29 Aug 2012 16:47:30 +0200 Subject: libosmogsm: Back-port SMS related fixes from openbsc This was fixed in 9c3dc90d16a40789081c84e46620f4d66689fec1 of openbsc.git, after the sms code had been migrated here: introduce HAVE_TM_GMTOFF_IN_TM Not all architectures have the tm.tm_gmtoff member. This fixes cygwin builds. --- configure.ac | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3e88a1b0..ca98fc2c 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,31 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) +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_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(config.h) -- cgit v1.2.3