From 1d944ab5641109b3fb442898288f002acc71f9ff Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 15:50:12 +0200 Subject: Bump autoconf requirement to 2.62 (latest released version). --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 430b2f6..ebd9114 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ # License along with libcanberra. If not, If not, see # . -AC_PREREQ(2.57) +AC_PREREQ(2.62) AC_INIT([libcanberra], 0.7, [mzyvopnaoreen (at) 0pointer (dot) de]) AC_CONFIG_SRCDIR([src/common.c]) -- cgit From 23e52b565fefcbe503395b618e58dfa5a98dd6e2 Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 16:20:44 +0200 Subject: Use AC_PROG_CC_C99 to discover C99-compliant compiler. Instead of just checking if the compiler supports -std=c99 option, make use of the autoconf macro for discovering C99. This way other non-GCC compiler could be used in C99 mode too. --- configure.ac | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ebd9114..48aec92 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,7 @@ fi # CC AC_PROG_CC +AC_PROG_CC_C99 AM_PROG_CC_C_O AC_PROG_GCC_TRADITIONAL AC_GNU_SOURCE @@ -65,10 +66,7 @@ test_gcc_flag() { # If using GCC specify some additional parameters if test "x$GCC" = "xyes" ; then - - # We use gnu99 instead of c99 because many have interpreted the standard - # in a way that int64_t isn't defined on non-64 bit platforms. - DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math" + DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math" for flag in $DESIRED_FLAGS ; do AC_MSG_CHECKING([whether $CC accepts $flag]) -- cgit From 4a1dd8ad276013b9fef02ca189b06eeaa1d1bf74 Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 16:28:18 +0200 Subject: Replace the CFLAGS-checking code with a common macro from xine-lib. Instead of writing custom code to check for cflags checking, import a copy of attributes.m4 from xine-lib's repository and use the CC_CHECK_CFLAGS macro. The advantage lies not only in being able to reduce the custom code in configure.ac, but also in the fact that the CC_CHECK_CFLAGS macro caches the results, making ./configure -C quite faster on second run. Check for the CFLAGS for any compiler and not just GCC, if the compiler does support the flag it is better to u se it anyway, otherwise it will be skipped. --- configure.ac | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 48aec92..2edc828 100644 --- a/configure.ac +++ b/configure.ac @@ -54,31 +54,11 @@ AC_GNU_SOURCE AC_PROG_CXX -# GCC flags - -test_gcc_flag() { - AC_LANG_CONFTEST([int main(int argc, char*argv[]) {}]) - $CC -c conftest.c $CFLAGS "$1" -o conftest.o > /dev/null 2> /dev/null - ret=$? - rm -f conftest.o - return $ret -} - -# If using GCC specify some additional parameters -if test "x$GCC" = "xyes" ; then - DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math" - - for flag in $DESIRED_FLAGS ; do - AC_MSG_CHECKING([whether $CC accepts $flag]) - if test_gcc_flag $flag ; then - CFLAGS="$CFLAGS $flag" - CXXFLAGS="$CXXFLAGS $flag" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - done -fi +DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math" + +for flag in $DESIRED_FLAGS ; do + CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"]) +done #### libtool stuff #### -- cgit