Skip to content

Commit 3bfe4b8

Browse files
nullpo-headzimmerle
authored andcommitted
build: Fix pcre's JIT support detection was not working
1 parent 662c05f commit 3bfe4b8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

build/pcre.m4

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,12 @@ if test -n "${PCRE_VERSION}"; then
6969
AC_MSG_CHECKING(for PCRE JIT)
7070
save_CFLAGS=$CFLAGS
7171
save_LDFLAGS=$LDFLAGS
72+
save_LIBS=$LIBS
7273
CFLAGS="${PCRE_CFLAGS} ${CFLAGS}"
73-
LDFLAGS="${LDFLAGS} ${PCRE_LDADD}"
74-
AC_TRY_COMPILE([ #include <stdio.h>
75-
#include <pcre.h> ],
76-
[ int jit = 0;
77-
pcre_free_study(NULL);
78-
pcre_config(PCRE_CONFIG_JIT, &jit);
79-
if (jit != 1) return 1; ],
74+
LDFLAGS="${PCRE_LDADD} ${LDFLAGS}"
75+
LIBS="${PCRE_LDADD} ${LIBS}"
76+
AC_TRY_LINK([ #include <pcre.h> ],
77+
[ pcre_jit_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL); ],
8078
[ pcre_jit_available=yes ], [:]
8179
)
8280
@@ -87,7 +85,8 @@ if test -n "${PCRE_VERSION}"; then
8785
AC_MSG_RESULT(no)
8886
fi
8987
CFLAGS=$save_CFLAGS
90-
LDFLAGS=$save_$LDFLAGS
88+
LDFLAGS=$save_LDFLAGS
89+
LIBS=$save_LIBS
9190
fi
9291
9392
AC_SUBST(PCRE_CONFIG)

0 commit comments

Comments
 (0)