[Nagiosplug-checkins] nagiosplug configure.in,1.158,1.159

M. Sean Finney seanius at users.sourceforge.net
Tue Oct 18 15:37:02 CEST 2005


Update of /cvsroot/nagiosplug/nagiosplug
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19928

Modified Files:
	configure.in 
Log Message:
initial "experimental" support for gnutls.  by default openssl is still
used if available, and gnutls is only used if openssl is not available
or explicitly disabled (--without-openssl).   currently the only plugin
i've verified to work is check_tcp, but i had to disable cert checking.


Index: configure.in
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/configure.in,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- configure.in	13 Oct 2005 11:51:15 -0000	1.158
+++ configure.in	18 Oct 2005 22:35:29 -0000	1.159
@@ -103,6 +103,7 @@
 AC_PATH_PROG(PYTHON,python)
 AC_PATH_PROG(SH,sh)
 AC_PATH_PROG(PERL,perl)
+AC_PATH_PROG(LIBGNUTLS_CONFIG,libgnutls-config)
 
 dnl allow them to override the path of perl
 AC_ARG_WITH(perl,
@@ -111,6 +112,12 @@
 			with_perl=$withval,with_perl=$PERL)
 AC_SUBST(PERL, $with_perl)
 
+dnl allow for gnutls, if it exists, instead of openssl
+AC_ARG_WITH(gnutls,
+            ACX_HELP_STRING([--with-gnutls=PATH],
+                            [path to gnutls installation root]),
+            GNUTLS=$withval)
+
 AC_PATH_PROG(HOSTNAME,hostname)
 AC_PATH_PROG(BASENAME,basename)
 
@@ -409,6 +416,7 @@
   CPPFLAGS="$_SAVEDCPPFLAGS"
 fi
 
+
 dnl Check for OpenSSL location
 AC_PATH_PROG(OPENSSL,openssl)
 if test "$OPENSSL" = "/usr/bin/openssl"; then
@@ -478,18 +486,43 @@
   fi
 fi
 
+dnl check for gnutls if openssl isn't found (or is disabled)
+FOUNDGNUTLS="no"
+if ! test "$FOUNDSSL" = "yes"; then
+	if test "$GNUTLS" = ""; then
+		CPPFLAGS="$CPPFLAGS -I$GNUTLS"
+	elif ! test "$LIBGNUTLS_CONFIG" = ""; then
+		CPPFLAGS="$CPPFLAGS -I`$LIBGNUTLS_CONFIG --prefix`"
+	fi
+	AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
+	if test "$FOUNDGNUTLS" = "yes"; then
+		AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
+		FOUNDSSL="yes"
+	fi
+fi
+dnl end check for gnutls
+
 if test "$FOUNDSSL" = "yes"; then
   check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
   AC_SUBST(check_tcp_ssl)
   AC_SUBST(SSLLIBS)
   AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
-  with_openssl="yes"
+  if test "$FOUNDGNUTLS" = "no"; then
+  	AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
+  	with_openssl="yes"
+	with_gnutls="no"
+  else
+  	AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
+  	with_gnutls="yes"
+	with_openssl="no"
+  fi
 else
   if test "$FOUNDSSL" = "no"; then
     AC_MSG_WARN([OpenSSL libs could not be found])
   dnl else deliberately disabled
   fi
   with_openssl="no"
+  with_gnutls="no"
   CPPFLAGS="$_SAVEDCPPFLAGS"
   LDFLAGS="$_SAVEDLDFLAGS"
 fi
@@ -1597,4 +1630,5 @@
 ACX_FEATURE([with],[lwres])
 ACX_FEATURE([with],[ipv6])
 ACX_FEATURE([with],[openssl])
+ACX_FEATURE([with],[gnutls])
 ACX_FEATURE([enable],[emulate-getaddrinfo])





More information about the Commits mailing list