mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
autoconf: Use m4 conditionals where possible.
Change-Id: I530c0a72f965437acef6a9a4fbfe5c487f078b65
This commit is contained in:
@@ -9,28 +9,17 @@ CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
|
||||
m4_ifval([$4],$4=0)
|
||||
ax_cv_have_func_attribute_$1=0
|
||||
|
||||
if test "x$2" = "x"
|
||||
then
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
|
||||
[])],
|
||||
[AC_LANG_PROGRAM(
|
||||
m4_ifblank([$2],
|
||||
[$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
|
||||
[$3 void __attribute__(($2)) *test(void *muffin, ...) ;]))],
|
||||
AC_MSG_RESULT(yes)
|
||||
m4_ifval([$4],$4=1)
|
||||
ax_cv_have_func_attribute_$1=1
|
||||
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
else
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([$3 void __attribute__(($2)) *test(void *muffin, ...) ;],
|
||||
[])],
|
||||
AC_MSG_RESULT(yes)
|
||||
m4_ifval([$4],$4=1)
|
||||
ax_cv_have_func_attribute_$1=1
|
||||
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
m4_ifval([$4],[AC_SUBST($4)])
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
|
Reference in New Issue
Block a user