Add build system plumbing for building with -Werror.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Tue, 10 Jun 2014 07:34:01 +0000 (09:34 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Tue, 10 Jun 2014 07:35:01 +0000 (09:35 +0200)
Makefile.am
configure.ac
eglib/Makefile.am
eglib/configure.ac
eglib/src/Makefile.am
libgc/Makefile.am
libgc/configure.ac

index 3542279772d8bcccda8448954ae79ad030594e4d..7d2251fd6405bcef8e7dfd26848bf2066df97d21 100644 (file)
@@ -1,5 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4
 
+AM_CFLAGS = $(WERROR_CFLAGS)
+
 MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
 
 if CROSS_COMPILING
index ffd989625292cce6323cde75ef6f186ccafdfbd6..6d06c9227ec8c3bb3885b796c5cba65aa638f17a 100644 (file)
@@ -676,6 +676,12 @@ AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir      Chan
        fi
 )
 
+AC_ARG_ENABLE(werror, [  --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
+if test x$werror_flag = xyes; then
+       WERROR_CFLAGS="-Werror"
+fi
+AC_SUBST([WERROR_CFLAGS])
+
 ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
 AC_CONFIG_SUBDIRS(eglib)
 
index b7e5cd63894c695447748d7f651671cebf7c5d5b..84cc8353c99489244340626b95d1d4b4b7b45cb1 100644 (file)
@@ -1,5 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4
 
+AM_CFLAGS = $(WERROR_CFLAGS)
+
 if HOST_WIN32
 SUBDIRS = m4 src
 else
index fab57247699fab6cdd6910b278c7f40ee7c36c5b..80600f8565f25eb5832cfa28e18b7026b9868dda 100644 (file)
@@ -235,6 +235,12 @@ AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir      Chan
        fi
 )
 
+AC_ARG_ENABLE(werror, [  --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
+if test x$werror_flag = xyes; then
+       WERROR_CFLAGS="-Werror"
+fi
+AC_SUBST([WERROR_CFLAGS])
+
 AC_SUBST(GPOINTER_TO_INT)
 AC_SUBST(GPOINTER_TO_UINT)
 AC_SUBST(GINT_TO_POINTER)
index 0d0e90354ee8adb5c48053a37c012ab0d0991393..a0baeea025fb0fa48715916914db0f51c6e7154e 100644 (file)
@@ -1,5 +1,7 @@
 noinst_LTLIBRARIES = libeglib.la libeglib-static.la
 
+AM_CFLAGS = $(WERROR_CFLAGS)
+
 win_files  = \
        eglib-config.hw \
        gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
index 49dbe4be81c6dcd2d3466b8ab07bf43b3b8417c6..a53aafcbf3e1d89d35191047891c45fafea27bff 100644 (file)
@@ -68,7 +68,7 @@ libmonogc_static_la_LDFLAGS = -static
 
 EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
 
-AM_CFLAGS = @GC_CFLAGS@
+AM_CFLAGS = $(WERROR_CFLAGS) @GC_CFLAGS@
 
 if CPLUSPLUS
 extra_checks = test_cpp
index 837e2cb9f158c14f8cdbe47e0abc14091db14edf..7dc04985a90b3ae260678acf9f3668ccf5c31355 100644 (file)
@@ -531,6 +531,12 @@ fi
 AC_ARG_ENABLE(quiet-build, [  --enable-quiet-build  Enable quiet libgc build (on by default)], enable_quiet_build=$enableval, enable_quiet_build=yes)
 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
 
+AC_ARG_ENABLE(werror, [  --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
+if test x$werror_flag = xyes; then
+       WERROR_CFLAGS="-Werror"
+fi
+AC_SUBST([WERROR_CFLAGS])
+
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
 else