summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-19 23:41:05 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-19 23:41:05 +0000
commit37e2520a920955d532d4c0faf7030e0d054dfc66 (patch)
tree3d68b867a7dc7084594d70ccd6cfef04b5411999
parent3796119dd7ac86c940aaad416c431e5dbdcafef7 (diff)
downloadxine-lib-37e2520a920955d532d4c0faf7030e0d054dfc66.tar.gz
xine-lib-37e2520a920955d532d4c0faf7030e0d054dfc66.tar.bz2
Use CC_CHECK_CFLAGS rather than AC_TRY_CFLAGS for checking the warnings to enabled, as this one caches its tests, so a run using cached values will be faster.
CVS patchset: 8721 CVS date: 2007/03/19 23:41:05
-rw-r--r--configure.ac28
1 files changed, 14 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 1b1763eb2..64371582e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2592,22 +2592,22 @@ AM_CONDITIONAL([BUILD_DMX_IMAGE], [test "x$have_imagemagick" = "xyes" -o "x$no_g
dnl Important warnings we _don't_ want to skip
dnl Don't put these under conditional for optimisations, because these
dnl need always to be enabled.
-AC_TRY_CFLAGS([-Wformat], [wformat="-Wformat"])
-AC_TRY_CFLAGS([-Wformat=2], [wformat="-Wformat=2"])
-if test "x$wformat" != "x"; then
- AC_TRY_CFLAGS([-Wno-format-zero-length], [wformat="$wformat -Wno-format-zero-length"])
-fi
-AC_TRY_CFLAGS([-Wmissing-format-attribute], [wformat="$wformat -Wmissing-format-attribute"])
-CFLAGS="$CFLAGS $wformat"
+CC_CHECK_CFLAGS([-Wformat=2], [wformat="-Wformat=2"],
+ [CC_CHECK_CFLAGS([-Wformat], [wformat="-Wformat"])])
+
+test "x$wformat" != "x" && \
+ CC_CHECK_CFLAGS([-Wno-format-zero-length], [wformat="$wformat -Wno-format-zero-length"])
-dnl This has to be stay at the end as it can break some autoconf tests.
-AC_TRY_CFLAGS([-Werror-implicit-function-declaration], [CFLAGS="$CFLAGS -Werror-implicit-function-declaration"])
+CC_CHECK_CFLAGS([-Wmissing-format-attribute], [wformat="$wformat -Wmissing-format-attribute"])
+warnflags="$warnflags $wformat"
-AC_TRY_CFLAGS([-Wstrict-aliasing], [wsa="-Wstrict-aliasing"])
-AC_TRY_CFLAGS([-Wstrict-aliasing=2], [wsa="-Wstrict-aliasing=2"])
-CFLAGS="$CFLAGS $wsa"
+dnl This *has* to stay at the end as it can break some autoconf tests.
+CC_CHECK_CFLAGS([-Werror-implicit-function-declaration], [warnflags="$warnflags -Werror-implicit-function-declaration"])
-case $host_or_hostalias in
+CC_CHECK_CFLAGS([-Wstrict-aliasing=2], [warnflags="$warnflags -Wstrict-aliasing=2"],
+ [CC_CHECK_CFLAGS([-Wstrict-aliasing], [warnflags="$warnflags -Wstrict-aliasing"])])
+
+case $host in
dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
dnl are requested, as different implementations are present; to avoid problems
dnl use -Wl,-z,defs only for those platform not behaving this way.
@@ -2619,7 +2619,7 @@ esac
AC_SUBST([NOUNDEF])
dnl Common cflags for all platforms
-CFLAGS="-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
+CFLAGS="-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $warnflags $CFLAGS"
DEBUG_CFLAGS="-D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $DEBUG_CFLAGS"
dnl ---------------------------------------------