From fc12ea8b6ff1146cb554f41f52d10f73c86b6967 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 10 Aug 2023 22:06:07 +0200 Subject: [PATCH] Fix check for using computed goto flag for re2c When the computed goto extension is available to optimize conditional jumps, option --enable-re2c-cgoto can add the -g flag for re2c. AC_LANG_SOURCE should be used instead of the AC_LANG_PROG so the compilation check program is not wrapped up in another main() function. When the check is successful, the -g is added, otherwise not. --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 6d6d44e0597c4..9083f856ebd34 100644 --- a/configure.ac +++ b/configure.ac @@ -178,7 +178,7 @@ if test "$PHP_RE2C_CGOTO" = "no"; then RE2C_FLAGS="" else AC_MSG_CHECKING([whether re2c -g works]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ int main(int argc, const char **argv) { argc = argc; @@ -190,11 +190,11 @@ label2: return 0; } ]])],[ - RE2C_FLAGS="" - AC_MSG_RESULT([no]) - ],[ RE2C_FLAGS="-g" AC_MSG_RESULT([yes]) + ],[ + RE2C_FLAGS="" + AC_MSG_RESULT([no]) ]) fi PHP_SUBST(RE2C_FLAGS)