[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cross-compilation guesses (13)
From: |
Bruno Haible |
Subject: |
cross-compilation guesses (13) |
Date: |
Sat, 05 May 2012 12:31:22 +0200 |
User-agent: |
KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; ) |
Another suboptimal cross-compilation guess is
checking whether tzset clobbers localtime buffer... yes
This fixes it.
2012-05-05 Bruno Haible <address@hidden>
tzset: Avoid guessing wrong when cross-compiling to glibc systems.
* m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Require AC_CANONICAL_HOST. When
cross-compiling to a glibc platform, set gl_cv_func_tzset_clobber to
"guessing no".
* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Update.
--- m4/gettimeofday.m4.orig Sat May 5 12:28:30 2012
+++ m4/gettimeofday.m4 Sat May 5 09:04:25 2012
@@ -1,4 +1,4 @@
-# serial 19
+# serial 20
# Copyright (C) 2001-2003, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -56,14 +56,16 @@
fi
m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
gl_FUNC_TZSET_CLOBBER
- if test $gl_cv_func_tzset_clobber = yes; then
- REPLACE_GETTIMEOFDAY=1
- gl_GETTIMEOFDAY_REPLACE_LOCALTIME
- AC_DEFINE([tzset], [rpl_tzset],
- [Define to rpl_tzset if the wrapper function should be used.])
- AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
- [Define if tzset clobbers localtime's static buffer.])
- fi
+ case "$gl_cv_func_tzset_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+ AC_DEFINE([tzset], [rpl_tzset],
+ [Define to rpl_tzset if the wrapper function should be used.])
+ AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
+ [Define if tzset clobbers localtime's static buffer.])
+ ;;
+ esac
])
fi
AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
--- m4/tzset.m4.orig Sat May 5 12:28:30 2012
+++ m4/tzset.m4 Sat May 5 09:02:20 2012
@@ -1,4 +1,4 @@
-# serial 6
+# serial 7
# Copyright (C) 2003, 2007, 2009-2012 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -20,6 +20,7 @@
AC_DEFUN([gl_FUNC_TZSET_CLOBBER],
[
AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether tzset clobbers localtime buffer],
gl_cv_func_tzset_clobber,
[
@@ -47,7 +48,13 @@
]])],
[gl_cv_func_tzset_clobber=no],
[gl_cv_func_tzset_clobber=yes],
- [gl_cv_func_tzset_clobber=yes])])
+ [case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_tzset_clobber="guessing yes" ;;
+ esac
+ ])])
AC_DEFINE([HAVE_RUN_TZSET_TEST], [1],
[Define to 1 if you have run the test for working tzset.])
- cross-compilation guesses (8), (continued)
- cross-compilation guesses (8), Bruno Haible, 2012/05/01
- cross-compilation guesses (9), Bruno Haible, 2012/05/01
- cross-compilation guesses (10), Bruno Haible, 2012/05/01
- cross-compilation guesses (11), Bruno Haible, 2012/05/05
- cross-compilation guesses (12), Bruno Haible, 2012/05/05
- cross-compilation guesses (13),
Bruno Haible <=
- cross-compilation guesses (14), Bruno Haible, 2012/05/05
- cross-compilation guesses (15), Bruno Haible, 2012/05/05