aboutsummaryrefslogtreecommitdiffstats
path: root/m4/acinclude.m4
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2007-12-29 23:58:47 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2007-12-29 23:58:47 +0800
commita4004017570744524ff2d0af3efab045821fd46f (patch)
tree9a15f253d9c45a90a8794143ecdd854650d58af1 /m4/acinclude.m4
parent0cfd80847f0d66967f56c7d6b3eb46793f725859 (diff)
downloadgsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.tar
gsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.tar.gz
gsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.tar.bz2
gsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.tar.lz
gsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.tar.xz
gsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.tar.zst
gsoc2013-empathy-a4004017570744524ff2d0af3efab045821fd46f.zip
Revert "merge git work"
This reverts commit 0cfd80847f0d66967f56c7d6b3eb46793f725859. git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@519 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'm4/acinclude.m4')
-rw-r--r--m4/acinclude.m465
1 files changed, 65 insertions, 0 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
new file mode 100644
index 000000000..3120d8620
--- /dev/null
+++ b/m4/acinclude.m4
@@ -0,0 +1,65 @@
+dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
+
+AC_DEFUN([IDT_COMPILE_WARNINGS],[
+ if test -f $srcdir/autogen.sh; then
+ default_compile_warnings="error"
+ else
+ default_compile_warnings="no"
+ fi
+
+ AC_ARG_WITH(compile-warnings,
+ AS_HELP_STRING([--with-compile-warnings=@<:@no/yes/error@:>@],
+ [Compiler warnings]),
+ [enable_compile_warnings="$withval"],
+ [enable_compile_warnings="$default_compile_warnings"])
+
+ warnCFLAGS=
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+
+ warning_flags=
+ realsave_CFLAGS="$CFLAGS"
+
+ case "$enable_compile_warnings" in
+ no)
+ warning_flags=
+ ;;
+ yes)
+ warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
+ ;;
+ maximum|error)
+ warning_flags="-Wall -Wunused -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
+ CFLAGS="$warning_flags $CFLAGS"
+ for option in -Wno-sign-compare -Wno-pointer-sign; do
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $option"
+ AC_MSG_CHECKING([whether gcc understands $option])
+ AC_TRY_COMPILE([], [],
+ has_option=yes,
+ has_option=no,)
+ CFLAGS="$SAVE_CFLAGS"
+ AC_MSG_RESULT($has_option)
+ if test $has_option = yes; then
+ warning_flags="$warning_flags $option"
+ fi
+ unset has_option
+ unset SAVE_CFLAGS
+ done
+ unset option
+ 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
+ CFLAGS="$realsave_CFLAGS"
+ AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+ AC_MSG_RESULT($warning_flags)
+
+ WARN_CFLAGS="$warning_flags"
+ AC_SUBST(WARN_CFLAGS)
+])
+