Skip to content

Commit fc12ea8

Browse files
committed
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.
1 parent 0d922aa commit fc12ea8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

configure.ac

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ if test "$PHP_RE2C_CGOTO" = "no"; then
178178
RE2C_FLAGS=""
179179
else
180180
AC_MSG_CHECKING([whether re2c -g works])
181-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
181+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
182182
int main(int argc, const char **argv)
183183
{
184184
argc = argc;
@@ -190,11 +190,11 @@ label2:
190190
return 0;
191191
}
192192
]])],[
193-
RE2C_FLAGS=""
194-
AC_MSG_RESULT([no])
195-
],[
196193
RE2C_FLAGS="-g"
197194
AC_MSG_RESULT([yes])
195+
],[
196+
RE2C_FLAGS=""
197+
AC_MSG_RESULT([no])
198198
])
199199
fi
200200
PHP_SUBST(RE2C_FLAGS)

0 commit comments

Comments
 (0)