<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7378">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/78/7378/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 d07fee7..6b5aee7 100755<br>--- a/configure<br>+++ b/configure<br>@@ -18080,8 +18080,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>@@ -18109,35 +18107,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>@@ -18151,8 +18120,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>@@ -18180,35 +18147,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>@@ -18222,8 +18160,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>@@ -18251,35 +18187,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>@@ -18293,8 +18200,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>@@ -18322,35 +18227,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>@@ -18364,8 +18240,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>@@ -18393,35 +18267,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>@@ -18435,8 +18280,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>@@ -18464,35 +18307,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>@@ -18506,8 +18320,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>@@ -18535,35 +18347,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>@@ -18577,8 +18360,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>@@ -18606,35 +18387,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>@@ -18648,8 +18400,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>@@ -18677,35 +18427,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>@@ -18719,8 +18440,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>@@ -18748,35 +18467,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>@@ -18794,8 +18484,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>@@ -18823,35 +18511,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>@@ -18868,36 +18527,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>@@ -18925,7 +18554,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/7378">change 7378</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/7378"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </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: 7378 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>