Skip to content

Commit d279f7b

Browse files
committed
Removed support to build without PCRE2, which is a mandatory dependency.
- Removed support for building with PCRE, which is end of life.
1 parent 095c380 commit d279f7b

File tree

11 files changed

+73
-482
lines changed

11 files changed

+73
-482
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
- {label: "wo geoip", opt: "--without-geoip" }
2626
- {label: "wo ssdeep", opt: "--without-ssdeep" }
2727
- {label: "with lmdb", opt: "--with-lmdb" }
28-
- {label: "with pcre2", opt: "--with-pcre2" }
2928
exclude:
3029
- platform: {label: "x32"}
3130
configure: {label: "wo geoip"}
@@ -37,19 +36,18 @@ jobs:
3736
sudo dpkg --add-architecture ${{ matrix.platform.arch }}
3837
sudo apt-get update -y -qq
3938
sudo apt-get install -y libyajl-dev:${{ matrix.platform.arch }} \
39+
libpcre2-dev:${{ matrix.platform.arch }} \
40+
pcre2-utils:${{ matrix.platform.arch }} \
4041
libcurl4-openssl-dev:${{ matrix.platform.arch }} \
4142
liblmdb-dev:${{ matrix.platform.arch }} \
4243
liblua5.2-dev:${{ matrix.platform.arch }} \
4344
libmaxminddb-dev:${{ matrix.platform.arch }} \
44-
libpcre2-dev:${{ matrix.platform.arch }} \
45-
pcre2-utils:${{ matrix.platform.arch }} \
4645
bison flex
4746
- name: Setup Dependencies (x32)
4847
if: ${{ matrix.platform.label == 'x32' }}
4948
run: |
5049
sudo apt-get install g++-multilib
51-
sudo apt-get install -y libxml2-dev:${{ matrix.platform.arch }} \
52-
libpcre3-dev:${{ matrix.platform.arch }}
50+
sudo apt-get install -y libxml2-dev:${{ matrix.platform.arch }}
5351
- name: Setup Dependencies (x64)
5452
if: ${{ matrix.platform.label == 'x64' }}
5553
run: |
@@ -85,7 +83,6 @@ jobs:
8583
- {label: "wo geoip", opt: "--without-geoip" }
8684
- {label: "wo ssdeep", opt: "--without-ssdeep" }
8785
- {label: "with lmdb", opt: "--with-lmdb" }
88-
- {label: "with pcre2", opt: "--with-pcre2" }
8986
steps:
9087
- name: Setup Dependencies
9188
# autoconf, curl, pcre2 not installed because they're already
@@ -99,7 +96,6 @@ jobs:
9996
libmaxminddb \
10097
geoip \
10198
ssdeep \
102-
pcre \
10399
bison \
104100
flex
105101
- uses: actions/checkout@v4

build/pcre.m4

Lines changed: 0 additions & 115 deletions
This file was deleted.

build/pcre2.m4

