diff options
author | Sergey Simonenko <sergey.simonenko@zabbix.com> | 2022-01-21 16:50:45 +0300 |
---|---|---|
committer | Sergey Simonenko <sergey.simonenko@zabbix.com> | 2022-01-21 16:50:45 +0300 |
commit | 1ea331c9b36bcad48957b2512aec39438dadef10 (patch) | |
tree | 8ea33aef3d210c7fb6a537935745e2ced2044bd5 /build | |
parent | 3284f71678d28fa95f5aefccb76937b0fba29eaf (diff) | |
parent | 8be647beb4b88ee07c4ef3c2b29180d26dd8fc68 (diff) |
...GI..... [ZBX-20444] fixed Agent and Agent 2 compilation with libpcre2 on Windows
Merge in ZBX/zabbix from feature/ZBX-20444-5.5 to master
* commit '8be647beb4b88ee07c4ef3c2b29180d26dd8fc68':
....I..... [ZBX-20444] added support for both debug and release version of libpcre2
.......... [ZBX-20444] updated Changelog entry
.......... [ZBX-20444] updated Changelog entry
...GI..... [ZBX-20444] fixed lpcre2 binary name
...GI..... [ZBX-20444] fixed missing CFLAGS
...GI..... [ZBX-20444] updated nmake Makefiles
...GI..... [ZBX-20444] fixed Agent 2 compilation with libpcre2 on Windows
Diffstat (limited to 'build')
-rw-r--r-- | build/mingw/Makefile | 11 | ||||
-rw-r--r-- | build/win32/include/config.h | 3 | ||||
-rw-r--r-- | build/win32/project/Makefile_pcre.inc | 52 |
3 files changed, 48 insertions, 18 deletions
diff --git a/build/mingw/Makefile b/build/mingw/Makefile index 8e08f499747..863565b4e8a 100644 --- a/build/mingw/Makefile +++ b/build/mingw/Makefile @@ -76,8 +76,15 @@ ifneq ("$(OPENSSL)", "") endif ifneq ("$(PCRE)", "") - CFLAGS := $(CFLAGS) -I$(PCRE)\include + 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 + TAGS := $(TAGS) pcre2 endif CGO_CFLAGS += $(CFLAGS) @@ -162,7 +169,7 @@ $(OUTPUTDIR)\algodefs.o: $(TOPDIR)\src\libs\zbxalgo\algodefs.c $(CC) $(CFLAGS) -DUNICODE -c $^ -o $@ $(OUTPUTDIR)\zbxregexp.o: $(TOPDIR)\src\libs\zbxregexp\zbxregexp.c - $(CC) $(CFLAGS) -DUNICODE -DPCRE_STATIC -c $^ -o $@ + $(CC) $(CFLAGS) -DUNICODE -c $^ -o $@ $(OUTPUTDIR)\persistent_state.o: $(TOPDIR)\src\zabbix_agent\logfiles\persistent_state.c $(CC) $(CFLAGS) -DUNICODE -c $^ -o $@ diff --git a/build/win32/include/config.h b/build/win32/include/config.h index c26f958d89b..8eee7dfea1d 100644 --- a/build/win32/include/config.h +++ b/build/win32/include/config.h @@ -76,8 +76,5 @@ /* define to 1 if you have the <errno.h> header file */ #define HAVE_ERRNO_H 1 -/* Define to 1 if you have the <pcre.h> header file. */ -#define HAVE_PCRE_H 1 - /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 diff --git a/build/win32/project/Makefile_pcre.inc b/build/win32/project/Makefile_pcre.inc index 96b0b0cc553..dc07a5f01f2 100644 --- a/build/win32/project/Makefile_pcre.inc +++ b/build/win32/project/Makefile_pcre.inc @@ -1,22 +1,48 @@ -! IF "$(PCREINCDIR)" == "" -! ERROR Please specify directory containing PCRE header files (e. g. PCREINCDIR=\somepath\include). +! 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)" == "") -! ERROR Please specify PCRELIBDIR (e. g. PCRELIBDIR=\somepath\lib). +! IF "$(PCRELIBDIR)" == "" && "$(PCRE2LIBDIR)" == "" +! ERROR Please specify either PCRELIBDIR or PCRE2LIBDIR (e. g. PCRELIBDIR=\somepath\lib or PCRE2LIBDIR=\somepath\lib). ! ENDIF -! IF EXISTS("$(PCREINCDIR)\pcre.h") -CFLAGS = $(CFLAGS) /DPCRE_STATIC +! 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" +! 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 +INCS = $(INCS) /I "$(PCRE2INCDIR)" +! ELSE +! ERROR PCRE2INCDIR "$(PCRE2INCDIR)" cannot find "$(PCRE2INCDIR)\pcre2.h" +! ENDIF ! ENDIF -PCRELIB = $(PCRELIBDIR)\pcre.lib +! IF "$(PCRELIBDIR)" != "" +! IF EXISTS("$(PCRELIBDIR)\pcre.lib") +LIBS = $(LIBS) "$(PCRELIBDIR)\pcre.lib" +! ELSE +! ERROR PCRELIBDIR "$(PCRELIBDIR)" cannot find "$(PCRELIBDIR)\pcre.lib" +! ENDIF +! ENDIF -! IF EXISTS("$(PCRELIB)") -LIBS = $(LIBS) "$(PCRELIB)" -! ELSE -! ERROR PCRELIBDIR "$(PCRELIBDIR)" cannot find PCRELIB "$(PCRELIB)" +! IF "$(PCRE2LIBDIR)" != "" +! IF EXISTS("$(PCRE2LIBDIR)\pcre2-8-static.lib") +LIBS = $(LIBS) "$(PCRE2LIBDIR)\pcre2-8-static.lib" +! ELSEIF EXISTS("$(PCRE2LIBDIR)\pcre2-8-staticd.lib") +LIBS = $(LIBS) "$(PCRE2LIBDIR)\pcre2-8-staticd.lib" +! ELSE +! ERROR PCRE2LIBDIR "$(PCRE2LIBDIR)" cannot find neither "$(PCRE2LIBDIR)\pcre2-8-static.lib" nor "$(PCRE2LIBDIR)\pcre2-8-staticd.lib" +! ENDIF ! ENDIF + |