]> git.sur5r.net Git - kconfig-frontends/commitdiff
configure: add option to build with -Werror
authorYann E. MORIN" <yann.morin.1998@free.fr>
Sun, 1 Apr 2012 13:21:22 +0000 (15:21 +0200)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Sun, 1 Apr 2012 13:21:22 +0000 (15:21 +0200)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
configure.ac
frontends/conf/Makefile.am
frontends/gconf/Makefile.am
frontends/mconf/Makefile.am
frontends/nconf/Makefile.am
frontends/qconf/Makefile.am
libs/lxdialog/Makefile.am
libs/parser/Makefile.am

index 78b1342564d34f6015746363abe233231ac5f0bd..2cfeefd149d2edcbcbd998805ccf7a23a30e347e 100644 (file)
@@ -28,6 +28,19 @@ LT_INIT([disable-static])
 
 #---------------------------------------------------------------------------
 # Set misc options
+
+# By default, do not build with -Werror, unless the user asks for it
+AC_ARG_ENABLE(
+    [werror],
+    [AS_HELP_STRING(
+        [--enable-werror],
+        [build with -Werror (default=no)])],
+    [AS_CASE(
+        ["$enableval"],
+        [yes], [werror_CFLAGS=-Werror],
+        [*],   [werror_CFLAGS=""])])
+AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
+
 # Although there is a default (="linux") in the code, we do provide
 # a default here, to get a consistent autostuff behavior
 AC_ARG_ENABLE(
@@ -372,8 +385,11 @@ AC_OUTPUT
 
 AC_MSG_NOTICE()
 AC_MSG_NOTICE([Configured with:])
-AC_MSG_NOTICE([- root-menu prompt: '$root_menu'])
-AC_MSG_NOTICE([- config prefix:    '$config_prefix'])
+AS_IF([test "$enable_werror" = "yes"],
+      [AC_MSG_NOTICE([- treat warnings as errors: yes])],
+      [AC_MSG_NOTICE([- treat warnings as errors: no])])
+AC_MSG_NOTICE([- root-menu prompt:        '$root_menu'])
+AC_MSG_NOTICE([- config prefix:           '$config_prefix'])
 AC_MSG_NOTICE([- frontends:])
 AS_IF([test "$enable_conf" = "yes"],
       [AC_MSG_NOTICE([  - conf:  yes])],
index 9b464cc933d23db8c24261d16581d5f5f1acdf15..4c3ce1f6f329ec0ec846c84a0a2f5908d56c1ec2 100644 (file)
@@ -4,5 +4,6 @@ conf_SOURCES = conf.c
 conf_CPPFLAGS = $(AM_CPPFLAGS)  \
                 $(GETTEXT)      \
                 -I$(top_srcdir)/libs/parser
+conf_CFLAGS = $(AM_CFLAGS) $(werror_CFLAGS)
 conf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la  \
              $(conf_EXTRA_LIBS)
index 0edd622d6e6d123d696578003d6e449cb3ae0da0..2aa1a5538f99c0a672cd06dcc99757a32a55074b 100644 (file)
@@ -6,7 +6,8 @@ gconf_CPPFLAGS = $(AM_CPPFLAGS)         \
                  -I$(top_srcdir)/libs/parser    \
                  -I$(top_srcdir)/libs/images    \
                  -DGUI_PATH='"$(pkgdatadir)/gconf.glade"'
-gconf_CFLAGS = $(AM_CFLAGS) \
+gconf_CFLAGS = $(AM_CFLAGS)     \
+               $(werror_CFLAGS) \
                $(gtk_CFLAGS)
 gconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \
               $(gtk_LIBS) $(gconf_EXTRA_LIBS)
index 9219d0da122086df807c206e6d8b46acee485831..c107ec9cc9a6fe48ed0e3da0c3a121931564d54b 100644 (file)
@@ -6,6 +6,8 @@ mconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
                  $(GETTEXT)                     \
                  -I$(top_srcdir)/libs                   \
                  -I$(top_srcdir)/libs/parser
+mconf_CFLAGS = $(AM_CFLAGS)     \
+               $(werror_CFLAGS)
 mconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \
               $(top_builddir)/libs/lxdialog/liblxdialog.a     \
               $(ncurses_LIBS) $(mconf_EXTRA_LIBS)
index 241912c059805e50bfa74ae4c4a4f780a86bdc89..87402e24b5448ed865594d83e78a852c9f973d6d 100644 (file)
@@ -4,6 +4,8 @@ nconf_SOURCES = nconf.c nconf.gui.c nconf.h
 nconf_CPPFLAGS = $(AM_CPPFLAGS)     \
                  $(GETTEXT)         \
                  -I$(top_srcdir)/libs/parser
+nconf_CFLAGS = $(AM_CFLAGS)     \
+               $(werror_CFLAGS)
 nconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \
               $(ncurses_extra_LIBS) $(ncurses_LIBS) \
               $(nconf_EXTRA_LIBS)
index 58152712d60dbedb8f8ce11f20949d4e7dcbd553..616d3d4803418dd945f32e8036bf5ffafff19808 100644 (file)
@@ -6,7 +6,8 @@ qconf_CPPFLAGS = $(AM_CPPFLAGS)         \
                  $(GETTEXT)             \
                  -I$(top_srcdir)/libs/parser    \
                  -I$(top_srcdir)/libs/images
-qconf_CXXFLAGS = $(AM_CXXFLAGS) \
+qconf_CXXFLAGS = $(AM_CXXFLAGS)     \
+                 $(werror_CFLAGS)   \
                  $(qt4_CFLAGS)
 qconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \
               $(qt4_LIBS) $(qconf_EXTRA_LIBS)
index 5f22423d2485f24a4380a3f5b7f0578ae374f0e6..fa2358c2e89051d0c9f4ecb0eb29bf46860b98a0 100644 (file)
@@ -12,3 +12,4 @@ liblxdialog_a_SOURCES = \
 liblxdialog_a_CPPFLAGS = $(AM_CPPFLAGS)                   \
                          -DCURSES_LOC='"${CURSES_LOC}"'   \
                          $(GETTEXT)
+liblxdialog_a_CFLAGS = $(AM_CFLAGS) $(werror_CFLAGS)
index 2ef195cc96ecf93fe1cb651610ce807f3186d64f..92bcf1e54c6fc124e2ca78b3fecd8d7de2c21a44 100644 (file)
@@ -8,6 +8,7 @@ dist_EXTRA_libkconfigparser_la_SOURCES =  \
     expr.c expr.h lkc.h lkc_proto.h
 libkconfigparser_la_CPPFLAGS = -DROOTMENU="\"$(root_menu)\""    \
                                -DCONFIG_=\"$(config_prefix)\"
+libkconfigparser_la_CFLAGS = $(AM_CFLAGS) $(werror_CFLAGS)
 libkconfigparser_la_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION)
 
 kconfig_includedir = $(includedir)/kconfig