summaryrefslogtreecommitdiffhomepage
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in26
1 files changed, 17 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 8b3bd6d..d96b4bf 100644
--- a/configure.in
+++ b/configure.in
@@ -23,8 +23,18 @@ AM_PROG_LEX
AC_PROG_RANLIB
dnl additional c flags
-CFLAGS="$CFLAGS -fno-strict-aliasing"
-AC_SUBST(CFLAGS)
+AM_CFLAGS="$AM_CFLAGS -Wall -fno-strict-aliasing"
+AC_ARG_WITH(werror,
+[ --with-werror treat compilation errors as warnings],
+[case "${withval}" in
+ yes) werr=true ;;
+ no) werr=false ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
+esac], [werr=false])
+
+if test x$werr = xtrue; then
+ AM_CFLAGS="$AM_CFLAGS -Werror"
+fi
dnl i18n stuff
AM_GNU_GETTEXT_VERSION(0.14)
@@ -89,7 +99,7 @@ if test x$wguile = xtrue; then
GUILE_CFLAGS="`guile-config compile`"
GUILE_LDFLAGS="`guile-config link`"
LIBS="$LIBS $GUILE_LDFLAGS"
- CFLAGS="$CFLAGS $GUILE_CFLAGS"
+ AM_CFLAGS="$AM_CFLAGS $GUILE_CFLAGS"
AC_SUBST(MAKE_GUILE)
AC_MSG_RESULT(yes)
fi
@@ -100,7 +110,7 @@ dnl Check for glib
PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.0)
LIBS="$LIBS $GLIB_LIBS"
-CFLAGS="$CFLAGS $GLIB_CFLAGS -DG_DISABLE_DEPRECATED"
+AM_CFLAGS="$AM_CFLAGS $GLIB_CFLAGS -DG_DISABLE_DEPRECATED"
dnl Check if the gtk gui is required
AC_ARG_ENABLE(gui,
@@ -114,13 +124,13 @@ esac],[gui=true])
dnl Check for gtk+
if test x$gui = xtrue; then
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0 libglade-2.0 >= 2.0.0 pango >= 1.4,
- [LIBS="$LIBS $GTK_LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS"],
+ [LIBS="$LIBS $GTK_LIBS" AM_CFLAGS="$AM_CFLAGS $GTK_CFLAGS"],
[AC_MSG_WARN(Cannot find GTK+/Glade/Pango: the GUI shall not be built)
gui=false])
fi
if test x$gui = xtrue; then
-CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
+AM_CFLAGS="$AM_CFLAGS -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
fi
dnl use the provided getopt if gnu getopt is not available
@@ -128,9 +138,7 @@ AC_REPLACE_FUNCS(getopt_long)
AM_CONDITIONAL(MAKE_GUI, test x$gui = xtrue)
-CFLAGS="$CFLAGS -Wall -Werror"
-
-AC_SUBST(CFLAGS)
+AC_SUBST(AM_CFLAGS)
AC_CONFIG_FILES(
Makefile