- # GCC 2.95 doesn't know to ignore warnings from system headers
- AC_CACHE_CHECK([whether -Werror is usable],
- rjk_cv_werror, [
- save_CFLAGS="${CFLAGS}"
- CFLAGS="${CFLAGS} ${GTK_CFLAGS} -Werror"
- AC_TRY_COMPILE([#include <gtk/gtk.h>],
- [],
- [rjk_cv_werror=yes],
- [rjk_cv_werror=no])
- CFLAGS="${save_CFLAGS}"
- ])
- if test $rjk_cv_werror = no; then
- gcc_werror=''
+ if test "$gcc_werror" != ''; then
+ # GCC 2.95 doesn't know to ignore warnings from system headers
+ AC_CACHE_CHECK([whether -Werror is usable],
+ rjk_cv_werror, [
+ save_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} ${GTK_CFLAGS} -Werror"
+ AC_TRY_COMPILE([#include <gtk/gtk.h>],
+ [],
+ [rjk_cv_werror=yes],
+ [rjk_cv_werror=no])
+ CFLAGS="${save_CFLAGS}"
+ ])
+ if test $rjk_cv_werror = no; then
+ gcc_werror=''
+ fi