From: Paul Eggert Date: Tue, 28 Jun 2022 22:10:53 +0000 (-0500) Subject: Refactor recent AC_FUNC_ALLOCA fix X-Git-Tag: v2.72c~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e3282fe3893a42eb9c5cc4eba5387a3be4e8d10;p=thirdparty%2Fautoconf.git Refactor recent AC_FUNC_ALLOCA fix * lib/autoconf/functions.m4 (AC_FUNC_ALLOCA): Simplify and use AS_IF. Had I done it this way originally I would have avoided the bug that Jim just fixed. --- diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 51aeb0b9..70eb8760 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -426,10 +426,9 @@ if test $ac_cv_working_alloca_h = yes; then fi AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works, -[if test $ac_cv_working_alloca_h = yes; then - ac_cv_func_alloca_works=yes -else - AC_LINK_IFELSE([AC_LANG_PROGRAM( +[ac_cv_func_alloca_works=$ac_cv_working_alloca_h +AS_IF([test "$ac_cv_func_alloca_works" != yes], + [AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include #include #ifndef alloca @@ -447,11 +446,7 @@ void *alloca (size_t); #endif ]], [[char *p = (char *) alloca (1); if (p) return 0;]])], - [ac_cv_func_alloca_works=yes], - [ac_cv_func_alloca_works=no] - ) -fi -]) + [ac_cv_func_alloca_works=yes])])]) if test $ac_cv_func_alloca_works = yes; then AC_DEFINE(HAVE_ALLOCA, 1,