From 10ea4910e708eb912395b9fa137dbac2e7868950 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Tue, 16 Jun 2009 16:32:36 +0000 Subject: 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: https://origsvn.digium.com/svn/asterisk/trunk@200985 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- configure | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 20 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 97015d342..1e2a6986e 100755 --- a/configure +++ b/configure @@ -18017,6 +18017,13 @@ $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 @@ -18025,7 +18032,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18076,7 +18083,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18131,6 +18138,13 @@ $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 @@ -18139,7 +18153,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18190,7 +18204,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18245,6 +18259,13 @@ $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 @@ -18253,7 +18274,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18304,7 +18325,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18359,6 +18380,13 @@ $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 @@ -18367,7 +18395,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18418,7 +18446,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18473,6 +18501,13 @@ $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 @@ -18481,7 +18516,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18532,7 +18567,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18587,6 +18622,13 @@ $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 @@ -18595,7 +18637,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18646,7 +18688,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18701,6 +18743,13 @@ $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 @@ -18709,7 +18758,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18760,7 +18809,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18815,6 +18864,13 @@ $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 @@ -18823,7 +18879,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18874,7 +18930,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18929,6 +18985,13 @@ $as_echo_n "checking for compiler 'attribute weakref' 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 "xweakref("foo")" = "x" then cat >conftest.$ac_ext <<_ACEOF @@ -18937,7 +19000,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((weakref)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((weakref)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -18988,7 +19051,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((weakref("foo"))) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((weakref("foo"))) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -19043,6 +19106,13 @@ $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 @@ -19051,7 +19121,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__((weak_import)) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__((weak_import)) *test(void *muffin, ...) {return (void *) 0;} int main () { @@ -19102,7 +19172,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} +$attribute_scope void __attribute__(()) *test(void *muffin, ...) {return (void *) 0;} int main () { -- cgit v1.2.3