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 )