Merged revisions 201090 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

........
  r201090 | kpfleming | 2009-06-16 14:27:12 -0500 (Tue, 16 Jun 2009) | 5 lines
  
  Another minor fix to compiler attribute checking.
  
  Defaulting to 'static' for the function scope was bad... so remove it.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@201092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
Kevin P. Fleming 17 years ago
parent c00866ad64
commit e586f666c6

@ -7,17 +7,10 @@ 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([$attribute_scope void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
AC_LANG_PROGRAM([$3 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.]),
@ -25,7 +18,7 @@ AC_COMPILE_IFELSE(
)
else
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([$attribute_scope void __attribute__(($2)) *test(void *muffin, ...) {return (void *) 0;}],
AC_LANG_PROGRAM([$3 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.]),

123
configure vendored

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac Revision: 196949 .
# From configure.ac Revision: 200990 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for asterisk 1.6.
#
@ -17940,13 +17940,6 @@ $as_echo_n "checking for compiler 'attribute pure' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -17955,7 +17948,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18006,7 +17999,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18061,13 +18054,6 @@ $as_echo_n "checking for compiler 'attribute malloc' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18076,7 +18062,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18127,7 +18113,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18182,13 +18168,6 @@ $as_echo_n "checking for compiler 'attribute const' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18197,7 +18176,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18248,7 +18227,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18303,13 +18282,6 @@ $as_echo_n "checking for compiler 'attribute unused' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18318,7 +18290,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18369,7 +18341,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18424,13 +18396,6 @@ $as_echo_n "checking for compiler 'attribute always_inline' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18439,7 +18404,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18490,7 +18455,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18545,13 +18510,6 @@ $as_echo_n "checking for compiler 'attribute deprecated' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18560,7 +18518,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18611,7 +18569,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18666,13 +18624,6 @@ $as_echo_n "checking for compiler 'attribute sentinel' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18681,7 +18632,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18732,7 +18683,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18787,13 +18738,6 @@ $as_echo_n "checking for compiler 'attribute warn_unused_result' support... " >&
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18802,7 +18746,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18853,7 +18797,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18908,13 +18852,6 @@ $as_echo_n "checking for compiler 'attribute weak' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -18923,7 +18860,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((weak)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((weak)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -18974,7 +18911,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -19029,13 +18966,6 @@ $as_echo_n "checking for compiler 'attribute weak_import' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x""" = "x"
then
attribute_scope="static"
else
attribute_scope=""""
fi
if test "x" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -19044,7 +18974,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((weak_import)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((weak_import)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -19095,7 +19025,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -19150,13 +19080,6 @@ $as_echo_n "checking for compiler 'attribute alias' support... " >&6; }
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
if test "x" = "x"
then
attribute_scope="static"
else
attribute_scope=""
fi
if test "xalias("foo")" = "x"
then
cat >conftest.$ac_ext <<_ACEOF
@ -19165,7 +19088,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((alias)) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((alias)) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{
@ -19216,7 +19139,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$attribute_scope void __attribute__((alias("foo"))) *test(void *muffin, ...) {return (void *) 0;}
void __attribute__((alias("foo"))) *test(void *muffin, ...) {return (void *) 0;}
int
main ()
{

@ -513,7 +513,7 @@ AST_GCC_ATTRIBUTE(deprecated)
AST_GCC_ATTRIBUTE(sentinel)
AST_GCC_ATTRIBUTE(warn_unused_result)
AST_GCC_ATTRIBUTE(weak)
AST_GCC_ATTRIBUTE(weak_import, , "")
AST_GCC_ATTRIBUTE(weak_import)
AST_GCC_ATTRIBUTE(alias, [alias("foo")])
AC_MSG_CHECKING(for -ffunction-sections support)

Loading…
Cancel
Save