pcre2: remove PCRE1 as dependency

pull/6414/head
Philippe Antoine 4 years ago
parent 56f664af6b
commit bce3c46874

@ -608,35 +608,6 @@
LIBS="${TMPLIBS} -lz"
fi
#libpcre
AC_ARG_WITH(libpcre_includes,
[ --with-libpcre-includes=DIR libpcre include directory],
[with_libpcre_includes="$withval"],[with_libpcre_includes="no"])
AC_ARG_WITH(libpcre_libraries,
[ --with-libpcre-libraries=DIR libpcre library directory],
[with_libpcre_libraries="$withval"],[with_libpcre_libraries="no"])
if test "$with_libpcre_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
fi
AC_CHECK_HEADER(pcre.h,,[AC_MSG_ERROR(pcre.h not found ...)])
if test "$with_libpcre_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_libpcre_libraries}"
fi
PCRE=""
AC_CHECK_LIB(pcre, pcre_get_substring,,PCRE="no")
if test "$PCRE" = "no"; then
echo
echo " ERROR! pcre library not found, go get it"
echo " from www.pcre.org. Or from packages:"
echo " Debian/Ubuntu: apt install libpcre3-dev"
echo " Fedora: dnf install pcre-devel"
echo " CentOS/RHEL: yum install pcre-devel"
echo
exit 1
fi
PCRE2=""
AC_CHECK_LIB(pcre2-8, pcre2_compile_8,,PCRE2="no")
if test "$PCRE2" = "no"; then
@ -665,45 +636,6 @@
AC_MSG_RESULT(no)
fi
# libpcre 8.35 (especially on debian) has a known issue that results in segfaults
# see https://redmine.openinfosecfoundation.org/issues/1693
if test "$with_libpcre_libraries" = "no"; then
PKG_CHECK_MODULES(LIBPCREVERSION, [libpcre = 8.35],[libpcre_buggy_found="yes"],[libprce_buggy_found="no"])
if test "$libpcre_buggy_found" = "yes"; then
echo
echo " Warning! vulnerable libpcre version 8.35 found"
echo " This version has a known issue that could result in segfaults"
echo " please upgrade to a newer version of pcre which you can get from"
echo " www.pcre.org. For more information, see issue #1693"
echo
echo " Continuing for now with JIT disabled..."
echo
fi
fi
# To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
# see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
PCRE=""
TMPLIBS="${LIBS}"
AC_CHECK_LIB(pcre, pcre_dfa_exec,, PCRE="no")
if test "$PCRE" = "no"; then
echo
echo " ERROR! pcre library was found but version was < 6.0"
echo " please upgrade to a newer version of pcre which you can get from"
echo " www.pcre.org."
echo
exit 1
fi
LIBS="${TMPLIBS}"
TMPCFLAGS="${CFLAGS}"
CFLAGS="-O0 -g -Werror -Wall"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pcre.h> ]],
[[ pcre_extra *extra = NULL; pcre_free_study(extra); ]])],
[ AC_DEFINE([HAVE_PCRE_FREE_STUDY], [1], [Pcre pcre_free_study supported])],[:]
)
CFLAGS="${TMPCFLAGS}"
# libhs
enable_hyperscan="no"
@ -2616,7 +2548,7 @@ SURICATA_BUILD_CONF="Suricata Configuration:
libjansson support: ${enable_jansson}
hiredis support: ${enable_hiredis}
hiredis async with libevent: ${enable_hiredis_async}
PCRE jit: ${pcre_jit_available}
PCRE jit: ${pcre2_jit_available}
LUA support: ${enable_lua}
libluajit: ${enable_luajit}
GeoIP2 support: ${enable_geoip}

@ -8,7 +8,7 @@ apt-get install dkms
apt-get install subversion flex bison
#Install the debs needed for suricata.
apt-get install libpcre3-dev libpcap-dev libyaml-dev zlib1g-dev libcap-ng-dev libnet1-dev
apt-get install libpcap-dev libyaml-dev zlib1g-dev libcap-ng-dev libnet1-dev libpcre2-dev
#In the exmple we will build from the GIT repo so we will need some extra packages
apt-get install git-core automake autoconf libtool

@ -75,7 +75,7 @@ the following packages to c:\mingw (use newer versions if you like):
- unpack to /msys/1.0
- don't forget to edit your ~/.gitconfig to at least give youreself a name :-)
5. Get libpcre
5. Get libpcre2
http://www.pcre.org/
@ -117,7 +117,7 @@ the following packages to c:\mingw (use newer versions if you like):
make
If everything goes well, you'll end up with suricata.exe in src/.lib. To test it
you will need libpcre-0.dll, libz-1.dll, and pthreadGC2.dll which you already have somewhere
you will need libpcre2-0.dll, libz-1.dll, and pthreadGC2.dll which you already have somewhere
under c:/mingw or c:/msys. To prepare the runtime environment:
- copy the executable and the DLLs to a dedicated directory

@ -63,7 +63,7 @@ Dependencies
For Suricata's compilation you'll need the following libraries and their development headers installed::
libjansson, libpcap, libpcre, libmagic, zlib, libyaml
libjansson, libpcap, libpcre2, libmagic, zlib, libyaml
The following tools are required::
@ -87,17 +87,17 @@ Ubuntu/Debian
Minimal::
apt-get install libpcre3 libpcre3-dbg libpcre3-dev build-essential libpcap-dev \
apt-get install build-essential libpcap-dev \
libyaml-0-2 libyaml-dev pkg-config zlib1g zlib1g-dev \
make libmagic-dev libjansson libjansson-dev
make libmagic-dev libjansson libjansson-dev libpcre2-dev
Recommended::
apt-get install libpcre3 libpcre3-dbg libpcre3-dev build-essential libpcap-dev \
apt-get install build-essential libpcap-dev \
libnet1-dev libyaml-0-2 libyaml-dev pkg-config zlib1g zlib1g-dev \
libcap-ng-dev libcap-ng0 make libmagic-dev \
libgeoip-dev liblua5.1-dev libhiredis-dev libevent-dev \
python-yaml rustc cargo
python-yaml rustc cargo libpcre2-dev
Extra for iptables/nftables IPS integration::

@ -433,7 +433,7 @@ int PerCentEncodingSetup ()
#define DETECT_PERCENT_ENCODING_REGEX "%[0-9|a-f|A-F]{2}"
int en;
PCRE2_SIZE eo = 0;
int opts = 0; //PCRE_NEWLINE_ANY??
int opts = 0; // PCRE2_NEWLINE_ANY??
percent_re = pcre2_compile((PCRE2_SPTR8)DETECT_PERCENT_ENCODING_REGEX, PCRE2_ZERO_TERMINATED,
opts, &en, &eo, NULL);

@ -24,7 +24,6 @@
*/
#include "suricata-common.h"
#include "pcre.h"
#include "debug.h"
#include "decode.h"
#include "detect.h"

@ -138,7 +138,6 @@ typedef unsigned short u_short
typedef unsigned char u_char
#endif
#include <pcre.h>
#include <pcre2.h>
#ifdef HAVE_SYSLOG_H
@ -365,10 +364,6 @@ typedef unsigned char u_char
#error "byte order: can't figure out big or little"
#endif
#ifndef HAVE_PCRE_FREE_STUDY
#define pcre_free_study pcre_free
#endif
#ifndef MIN
#define MIN(x, y) (((x)<(y))?(x):(y))
#endif

Loading…
Cancel
Save