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.
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(
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],
)
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"