Skip to content

Commit

Permalink
...G...PS. [ZBXNEXT-9338] dropped support for libpcre <= 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Juris Lambda committed Jan 21, 2025
2 parents 86c01d6 + 0e5c370 commit 1838a14
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 578 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
!/build/win32/**/Makefile
!/build/win64/**/Makefile
!/src/modules/dummy/Makefile
*.a
*.o
Expand Down Expand Up @@ -52,6 +50,8 @@ build/win32/project/MSG00001.bin
build/win32/project/messages.h
build/win32/project/messages.rc
build/win32/project/resource.res
!/build/win32/**/Makefile
!/build/win64/**/Makefile
database/mysql/data.sql
database/mysql/schema.sql
database/mysql/option-patches
Expand Down
1 change: 1 addition & 0 deletions ChangeLog.d/feature/ZBXNEXT-9338
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
...GI..PS. [ZBXNEXT-9338] dropped legacy libpcre support (jxl)
2 changes: 1 addition & 1 deletion build-backend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<!-- Zabbix various configuration parameters for cmocka tests -->
<!-- Configuration option name must consist of prefix 'cmocka-', configuration order number
and configuration title: cmocka-<number>-<title> -->
<property name="cmocka-1-default" value="-q CFLAGS='${COMP_FLAGS}' ${ZBX_BASE_FLAGS} --enable-ipv6 --with-mysql --with-openipmi --with-openssl --with-iconv --with-libpcre"/>
<property name="cmocka-1-default" value="-q CFLAGS='${COMP_FLAGS}' ${ZBX_BASE_FLAGS} --enable-ipv6 --with-mysql --with-openipmi --with-openssl --with-iconv --with-libpcre2"/>
<property name="cmocka-2-agent-only" value="-q CFLAGS='${COMP_FLAGS}' --enable-agent"/>
<property name="cmocka-3-server-only" value="-q CFLAGS='${COMP_FLAGS}' --enable-server --with-mysql --with-libcurl"/>
<property name="cmocka-4-proxy-only" value="-q CFLAGS='${COMP_FLAGS}' --enable-proxy --with-sqlite3 --with-libcurl"/>
Expand Down
6 changes: 0 additions & 6 deletions build/mingw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ ifneq ("$(OPENSSL)", "")
endif
endif

ifneq ("$(PCRE)", "")
CFLAGS := $(CFLAGS) -DPCRE_STATIC -I$(PCRE)\include -DHAVE_PCRE_H=1
LDFLAGS := $(LDFLAGS) -L$(PCRE)\lib
TAGS := $(TAGS) pcre
endif

ifneq ("$(PCRE2)", "")
CFLAGS := $(CFLAGS) -DPCRE2_STATIC -I$(PCRE2)\include -DHAVE_PCRE2_H=1
LDFLAGS := $(LDFLAGS) -L$(PCRE2)\lib
Expand Down
29 changes: 0 additions & 29 deletions build/win32/project/Makefile_pcre.inc
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
! IF "$(PCREINCDIR)" == "" && "$(PCRE2INCDIR)" == ""
! ERROR Please specify directory containing PCRE or PCRE2 header files (e. g. PCREINCDIR=\somepath\include or PCRE2INCDIR=\somepath\include).
! ENDIF

! IF "$(PCRELIBDIR)" == "" && "$(PCRE2LIBDIR)" == ""
! ERROR Please specify either PCRELIBDIR or PCRE2LIBDIR (e. g. PCRELIBDIR=\somepath\lib or PCRE2LIBDIR=\somepath\lib).
! ENDIF

! IF ("$(PCREINCDIR)" != "" && "$(PCRE2INCDIR)" != "") || ("$(PCRELIBDIR)" != "" && "$(PCRE2LIBDIR)" != "")
! ERROR Cannot use both PCRE and PCRE2 at the same time!
! ENDIF

! IF "$(PCREINCDIR)" != ""
! IF EXISTS("$(PCREINCDIR)\pcre.h")
CFLAGS = $(CFLAGS) /DPCRE_STATIC /DHAVE_PCRE_H
INCS = $(INCS) /I "$(PCREINCDIR)"
! ELSE
! ERROR PCREINCDIR "$(PCREINCDIR)" cannot find "$(PCREINCDIR)\pcre.h"
! ENDIF
! ENDIF

! IF "$(PCRE2INCDIR)" != ""
! IF EXISTS("$(PCRE2INCDIR)\pcre2.h")
CFLAGS = $(CFLAGS) /DPCRE2_STATIC /DHAVE_PCRE2_H
Expand All @@ -28,14 +7,6 @@ INCS = $(INCS) /I "$(PCRE2INCDIR)"
! ENDIF
! ENDIF

! IF "$(PCRELIBDIR)" != ""
! IF EXISTS("$(PCRELIBDIR)\pcre.lib")
LIBS = $(LIBS) "$(PCRELIBDIR)\pcre.lib"
! ELSE
! ERROR PCRELIBDIR "$(PCRELIBDIR)" cannot find "$(PCRELIBDIR)\pcre.lib"
! ENDIF
! ENDIF

