summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-04-23 14:08:40 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-04-23 14:08:40 +0000
commit092e8f774127db44b5ac02dde58781264032f53f (patch)
tree06420d9e8219facd1af5eb589349018d3030e25b /m4
parentc0a7ef14e149fb0e49e58c36ca94ca5482856c37 (diff)
downloadzabbix-092e8f774127db44b5ac02dde58781264032f53f.tar.gz
zabbix-092e8f774127db44b5ac02dde58781264032f53f.tar.xz
zabbix-092e8f774127db44b5ac02dde58781264032f53f.zip
fixes for static compisation
git-svn-id: svn://svn.zabbix.com/trunk@4048 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'm4')
-rw-r--r--m4/ldap.m48
-rw-r--r--m4/libcurl.m420
-rw-r--r--m4/netsnmp.m497
3 files changed, 83 insertions, 42 deletions
diff --git a/m4/ldap.m4 b/m4/ldap.m4
index ca42dcbe..8da8dfb2 100644
--- a/m4/ldap.m4
+++ b/m4/ldap.m4
@@ -73,6 +73,14 @@ AC_HELP_STRING([--with-ldap@<:@=DIR@:>@],[Include LDAP support @<:@default=no@:>
found_ldap="yes"
AC_DEFINE(HAVE_LDAP,1,[Define to 1 if LDAP should be enabled.])
AC_MSG_RESULT(yes)
+
+ if test "x$enable_static" = "xyes"; then
+ AC_CHECK_LIB(lber, main, , AC_MSG_ERROR([Not found LBER library]))
+ AC_CHECK_LIB(gnutls, main, , AC_MSG_ERROR([Not found GnuTLS library]))
+ AC_CHECK_LIB(pthread, main, , AC_MSG_ERROR([Not found Pthread library]))
+ AC_CHECK_LIB(sasl2, main, , AC_MSG_ERROR([Not found SASL2 library]))
+ fi
+
fi
fi
diff --git a/m4/libcurl.m4 b/m4/libcurl.m4
index a53a07e7..30088193 100644
--- a/m4/libcurl.m4
+++ b/m4/libcurl.m4
@@ -114,17 +114,33 @@ AC_HELP_STRING([--with-libcurl@<:@=DIR@:>@],[use cURL library @<:@default=yes@:>
LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
fi
if test x"$LIBCURL_LDFLAGS" = "x" ; then
- _full_libcurl_libs=`$_libcurl_config --libs`
+ _full_libcurl_libs=`$_libcurl_config --libs`
for i in $_full_libcurl_libs; do
case $i in
-L*)
LIBCURL_LDFLAGS="$LIBCURL_LDFLAGS $i"
+
;;
esac
done
- LIBCURL_LDFLAGS="$LIBCURL_LDFLAGS -lcurl"
+ if test "x$enable_static" = "xyes"; then
+
+ for i in $_full_libcurl_libs; do
+ case $i in
+ -l*)
+ _lib_name=`echo "$i" | cut -b3-`
+ AC_CHECK_LIB($_lib_name , main, , AC_MSG_ERROR([Not found $_lib_name library]))
+ LIBCURL_LDFLAGS="$LIBCURL_LDFLAGS $i"
+
+ ;;
+ esac
+ done
+ else
+ AC_CHECK_LIB(curl, main, , AC_MSG_ERROR([Not found curl library]))
+ LIBCURL_LDFLAGS="$LIBCURL_LDFLAGS -lcurl"
+ fi
# This is so silly, but Apple actually has a bug in their
# curl-config script. Fixed in Tiger, but there are still
diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4
index 5ec16781..3bd5354b 100644
--- a/m4/netsnmp.m4
+++ b/m4/netsnmp.m4
@@ -36,51 +36,68 @@ AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@],
],[_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)
+
+ if test -d "$_libnetsnmp_with" ; then
+ SNMP_INCDIR="-I$withval/include"
+ _libnetsnmp_ldflags="-L$_libnetsnmp_with/lib"
+ AC_PATH_PROG([_libnetsnmp_config],["$_libnetsnmp_with/bin/net-snmp-config"])
+ else
+ AC_PATH_PROG([_libnetsnmp_config],[net-snmp-config])
+ fi
+
+ if test "x$_libnetsnmp_config" != "x" ; then
+ _full_libnetsnmp_libs=`$_libnetsnmp_config --libs`
+ for i in $_full_libnetsnmp_libs; do
+ case $i in
+ -L*)
+ SNMP_LIBDIRS="$SNMP_LIBDIRS $i"
+
+ ;;
+ esac
+ done
+
+ if test "x$enable_static" = "xyes"; then
+
+ for i in $_full_libnetsnmp_libs; do
+ case $i in
+ -lnetsnmp)
+ ;;
+ -l*)
+ _lib_name=`echo "$i" | cut -b3-`
+ AC_CHECK_LIB($_lib_name , main, , AC_MSG_ERROR([Not found $_lib_name library]))
+ SNMP_LIBS="$SNMP_LIBS $i"
+
+ ;;
+ esac
+ done
fi
- fi
- if test "x$found_netsnmp" != "xno"; then
- found_netsnmp="yes"
- AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(netsnmp, main, , AC_MSG_ERROR([Not found netsnmp library]))
+ SNMP_LIBS="$SNMP_LIBS -lnetsnmp"
+
+ _full_libnetsnmp_cflags=`$_libnetsnmp_config --cflags`
+ for i in $_full_libnetsnmp_cflags; do
+ case $i in
+ -I*)
+ SNMP_INCDIRS="$SNMP_INCDIRS $i"
- AC_CHECK_LIB(crypto, main, SNMP_LIBS="$SNMP_LIBS -lcrypto")
+ ;;
+ esac
+ done
- SNMP_CPPFLAGS=-I$SNMP_INCDIR
- SNMP_LDFLAGS="-L$SNMP_LIBDIR $SNMP_LFLAGS -lnetsnmp $SNMP_LIBS"
+ _libnetsnmp_libdir=`$_libnetsnmp_config --libdir`
- 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.])
+ if test "x$found_netsnmp" != "xno"; then
+ found_netsnmp="yes"
+
+ SNMP_CPPFLAGS="$SNMP_INCDIRS"
+ SNMP_LDFLAGS="$SNMP_LIBDIRS $SNMP_LFLAGS $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
+ else
+ found_netsnmp="no"
fi
fi