From: Yann E. MORIN" Date: Wed, 4 Apr 2012 16:40:46 +0000 (+0200) Subject: configure: enable building with -Wall X-Git-Tag: v3.4.0-0~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7580ef561204b1b4ed31b8cd0a2a928bc210fec9;p=kconfig-frontends configure: enable building with -Wall Signed-off-by: "Yann E. MORIN" --- diff --git a/configure.ac b/configure.ac index 2cfeefd..9376059 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,18 @@ LT_INIT([disable-static]) #--------------------------------------------------------------------------- # Set misc options +# By default, do not build with -Wall, unless the user asks for it +AC_ARG_ENABLE( + [wall], + [AS_HELP_STRING( + [--enable-wall], + [build with -Wall (default=no)])], + [AS_CASE( + ["$enableval"], + [yes], [wall_CFLAGS=-Wall], + [*], [wall_CFLAGS=""])]) +AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}]) + # By default, do not build with -Werror, unless the user asks for it AC_ARG_ENABLE( [werror], @@ -124,6 +136,10 @@ AC_ARG_ENABLE( done]) AC_SUBST([enable_frontends]) +#---------------------------------------- +# What extra CFLAGS we will be using +AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"]) + #---------------------------------------- # Dependencies that will be needed, depending on the frontends AS_CASE( @@ -385,6 +401,9 @@ AC_OUTPUT AC_MSG_NOTICE() AC_MSG_NOTICE([Configured with:]) +AS_IF([test "$enable_wall" = "yes"], + [AC_MSG_NOTICE([- catch all warnings : yes])], + [AC_MSG_NOTICE([- catch all warnings : no])]) AS_IF([test "$enable_werror" = "yes"], [AC_MSG_NOTICE([- treat warnings as errors: yes])], [AC_MSG_NOTICE([- treat warnings as errors: no])]) diff --git a/frontends/conf/Makefile.am b/frontends/conf/Makefile.am index 4c3ce1f..310f41a 100644 --- a/frontends/conf/Makefile.am +++ b/frontends/conf/Makefile.am @@ -4,6 +4,6 @@ conf_SOURCES = conf.c conf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I$(top_srcdir)/libs/parser -conf_CFLAGS = $(AM_CFLAGS) $(werror_CFLAGS) +conf_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) conf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \ $(conf_EXTRA_LIBS) diff --git a/frontends/gconf/Makefile.am b/frontends/gconf/Makefile.am index 2aa1a55..ff70aad 100644 --- a/frontends/gconf/Makefile.am +++ b/frontends/gconf/Makefile.am @@ -6,8 +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) \ - $(werror_CFLAGS) \ +gconf_CFLAGS = $(AM_CFLAGS) \ + $(kf_CFLAGS) \ $(gtk_CFLAGS) gconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \ $(gtk_LIBS) $(gconf_EXTRA_LIBS) diff --git a/frontends/mconf/Makefile.am b/frontends/mconf/Makefile.am index c107ec9..ea34964 100644 --- a/frontends/mconf/Makefile.am +++ b/frontends/mconf/Makefile.am @@ -6,8 +6,8 @@ mconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I$(top_srcdir)/libs \ -I$(top_srcdir)/libs/parser -mconf_CFLAGS = $(AM_CFLAGS) \ - $(werror_CFLAGS) +mconf_CFLAGS = $(AM_CFLAGS) \ + $(kf_CFLAGS) mconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \ $(top_builddir)/libs/lxdialog/liblxdialog.a \ $(ncurses_LIBS) $(mconf_EXTRA_LIBS) diff --git a/frontends/nconf/Makefile.am b/frontends/nconf/Makefile.am index 87402e2..4a8341c 100644 --- a/frontends/nconf/Makefile.am +++ b/frontends/nconf/Makefile.am @@ -5,7 +5,7 @@ nconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I$(top_srcdir)/libs/parser nconf_CFLAGS = $(AM_CFLAGS) \ - $(werror_CFLAGS) + $(kf_CFLAGS) nconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \ $(ncurses_extra_LIBS) $(ncurses_LIBS) \ $(nconf_EXTRA_LIBS) diff --git a/frontends/qconf/Makefile.am b/frontends/qconf/Makefile.am index 616d3d4..b0ba091 100644 --- a/frontends/qconf/Makefile.am +++ b/frontends/qconf/Makefile.am @@ -6,8 +6,8 @@ qconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I$(top_srcdir)/libs/parser \ -I$(top_srcdir)/libs/images -qconf_CXXFLAGS = $(AM_CXXFLAGS) \ - $(werror_CFLAGS) \ +qconf_CXXFLAGS = $(AM_CXXFLAGS) \ + $(kf_CFLAGS) \ $(qt4_CFLAGS) qconf_LDADD = $(top_builddir)/libs/parser/libkconfigparser.la \ $(qt4_LIBS) $(qconf_EXTRA_LIBS) diff --git a/libs/lxdialog/Makefile.am b/libs/lxdialog/Makefile.am index fa2358c..2808a69 100644 --- a/libs/lxdialog/Makefile.am +++ b/libs/lxdialog/Makefile.am @@ -12,4 +12,4 @@ liblxdialog_a_SOURCES = \ liblxdialog_a_CPPFLAGS = $(AM_CPPFLAGS) \ -DCURSES_LOC='"${CURSES_LOC}"' \ $(GETTEXT) -liblxdialog_a_CFLAGS = $(AM_CFLAGS) $(werror_CFLAGS) +liblxdialog_a_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) diff --git a/libs/parser/Makefile.am b/libs/parser/Makefile.am index 92bcf1e..d5b4a04 100644 --- a/libs/parser/Makefile.am +++ b/libs/parser/Makefile.am @@ -8,7 +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_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) libkconfigparser_la_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION) kconfig_includedir = $(includedir)/kconfig