! IF "$(PCRE2LIBDIR)" != ""
! IF EXISTS("$(PCRE2LIBDIR)\pcre2-8-static.lib")
LIBS = $(LIBS) "$(PCRE2LIBDIR)\pcre2-8-static.lib"
Expand Down
43 changes: 1 addition & 42 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1946,37 +1946,6 @@ ZBXJS_LDFLAGS="$ZBXJS_LDFLAGS $LIBCURL_LDFLAGS"
ZBXJS_LIBS="$ZBXJS_LIBS $LIBCURL_LIBS"

if test "x$server" = "xyes" || test "x$proxy" = "xyes" || test "x$agent" = "xyes" || test "x$agent2" = "xyes"; then
LIBPCRE_CHECK_CONFIG([flags-only])
LIBPCRE2_CHECK_CONFIG([flags-only])

if test "x$want_libpcre2" = "xno"; then # default to old pcre
if test "x$want_libpcre" = "xno"; then
AC_MSG_NOTICE([using old pcre library by default])
fi

LIBPCRE_CHECK_CONFIG([mandatory])

if test "x$found_libpcre" != "xyes"; then
AC_MSG_ERROR([unable to use libpcre (libpcre check failed)])
fi

LIBPCRE_CHECK_CONFIG([no])

CFLAGS="$CFLAGS $LIBPCRE_CFLAGS"
LDFLAGS="$LDFLAGS $LIBPCRE_LDFLAGS"
if test "x$ARCH" = "xosx"; then
LIBS="$LIBPCRE_LIBS $LIBS"
else
LIBS="$LIBS $LIBPCRE_LIBS"
fi

AC_DEFINE([HAVE_PCRE_H], 1, [Define to 1 if you have the 'libpcre' library (-lpcre)])
have_pcre=1
else
if test "x$want_libpcre" != "xno"; then
AC_MSG_ERROR([cannot use both pcre and pcre2 at the same time])
fi

LIBPCRE2_CHECK_CONFIG([mandatory])

if test "x$found_libpcre2" != "xyes"; then
Expand All @@ -1995,12 +1964,6 @@ else
have_pcre2=1
fi

if test "x$have_pcre" != "x1" && test "x$have_pcre2" != "x1"; then
AC_MSG_ERROR([cannot build with libpcre or libpcre2])
fi
fi

AM_CONDITIONAL([HAVE_PCRE], [test "x$have_pcre" = "x1"])
AM_CONDITIONAL([HAVE_PCRE2], [test "x$have_pcre2" = "x1"])

found_iconv="no"
Expand Down Expand Up @@ -2062,7 +2025,7 @@ if test "x$HAVE_START_GROUP" = "xyes"; then
fi

if test "x$agent2" = "xyes"; then
CGO_CFLAGS="$TLS_CFLAGS $LIBPCRE_CFLAGS $LIBPCRE2_CFLAGS"
CGO_CFLAGS="$TLS_CFLAGS $LIBPCRE2_CFLAGS"
CGO_LDFLAGS="$AGENT2_LDFLAGS $LD_START_GROUP \
\${abs_top_builddir}/src/libs/zbxalgo/libzbxalgo.a \
\${abs_top_builddir}/src/libs/zbxinterface/libzbxinterface.a \
Expand Down Expand Up @@ -2402,10 +2365,6 @@ if test "x$DB_CFLAGS" != "x"; then
echo " database: ${DB_CFLAGS}"
fi

if test "x$LIBPCRE_CFLAGS" != "x"; then
echo " libpcre: ${LIBPCRE_CFLAGS}"
fi

if test "x$LIBPCRE2_CFLAGS" != "x"; then
echo " libpcre2: ${LIBPCRE2_CFLAGS}"
fi
Expand Down
4 changes: 0 additions & 4 deletions include/common/zbxsysinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,6 @@
# include <math.h>
#endif

#ifdef HAVE_PCRE_H
# include <pcre.h>
#endif

#ifdef HAVE_PCRE2_H
# define PCRE2_CODE_UNIT_WIDTH 8
# include <pcre2.h>
Expand Down
3 changes: 2 additions & 1 deletion include/zbxregexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ ZBX_PTR_VECTOR_DECL(expression, zbx_expression_t *)

/* regular expressions */
int zbx_regexp_compile(const char *pattern, zbx_regexp_t **regexp, char **err_msg);
int zbx_regexp_compile_ext(const char *pattern, zbx_regexp_t **regexp, int flags, char **err_msg);
int zbx_regexp_compile_ext(const char *pattern, zbx_regexp_t **regexp,
zbx_uint32_t flags, char **err_msg);
void zbx_regexp_free(zbx_regexp_t *regexp);
int zbx_regexp_match_precompiled(const char *string, const zbx_regexp_t *regexp);
int zbx_regexp_match_precompiled2(const char *string, const zbx_regexp_t *regexp, char **err_msg);
Expand Down
Loading

0 comments on commit 1838a14

Please sign in to comment.