Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com>2022-06-17 11:09:39 +0300
committerArtjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com>2022-06-17 11:09:39 +0300
commit82c84d985a09b67c7b344ee20d4fde4f4e6aef4f (patch)
treed96310a37b8c58c9332dfa4214367c946a105031 /configure.ac
parent5f4085ef702ad6e20ad7c64531e44d5f08f389e4 (diff)
parent6e90007a77cce2de553b90b80a84bbc0f7a87266 (diff)
.......... [DEV-2113] updated to the latest master
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac81
1 files changed, 55 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac
index db0c3722ec8..643526a9869 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,9 @@ AC_CHECK_HEADERS(libperfstat.h, [], [], [
#endif
])
+dnl Kluge for building wihout pkg-config
+m4_ifdef([PKG_PROG_PKG_CONFIG], [], [ AC_DEFUN([PKG_PROG_PKG_CONFIG], []) ])
+
dnl *****************************************************************
dnl * *
dnl * Checks for libraries *
@@ -1322,6 +1325,10 @@ AC_ARG_ENABLE(static-libs,[ --enable-static-libs Build statically linked bin
*) AC_MSG_ERROR([bad value ${enableval} for --enable-static-libs]) ;;
esac])
+if test "x#static_linking" = "xyes" && test "x$static_linking_libs" = "xyes"; then
+ AC_MSG_ERROR([cannot use --static and --static-libs at the same time])
+fi
+
AC_ARG_ENABLE(server,[ --enable-server Turn on build of Zabbix server],
[case "${enableval}" in
yes) server=yes ;;
@@ -1545,9 +1552,12 @@ if test "x$server" = "xyes" || test "x$proxy" = "xyes"; then
have_libxml2="yes"
fi
fi
-
- LDFLAGS="$LDFLAGS $LIBXML2_LDFLAGS"
- LIBS="$LIBS $LIBXML2_LIBS"
+
+ SERVER_LDFLAGS="$SERVER_LDFLAGS $LIBXML2_LDFLAGS"
+ SERVER_LIBS="$SERVER_LIBS $LIBXML2_LIBS"
+
+ PROXY_LDFLAGS="$PROXY_LDFLAGS $LIBXML2_LDFLAGS"
+ PROXY_LIBS="$PROXY_LIBS $LIBXML2_LIBS"
AC_SUBST(LIBXML2_CFLAGS)
@@ -1873,36 +1883,22 @@ 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
-dnl Check for libpcre or libpcre2, used by Zabbix for regular expressions
-dnl Must check for both pcre and pcre2 to check if both were selected by the user and produce an error in that case
-LIBPCRE_CHECK_CONFIG([no])
-if test "x$enable_static_libs" != "xyes" || test "x$found_libpcre" != "xyes"; then
-LIBPCRE2_CHECK_CONFIG([no])
-fi
-if test "x$want_libpcre2" = "xyes"; then
- if test "x$want_libpcre" = "xyes"; then
- AC_MSG_ERROR([Cannot use both pcre and pcre2 at the same time!])
- fi
+LIBPCRE_CHECK_CONFIG([flags-only])
+LIBPCRE2_CHECK_CONFIG([flags-only])
- if test "x$found_libpcre2" != "xyes"; then
- AC_MSG_ERROR([Unable to use libpcre2 (libpcre2 check failed)])
+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
- CFLAGS="$CFLAGS $LIBPCRE2_CFLAGS"
- LDFLAGS="$LDFLAGS $LIBPCRE2_LDFLAGS"
- if test "x$ARCH" = "xosx"; then
- LIBS="$LIBPCRE2_LIBS $LIBS"
- else
- LIBS="$LIBS $LIBPCRE2_LIBS"
- fi
+ LIBPCRE_CHECK_CONFIG([mandatory])
- AC_DEFINE([HAVE_PCRE2_H], 1, [Define to 1 if you have the 'libpcre2' library (-lpcre2-8)])
- have_pcre2=1
-else
if test "x$found_libpcre" != "xyes"; then
- AC_MSG_ERROR([Unable to use libpcre (libpcre check failed)])
+ 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
@@ -1913,6 +1909,31 @@ else
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
+ AC_MSG_ERROR([unable to use libpcre2 (libpcre2 check failed)])
+ fi
+
+ CFLAGS="$CFLAGS $LIBPCRE2_CFLAGS"
+ LDFLAGS="$LDFLAGS $LIBPCRE2_LDFLAGS"
+ if test "x$ARCH" = "xosx"; then
+ LIBS="$LIBPCRE2_LIBS $LIBS"
+ else
+ LIBS="$LIBS $LIBPCRE2_LIBS"
+ fi
+
+ AC_DEFINE([HAVE_PCRE2_H], 1, [Define to 1 if you have the 'libpcre2' library (-lpcre2-8)])
+ 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
@@ -2246,6 +2267,14 @@ 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
+
if test "x$LIBXML2_CFLAGS" != "x"; then
echo " libXML2: ${LIBXML2_CFLAGS}"
fi