summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-01-08 16:13:49 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-01-08 16:13:49 +0000
commitea6bdbcf952e5ac4696cb91364c1923f6ab96321 (patch)
tree06184b10a3e0231b7c18d9cf6a66f2a3a6f97f8c
parent8f08a8271468cf8285f000ac4c0b25e12f1d596b (diff)
downloadzabbix-ea6bdbcf952e5ac4696cb91364c1923f6ab96321.tar.gz
zabbix-ea6bdbcf952e5ac4696cb91364c1923f6ab96321.tar.xz
zabbix-ea6bdbcf952e5ac4696cb91364c1923f6ab96321.zip
- improved databases determination of configuration script (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3664 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--ChangeLog1
-rwxr-xr-xbuild/win32/include/config.h2
-rw-r--r--configure.in275
-rw-r--r--include/db.h8
-rw-r--r--m4/libcurl.m46
-rw-r--r--src/libs/zbxdbhigh/Makefile.am2
-rw-r--r--src/libs/zbxdbhigh/db.c30
-rw-r--r--src/zabbix_server/Makefile.am8
-rw-r--r--src/zabbix_server/alerter/Makefile.am2
-rw-r--r--src/zabbix_server/housekeeper/Makefile.am2
-rw-r--r--src/zabbix_server/housekeeper/housekeeper.c2
-rw-r--r--src/zabbix_server/httppoller/Makefile.am2
-rw-r--r--src/zabbix_server/httppoller/httptest.c6
-rw-r--r--src/zabbix_server/nodewatcher/Makefile.am2
-rw-r--r--src/zabbix_server/pinger/Makefile.am2
-rw-r--r--src/zabbix_server/poller/Makefile.am2
-rw-r--r--src/zabbix_server/timer/Makefile.am2
-rw-r--r--src/zabbix_server/timer/timer.c2
-rw-r--r--src/zabbix_server/trapper/Makefile.am2
-rw-r--r--src/zabbix_server/utils/Makefile.am2
20 files changed, 120 insertions, 240 deletions
diff --git a/ChangeLog b/ChangeLog
index eb115465..18187b4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
Changes for 1.3.3:
+ - improved databases determination of configuration script (Eugene)
- new server parameter 'StartHTTPPollers' (Alexei)
Changes for 1.3.2:
diff --git a/build/win32/include/config.h b/build/win32/include/config.h
index fcf8e3ec..2577a2b5 100755
--- a/build/win32/include/config.h
+++ b/build/win32/include/config.h
@@ -158,7 +158,7 @@
/* #undef HAVE_ORACLE */
/* Define to 1 if PostgreSQL should be enabled. */
-/* #undef HAVE_PGSQL */
+/* #undef HAVE_POSTGRESQL */
/* Define to 1 if '/proc' file system should be used. */
//#define HAVE_PROC 1
diff --git a/configure.in b/configure.in
index 0efb4f92..7c95c3fc 100644
--- a/configure.in
+++ b/configure.in
@@ -474,7 +474,7 @@ AC_ARG_ENABLE(server,
[case "${enableval}" in
yes) server=yes ;;
no) server=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-server) ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-server]) ;;
esac],
[server=no])
AM_CONDITIONAL(SERVER, test x$server = xyes)
@@ -484,7 +484,7 @@ AC_ARG_ENABLE(agent,
[case "${enableval}" in
yes) agent=yes ;;
no) agent=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-agent) ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-agent]) ;;
esac],
[agent=no])
AM_CONDITIONAL(AGENT, test x$agent = xyes)
@@ -492,15 +492,19 @@ AM_CONDITIONAL(AGENT, test x$agent = xyes)
have_db="no"
if test "$server" = "yes"; then
- AC_MSG_CHECKING(for Oracle support)
+
AC_ARG_WITH(oracle,
[
- What DBMS do you want to use (please select only one):
- --with-oracle[=DIR] Include Oracle support. DIR is the Sqlora8 base
- install directory, default is to search through
- a number of common places for the Sqlora8 files.],
+What DBMS do you want to use (please select only one):
+AC_HELP_STRING([--with-oracle@<:@=ARG@:>@],
+ [use Sqlora8 library @<:@default=no@:>@, default is to search through a number of common places for the Sqlora8 files.])],
[
if test "$withval" != "no"; then
+ AC_MSG_CHECKING(for Oracle support)
+ if test "$have_db" != "no"; then
+ AC_MSG_RESULT(error)
+ AC_MSG_ERROR([You can configure for only one database.]);
+ fi
if test "$withval" = "yes"; then
if test -f /usr/include/sqlora.h; then
ORACLE_INCDIR=/usr/include
@@ -516,7 +520,7 @@ if test "$server" = "yes"; then
ORACLE_LIBDIR=${ORACLE_HOME}/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid Oracle directory - unable to find sqlora.h)
+ AC_MSG_ERROR([Invalid Oracle directory - unable to find sqlora.h])
fi
else
if test -f $withval/include/sqlora.h; then
@@ -530,7 +534,7 @@ if test "$server" = "yes"; then
ORACLE_LIBDIR=$withval
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid Oracle directory - unable to find sqlora.h under $withval)
+ AC_MSG_ERROR([Invalid Oracle directory - unable to find sqlora.h under $withval])
fi
fi
ORACLE_INCLUDE="-I$ORACLE_INCDIR -I/home/zabbix/sqlora8/lib/libsqlora8/include"
@@ -540,197 +544,69 @@ if test "$server" = "yes"; then
AC_DEFINE(HAVE_ORACLE,1,[Define to 1 if Oracle should be enabled.])
AC_MSG_RESULT(yes)
have_db="Oracle"
-
- else
- AC_MSG_RESULT(no)
fi
- ],[
- AC_MSG_RESULT(no)
- ])
+ ],[])
AC_SUBST(ORACLE_INCLUDE)
AC_SUBST(ORACLE_LFLAGS)
AC_SUBST(ORACLE_LIBS)
- AC_MSG_CHECKING(for SQLite3 support)
- AC_ARG_WITH(sqlite3,
- [
- What DBMS do you want to use (please select only one):
- --with-sqlite3[=DIR] Include SQLite3 support. DIR is the SQLite base
- install directory, default is to search through
- a number of common places for the SQLite files.],
- [
- if test "$withval" != "no"; then
- if test "$withval" = "yes"; then
- if test -f /usr/include/sqlite3.h; then
- SQLITE3_INCDIR=/usr/include
- SQLITE3_LIBDIR=/usr/lib
- elif test -f /usr/lib/sqlite/include/sqlite3.h; then
- SQLITE_INCDIR=/usr/lib/sqlite3/include
- SQLITE_LIBDIR=/usr/lib
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid SQLite directory - unable to find sqlite3.h)
- fi
- else
- if test -f $withval/include/sqlite3.h; then
- SQLITE3_INCDIR=$withval/include
- SQLITE3_LIBDIR=$withval/lib
- elif test -f $withval/lib/sqlite/include/sqlite3.h; then
- SQLITE3_INCDIR=$withval/lib/sqlite/include
- SQLITE3_LIBDIR=$withval/lib
- elif test -f $withval/sqlite/include/sqlite3.h; then
- SQLITE3_INCDIR=$withval/sqlite/include
- SQLITE3_LIBDIR=$withval
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid SQLite directory - unable to find sqlite3.h under $withval)
- fi
+ dnl Checking for SQLite3 support
+ AX_LIB_SQLITE3()
+ if test "x$WANT_SQLITE3" = "xyes"; then
+ if test "$have_db" != "no"; then
+ AC_MSG_ERROR([You can configure for only one database.]);
fi
- SQLITE3_INCLUDE="-I$SQLITE3_INCDIR"
- SQLITE3_LFLAGS="-L$SQLITE3_LIBDIR"
- SQLITE3_LIBS="-lsqlite3"
-
- AC_DEFINE(HAVE_SQLITE3,1,[Define to 1 if SQLite should be enabled.])
- AC_MSG_RESULT(yes)
- have_db="SQLite v3.x"
- else
- AC_MSG_RESULT(no)
- fi
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_SUBST(SQLITE3_INCLUDE)
- AC_SUBST(SQLITE3_LFLAGS)
- AC_SUBST(SQLITE3_LIBS)
-
- AC_MSG_CHECKING(for MySQL support)
- AC_ARG_WITH(mysql,
- [
- --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
- install directory, default is to search through
- a number of common places for the MySQL files.],
- [
- if test "$withval" != "no"; then
- if test "$withval" = "yes"; then
- if test -f /usr/local/mysql/include/mysql/mysql.h; then
- MYSQL_INCDIR=/usr/local/mysql/include/mysql
- MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
- elif test -f /usr/include/mysql/mysql.h; then
- MYSQL_INCDIR=/usr/include/mysql
- MYSQL_LIBDIR=/usr/lib/mysql
- elif test -f /usr/include/mysql.h; then
- MYSQL_INCDIR=/usr/include
- MYSQL_LIBDIR=/usr/lib
- elif test -f /usr/local/include/mysql/mysql.h; then
- MYSQL_INCDIR=/usr/local/include/mysql
- MYSQL_LIBDIR=/usr/local/lib/mysql
- elif test -f /usr/local/include/mysql.h; then
- MYSQL_INCDIR=/usr/local/include
- MYSQL_LIBDIR=/usr/local/lib
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h)
- fi
+ if test "$found_sqlite3" = "yes"; then
+ have_db="SQLite v3.x"
else
- if test -f $withval/include/mysql/mysql.h; then
- MYSQL_INCDIR=$withval/include/mysql
- MYSQL_LIBDIR=$withval/lib/mysql
- elif test -f $withval/include/mysql.h; then
- MYSQL_INCDIR=$withval/include
- MYSQL_LIBDIR=$withval/lib
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval)
- fi
+ AC_MSG_ERROR([Not found SQLite3 library]);
fi
- MYSQL_INCLUDE="-I$MYSQL_INCDIR"
- MYSQL_LFLAGS="-L$MYSQL_LIBDIR"
- MYSQL_LIBS="-lmysqlclient"
+ fi
- AC_DEFINE(HAVE_MYSQL,1,[Define to 1 if MySQL should be enabled.])
- AC_MSG_RESULT(yes)
- have_db="MySQL"
- dnl MySQL requires -lm sometime
- dnl AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor, MYSQL_LFLAGS="$MYSQL_LFLAGS -lm"))
- AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor, MYSQL_LIBS="$MYSQL_LIBS -lm"))
- dnl MySQL 3.23 requires -lz sometime
- dnl This does not work for some reason
- dnl AC_CHECK_FUNC(compress, , AC_CHECK_LIB(z, compress, MYSQL_LFLAGS="$MYSQL_LFLAGS -lz"))
- dnl AC_CHECK_LIB(z, compress, MYSQL_LFLAGS="$MYSQL_LFLAGS -lz")
- AC_CHECK_LIB(z, compress, MYSQL_LIBS="$MYSQL_LIBS -lz")
+ dnl Checking for MySQL support
+ AX_LIB_MYSQL()
+ if test "$want_mysql" = "yes"; then
+ if test "$have_db" != "no"; then
+ AC_MSG_ERROR([You can configure for only one database.]);
+ fi
+
+ if test "$found_mysql" = "yes"; then
+
+ have_db="MySQL"
+ dnl MySQL requires -lm sometime
+ AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor, MYSQL_LDFLAGS="$MYSQL_LDFLAGS -lm"))
+
+ dnl MySQL 3.23 requires -lz sometime
+ AC_CHECK_LIB(z, compress, MYSQL_LDFLAGS="$MYSQL_LDFLAGS -lz")
else
- AC_MSG_RESULT(no)
+ AC_MSG_ERROR([Not found MySQL library]);
fi
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_SUBST(MYSQL_INCLUDE)
- AC_SUBST(MYSQL_LFLAGS)
- AC_SUBST(MYSQL_LIBS)
-
-
- AC_MSG_CHECKING(for PostgreSQL support)
- AC_ARG_WITH(pgsql,
- [ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
- base install directory, defaults to /usr/local/pgsql.],
- [
- if test "$withval" != "no"; then
- if test "$have_db" != "no"; then
- AC_MSG_RESULT(error)
- AC_MSG_ERROR("You can configure for only one database.");
- fi
- if test "$withval" = "yes"; then
- if test -f /usr/include/pgsql/libpq-fe.h; then
- PGSQL_INCDIR=/usr/include/pgsql
- elif test -f /usr/include/postgresql/libpq-fe.h; then
- PGSQL_INCDIR=/usr/include/postgresql
- elif test -f /usr/local/include/libpq-fe.h; then
- PGSQL_INCDIR=/usr/local/include
- elif test -f /usr/local/include/pgsql/libpq-fe.h; then
- PGSQL_INCDIR=/usr/local/include/pgsql
- else
- PGSQL_INCDIR=/usr/local/pgsql/include
- fi
- if test -f /usr/lib/libpq.a; then
- PGSQL_LIBDIR=/usr/lib
- elif test -f /usr/local/lib/libpq.a; then
- PGSQL_LIBDIR=/usr/local/lib
- else
- PGSQL_LIBDIR=/usr/local/pgsql/lib
- fi
+ fi
+
+ dnl Checking for PostgreSQL support
+ AX_LIB_POSTGRESQL()
+ if test "$want_postgresql" = "yes"; then
+ if test "$have_db" != "no"; then
+ AC_MSG_ERROR([You can configure for only one database.]);
+ fi
+
+ if test "$found_postgresql" = "yes"; then
+
+ have_db="PostgreSQL"
+
+ dnl To avoid linking of crypt with the agent
+ AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, POSTGRESQL_LDFLAGS="-lcrypt $POSTGRESQL_LDFLAGS"))
else
- PGSQL_INCDIR=$withval/include
- test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql
- PGSQL_LIBDIR=$withval/lib
- test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql
+ AC_MSG_ERROR([Not found PostgreSQL library]);
fi
- PGSQL_INCLUDE="-I$PGSQL_INCDIR"
- PGSQL_LFLAGS="-L$PGSQL_LIBDIR"
- PGSQL_LIBS="-lpq"
- dnl To avoid linking of crypt with the agent
- dnl AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, LIBS="-lcrypt $LIBS"))
- dnl AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, PGSQL_LFLAGS="-lcrypt $PGSQL_LFLAGS"))
- AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, PGSQL_LIBS="-lcrypt $PGSQL_LIBS"))
-
- AC_DEFINE(HAVE_PGSQL,1,[Define to 1 if PostgreSQL should be enabled.])
- AC_MSG_RESULT(yes)
- have_db="PostgreSQL"
- else
- AC_MSG_RESULT(no)
- fi
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_SUBST(PGSQL_INCLUDE)
- AC_SUBST(PGSQL_LFLAGS)
- AC_SUBST(PGSQL_LIBS)
+ fi
AC_MSG_CHECKING(for ZABBIX server database selection)
if test "$have_db" = "no"; then
AC_MSG_RESULT(error)
- AC_MSG_ERROR(No database selected for ZABBIX server. Use --with-mysql or --with-oracle or --with-pgsql or --with-sqlite.)
+ AC_MSG_ERROR([No database selected for ZABBIX server. Use --with-mysql or --with-oracle or --with-pgsql or --with-sqlite3.])
else
AC_MSG_RESULT(ok)
fi
@@ -740,10 +616,8 @@ AC_MSG_CHECKING(for NET-SNMP support)
AC_ARG_WITH(net-snmp,
[
What SNMP package do you want to use (please select only one):
- --with-net-snmp[=DIR] Include SNMP support. DIR is the NET-SNMP
- base install directory, default is to search
- through a number of common places for the
- SNMP files.],
+AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@],
+ [use NET-SNMP package @<:@default=no@:>@, default is to search through a number of common places for the NET-SNMP files.])],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
@@ -768,7 +642,7 @@ dnl SNMP_LIBDIR=/usr/local/lib/net-snmp
SNMP_LIBDIR=/usr/local/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid NET-SNMP directory - unable to find net-snmp-includes.h)
+ AC_MSG_ERROR([Invalid NET-SNMP directory - unable to find net-snmp-includes.h])
fi
else
if test -f $withval/include/net-snmp/net-snmp-includes.h; then
@@ -781,7 +655,7 @@ dnl SNMP_LIBDIR=$withval/lib/net-snmp
SNMP_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid NET-SNMP directory - unable to find net-snmp-includes.h under $withval)
+ AC_MSG_ERROR([Invalid NET-SNMP directory - unable to find net-snmp-includes.h under $withval])
fi
fi
@@ -792,7 +666,7 @@ dnl AC_CHECK_LIB(crypto, main, SNMP_LFLAGS="-lcrypto $SNMP_LFLAGS")
SNMP_LFLAGS="-L$SNMP_LIBDIR $SNMP_LFLAGS"
SNMP_LIBS="-lnetsnmp $SNMP_LIBS"
- AC_DEFINE(HAVE_NETSNMP,1,[Define to 1 if NETSNMP should be enabled.])
+ AC_DEFINE(HAVE_NETSNMP,1,[Define to 1 if NET-SNMP should be enabled.])
AC_DEFINE(HAVE_SNMP,1,[Define to 1 if SNMP should be enabled.])
AC_MSG_RESULT(yes)
@@ -806,14 +680,10 @@ AC_SUBST(SNMP_INCLUDE)
AC_SUBST(SNMP_LFLAGS)
AC_SUBST(SNMP_LIBS)
-LIBCURL_CHECK_CONFIG([yes], [7.15.1], [],[])
-
AC_MSG_CHECKING(for UCD-SNMP support)
AC_ARG_WITH(ucd-snmp,
-[ --with-ucd-snmp[=DIR] Include SNMP support. DIR is the UCD-SNMP
- base install directory, default is to search
- through a number of common places for the
- SNMP files.],
+[AC_HELP_STRING([--with-ucd-snmp@<:@=ARG@:>@],
+ [use UCD-SNMP package @<:@default=no@:>@, default is to search through a number of common places for the UCD-SNMP files.])],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
@@ -838,7 +708,7 @@ dnl SNMP_LIBDIR=/usr/local/lib/ucd-snmp
SNMP_LIBDIR=/usr/local/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid UCD-SNMP directory - unable to find ucd-snmp-config.h)
+ AC_MSG_ERROR([Invalid UCD-SNMP directory - unable to find ucd-snmp-config.h])
fi
else
if test -f $withval/include/ucd-snmp/ucd-snmp-config.h; then
@@ -851,7 +721,7 @@ dnl SNMP_LIBDIR=$withval/lib/ucd-snmp
SNMP_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid UCD-SNMP directory - unable to find ucd-snmp-config.h under $withval)
+ AC_MSG_ERROR([Invalid UCD-SNMP directory - unable to find ucd-snmp-config.h under $withval])
fi
fi
dnl AC_CHECK_LIB(crypto, main, SNMP_LFLAGS="-lcrypto $SNMP_LFLAGS")
@@ -874,14 +744,15 @@ dnl AC_CHECK_LIB(crypto, main, SNMP_LFLAGS="-lcrypto $SNMP_LFLAGS")
AC_SUBST(SNMP_LFLAGS)
AC_SUBST(SNMP_INCLUDE)
+LIBCURL_CHECK_CONFIG([yes], [7.15.1], [],[])
+
+
AC_MSG_CHECKING(for LDAP support)
AC_ARG_WITH(ldap,
[
If you want to check LDAP servers:
- --with-ldap[=DIR] Include LDAP support. DIR is the LDAP
- base install directory, default is to search
- through a number of common places for the
- LDAP files.],
+AC_HELP_STRING([--with-ldap@<:@=DIR@:>@],
+ [Include LDAP support @<:@default=no@:>@. DIR is the LDAP base install directory, default is to search through a number of common places for the LDAP files.])],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
@@ -896,7 +767,7 @@ If you want to check LDAP servers:
LDAP_LIBDIR=/usr/local/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid LDAP directory - unable to find ldap.h)
+ AC_MSG_ERROR([Invalid LDAP directory - unable to find ldap.h])
fi
else
if test -f $withval/include/ldap.h; then
@@ -904,7 +775,7 @@ If you want to check LDAP servers:
LDAP_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid LDAP directory - unable to find ldap.h under $withval)
+ AC_MSG_ERROR([Invalid LDAP directory - unable to find ldap.h under $withval])
fi
fi
diff --git a/include/db.h b/include/db.h
index e9bfff64..2b2353ed 100644
--- a/include/db.h
+++ b/include/db.h
@@ -38,13 +38,13 @@
# include "sqlora.h"
#endif /* HAVE_ORACLE */
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
# include <libpq-fe.h>
-#endif /* HAVE_PGSQL */
+#endif /* HAVE_POSTGRESQL */
#ifdef HAVE_SQLITE3
# include <sqlite3.h>
-#endif /* HAVE_PGSQL */
+#endif /* HAVE_SQLITE3 */
#ifdef HAVE_SQLITE3
@@ -108,7 +108,7 @@ void SQ_DBfree_result(DB_RESULT result);
#define DB_ROW MYSQL_ROW
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
#define DB_ROW char **
#define DB_RESULT ZBX_PG_DB_RESULT*
#define DBfree_result PG_DBfree_result
diff --git a/m4/libcurl.m4 b/m4/libcurl.m4
index a9bfa2e2..45f2a877 100644
--- a/m4/libcurl.m4
+++ b/m4/libcurl.m4
@@ -57,8 +57,10 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
AC_ARG_WITH(libcurl,
- AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
- [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
+ [
+If you want to use cURL library:
+AC_HELP_STRING([--with-libcurl@<:@=DIR@:>@],[use cURL library @<:@default=no@:>@, look for the curl library in DIR])],
+ [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[no],[$1])])
if test "$_libcurl_with" != "no" ; then
diff --git a/src/libs/zbxdbhigh/Makefile.am b/src/libs/zbxdbhigh/Makefile.am
index 78c15843..f6d3f9e2 100644
--- a/src/libs/zbxdbhigh/Makefile.am
+++ b/src/libs/zbxdbhigh/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @PGSQL_INCLUDE@ @ORACLE_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @POSTGRESQL_CFLAGS@ @ORACLE_INCLUDE@
libzbxdbhigh_a_SOURCES=action.c graph.c item.c trigger.c host.c db.c
lib_LIBRARIES=libzbxdbhigh.a
#libzbxdbhigh_a_LIBADD = ../zbxcommon/libzbxcommon.a
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c
index 8bea76c7..3924fa61 100644
--- a/src/libs/zbxdbhigh/db.c
+++ b/src/libs/zbxdbhigh/db.c
@@ -43,7 +43,7 @@
MYSQL mysql;
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
PGconn *conn;
#endif
@@ -61,7 +61,7 @@ void DBclose(void)
#ifdef HAVE_MYSQL
mysql_close(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
PQfinish(conn);
#endif
#ifdef HAVE_ORACLE
@@ -108,7 +108,7 @@ void DBconnect(void)
exit(FAIL);
}
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
/* conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName); */
/* conn = PQsetdb(NULL, NULL, NULL, NULL, CONFIG_DBNAME);*/
conn = PQsetdbLogin(CONFIG_DBHOST, NULL, NULL, NULL, CONFIG_DBNAME, CONFIG_DBUSER, CONFIG_DBPASSWORD );
@@ -287,7 +287,7 @@ int DBexecute(const char *fmt, ...)
char sql[ZBX_MAX_SQL_LEN];
va_list args;
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
PGresult *result;
#endif
#ifdef HAVE_ORACLE
@@ -315,7 +315,7 @@ int DBexecute(const char *fmt, ...)
}
return (long)mysql_affected_rows(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
result = PQexec(conn,sql);
if( result==NULL)
@@ -389,7 +389,7 @@ int DBis_null(char *field)
return ret;
}
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
/* in db.h - #define DBfree_result PG_DBfree_result */
void PG_DBfree_result(DB_RESULT result)
{
@@ -427,7 +427,7 @@ DB_ROW DBfetch(DB_RESULT result)
#ifdef HAVE_MYSQL
return mysql_fetch_row(result);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
int i;
@@ -505,7 +505,7 @@ DB_RESULT DBselect(const char *fmt, ...)
char sql[ZBX_MAX_SQL_LEN];
va_list args;
-#if defined(HAVE_PGSQL) || defined(HAVE_SQLITE3)
+#if defined(HAVE_POSTGRESQL) || defined(HAVE_SQLITE3)
DB_RESULT result;
#endif
#ifdef HAVE_ORACLE
@@ -534,7 +534,7 @@ DB_RESULT DBselect(const char *fmt, ...)
}
return mysql_store_result(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
result = malloc(sizeof(ZBX_PG_DB_RESULT));
result->pg_result = PQexec(conn,sql);
result->values = NULL;
@@ -610,7 +610,7 @@ DB_RESULT DBselectN(char *query, int n)
#ifdef HAVE_MYSQL
return DBselect("%s limit %d", query, n);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
return DBselect("%s limit %d", query, n);
#endif
#ifdef HAVE_ORACLE
@@ -640,7 +640,7 @@ char *DBget_field(DB_RESULT result, int rownum, int fieldnum)
}
return row[fieldnum];
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
return PQgetvalue(result, rownum, fieldnum);
#endif
#ifdef HAVE_ORACLE
@@ -662,7 +662,7 @@ zbx_uint64_t DBinsert_id(int exec_result, const char *table, const char *field)
return mysql_insert_id(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
DB_RESULT tmp_res;
zbx_uint64_t id_res = FAIL;
@@ -718,7 +718,7 @@ long DBaffected_rows()
#ifdef HAVE_MYSQL
return (long)mysql_affected_rows(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
NOT IMPLEMENTED YET
#endif
#ifdef HAVE_ORACLE
@@ -781,7 +781,7 @@ int DBnum_rows(DB_RESULT result)
zabbix_log(LOG_LEVEL_DEBUG, "Result of DBnum_rows [%d]", rows);
return rows;
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
zabbix_log(LOG_LEVEL_DEBUG, "In DBnum_rows");
return PQntuples(result);
#endif
@@ -1898,7 +1898,7 @@ int DBadd_alert(zbx_uint64_t actionid, zbx_uint64_t userid, zbx_uint64_t trigger
void DBvacuum(void)
{
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
char *table_for_housekeeping[]={"services", "services_links", "graphs_items", "graphs", "sysmaps_links",
"sysmaps_elements", "sysmaps", "config", "groups", "hosts_groups", "alerts",
"actions", "events", "functions", "history", "history_str", "hosts", "trends",
diff --git a/src/zabbix_server/Makefile.am b/src/zabbix_server/Makefile.am
index c2583ee7..3c9fbcca 100644
--- a/src/zabbix_server/Makefile.am
+++ b/src/zabbix_server/Makefile.am
@@ -1,14 +1,14 @@
SUBDIRS = alerter housekeeper pinger poller httppoller timer trapper nodewatcher utils
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @SNMP_INCLUDE@ @PGSQL_INCLUDE@ @SQLITE3_INCLUDE@ @LIBCURL_CPPFLAGS@
+INCLUDES=-I@top_srcdir@/include @ORACLE_INCLUDE@ @SNMP_INCLUDE@
bin_PROGRAMS = zabbix_server
zabbix_server_SOURCES = evalfunc.c expression.c actions.c events.c zlog.c functions.c server.c
-zabbix_server_CPPFLAGS = -DZABBIX_DAEMON
+zabbix_server_CPPFLAGS = -DZABBIX_DAEMON @MYSQL_CFLAGS@ @POSTGRESQL_CFLAGS@ @SQLITE3_CFLAGS@ @LIBCURL_CPPFLAGS@
zabbix_server_LDADD = ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/@ARCH@/libzbxsysinfo2.a \
../libs/zbxlog/libzbxlog.a ../libs/zbxnix/libzbxnix.a ../libs/zbxsys/libzbxsys.a ../libs/zbxconf/libzbxconf.a \
../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a \
alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a nodewatcher/libzbxnodewatcher.a \
../libs/zbxemail/libzbxemail.a utils/libzbxutils.a httppoller/libzbxhttppoller.a \
../libs/zbxsms/libzbxsms.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a \
-../libs/zbxcrypto/libzbxcrypto.a @MYSQL_LIBS@ @PGSQL_LIBS@ @ORACLE_LIBS@ @SQLITE3_LIBS@ @LDAP_LIBS@ @SNMP_LIBS@ @LIBCURL@
-zabbix_server_LDFLAGS=@MYSQL_LFLAGS@ @PGSQL_LFLAGS@ @ORACLE_LFLAGS@ @SQLITE3_LFLAGS@ @LDAP_LFLAGS@ @SNMP_LFLAGS@
+../libs/zbxcrypto/libzbxcrypto.a @ORACLE_LIBS@ @LDAP_LIBS@ @SNMP_LIBS@ @LIBCURL@
+zabbix_server_LDFLAGS=@MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@ @ORACLE_LFLAGS@ @SQLITE3_LDFLAGS@ @LDAP_LFLAGS@ @SNMP_LFLAGS@
diff --git a/src/zabbix_server/alerter/Makefile.am b/src/zabbix_server/alerter/Makefile.am
index 6a21dfd9..efc70d14 100644
--- a/src/zabbix_server/alerter/Makefile.am
+++ b/src/zabbix_server/alerter/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxalerter.a
libzbxalerter_a_SOURCES=alerter.c
libzbxalerter_a_LIBADD = ../../libs/zbxemail/libzbxemail.a
diff --git a/src/zabbix_server/housekeeper/Makefile.am b/src/zabbix_server/housekeeper/Makefile.am
index 94f5ea6e..59a8cf3a 100644
--- a/src/zabbix_server/housekeeper/Makefile.am
+++ b/src/zabbix_server/housekeeper/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxhousekeeper.a
libzbxhousekeeper_a_SOURCES=housekeeper.c
diff --git a/src/zabbix_server/housekeeper/housekeeper.c b/src/zabbix_server/housekeeper/housekeeper.c
index 42389718..01b686a6 100644
--- a/src/zabbix_server/housekeeper/housekeeper.c
+++ b/src/zabbix_server/housekeeper/housekeeper.c
@@ -90,7 +90,7 @@ static int housekeeping_process_log()
#ifdef HAVE_ORACLE
deleted = DBexecute("delete from %s where %s=" ZBX_FS_UI64 " and rownum<500",housekeeper.tablename, housekeeper.field,housekeeper.value);
-#elif defined(HAVE_PGSQL)
+#elif defined(HAVE_POSTGRESQL)
deleted = DBexecute("delete from %s where oid in (select oid from %s where %s=" ZBX_FS_UI64 " limit 500)",
housekeeper.tablename,
housekeeper.tablename,
diff --git a/src/zabbix_server/httppoller/Makefile.am b/src/zabbix_server/httppoller/Makefile.am
index 19d1a9bc..90ce0fd6 100644
--- a/src/zabbix_server/httppoller/Makefile.am
+++ b/src/zabbix_server/httppoller/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@ @SNMP_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@ @SNMP_INCLUDE@
lib_LIBRARIES=libzbxhttppoller.a
libzbxhttppoller_a_SOURCES=httptest.c httppoller.c
diff --git a/src/zabbix_server/httppoller/httptest.c b/src/zabbix_server/httppoller/httptest.c
index dc98eef2..e01d2528 100644
--- a/src/zabbix_server/httppoller/httptest.c
+++ b/src/zabbix_server/httppoller/httptest.c
@@ -51,6 +51,7 @@ size_t HEADERFUNCTION( void *ptr, size_t size, size_t nmemb, void *stream)
void process_http_data()
{
+#ifdef HAVE_LIBCURL
DB_RESULT result;
DB_ROW row;
char server_esc[MAX_STRING_LEN];
@@ -77,6 +78,7 @@ void process_http_data()
DBfree_result(result);
DBfree_result(result);
+#endif /* HAVE_LIBCURL */
}
@@ -98,6 +100,7 @@ void process_http_data()
******************************************************************************/
int process_httptest(zbx_uint64_t httptestid)
{
+#ifdef HAVE_LIBCURL
DB_RESULT result;
DB_ROW row;
int ret = SUCCEED;
@@ -199,6 +202,7 @@ int process_httptest(zbx_uint64_t httptestid)
(void)curl_easy_cleanup(easyhandle);
return ret;
+#endif /* HAVE_LIBCURL */
}
/******************************************************************************
@@ -218,6 +222,7 @@ int process_httptest(zbx_uint64_t httptestid)
******************************************************************************/
void process_httptests(int now)
{
+#ifdef HAVE_LIBCURL
DB_RESULT result;
DB_ROW row;
@@ -234,4 +239,5 @@ void process_httptests(int now)
DBexecute("update httptest set nextcheck=%d+delay where httptestid=" ZBX_FS_UI64, now, httptestid);
}
DBfree_result(result);
+#endif /* HAVE_LIBCURL */
}
diff --git a/src/zabbix_server/nodewatcher/Makefile.am b/src/zabbix_server/nodewatcher/Makefile.am
index dd144c9c..2440379b 100644
--- a/src/zabbix_server/nodewatcher/Makefile.am
+++ b/src/zabbix_server/nodewatcher/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxnodewatcher.a
libzbxnodewatcher_a_SOURCES=nodewatcher.c nodesender.c nodecomms.c events.c history.c
diff --git a/src/zabbix_server/pinger/Makefile.am b/src/zabbix_server/pinger/Makefile.am
index 0983d715..fca06bd3 100644
--- a/src/zabbix_server/pinger/Makefile.am
+++ b/src/zabbix_server/pinger/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@ @SNMP_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@ @SNMP_INCLUDE@
lib_LIBRARIES=libzbxpinger.a
libzbxpinger_a_SOURCES=pinger.c
diff --git a/src/zabbix_server/poller/Makefile.am b/src/zabbix_server/poller/Makefile.am
index dbdaa84c..669e9971 100644
--- a/src/zabbix_server/poller/Makefile.am
+++ b/src/zabbix_server/poller/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@ @SNMP_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@ @SNMP_INCLUDE@
lib_LIBRARIES=libzbxpoller.a
libzbxpoller_a_SOURCES=checks_agent.c checks_internal.c checks_simple.c checks_snmp.c checks_aggregate.c poller.c
diff --git a/src/zabbix_server/timer/Makefile.am b/src/zabbix_server/timer/Makefile.am
index 1a9efcc2..338d5e3a 100644
--- a/src/zabbix_server/timer/Makefile.am
+++ b/src/zabbix_server/timer/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxtimer.a
libzbxtimer_a_SOURCES=timer.c
diff --git a/src/zabbix_server/timer/timer.c b/src/zabbix_server/timer/timer.c
index 6a08fbb6..a5ff96db 100644
--- a/src/zabbix_server/timer/timer.c
+++ b/src/zabbix_server/timer/timer.c
@@ -83,7 +83,7 @@ void main_timer_loop()
now=time(NULL);
/*
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
zbx_snprintf(sql,sizeof(sql),"select distinct f.itemid,f.functionid,f.parameter from functions f, items i,hosts h where h.hostid=i.hostid and h.status=%d and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter::text::integer<=%d and i.status=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE);
#else
zbx_snprintf(sql,sizeof(sql),"select distinct f.itemid,f.functionid,f.parameter,f.function from functions f, items i,hosts h where h.hostid=i.hostid and h.status=%d and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter<=%d and i.status=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE);
diff --git a/src/zabbix_server/trapper/Makefile.am b/src/zabbix_server/trapper/Makefile.am
index 14ef010b..a4fee911 100644
--- a/src/zabbix_server/trapper/Makefile.am
+++ b/src/zabbix_server/trapper/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxtrapper.a
libzbxtrapper_a_SOURCES=active.c autoregister.h autoregister.c trapper.c nodesync.c nodeevents.c nodehistory.c
libzbxtrapper_a_LIBADD = ../../libs/zbxdbhigh/libzbxdbhigh.a
diff --git a/src/zabbix_server/utils/Makefile.am b/src/zabbix_server/utils/Makefile.am
index c0e8882c..472c6a85 100644
--- a/src/zabbix_server/utils/Makefile.am
+++ b/src/zabbix_server/utils/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxutils.a
libzbxutils_a_SOURCES=nodechange.c