Skip to content

Commit 933daee

Browse files
authored
Merge pull request #2828 from martinhsv/v3/master
During configure, do not check for pcre if pcre2 specified
2 parents de01b02 + 791964a commit 933daee

File tree

2 files changed

+78
-71
lines changed

2 files changed

+78
-71
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v3.x.y - YYYY-MMM-DD (to be released)
22
-------------------------------------
33

4+
- During configure, do not check for pcre if pcre2 specified
5+
[Issue #2750 - @dvershinin, @martinhsv]
46
- Use pkg-config to find libxml2 first
57
[Issue #2714 - @hughmcmaster]
68
- Fix two rule-reload memory leak issues

build/pcre.m4

Lines changed: 76 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -21,88 +21,93 @@ AC_ARG_WITH(
2121
[test_paths="${with_pcre}"],
2222
[test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr /opt/local"])
2323
24-
AC_MSG_CHECKING([for libpcre config script])
24+
if test "x${with_pcre2}" != "x" && test "x${with_pcre2}" != "xno"; then
25+
AC_MSG_NOTICE([pcre2 specified; omitting check for pcre])
26+
else
2527
26-
for x in ${test_paths}; do
27-
dnl # Determine if the script was specified and use it directly
28-
if test ! -d "$x" -a -e "$x"; then
29-
PCRE_CONFIG=$x
30-
pcre_path="no"
31-
break
32-
fi
28+
AC_MSG_CHECKING([for libpcre config script])
3329
34-
dnl # Try known config script names/locations
35-
for PCRE_CONFIG in pcre-config; do
36-
if test -e "${x}/bin/${PCRE_CONFIG}"; then
37-
pcre_path="${x}/bin"
30+
for x in ${test_paths}; do
31+
dnl # Determine if the script was specified and use it directly
32+
if test ! -d "$x" -a -e "$x"; then
33+
PCRE_CONFIG=$x
34+
pcre_path="no"
3835
break
39-
elif test -e "${x}/${PCRE_CONFIG}"; then
40-
pcre_path="${x}"
36+
fi
37+
38+
dnl # Try known config script names/locations
39+
for PCRE_CONFIG in pcre-config; do
40+
if test -e "${x}/bin/${PCRE_CONFIG}"; then
41+
pcre_path="${x}/bin"
42+
break
43+
elif test -e "${x}/${PCRE_CONFIG}"; then
44+
pcre_path="${x}"
45+
break
46+
else
47+
pcre_path=""
48+
fi
49+
done
50+
if test -n "$pcre_path"; then
4151
break
42-
else
43-
pcre_path=""
4452
fi
4553
done
46-
if test -n "$pcre_path"; then
47-
break
48-
fi
49-
done
5054
51-
if test -n "${pcre_path}"; then
52-
if test "${pcre_path}" != "no"; then
53-
PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
55+
if test -n "${pcre_path}"; then
56+
if test "${pcre_path}" != "no"; then
57+
PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
58+
fi
59+
AC_MSG_RESULT([${PCRE_CONFIG}])
60+
PCRE_VERSION="`${PCRE_CONFIG} --version`"
61+
if test ! -z "${PCRE_VERSION}"; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi
62+
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
63+
if test ! -z "${PCRE_CFLAGS}"; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
64+
PCRE_LDADD="`${PCRE_CONFIG} --libs`"
65+
if test ! -z "${PCRE_LDADD}"; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi
66+
PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`"
67+
if test ! -z "${PCRE_LD_PATH}"; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
68+
else
69+
AC_MSG_RESULT([no])
5470
fi
55-
AC_MSG_RESULT([${PCRE_CONFIG}])
56-
PCRE_VERSION="`${PCRE_CONFIG} --version`"
57-
if test ! -z "${PCRE_VERSION}"; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi
58-
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
59-
if test ! -z "${PCRE_CFLAGS}"; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
60-
PCRE_LDADD="`${PCRE_CONFIG} --libs`"
61-
if test ! -z "${PCRE_LDADD}"; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi
62-
PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`"
63-
if test ! -z "${PCRE_LD_PATH}"; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
64-
else
65-
AC_MSG_RESULT([no])
66-
fi
6771
68-
if test -n "${PCRE_VERSION}"; then
69-
AC_MSG_CHECKING(for PCRE JIT)
70-
save_CFLAGS=$CFLAGS
71-
save_LDFLAGS=$LDFLAGS
72-
save_LIBS=$LIBS
73-
CFLAGS="${PCRE_CFLAGS} ${CFLAGS}"
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); ],
78-
[ pcre_jit_available=yes ], [:]
79-
)
72+
if test -n "${PCRE_VERSION}"; then
73+
AC_MSG_CHECKING(for PCRE JIT)
74+
save_CFLAGS=$CFLAGS
75+
save_LDFLAGS=$LDFLAGS
76+
save_LIBS=$LIBS
77+
CFLAGS="${PCRE_CFLAGS} ${CFLAGS}"
78+
LDFLAGS="${PCRE_LDADD} ${LDFLAGS}"
79+
LIBS="${PCRE_LDADD} ${LIBS}"
80+
AC_TRY_LINK([ #include <pcre.h> ],
81+
[ pcre_jit_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL); ],
82+
[ pcre_jit_available=yes ], [:]
83+
)
8084
81-
if test "x$pcre_jit_available" = "xyes"; then
82-
AC_MSG_RESULT(yes)
83-
PCRE_CFLAGS="${PCRE_CFLAGS} -DPCRE_HAVE_JIT"
84-
else
85-
AC_MSG_RESULT(no)
85+
if test "x$pcre_jit_available" = "xyes"; then
86+
AC_MSG_RESULT(yes)
87+
PCRE_CFLAGS="${PCRE_CFLAGS} -DPCRE_HAVE_JIT"
88+
else
89+
AC_MSG_RESULT(no)
90+
fi
91+
CFLAGS=$save_CFLAGS
92+
LDFLAGS=$save_LDFLAGS
93+
LIBS=$save_LIBS
8694
fi
87-
CFLAGS=$save_CFLAGS
88-
LDFLAGS=$save_LDFLAGS
89-
LIBS=$save_LIBS
90-
fi
9195
92-
AC_SUBST(PCRE_CONFIG)
93-
AC_SUBST(PCRE_VERSION)
94-
AC_SUBST(PCRE_CPPFLAGS)
95-
AC_SUBST(PCRE_CFLAGS)
96-
AC_SUBST(PCRE_LDFLAGS)
97-
AC_SUBST(PCRE_LDADD)
98-
AC_SUBST(PCRE_LD_PATH)
96+
AC_SUBST(PCRE_CONFIG)
97+
AC_SUBST(PCRE_VERSION)
98+
AC_SUBST(PCRE_CPPFLAGS)
99+
AC_SUBST(PCRE_CFLAGS)
100+
AC_SUBST(PCRE_LDFLAGS)
101+
AC_SUBST(PCRE_LDADD)
102+
AC_SUBST(PCRE_LD_PATH)
99103
100-
if test -z "${PCRE_VERSION}"; then
101-
AC_MSG_NOTICE([*** pcre library not found.])
102-
ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2)
103-
else
104-
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
105-
ifelse([$1], , , $1)
106-
PCRE_LDADD="${PCRE_LDADD} -lpcre"
107-
fi
104+
if test -z "${PCRE_VERSION}"; then
105+
AC_MSG_NOTICE([*** pcre library not found.])
106+
ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2)
107+
else
108+
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
109+
ifelse([$1], , , $1)
110+
PCRE_LDADD="${PCRE_LDADD} -lpcre"
111+
fi
112+
fi
108113
])

0 commit comments

Comments
 (0)