Index: bamf-0.5.4/configure.ac =================================================================== --- bamf-0.5.4.orig/configure.ac +++ bamf-0.5.4/configure.ac @@ -15,17 +15,17 @@ AM_SILENT_RULES([yes]) AC_CONFIG_MACRO_DIR([m4]) GNOME_COMMON_INIT -GNOME_COMPILE_WARNINGS(maximum) AM_MAINTAINER_MODE -AM_DISABLE_STATIC -AM_PROG_LIBTOOL AC_ISC_POSIX AC_SUBST(ACLOCAL_AMFLAFS, "$ACLOCAL_FLAGS -I m4") PKG_PROG_PKG_CONFIG if test "x$PKG_CONFIG" = "x"; then AC_MSG_ERROR([You need to install pkg-config]); fi +LT_INIT([disable-static]) +LT_LIB_M + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O @@ -150,8 +150,39 @@ AC_SUBST(COVERAGE_LDFLAGS) # AM_PATH_GTK_3_0 +# Compile warnings +AC_ARG_ENABLE(compile-warnings, + AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@], + [Turn on compiler warnings]),, + [enable_compile_warnings=maximum]) + +warning_flags= + +case "$enable_compile_warnings" in +no) +warning_flags= +;; +minimum) +warning_flags="-Wall" +;; +yes) +warning_flags="-wall -Wno-error=deprecated-declarations" +;; +maximum|error) +warning_flags="-Wall -Wno-error=deprecated-declarations -Wempty-body -Wformat-security -Winit-self -Warray-bounds -Wimplicit-function-declaration" +if test "$enable_compile_warnings" = "error" ; then + warning_flags="$warning_flags -Werror" +fi +;; +*) +AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings) +;; +esac +AC_MSG_CHECKING(what warning flags to pass to the C compiler) +AC_MSG_RESULT($warning_flags) + dnl CFLAGS -CFLAGS="$CFLAGS -Wall -Werror -Wno-error=deprecated-declarations -Wempty-body -Wformat-security -Winit-self -Warray-bounds -Wimplicit-function-declaration -lm" +CFLAGS="$CFLAGS $warning_flags $LIBM" AC_SUBST(BAMFDAEMON_CFLAGS) AC_SUBST(BAMFDAEMON_LIBS) @@ -186,5 +217,6 @@ ${PACKAGE}-${VERSION} Headless tests: ${enable_headless_tests} Coverage Reporting: ${use_gcov} Export actions menus: ${enable_export_actions_menu} + Compiler Flags: ${CFLAGS} EOF