autoconf: Use m4 conditionals where possible.

Change-Id: I530c0a72f965437acef6a9a4fbfe5c487f078b65
This commit is contained in:
Corey Farrell
2017-11-17 11:38:48 -05:00
parent 87a57e8d46
commit ce5cfc8ffb
7 changed files with 2048 additions and 3823 deletions

View File

@@ -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"