aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-16 16:32:36 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-16 16:32:36 +0000
commitd2292f0eca49f9ec9297bab8aa9c551557213662 (patch)
tree0a9e072b735507f3f3e340e4c16046aa4140ea9e /autoconf
parent39c737328cd621c6e3a502dbf24e810c6d38b77d (diff)
Fix problems with new compiler attribute checking in configure script.
The last changes to ast_gcc_attribute.m4 caused some problems checking for various attributes, because the scope of the symbol the attribute is applied to can be important; this patch allows the scope to be specified for the check. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200985 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/ast_gcc_attribute.m413
1 files changed, 10 insertions, 3 deletions
diff --git a/autoconf/ast_gcc_attribute.m4 b/autoconf/ast_gcc_attribute.m4
index 806b39019..f08b2545b 100644
--- a/autoconf/ast_gcc_attribute.m4
+++ b/autoconf/ast_gcc_attribute.m4
@@ -1,5 +1,5 @@
# Helper function to check for gcc attributes.
-# AST_GCC_ATTRIBUTE([attribute name], [attribute syntax])
+# AST_GCC_ATTRIBUTE([attribute name], [attribute syntax], [attribute scope])
AC_DEFUN([AST_GCC_ATTRIBUTE],
[
@@ -7,10 +7,17 @@ AC_MSG_CHECKING(for compiler 'attribute $1' support)
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
+if test "x$3" = "x"
+then
+attribute_scope="static"
+else
+attribute_scope="$3"
+fi
+
if test "x$2" = "x"
then
AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([static void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
+ AC_LANG_PROGRAM([$attribute_scope 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 +25,7 @@ AC_COMPILE_IFELSE(
)
else
AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([static void __attribute__(($2)) *test(void *muffin, ...) {return (void *) 0;}],
+ AC_LANG_PROGRAM([$attribute_scope 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.]),