Skip to content

Commit 3d8f1f0

Browse files
author
foobar
committed
MFH: Fix for bug #22131
1 parent d2c4424 commit 3d8f1f0

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

ext/pcre/config0.m4

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,20 @@ if test "$PHP_PCRE_REGEX" != "no"; then
1717
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
1818
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
1919
else
20-
test -f $PHP_PCRE_REGEX/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX
21-
test -f $PHP_PCRE_REGEX/include/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX/include
22-
test -f $PHP_PCRE_REGEX/include/pcre/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX/include/pcre
20+
for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do
21+
test -f $i/pcre.h && PCRE_INCDIR=$i
22+
done
2323

2424
if test -z "$PCRE_INCDIR"; then
25-
AC_MSG_RESULT(Could not find pcre.h in $PHP_PCRE_REGEX)
25+
AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX])
26+
fi
27+
28+
for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib; do
29+
test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
30+
done
31+
32+
if test -z "$PCRE_LIBDIR" ; then
33+
AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX])
2634
fi
2735

2836
changequote({,})
@@ -35,14 +43,7 @@ if test "$PHP_PCRE_REGEX" != "no"; then
3543
fi
3644
pcre_version=$pcre_major$pcre_minor
3745
if test "$pcre_version" -lt 208; then
38-
AC_MSG_ERROR(The PCRE extension requires PCRE library version >= 2.08)
39-
fi
40-
41-
test -f $PHP_PCRE_REGEX/libpcre.a && PCRE_LIBDIR=$PHP_PCRE_REGEX
42-
test -f $PHP_PCRE_REGEX/lib/libpcre.a && PCRE_LIBDIR=$PHP_PCRE_REGEX/lib
43-
44-
if test -z "$PCRE_LIBDIR" ; then
45-
AC_MSG_ERROR(Could not find libpcre.a in $PHP_PCRE_REGEX)
46+
AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 2.08])
4647
fi
4748

4849
PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
@@ -51,7 +52,5 @@ if test "$PHP_PCRE_REGEX" != "no"; then
5152
PHP_ADD_INCLUDE($PCRE_INCDIR)
5253
PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2)
5354
fi
55+
PHP_SUBST(PCRE_SHARED_LIBADD)
5456
fi
55-
PHP_SUBST(PCRE_SHARED_LIBADD)
56-
57-
AC_CHECK_FUNC(memmove, [], [AC_DEFINE(USE_BCOPY, 1, [ ])])

0 commit comments

Comments
 (0)