summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-08 16:03:19 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-08 16:03:19 +0000
commit92ef7bbf6a7c38984e4cd596dcb86b5e2a1faafb (patch)
tree0c512d79a88744d2c6d6e5b15b8a6d0cd69ea6e2 /m4
parent40d8696d1b58c0f76ee82ba8ebdb90e965efcd62 (diff)
- improved configuration script
- added suport of 'make dist' - fixed some bugs with DB supporting git-svn-id: svn://svn.zabbix.com/trunk@3814 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'm4')
-rw-r--r--m4/ax_lib_mysql.m48
-rw-r--r--m4/ax_lib_postgresql.m48
-rw-r--r--m4/ax_lib_sqlite3.m46
-rw-r--r--m4/ldap.m483
-rw-r--r--m4/libcurl.m430
-rw-r--r--m4/netsnmp.m491
-rw-r--r--m4/sqlora8.m4105
-rw-r--r--m4/ucdsnmp.m491
8 files changed, 395 insertions, 27 deletions
diff --git a/m4/ax_lib_mysql.m4 b/m4/ax_lib_mysql.m4
index d3b90ccf..af22f9ff 100644
--- a/m4/ax_lib_mysql.m4
+++ b/m4/ax_lib_mysql.m4
@@ -25,7 +25,7 @@
#
# This macro calls:
#
-# AC_SUBST(MYSQL_CFLAGS)
+# AC_SUBST(MYSQL_CPPFLAGS)
# AC_SUBST(MYSQL_LDFLAGS)
# AC_SUBST(MYSQL_VERSION)
#
@@ -64,7 +64,7 @@ AC_DEFUN([AX_LIB_MYSQL],
[want_mysql="no"]
)
- MYSQL_CFLAGS=""
+ MYSQL_CPPFLAGS=""
MYSQL_LDFLAGS=""
MYSQL_VERSION=""
@@ -81,7 +81,7 @@ AC_DEFUN([AX_LIB_MYSQL],
if test "$MYSQL_CONFIG" != "no"; then
AC_MSG_CHECKING([for MySQL libraries])
- MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`"
+ MYSQL_CPPFLAGS="`$MYSQL_CONFIG --cflags`"
MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`"
MYSQL_VERSION=`$MYSQL_CONFIG --version`
@@ -143,6 +143,6 @@ AC_DEFUN([AX_LIB_MYSQL],
fi
AC_SUBST([MYSQL_VERSION])
- AC_SUBST([MYSQL_CFLAGS])
+ AC_SUBST([MYSQL_CPPFLAGS])
AC_SUBST([MYSQL_LDFLAGS])
])
diff --git a/m4/ax_lib_postgresql.m4 b/m4/ax_lib_postgresql.m4
index c97f5e12..f47d3725 100644
--- a/m4/ax_lib_postgresql.m4
+++ b/m4/ax_lib_postgresql.m4
@@ -25,7 +25,7 @@
#
# This macro calls:
#
-# AC_SUBST(POSTGRESQL_CFLAGS)
+# AC_SUBST(POSTGRESQL_CPPFLAGS)
# AC_SUBST(POSTGRESQL_LDFLAGS)
# AC_SUBST(POSTGRESQL_VERSION)
#
@@ -64,7 +64,7 @@ AC_DEFUN([AX_LIB_POSTGRESQL],
[want_postgresql="no"]
)
- POSTGRESQL_CFLAGS=""
+ POSTGRESQL_CPPFLAGS=""
POSTGRESQL_LDFLAGS=""
POSTGRESQL_POSTGRESQL=""
@@ -81,7 +81,7 @@ AC_DEFUN([AX_LIB_POSTGRESQL],
if test "$PG_CONFIG" != "no"; then
AC_MSG_CHECKING([for PostgreSQL libraries])
- POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
+ POSTGRESQL_CPPFLAGS="-I`$PG_CONFIG --includedir`"
POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
@@ -143,6 +143,6 @@ AC_DEFUN([AX_LIB_POSTGRESQL],
fi
AC_SUBST([POSTGRESQL_VERSION])
- AC_SUBST([POSTGRESQL_CFLAGS])
+ AC_SUBST([POSTGRESQL_CPPFLAGS])
AC_SUBST([POSTGRESQL_LDFLAGS])
])
diff --git a/m4/ax_lib_sqlite3.m4 b/m4/ax_lib_sqlite3.m4
index 2ead5893..1d70ca85 100644
--- a/m4/ax_lib_sqlite3.m4
+++ b/m4/ax_lib_sqlite3.m4
@@ -17,7 +17,7 @@
#
# This macro calls:
#
-# AC_SUBST(SQLITE3_CFLAGS)
+# AC_SUBST(SQLITE3_CPPFLAGS)
# AC_SUBST(SQLITE3_LDFLAGS)
# AC_SUBST(SQLITE3_VERSION)
#
@@ -129,7 +129,7 @@ dnl AC_LANG_POP([C++])
if test "$found_sqlite3" = "yes"; then
- SQLITE3_CFLAGS="$ac_sqlite3_cppflags"
+ SQLITE3_CPPFLAGS="$ac_sqlite3_cppflags"
SQLITE3_LDFLAGS="$ac_sqlite3_ldflags"
ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header"
@@ -146,7 +146,7 @@ dnl AC_LANG_POP([C++])
fi
fi
- AC_SUBST(SQLITE3_CFLAGS)
+ AC_SUBST(SQLITE3_CPPFLAGS)
AC_SUBST(SQLITE3_LDFLAGS)
AC_SUBST(SQLITE3_VERSION)
AC_DEFINE(HAVE_SQLITE3, [1], [Define to 1 if SQLite libraries are available])
diff --git a/m4/ldap.m4 b/m4/ldap.m4
new file mode 100644
index 00000000..86afddf1
--- /dev/null
+++ b/m4/ldap.m4
@@ -0,0 +1,83 @@
+# LIBLDAP_CHECK_CONFIG ([DEFAULT-ACTION])
+# ----------------------------------------------------------
+# Eugene Grigorjev <eugene@zabbix.com> Feb-02-2007
+#
+# Checks for ldap. DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-ldap or --without-ldap.
+# If not supplied, DEFAULT-ACTION is no.
+#
+# This macro #defines HAVE_LDAP if a required header files is
+# found, and sets @LDAP_LDFLAGS@ and @LDAP_CPPFLAGS@ to the necessary
+# values.
+#
+# Users may override the detected values by doing something like:
+# LDAP_LDFLAGS="-lldap" LDAP_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# This macro is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+AC_DEFUN([LIBLDAP_CHECK_CONFIG],
+[
+ AC_ARG_WITH(ldap,
+ [If you want to check LDAP servers:
+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
+ want_ldap="no"
+ _libldap_with="no"
+ elif test "$withval" = "yes"; then
+ want_ldap="yes"
+ _libldap_with="yes"
+ else
+ want_ldap="yes"
+ _libldap_with=$withval
+ fi
+ ],[_libldap_with=ifelse([$1],,[no],[$1])])
+
+ if test "x$_libldap_with" != x"no"; then
+ AC_MSG_CHECKING(for LDAP support)
+
+ if test "$_libldap_with" = "yes"; then
+ if test -f /usr/local/openldap/include/ldap.h; then
+ LDAP_INCDIR=/usr/local/openldap/include/
+ LDAP_LIBDIR=/usr/local/openldap/lib/
+ elif test -f /usr/include/ldap.h; then
+ LDAP_INCDIR=/usr/include
+ LDAP_LIBDIR=/usr/lib
+ elif test -f /usr/local/include/ldap.h; then
+ LDAP_INCDIR=/usr/local/include
+ LDAP_LIBDIR=/usr/local/lib
+ else
+ found_ldap="no"
+ AC_MSG_RESULT(no)
+ fi
+ else
+ if test -f $_libldap_with/include/ldap.h; then
+ LIBLDAP_INCDIR=$_libldap_with/include
+ LIBLDAP_LIBDIR=$_libldap_with/lib
+ else
+ found_ldap="no"
+ AC_MSG_RESULT(no)
+ fi
+ fi
+
+ if test "x$found_ldap" != "xno" ; then
+
+ if test "x$enable_static" = "xyes"; then
+ LDAP_LIBS=" -llber -lgnutls -lpthread -lsasl2 $LDAP_LIBS"
+ fi
+
+ LIBLDAP_CPPFLAGS=-I$LIBLDAP_INCDIR
+ LIBLDAP_LDFLAGS="-L$LIBLDAP_LIBDIR -lldap $LDAP_LIBS"
+
+ found_ldap="yes"
+ AC_DEFINE(HAVE_LDAP,1,[Define to 1 if LDAP should be enabled.])
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+
+ AC_SUBST(LIBLDAP_CPPFLAGS)
+ AC_SUBST(LIBLDAP_LDFLAGS)
+
+ unset _libldap_with
+])dnl
diff --git a/m4/libcurl.m4 b/m4/libcurl.m4
index 43f947ce..8e3b6a93 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@ and @LIBCURL_CPPFLAGS@ to the necessary
+# found, and sets @LIBCURL_LDFLAGS@ and @LIBCURL_CPPFLAGS@ 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="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure
+# LIBCURL_LDFLAGS="-lcurl" LIBCURL_CPPFLAGS="-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
@@ -57,20 +57,18 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
AC_ARG_WITH(libcurl,
- [
-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])],
+ [If you want to use cURL library:
+AC_HELP_STRING([--with-libcurl@<:@=DIR@:>@],[use cURL library @<:@default=yes@:>@, look for the curl library in DIR])],
[
if test "$withval" = "no"; then
_libcurl_with="no"
elif test "$withval" = "yes"; then
_libcurl_with="yes"
else
- _libcurl_with="yes"
+ _libcurl_with=$withval
fi
],
- [_libcurl_with="no"])
-dnl [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[no],[$1])])
+ [_libcurl_with=ifelse([$1],,[yes],[$1])])
if test "$_libcurl_with" != "no" ; then
@@ -112,15 +110,15 @@ dnl [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[no],[$1])])
if test x"$LIBCURL_CPPFLAGS" = "x" ; then
LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
fi
- if test x"$LIBCURL" = "x" ; then
- LIBCURL=`$_libcurl_config --libs`
+ if test x"$LIBCURL_LDFLAGS" = "x" ; then
+ LIBCURL_LDFLAGS=`$_libcurl_config --libs`
# This is so silly, but Apple actually has a bug in their
# curl-config script. Fixed in Tiger, but there are still
# lots of Panther installs around.
case "${host}" in
powerpc-apple-darwin7*)
- LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+ LIBCURL_LDFLAGS=`echo $LIBCURL_LDFLAGS | sed -e 's|-arch i386||g'`
;;
esac
fi
@@ -143,7 +141,7 @@ dnl [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[no],[$1])])
# we didn't find curl-config, so let's see if the user-supplied
# link line (or failing that, "-lcurl") is enough.
- LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+ LIBCURL_LDFLAGS=${LIBCURL_LDFLAGS-"$_libcurl_ldflags -lcurl"}
AC_CACHE_CHECK([whether libcurl is usable],
[libcurl_cv_lib_curl_usable],
@@ -151,7 +149,7 @@ dnl [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[no],[$1])])
_libcurl_save_cppflags=$CPPFLAGS
CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
_libcurl_save_libs=$LIBS
- LIBS="$LIBCURL $LIBS"
+ LIBS="$LIBCURL_LDFLAGS $LIBS"
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
/* Try and use a few common options to force a failure if we are
@@ -180,7 +178,7 @@ x=CURLOPT_VERBOSE;
_libcurl_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
_libcurl_save_libs=$LIBS
- LIBS="$LIBS $LIBCURL"
+ LIBS="$LIBS $LIBCURL_LDFLAGS"
AC_CHECK_FUNC(curl_free,,
AC_DEFINE(curl_free,free,
@@ -194,7 +192,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)
+ AC_SUBST(LIBCURL_LDFLAGS)
for _libcurl_feature in $_libcurl_features ; do
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
@@ -223,7 +221,7 @@ x=CURLOPT_VERBOSE;
eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
done
else
- unset LIBCURL
+ unset LIBCURL_LDFLAGS
unset LIBCURL_CPPFLAGS
fi
fi
diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4
new file mode 100644
index 00000000..5ec16781
--- /dev/null
+++ b/m4/netsnmp.m4
@@ -0,0 +1,91 @@
+# LIBNETSNMP_CHECK_CONFIG ([DEFAULT-ACTION])
+# ----------------------------------------------------------
+# Eugene Grigorjev <eugene@zabbix.com> Feb-02-2007
+#
+# Checks for net-snmp. DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-net-snmp or --without-net-snmp.
+# If not supplied, DEFAULT-ACTION is no.
+#
+# This macro #defines HAVE_SNMP and HAVE_NETSNMP if a required header files is
+# found, and sets @SNMP_LDFLAGS@ and @SNMP_CPPFLAGS@ to the necessary
+# values.
+#
+# Users may override the detected values by doing something like:
+# SNMP_LDFLAGS="-lsnmp" SNMP_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# This macro is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+AC_DEFUN([LIBNETSNMP_CHECK_CONFIG],
+[
+ AC_ARG_WITH(net-snmp,
+[
+What SNMP package do you want to use (please select only one):
+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
+ want_netsnmp="no"
+ _libnetsnmp_with="no"
+ elif test "$withval" = "yes"; then
+ want_netsnmp="yes"
+ _libnetsnmp_with="yes"
+ else
+ want_netsnmp="yes"
+ _libnetsnmp_with=$withval
+ fi
+ ],[_libnetsnmp_with=ifelse([$1],,[no],[$1])])
+
+ if test "x$_libnetsnmp_with" != x"no"; then
+ AC_MSG_CHECKING(for NET-SNMP support)
+ if test "$_libnetsnmp_with" = "yes"; then
+ if test -f /usr/local/net-snmp/include/net-snmp-includes.h; then
+ SNMP_INCDIR=/usr/local/net-snmp/include/
+ SNMP_LIBDIR=/usr/local/net-snmp/lib/
+ elif test -f /usr/include/net-snmp/net-snmp-includes.h; then
+ SNMP_INCDIR=/usr/include
+ SNMP_LIBDIR=/usr/lib
+ elif test -f /usr/include/net-snmp-includes.h; then
+ SNMP_INCDIR=/usr/include
+ SNMP_LIBDIR=/usr/lib
+ elif test -f /usr/local/include/net-snmp/net-snmp-includes.h; then
+ SNMP_INCDIR=/usr/local/include
+ SNMP_LIBDIR=/usr/local/lib
+ elif test -f /usr/local/include/net-snmp-includes.h; then
+ SNMP_INCDIR=/usr/local/include
+ SNMP_LIBDIR=/usr/local/lib
+ else
+ found_netsnmp="no"
+ AC_MSG_RESULT(no)
+ fi
+ else
+ if test -f $_libnetsnmp_with/include/net-snmp/net-snmp-includes.h; then
+ SNMP_INCDIR=$_libnetsnmp_with/include
+ SNMP_LIBDIR=$_libnetsnmp_with/lib
+ elif test -f $withval/include/net-snmp-includes.h; then
+ SNMP_INCDIR=$_libnetsnmp_with/include
+ SNMP_LIBDIR=$_libnetsnmp_with/lib
+ else
+ found_netsnmp="no"
+ AC_MSG_RESULT(no)
+ fi
+ fi
+
+ if test "x$found_netsnmp" != "xno"; then
+ found_netsnmp="yes"
+ AC_MSG_RESULT(yes)
+
+ AC_CHECK_LIB(crypto, main, SNMP_LIBS="$SNMP_LIBS -lcrypto")
+
+ SNMP_CPPFLAGS=-I$SNMP_INCDIR
+ SNMP_LDFLAGS="-L$SNMP_LIBDIR $SNMP_LFLAGS -lnetsnmp $SNMP_LIBS"
+
+ 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.])
+ fi
+ fi
+
+ AC_SUBST(SNMP_CPPFLAGS)
+ AC_SUBST(SNMP_LDFLAGS)
+
+ unset _libnetsnmp_with
+])dnl
diff --git a/m4/sqlora8.m4 b/m4/sqlora8.m4
new file mode 100644
index 00000000..17896edb
--- /dev/null
+++ b/m4/sqlora8.m4
@@ -0,0 +1,105 @@
+# LIBSQLORA8_CHECK_CONFIG ([DEFAULT-ACTION])
+# ----------------------------------------------------------
+# Eugene Grigorjev <eugene@zabbix.com> Feb-02-2007
+#
+# Checks for Sqlora8. DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-sqlora8 or --without-sqlora8
+# or --with-oracle or --without-oracle. If not supplied, DEFAULT-ACTION is no.
+#
+# This macro #defines HAVE_SQLORA8 if a required header files is
+# found, and sets @SQLORA8_LDFLAGS@ and @SQLORA8_CPPFLAGS@ to the necessary
+# values.
+#
+# Users may override the detected values by doing something like:
+# SQLORA8_LDFLAGS="-lsqlora8" SQLORA8_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# This macro is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+AC_DEFUN([LIBSQLORA8_CHECK_CONFIG],
+[
+ AC_ARG_WITH(oracle,
+ [
+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
+ want_sqlora8="no"
+ _libsqlora8_with="no"
+ elif test "$withval" = "yes"; then
+ want_sqlora8="yes"
+ _libsqlora8_with="yes"
+ else
+ want_sqlora8="yes"
+ _libsqlora8_with=$withval
+ fi
+ ],[_libsqlora8_with=ifelse([$1],,[no],[$1])])
+
+ if test "x$want_sqlora8" = "x" ; then
+ AC_ARG_WITH(sqlora8,
+ [AC_HELP_STRING([--with-sqlora8@<:@=ARG@:>@],
+ [use Sqlora8 library @<:@default=no@:>@, same as --with-oracle.])],[ if test "$withval" = "no"; then
+ want_sqlora8="no"
+ _libsqlora8_with="no"
+ elif test "$withval" = "yes"; then
+ want_sqlora8="yes"
+ _libsqlora8_with="yes"
+ else
+ want_sqlora8="yes"
+ _libsqlora8_with=$withval
+ fi
+ ],[_libsqlora8_with=ifelse([$1],,[no],[$1])])
+ fi
+
+ if test "x$_libsqlora8_with" != x"no"; then
+ AC_MSG_CHECKING(for Oracle support)
+
+ if test "$_libsqlora8_with" = "yes"; then
+ if test -f /usr/include/sqlora.h; then
+ SQLORA8_INCDIR=/usr/include
+ SQLORA8_LIBDIR=/usr/lib
+ elif test -f /usr/lib/libsqlora8/include/sqlora.h; then
+ SQLORA8_INCDIR=/usr/lib/libsqlora8/include
+ SQLORA8_LIBDIR=/usr/lib
+ elif test -f $SQLORA8_HOME/lib/sqlora8/include/sqlora.h; then
+ SQLORA8_INCDIR=$SQLORA8_HOME/lib/sqlora8/include
+ SQLORA8_LIBDIR=$SQLORA8_HOME/lib
+ elif test -f $SQLORA8_HOME/include/sqlora.h; then
+ SQLORA8_INCDIR=${SQLORA8_HOME}/include
+ SQLORA8_LIBDIR=${SQLORA8_HOME}/lib
+ else
+ found_libsqlora8="no"
+ AC_MSG_RESULT(no)
+ fi
+ else
+ if test -f $_libsqlora8_with/include/sqlora.h; then
+ SQLORA8_INCDIR=$_libsqlora8_with/include
+ SQLORA8_LIBDIR=$_libsqlora8_with/lib
+ elif test -f $withval/lib/libsqlora8/include/sqlora.h; then
+ SQLORA8_INCDIR=$_libsqlora8_with/lib/libsqlora8/include
+ SQLORA8_LIBDIR=$_libsqlora8_with/lib
+ elif test -f $withval/libsqlora8/include/sqlora.h; then
+ SQLORA8_INCDIR=$_libsqlora8_with/libsqlora8/include
+ SQLORA8_LIBDIR=$_libsqlora8_with
+ else
+ found_libsqlora8="no"
+ AC_MSG_RESULT(no)
+ fi
+ fi
+
+ if test "x$found_libsqlora8" != "xno" ; then
+ $found_libsqlora8="yes"
+ AC_MSG_RESULT(yes)
+
+ SQLORA8_CPPFLAGS="-I$SQLORA8_INCDIR"
+ SQLORA8_LDFLAGS="-L$SQLORA8_LIBDIR -lsqlora8"
+
+ AC_DEFINE(HAVE_SQLORA8,1,[Define to 1 if SQLORA8 library should be enabled.])
+ fi
+ fi
+
+ AC_SUBST(SQLORA8_CPPFLAGS)
+ AC_SUBST(SQLORA8_LDFLAGS)
+
+ unset _libsqlora8_with
+])dnl
diff --git a/m4/ucdsnmp.m4 b/m4/ucdsnmp.m4
new file mode 100644
index 00000000..933fd04b
--- /dev/null
+++ b/m4/ucdsnmp.m4
@@ -0,0 +1,91 @@
+# LIBSNMP_CHECK_CONFIG ([DEFAULT-ACTION])
+# ----------------------------------------------------------
+# Eugene Grigorjev <eugene@zabbix.com> Feb-02-2007
+#
+# Checks for snmp. DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-ucd-snmp or --without-ucd-snmp.
+# If not supplied, DEFAULT-ACTION is no.
+#
+# This macro #defines HAVE_SNMP and HAVE_UCDSNMP if a required header files is
+# found, and sets @SNMP_LDFLAGS@ and @SNMP_CPPFLAGS@ to the necessary
+# values.
+#
+# Users may override the detected values by doing something like:
+# SNMP_LDFLAGS="-lsnmp" SNMP_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# This macro is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+AC_DEFUN([LIBSNMP_CHECK_CONFIG],
+[
+ AC_ARG_WITH(ucd-snmp,
+ [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
+ want_snmp="no"
+ _libsnmp_with="no"
+ elif test "$withval" = "yes"; then
+ want_snmp="yes"
+ _libsnmp_with="yes"
+ else
+ want_snmp="yes"
+ _libsnmp_with=$withval
+ fi
+ ],[_libsnmp_with=ifelse([$1],,[no],[$1])])
+
+ if test "x$_libsnmp_with" != x"no"; then
+ AC_MSG_CHECKING(for UCD-SNMP support)
+
+ if test "$_libsnmp_with" = "yes"; then
+ if test -f /usr/local/ucd-snmp/include/ucd-snmp-config.h; then
+ SNMP_INCDIR=/usr/local/ucd-snmp/include/
+ SNMP_LIBDIR=/usr/local/ucd-snmp/lib/
+ elif test -f /usr/include/ucd-snmp/ucd-snmp-config.h; then
+ SNMP_INCDIR=/usr/include
+ SNMP_LIBDIR=/usr/lib
+ elif test -f /usr/include/ucd-snmp-config.h; then
+ SNMP_INCDIR=/usr/include
+ SNMP_LIBDIR=/usr/lib
+ elif test -f /usr/local/include/ucd-snmp/ucd-snmp-config.h; then
+ SNMP_INCDIR=/usr/local/include
+ SNMP_LIBDIR=/usr/local/lib
+ elif test -f /usr/local/include/ucd-snmp-config.h; then
+ SNMP_INCDIR=/usr/local/include
+ SNMP_LIBDIR=/usr/local/lib
+ else
+ found_snmp="no"
+ AC_MSG_RESULT(no)
+ fi
+ else
+ if test -f $withval/include/ucd-snmp/ucd-snmp-config.h; then
+ SNMP_INCDIR=$withval/include
+ SNMP_LIBDIR=$withval/lib
+ elif test -f $withval/include/ucd-snmp-config.h; then
+ SNMP_INCDIR=$withval/include
+ SNMP_LIBDIR=$withval/lib
+ else
+ found_snmp="no"
+ AC_MSG_RESULT(no)
+ fi
+ fi
+
+ if test "x$found_snmp" != "xno" ; then
+ found_snmp="yes"
+ AC_MSG_RESULT(yes)
+
+ AC_CHECK_LIB(crypto, main, SNMP_LIBS="$SNMP_LIBS -lcrypto")
+
+ SNMP_CPPFLAGS=-I$SNMP_INCDIR
+ SNMP_LDFLAGS="-L$SNMP_LIBDIR $SNMP_LFLAGS -lsnmp $SNMP_LIBS"
+
+ AC_DEFINE(HAVE_UCDSNMP,1,[Define to 1 if UCD-SNMP should be enabled.])
+ AC_DEFINE(HAVE_SNMP,1,[Define to 1 if SNMP should be enabled.])
+ fi
+ fi
+
+ AC_SUBST(SNMP_LDFLAGS)
+ AC_SUBST(SNMP_CPPFLAGS)
+
+ unset _libsnmp_with
+])dnl