summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2009-09-11 09:19:47 +0100
committerRichard Hughes <richard@hughsie.com>2009-09-11 09:45:41 +0100
commitde7c4bcc3736bf72b83b40f3f2168dce076053a1 (patch)
treecba47ddc9853028504cf907ba3da3f857f38fc62 /configure.ac
parent40e554865d3a298d5a31a26bf05680557d388570 (diff)
parent309325949f85a648488a9c54c9f69e2df7fc60dc (diff)
Fix conflicts in the merge
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac123
1 files changed, 53 insertions, 70 deletions
diff --git a/configure.ac b/configure.ac
index 38cc79f..0d521e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,80 +67,63 @@ AC_SUBST(slashlibdir)
#### gcc warning flags
dnl ---------------------------------------------------------------------------
-dnl - Extra verbose warning switches, disable if needed
+dnl - Extra verbose warning switches
dnl ---------------------------------------------------------------------------
-if test "$GCC" = "yes"; then
- CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized"
- CPPFLAGS="$CPPFLAGS -Wall -Wformat-security"
-# CPPFLAGS="$CPPFLAGS -Wall"
+CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
+CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
+CPPFLAGS="$CPPFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
+CPPFLAGS="$CPPFLAGS -DGSEAL_ENABLE"
+
+dnl ---------------------------------------------------------------------------
+dnl - Use strict options (default enabled for devs, disabled in releases)
+dnl ---------------------------------------------------------------------------
+dnl if .git directory is present, considering we are working in the repository
+if test -d ".git"; then
+ default_strict=yes
+else
+ default_strict=no
fi
-if test "x$GCC" = "xyes"; then
- changequote(,)dnl
- case " $CFLAGS " in
- *[\ \ ]-Wall[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wall" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wnested-externs[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wnested-externs" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wcast-align[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wcast-align" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wsign-compare[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wsign-compare" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-Wno-strict-aliasing[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wno-strict-aliasing" ;;
- esac
-
-
- if test "x$enable_ansi" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-ansi[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -ansi" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-D_POSIX_C_SOURCE*) ;;
- *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-pedantic[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -pedantic" ;;
- esac
- fi
- changequote([,])dnl
+AC_ARG_ENABLE(strict, AC_HELP_STRING([--enable-strict],
+ [Enable strict compilation options]), enable_strict=$enableval,
+ enable_strict=$default_strict)
+if test x$enable_strict != xno; then
+ if test "$GCC" = "yes"; then
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Werror"
+ fi
+fi
+
+if test "$GCC" = "yes"; then
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wall"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align -Wno-uninitialized"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-declarations"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wredundant-decls"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wpointer-arith"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wwrite-strings"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Winit-self"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wreturn-type"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-nonliteral"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-security"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-include-dirs"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-format-attribute"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wclobbered"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wempty-body"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wignored-qualifiers"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wsign-compare"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wtype-limits"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wuninitialized"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow"
+ WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type"
+# WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init"
+else
+ WARNINGFLAGS_C=""
fi
+AC_SUBST(WARNINGFLAGS_C)
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0])
AC_SUBST(GLIB_CFLAGS)