Lines changed: 52 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dnl Check for PCRE2 Libraries
22
dnl CHECK_PCRE2(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
33

4-
AC_DEFUN([PROG_PCRE2], [
4+
AC_DEFUN([CHECK_PCRE2], [
55
66
# Possible names for the pcre2 library/package (pkg-config)
77
PCRE2_POSSIBLE_LIB_NAMES="pcre2 pcre2-8 libpcre2-8"
@@ -13,105 +13,76 @@ PCRE2_POSSIBLE_EXTENSIONS="so so0 la sl dll dylib so.0.0.0"
1313
PCRE2_POSSIBLE_PATHS="/usr/lib /usr/local/lib /usr/local/libpcre2-8 /usr/local/pcre2 /usr/local /opt/libpcre2-8 /opt/pcre2 /opt /usr /usr/lib64 /opt/local"
1414
1515
# Variables to be set by this very own script.
16-
PCRE2_VERSION=""
17-
PCRE2_CFLAGS=""
18-
PCRE2_CPPFLAGS=""
19-
PCRE2_LDADD=""
20-
PCRE2_LDFLAGS=""
16+
PCRE_VERSION=""
17+
PCRE_CFLAGS=""
18+
PCRE_LDADD=""
19+
PCRE_LDFLAGS=""
20+
PCRE_DISPLAY=""
2121
2222
AC_ARG_WITH(
2323
pcre2,
2424
[AS_HELP_STRING([--with-pcre2=PATH],[Path to pcre2 prefix or config script])]
2525
)
2626
27-
if test "x${with_pcre2}" == "xno"; then
28-
AC_DEFINE(HAVE_PCRE2, 0, [Support for PCRE2 was disabled by the utilization of --without-pcre2 or --with-pcre2=no])
29-
AC_MSG_NOTICE([Support for PCRE2 was disabled by the utilization of --without-pcre2 or --with-pcre2=no])
30-
PCRE2_DISABLED=yes
31-
else
32-
if test "x${with_pcre2}" == "xyes"; then
33-
PCRE2_MANDATORY=yes
34-
AC_MSG_NOTICE([PCRE2 support was marked as mandatory by the utilization of --with-pcre2=yes])
35-
fi
36-
# for x in ${PCRE2_POSSIBLE_LIB_NAMES}; do
37-
# CHECK_FOR_PCRE2_AT(${x})
38-
# if test -n "${PCRE2_VERSION}"; then
39-
# break
40-
# fi
41-
# done
42-
43-
# if test "x${with_pcre2}" != "xyes" or test "x${with_pcre2}" == "xyes"; then
44-
if test "x${with_pcre2}" == "x" || test "x${with_pcre2}" == "xyes"; then
45-
# Nothing about PCRE2 was informed, using the pkg-config to figure things out.
46-
if test -n "${PKG_CONFIG}"; then
47-
PCRE2_PKG_NAME=""
48-
for x in ${PCRE2_POSSIBLE_LIB_NAMES}; do
49-
if ${PKG_CONFIG} --exists ${x}; then
50-
PCRE2_PKG_NAME="$x"
51-
break
52-
fi
53-
done
27+
PCRE2_MANDATORY=yes
28+
AC_MSG_NOTICE([pcre2 is mandatory])
29+
30+
if test "x${with_pcre2}" == "x" || test "x${with_pcre2}" == "xyes"; then
31+
# Nothing about PCRE2 was informed, using the pkg-config to figure things out.
32+
if test -n "${PKG_CONFIG}"; then
33+
PCRE2_PKG_NAME=""
34+
for x in ${PCRE2_POSSIBLE_LIB_NAMES}; do
35+
if ${PKG_CONFIG} --exists ${x}; then
36+
PCRE2_PKG_NAME="$x"
37+
break
5438
fi
55-
AC_MSG_NOTICE([Nothing about PCRE2 was informed during the configure phase. Trying to detect it on the platform...])
56-
if test -n "${PCRE2_PKG_NAME}"; then
57-
# Package was found using the pkg-config scripts
58-
PCRE2_VERSION="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --modversion`"
59-
PCRE2_CFLAGS="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --cflags`"
60-
PCRE2_LDADD="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --libs-only-l`"
61-
PCRE2_LDFLAGS="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --libs-only-L --libs-only-other`"
62-
PCRE2_DISPLAY="${PCRE2_LDADD}, ${PCRE2_CFLAGS}"
63-
else
64-
# If pkg-config did not find anything useful, go over file lookup.
65-
for x in ${PCRE2_POSSIBLE_PATHS}; do
66-
CHECK_FOR_PCRE2_AT(${x})
67-
if test -n "${PCRE2_VERSION}"; then
68-
break
69-
fi
70-
done
39+
done
40+
fi
41+
AC_MSG_NOTICE([Nothing about PCRE2 was informed during the configure phase. Trying to detect it on the platform...])
42+
if test -n "${PCRE2_PKG_NAME}"; then
43+
# Package was found using the pkg-config scripts
44+
PCRE_VERSION="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --modversion`"
45+
PCRE_CFLAGS="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --cflags`"
46+
PCRE_LDADD="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --libs-only-l`"
47+
PCRE_LDFLAGS="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --libs-only-L --libs-only-other`"
48+
else
49+
# If pkg-config did not find anything useful, go over file lookup.
50+
for x in ${PCRE2_POSSIBLE_PATHS}; do
51+
CHECK_FOR_PCRE2_AT(${x})
52+
if test -n "${PCRE_LDADD}"; then
53+
break
7154
fi
72-
fi
73-
if test "x${with_pcre2}" != "x"; then
74-
# An specific path was informed, lets check.
75-
PCRE2_MANDATORY=yes
76-
CHECK_FOR_PCRE2_AT(${with_pcre2})
77-
fi
78-
# fi
55+
done
56+
fi
57+
elif test "x${with_pcre2}" != "x"; then
58+
# A specific path was informed, let's check.
59+
CHECK_FOR_PCRE2_AT(${with_pcre2})
7960
fi
8061
81-
if test -z "${PCRE2_LDADD}"; then
82-
if test -z "${PCRE2_MANDATORY}"; then
83-
if test -z "${PCRE2_DISABLED}"; then
84-
AC_MSG_NOTICE([PCRE2 library was not found])
85-
PCRE2_FOUND=0
86-
else
87-
PCRE2_FOUND=2
88-
fi
89-
else
90-
AC_MSG_ERROR([PCRE2 was explicitly referenced but it was not found])
91-
PCRE2_FOUND=-1
92-
fi
62+
if test -z "${PCRE_LDADD}"; then
63+
AC_MSG_ERROR([PCRE2 is mandatory but it was not found])
64+
PCRE2_FOUND=-1
9365
else
9466
if test -z "${PCRE2_MANDATORY}"; then
9567
PCRE2_FOUND=2
9668
AC_MSG_NOTICE([PCRE2 is disabled by default.])
9769
else
9870
PCRE2_FOUND=1
99-
AC_MSG_NOTICE([using PCRE2 v${PCRE2_VERSION}])
100-
PCRE2_CFLAGS="-DWITH_PCRE2 ${PCRE2_CFLAGS}"
101-
PCRE2_DISPLAY="${PCRE2_LDADD}, ${PCRE2_CFLAGS}"
102-
AC_SUBST(PCRE2_VERSION)
103-
AC_SUBST(PCRE2_LDADD)
104-
AC_SUBST(PCRE2_LIBS)
105-
AC_SUBST(PCRE2_LDFLAGS)
106-
AC_SUBST(PCRE2_CFLAGS)
107-
AC_SUBST(PCRE2_DISPLAY)
71+
AC_MSG_NOTICE([using PCRE2 v${PCRE_VERSION}])
72+
PCRE_CFLAGS="${PCRE_CFLAGS}"
73+
PCRE_DISPLAY="${PCRE_LDADD}, ${PCRE_CFLAGS}"
74+
AC_SUBST(PCRE_VERSION)
75+
AC_SUBST(PCRE_LDADD)
76+
AC_SUBST(PCRE_LDFLAGS)
77+
AC_SUBST(PCRE_CFLAGS)
78+
AC_SUBST(PCRE_DISPLAY)
10879
fi
10980
fi
11081
11182
11283
AC_SUBST(PCRE2_FOUND)
11384
114-
]) # AC_DEFUN [PROG_PCRE2]
85+
]) # AC_DEFUN [CHECK_PCRE2]
11586

11687

11788
AC_DEFUN([CHECK_FOR_PCRE2_AT], [
@@ -172,9 +143,8 @@ AC_DEFUN([CHECK_FOR_PCRE2_AT], [
172143
173144
if test -n "${pcre2_lib_path}" -a -n "${pcre2_inc_path}"; then
174145
# TODO: Compile a piece of code to check the version.
175-
PCRE2_CFLAGS="-I${pcre2_inc_path}"
176-
PCRE2_LDADD="-l${pcre2_lib_name}"
177-
PCRE2_LDFLAGS="-L${pcre2_lib_path}"
178-
PCRE2_DISPLAY="${pcre2_lib_file}, ${pcre2_inc_path}"
146+
PCRE_CFLAGS="-I${pcre2_inc_path}"
147+
PCRE_LDADD="-l${pcre2_lib_name}"
148+
PCRE_LDFLAGS="-L${pcre2_lib_path}"
179149
fi
180150
]) # AC_DEFUN [CHECK_FOR_PCRE2_AT]

0 commit comments

Comments
 (0)