<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7390">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">autoconf: Use m4 conditional in AST_GCC_ATTRIBUTE.<br><br>Change-Id: Ie70134f5795f38cb6fbd46684971e1fa847bc774<br>---<br>M autoconf/ast_gcc_attribute.m4<br>M configure<br>2 files changed, 4 insertions(+), 387 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/7390/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/autoconf/ast_gcc_attribute.m4 b/autoconf/ast_gcc_attribute.m4<br>index b1972be..9d5a320 100644<br>--- a/autoconf/ast_gcc_attribute.m4<br>+++ b/autoconf/ast_gcc_attribute.m4<br>@@ -9,28 +9,17 @@<br> m4_ifval([$4],$4=0)<br> ax_cv_have_func_attribute_$1=0<br> <br>-if test "x$2" = "x"<br>-then<br> AC_COMPILE_IFELSE(<br>- [AC_LANG_PROGRAM([$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],<br>- [])],<br>+ [AC_LANG_PROGRAM(<br>+ m4_ifblank([$2],<br>+ [$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],<br>+ [$3 void __attribute__(($2)) *test(void *muffin, ...) ;]))],<br> AC_MSG_RESULT(yes)<br> m4_ifval([$4],$4=1)<br> ax_cv_have_func_attribute_$1=1<br> AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),<br> AC_MSG_RESULT(no)<br> )<br>-else<br>-AC_COMPILE_IFELSE(<br>- [AC_LANG_PROGRAM([$3 void __attribute__(($2)) *test(void *muffin, ...) ;],<br>- [])],<br>- AC_MSG_RESULT(yes)<br>- m4_ifval([$4],$4=1)<br>- ax_cv_have_func_attribute_$1=1<br>- AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),<br>- AC_MSG_RESULT(no)<br>-)<br>-fi<br> <br> m4_ifval([$4],[AC_SUBST($4)])<br> CFLAGS="$saved_CFLAGS"<br>diff --git a/configure b/configure<br>index 43ef738..eca9c8d 100755<br>--- a/configure<br>+++ b/configure<br>@@ -17815,8 +17815,6 @@<br> <br> ax_cv_have_func_attribute_pure=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -17844,35 +17842,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_pure=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_pure 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -17886,8 +17855,6 @@<br> <br> ax_cv_have_func_attribute_malloc=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -17915,35 +17882,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_malloc=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_malloc 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -17957,8 +17895,6 @@<br> <br> ax_cv_have_func_attribute_const=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -17986,35 +17922,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_const=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_const 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18028,8 +17935,6 @@<br> <br> ax_cv_have_func_attribute_unused=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18057,35 +17962,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_unused=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_unused 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18099,8 +17975,6 @@<br> <br> ax_cv_have_func_attribute_always_inline=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18128,35 +18002,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_always_inline=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_always_inline 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18170,8 +18015,6 @@<br> <br> ax_cv_have_func_attribute_deprecated=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18199,35 +18042,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_deprecated=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_deprecated 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18241,8 +18055,6 @@<br> <br> ax_cv_have_func_attribute_sentinel=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18270,35 +18082,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_sentinel=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_sentinel 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18312,8 +18095,6 @@<br> <br> ax_cv_have_func_attribute_warn_unused_result=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18341,35 +18122,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_warn_unused_result=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_warn_unused_result 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18383,8 +18135,6 @@<br> <br> ax_cv_have_func_attribute_may_alias=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((may_alias)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18412,35 +18162,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_may_alias=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_may_alias 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18454,8 +18175,6 @@<br> <br> ax_cv_have_func_attribute_constructor=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((constructor)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18483,35 +18202,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_constructor=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_constructor 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18529,8 +18219,6 @@<br> <br> ax_cv_have_func_attribute_destructor=0<br> <br>-if test "x" = "x"<br>-then<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((destructor)) *test(void *muffin, ...) {return (void *) 0;}<br>@@ -18558,35 +18246,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__(()) *test(void *muffin, ...) ;<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_destructor=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_destructor 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br>@@ -18603,36 +18262,6 @@<br> <br> ax_cv_have_func_attribute_noreturn=0<br> <br>-if test "xnoreturn" = "x"<br>-then<br>-cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h. */<br>- void __attribute__((noreturn)) *test(void *muffin, ...) {return (void *) 0;}<br>-int<br>-main ()<br>-{<br>-<br>- ;<br>- return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>- ax_cv_have_func_attribute_noreturn=1<br>-<br>-cat >>confdefs.h <<_ACEOF<br>-#define HAVE_ATTRIBUTE_noreturn 1<br>-_ACEOF<br>-<br>-else<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-else<br> cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br> /* end confdefs.h. */<br> void __attribute__((noreturn)) *test(void *muffin, ...) ;<br>@@ -18660,7 +18289,6 @@<br> <br> fi<br> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-fi<br> <br> <br> CFLAGS="$saved_CFLAGS"<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7390">change 7390</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7390"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie70134f5795f38cb6fbd46684971e1fa847bc774 </div>
<div style="display:none"> Gerrit-Change-Number: 7390 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>