From 8ce85250268fe2e6f0e4ccfbfbf80ee63a2c1d75 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 27 Oct 2002 07:01:26 +0000 Subject: [PATCH] * configure.in: rearrange things so that --enable-error-on-warning uses GUILE_ERROR_ON_WARNING as an indicator and actually set the value of CFLAGS to include -Werror at the end of configure.in so it doesn't break any of the non-Werror clean configure tests. Add check for assert.h since it's used in config.h.in. --- configure.in | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 9b4c2273b..727965eab 100644 --- a/configure.in +++ b/configure.in @@ -43,15 +43,16 @@ AC_CONFIG_SUBDIRS(guile-readline) # #-------------------------------------------------------------------- +GUILE_ERROR_ON_WARNING="yes" + AC_ARG_ENABLE(error-on-warning, [ --enable-error-on-warning treat compile warnings as errors], [case "${enableval}" in - yes | y) CFLAGS="${CFLAGS} -Werror"; enable_compile_warnings=no ;; - no | n) ;; + yes | y) GUILE_ERROR_ON_WARNING="yes" ;; + no | n) GUILE_ERROR_ON_WARNING="no" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;; esac]) - AC_ARG_ENABLE(debug-freelist, [ --enable-debug-freelist include garbage collector freelist debugging code], if test "$enable_debug_freelist" = y || test "$enable_debug_freelist" = yes; then @@ -221,7 +222,7 @@ AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(io.h libc.h limits.h malloc.h memory.h string.h regex.h rxposix.h rx/rxposix.h sys/ioctl.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h sys/utime.h time.h unistd.h utime.h pwd.h winsock2.h grp.h sys/utsname.h) +AC_CHECK_HEADERS([assert.h io.h libc.h limits.h malloc.h memory.h string.h regex.h rxposix.h rx/rxposix.h sys/ioctl.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h sys/utime.h time.h unistd.h utime.h pwd.h winsock2.h grp.h sys/utsname.h]) GUILE_HEADER_LIBC_WITH_UNISTD AC_TYPE_GETGROUPS @@ -622,6 +623,15 @@ if test "${THREAD_PACKAGE}" != "" ; then fi fi +# Do this here so we don't screw up any of the tests above that might +# not be "warning free" + +if test "${GUILE_ERROR_ON_WARNING}" = yes +then + CFLAGS="${CFLAGS} -Werror" + enable_compile_warnings=no +fi + ## If we're using GCC, ask for aggressive warnings. case "$GCC" in yes )