build: Fix pcre's JIT support detection was not working

This commit is contained in:
Takaya Saeki 2021-04-28 19:19:41 +09:00 committed by Felipe Zimmerle
parent 662c05f89b
commit 3bfe4b81af

View File

@ -69,14 +69,12 @@ if test -n "${PCRE_VERSION}"; then
AC_MSG_CHECKING(for PCRE JIT) AC_MSG_CHECKING(for PCRE JIT)
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
save_LDFLAGS=$LDFLAGS save_LDFLAGS=$LDFLAGS
save_LIBS=$LIBS
CFLAGS="${PCRE_CFLAGS} ${CFLAGS}" CFLAGS="${PCRE_CFLAGS} ${CFLAGS}"
LDFLAGS="${LDFLAGS} ${PCRE_LDADD}" LDFLAGS="${PCRE_LDADD} ${LDFLAGS}"
AC_TRY_COMPILE([ #include <stdio.h> LIBS="${PCRE_LDADD} ${LIBS}"
#include <pcre.h> ], AC_TRY_LINK([ #include <pcre.h> ],
[ int jit = 0; [ pcre_jit_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL); ],
pcre_free_study(NULL);
pcre_config(PCRE_CONFIG_JIT, &jit);
if (jit != 1) return 1; ],
[ pcre_jit_available=yes ], [:] [ pcre_jit_available=yes ], [:]
) )
@ -87,7 +85,8 @@ if test -n "${PCRE_VERSION}"; then
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
LDFLAGS=$save_$LDFLAGS LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
fi fi
AC_SUBST(PCRE_CONFIG) AC_SUBST(PCRE_CONFIG)