diff mcabber/connwrap/configure.in @ 25:bf3d6e241714

[/trunk] Changeset 41 by mikael * Add libjabber to trunk. Let the game begin! :-)
author mikael
date Sun, 27 Mar 2005 20:18:21 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mcabber/connwrap/configure.in	Sun Mar 27 20:18:21 2005 +0000
@@ -0,0 +1,79 @@
+AC_INIT(aclocal.m4)
+AM_INIT_AUTOMAKE(connwrap, 0.1)
+
+AC_PROG_RANLIB
+
+AC_PROG_CC
+AC_PROG_CXX
+
+###
+###     SSL libs
+###
+
+AC_ARG_WITH(ssl, [  --with-ssl              enable SSL secured connections using either OpenSSL
+			  or GnuTLS],
+	[with_ssl=$withval])
+
+if test "$with_ssl" != "no"; then
+    AC_ARG_WITH(openssl,
+	[  --with-openssl=[DIR]    enable SSL secured connections using the OpenSSL
+			  library in DIR (optional)],
+	[with_openssl=$withval])
+
+    if test -z "$with_openssl"; then
+	for ac_dir in /usr/local /usr; do
+	    if test -f "$ac_dir/include/openssl/ssl.h"; then
+		with_openssl=$ac_dir
+		break;
+	    fi
+	done
+    fi
+
+    AC_MSG_CHECKING(for OpenSSL)
+
+    if test -n "$with_openssl" -a "$with_openssl" != "no"; then
+	if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi
+	CFLAGS="$CFLAGS -I${with_openssl}"
+	AC_DEFINE(HAVE_OPENSSL)
+	AC_MSG_RESULT([found in $with_openssl])
+	AC_CHECK_LIB(crypto, main, [
+		AC_CHECK_LIB(crypto, SSLeay_add_all_algorithms, [
+		    AC_DEFINE(HAVE_SSLEAY)
+		])
+	    ])
+	AC_CHECK_LIB(ssl, main)
+    else
+	AC_MSG_RESULT([not found or disabled])
+
+	AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
+	    CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
+	    LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
+	    AC_DEFINE(HAVE_GNUTLS)
+	])
+    fi
+fi
+
+AC_MSG_CHECKING(for inet_aton() presence)
+
+AC_TRY_LINK([
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+], [
+
+struct in_addr inp;
+inet_aton("address", &inp);
+
+], have_aton=yes, have_aton=no)
+
+if test "$have_aton" = "yes"; then
+    AC_DEFINE(HAVE_INET_ATON)
+    AC_MSG_RESULT(yes)
+else
+    AC_MSG_RESULT(no)
+fi
+
+AC_OUTPUT(Makefile)