workaround for gcc 3.3. bug - alternate strftime test
rathnor rathnor
2 files changed,
27 insertions(+),
1 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,6 +1,9 @@
(Format: Year/Month/Day) Changes for 0.9.4: *03/06/15: + * Apply workaround for strftime test - fails with gcc 3.3 due to + compiler bug? - thanks Joshua Kwan (Simon) + configure.in * Fix group cycling, also adding new "NextGroup/PrevGroup" keys (Simon) Screen.hh/cc Keys.hh/cc fluxbox.cc *03/06/13:
M
configure.in
→
configure.in
@@ -31,7 +31,30 @@ AC_HEADER_TIME
dnl Check for existance of basename(), setlocale() and strftime() AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename, LIBS="$LIBS -lgen")) -AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose) +AC_CHECK_FUNCS(getpid setlocale sigaction strcasestr snprintf vsnprintf catopen catgets catclose) +dnl The autoconf test for strftime is broken now (due to gcc 3.3 bug?): +dnl Gcc 3.3 testprog = ``extern "C" char strftime;'', build with g++ test.cc +dnl breaks with: +dnl test.cc:1: error: nonnull argument with out-of-range operand number +dnl (arg 1, operand 3) + + +AC_MSG_CHECKING(for strftime) + +AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([#include <time.h>], +[[ +char * s; +time_t t = time(NULL); +size_t x = strftime(s, 5, "%a", localtime(&t)); +]] +)], +[ + AC_DEFINE(HAVE_STRFTIME, 1, [Define to 1 if you have the 'strftime' function.]) + AC_MSG_RESULT(yes) +], +[AC_MSG_RESULT(no)]) + AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl") AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")