diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-07 13:58:01 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-07 13:58:01 +0000 |
commit | d9ff665135bd0ac36a8fe284b5be08284aa68152 (patch) | |
tree | 430cb6942fddea497414db432fe2baaad9784a0a | |
parent | 5f07118a2acd7c31c5681973ebf09ee355b6b043 (diff) | |
download | zabbix-d9ff665135bd0ac36a8fe284b5be08284aa68152.tar.gz zabbix-d9ff665135bd0ac36a8fe284b5be08284aa68152.tar.xz zabbix-d9ff665135bd0ac36a8fe284b5be08284aa68152.zip |
- [DEV-137] Misc bugs and improvements
fixed bugs in configure scripts
git-svn-id: svn://svn.zabbix.com/trunk@5885 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | configure.in | 28 | ||||
-rw-r--r-- | include/sysinc.h | 4 | ||||
-rw-r--r-- | m4/libcurl.m4 | 21 | ||||
-rw-r--r-- | m4/netsnmp.m4 | 3 | ||||
-rw-r--r-- | src/libs/zbxdb/db.c | 10 |
5 files changed, 35 insertions, 31 deletions
diff --git a/configure.in b/configure.in index 5963e5ac..c4381755 100644 --- a/configure.in +++ b/configure.in @@ -47,7 +47,7 @@ AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h netdb.h signal.h \ sys/time.h kstat.h sys/syscall.h sys/sysmacros.h sys/procfs.h \ stdint.h mach/host_info.h mach/mach_host.h knlist.h pwd.h sys/proc.h \ sys/var.h resolv.h arpa/nameser.h assert.h sys/dkstat.h sys/disk.h \ - nlist.h net/if.h kvm.h linux/kernel.h ldap.h getopt.h procinfo.h sys/dk.h \ + nlist.h net/if.h kvm.h linux/kernel.h getopt.h procinfo.h sys/dk.h \ sys/resource.h pthread.h windows.h process.h conio.h sys/wait.h regex.h \ stdarg.h winsock2.h pdh.h psapi.h sys/sem.h sys/ipc.h sys/shm.h Winldap.h \ sys/timeb.h Winber.h lber.h ws2tcpip.h inttypes.h sys/file.h grp.h \ @@ -309,6 +309,10 @@ AC_TRY_COMPILE( #ifdef HAVE_SYS_VMMETER_H #include <sys/vmmeter.h> #endif /* HAVE_SYS_VMMETER_H */ + +#ifndef NULL +#define NULL (void *)0 +#endif ], [ int mib[] = {CTL_VM, VM_METER}; @@ -344,6 +348,10 @@ AC_TRY_COMPILE( #ifdef HAVE_SYS_VMMETER_H #include <sys/vmmeter.h> #endif /* HAVE_SYS_VMMETER_H */ + +#ifndef NULL +#define NULL (void *)0 +#endif ], [ int mib[] = {CTL_VM, VM_UVMEXP2}; @@ -379,6 +387,10 @@ AC_TRY_COMPILE( #ifdef HAVE_SYS_VMMETER_H #include <sys/vmmeter.h> #endif /* HAVE_SYS_VMMETER_H */ + +#ifndef NULL +#define NULL (void *)0 +#endif ], [ int mib[] = {CTL_VM, VM_UVMEXP}; @@ -401,6 +413,10 @@ AC_TRY_COMPILE( #include <sys/types.h> #include <sys/syscall.h> #include <sys/swap.h> + +#ifndef NULL +#define NULL (void *)0 +#endif ], [ register int cnt, i; @@ -830,17 +846,7 @@ if test "$server" = "yes" || test "$proxy" = "yes"; then fi if test "x$found_mysql" = "xyes"; then - have_db="MySQL" - - dnl Check forql_autocommit in MySQL - AC_MSG_CHECKING(for mysql_autocommit in MySQL) - AC_TRY_COMPILE( - [#include <mysql.h> - ],[mysql_autocommit(NULL, 0);], - AC_DEFINE(HAVE_MYSQL_AUTOCOMMIT,1,[Define to 1 if 'mysql_autocommit' exist .]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) else AC_MSG_ERROR([Not found MySQL library]) fi diff --git a/include/sysinc.h b/include/sysinc.h index fcdbea19..e58b0463 100644 --- a/include/sysinc.h +++ b/include/sysinc.h @@ -121,8 +121,8 @@ # include <kstat.h> #endif -#ifdef HAVE_LDAP_H - #include <ldap.h> +#ifdef HAVE_LDAP +# include <ldap.h> #endif #ifdef HAVE_WINLDAP_H diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index 37603d99..f34545ee 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 @@ -14,7 +14,7 @@ # Note that using --without-libcurl does run ACTION-IF-NO. # # This macro #defines HAVE_LIBCURL if a working libcurl setup is -# found, and sets @LIBCURL_LIBS@ and @LIBCURL_CPPFLAGS@ to the necessary +# found, and sets @LIBCURL_LIBS@ and @LIBCURL_CFLAGS@ to the necessary # values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are # the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy # where yyy are the various protocols supported by libcurl. Both xxx @@ -26,7 +26,7 @@ # curl-config list (e.g. it's "HTTP" and not "http"). # # Users may override the detected values by doing something like: -# LIBCURL_LIBS="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure +# LIBCURL_LIBS="-lcurl" LIBCURL_CFLAGS="-I/usr/myinclude" ./configure # # For the sake of sanity, this macro assumes that any libcurl that is # found is after version 7.7.2, the first version that included the @@ -106,17 +106,19 @@ AC_HELP_STRING([--with-libcurl@<:@=DIR@:>@],[use cURL package @<:@default=yes@:> fi if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then - if test x"$LIBCURL_CPPFLAGS" = "x" ; then - LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` + if test x"$LIBCURL_CFLAGS" = "x" ; then + LIBCURL_CFLAGS=`$_libcurl_config --cflags` fi if test x"$LIBCURL_LIBS" = "x" ; then _full_libcurl_libs=`$_libcurl_config --libs` for i in $_full_libcurl_libs; do case $i in + -l*) + LIBCURL_LDFLAGS="$LIBCURL_LDFLAGS $i" + ;; -L*) LIBCURL_LDFLAGS="$LIBCURL_LDFLAGS $i" - ;; esac done @@ -198,7 +200,10 @@ AC_HELP_STRING([--with-libcurl@<:@=DIR@:>@],[use cURL package @<:@default=yes@:> LDFLAGS="${LDFLAGS} ${LIBCURL_LDFLAGS}" CFLAGS="${CFLAGS} ${LIBCURL_CFLAGS}" - AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[ + AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h> +#ifndef NULL +#define NULL (void *)0 +#endif],[ /* Try and use a few common options to force a failure if we are missing symbols or can't link. */ int x; @@ -244,7 +249,7 @@ x=CURLOPT_VERBOSE; AC_DEFINE(HAVE_LIBCURL,1, [Define to 1 if you have a functional curl library.]) - AC_SUBST(LIBCURL_CPPFLAGS) + AC_SUBST(LIBCURL_CFLAGS) AC_SUBST(LIBCURL_LDFLAGS) AC_SUBST(LIBCURL_LIBS) found_curl="yes" @@ -277,7 +282,7 @@ x=CURLOPT_VERBOSE; done else unset LIBCURL_LIBS - unset LIBCURL_CPPFLAGS + unset LIBCURL_CFLAGS fi fi diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4 index db1a26a3..edd7de00 100644 --- a/m4/netsnmp.m4 +++ b/m4/netsnmp.m4 @@ -61,6 +61,9 @@ AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@], _full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto" for i in $_full_libnetsnmp_libs; do case $i in + -l*) + SNMP_LDFLAGS="${SNMP_LDFLAGS} $i" + ;; -L*) SNMP_LDFLAGS="${SNMP_LDFLAGS} $i" ;; diff --git a/src/libs/zbxdb/db.c b/src/libs/zbxdb/db.c index ccd5c403..f6fa81cd 100644 --- a/src/libs/zbxdb/db.c +++ b/src/libs/zbxdb/db.c @@ -102,17 +102,7 @@ int zbx_db_connect(char *host, char *user, char *password, char *dbname, char *d } if(ZBX_DB_OK == ret) - { -#ifdef HAVE_MYSQL_AUTOCOMMIT - if(mysql_autocommit(conn, 1) != 0) - { - zabbix_log(LOG_LEVEL_ERR, "Failed to set autocommit to 1: Error: %s [%d]", - mysql_error(conn), mysql_errno(conn)); - ret = ZBX_DB_FAIL; - } -#endif /* HAVE_MYSQL_AUTOCOMMIT */ DBexecute("SET CHARACTER SET utf8"); - } if(ZBX_DB_FAIL == ret) { |