[asterisk-commits] kpfleming: trunk r200764 - in /trunk: autoconf/ast_gcc_attribute.m4 configure

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 15 20:28:12 CDT 2009


Author: kpfleming
Date: Mon Jun 15 20:28:08 2009
New Revision: 200764

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200764
Log:
Ensure that configure-script testing for compiler attributes actually works.

The configure script tests for compiler attributes didn't actually enable
enough warnings or provide a proper test harness to determine whether the 
compiler supports the attribute in question or not; this caused gcc 4.1 to
report that it supports 'weakref', but it doesn't actually support it in the
way that is needed for our optional API mechanism. The new configure script
test will properly distinguish between full support and partial support
for this attribute, among others.


Modified:
    trunk/autoconf/ast_gcc_attribute.m4
    trunk/configure

Modified: trunk/autoconf/ast_gcc_attribute.m4
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/autoconf/ast_gcc_attribute.m4?view=diff&rev=200764&r1=200763&r2=200764
==============================================================================
--- trunk/autoconf/ast_gcc_attribute.m4 (original)
+++ trunk/autoconf/ast_gcc_attribute.m4 Mon Jun 15 20:28:08 2009
@@ -5,12 +5,12 @@
 [
 AC_MSG_CHECKING(for compiler 'attribute $1' support)
 saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Werror"
+CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
 if test "x$2" = "x"
 then
 AC_COMPILE_IFELSE(
-	AC_LANG_PROGRAM([void __attribute__(($1)) *test(void *muffin, ...) {}],
+	AC_LANG_PROGRAM([static void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
 			[]),
 	AC_MSG_RESULT(yes)
 	AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
@@ -18,7 +18,7 @@
 )
 else
 AC_COMPILE_IFELSE(
-	AC_LANG_PROGRAM([void __attribute__(($2)) *test(void *muffin, ...) {}],
+	AC_LANG_PROGRAM([static void __attribute__(($2)) *test(void *muffin, ...) {return (void *) 0;}],
 			[]),
 	AC_MSG_RESULT(yes)
 	AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),




More information about the asterisk-commits mailing list