aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-11-06 23:30:17 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-06 23:30:17 +0800
commit3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4 (patch)
tree349fd8908e0090330bbf7a9b8e03a520b9e85d0e
parent0bfb97d530da59f876460652de4bef321d1b35f4 (diff)
downloadgsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.tar
gsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.tar.gz
gsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.tar.bz2
gsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.tar.lz
gsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.tar.xz
gsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.tar.zst
gsoc2013-evolution-3e52c7380bbcfbee3ff6e1bbc25cb5fda66db4f4.zip
Introduce --enable-strict configure option
This is currently used to add extra AM_CPPFLAGS to disable deprecated symbols from other libraries.
-rw-r--r--configure.ac31
1 files changed, 26 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index f4ba77ac03..1cee670d9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,9 +64,7 @@ dnl ******************************
dnl Compiler Warning Flags
dnl ******************************
AS_COMPILER_FLAGS(WARNING_FLAGS,
- "-DE_BOOK_DISABLE_DEPRECATED
- -DE_CAL_DISABLE_DEPRECATED
- -Wall -Wextra
+ "-Wall -Wextra
-Wno-missing-field-initializers
-Wno-sign-compare
-Wno-unused-parameter
@@ -90,10 +88,32 @@ dnl -Wmissing-format-attribute
dnl -Wshadow
dnl -Wformat-nonliteral
dnl -Wstrict-aliasing=2
-dnl -DE_BOOK_DISABLE_DEPRECATED
-dnl -DE_CAL_DISABLE_DEPRECATED
AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
+
+dnl *******************************
+dnl Check for --enable-strict
+dnl *******************************
+AC_ARG_ENABLE([strict],
+ [AS_HELP_STRING([--enable-strict],
+ [enable strict building, like without deprecated symbols (default=auto); auto enables strict building only if .git subdirectory exists])],
+ [enable_strict=$enableval], [enable_strict=auto])
+
+AC_MSG_CHECKING([if strict building is enabled])
+if test "x$enable_strict" = xauto; then
+ dnl Be strict when compiling with .git subdirectory
+ if test -d .git ; then
+ enable_strict=yes
+ else
+ enable_strict=no
+ fi
+fi
+AC_MSG_RESULT([$enable_strict])
+
+if test "x$enable_strict" = xyes; then
+ AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED -DE_BOOK_DISABLE_DEPRECATED -DE_CAL_DISABLE_DEPRECATED"
+fi
+
AC_SUBST(AM_CPPFLAGS)
AC_CANONICAL_HOST
@@ -1707,4 +1727,5 @@ echo "
Highlight support: $msg_text_highlight
Plugins: $msg_plugins
User documentation: $with_help
+ Strict building: $enable_strict
"