Skip to content

Commit

Permalink
Fix check for using computed goto flag for re2c
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
petk committed Aug 10, 2023
1 parent 0d922aa commit fc12ea8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit fc12ea8

Please sign in to comment.