From c4e077cc77ec31e86baefc4644686a86b39cd460 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 1 May 2010 09:53:12 +0200 Subject: [PATCH] Build system: Check for "strtok_r" availability with "-Wall -Werror" when using GCC. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously, the check was done without "-Werror" which resulted in a warning and success. When the daemon was later built with "-Werror" set, that warning would result in an error and abort the build. Thanks to Aurélien Reynaud for reporting the problem. --- configure.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 6b66b2ac..c0ffb03c 100644 --- a/configure.in +++ b/configure.in @@ -459,6 +459,13 @@ AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr AC_FUNC_STRERROR_R +SAVE_CFLAGS="$CFLAGS" +# Emulate behavior of src/Makefile.am +if test "x$GCC" = "xyes" +then + CFLAGS="$CFLAGS -Wall -Werror" +fi + AC_CACHE_CHECK([for strtok_r], [c_cv_have_strtok_r_default], AC_LINK_IFELSE( @@ -489,7 +496,6 @@ AC_CACHE_CHECK([for strtok_r], if test "x$c_cv_have_strtok_r_default" = "xno" then - SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -D_REENTRANT=1" AC_CACHE_CHECK([if strtok_r needs _REENTRANT], @@ -521,6 +527,12 @@ then ) fi +CFLAGS="$SAVE_CFLAGS" +if test "x$c_cv_have_strtok_r_reentrant" = "xyes" +then + CFLAGS="$CFLAGS -D_REENTRANT=1" +fi + AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree) socket_needs_socket="no" -- 2.11.0