AC_INIT(starttls.el)
-AC_PREREQ(2.13)
-AM_INIT_AUTOMAKE(starttls, 0.9)
+AC_PREREQ(2.50)
+AM_INIT_AUTOMAKE(starttls, 0.10)
AM_PATH_LISPDIR
fi
AC_CHECK_LIB(socket, socket)
-AC_CHECK_FUNC(getopt_long,,[AC_LIBOBJ(getopt)AC_LIBOBJ(getopt1)])
+AC_CHECK_FUNC(getopt_long,,[
+ AC_LIBOBJ(getopt)
+ AC_LIBOBJ(getopt1)])
AC_REPLACE_FUNCS(basename)
AC_CHECK_FUNC(poll)
AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH])
-
-if test -n "$with_openssl"; then
- CPPFLAGS="$CPPFLAGS -I${with_openssl}/include"
- LDFLAGS="$LDFLAGS -L${with_openssl}/lib"
+AC_ARG_WITH(gnutls,[ --with-gnutls use GnuTLS instead of OpenSSL],
+ use_gnutls=true, use_gnutls=false)
+AM_CONDITIONAL(USE_GNUTLS, test x$use_gnutls = xtrue)
+
+if $use_gnutls; then
+ AC_CHECK_HEADER(gnutls/gnutls.h, [
+ AC_DEFINE(USE_GNUTLS)
+ AC_CHECK_LIB(gnutls, gnutls_global_init, LIBS="-lgnutls $LIBS")],
+ [GnuTLS is selected, but it is not installed])
+else
+ if test -n "$with_openssl"; then
+ CPPFLAGS="$CPPFLAGS -I${with_openssl}/include"
+ LDFLAGS="$LDFLAGS -L${with_openssl}/lib"
+ fi
+ AC_CHECK_HEADER(openssl/ssl.h, [
+ AC_CHECK_LIB(crypto, BIO_accept, LIBS="-lcrypto $LIBS")
+ AC_CHECK_LIB(ssl, SSL_CTX_new, LIBS="-lssl $LIBS")],
+ AC_MSG_ERROR([OpenSSL not installed - please install first]))
fi
-AC_CHECK_HEADER(openssl/ssl.h, [
- AC_CHECK_LIB(crypto, BIO_accept, LIBS="-lcrypto $LIBS")
- AC_CHECK_LIB(ssl, SSL_CTX_new, LIBS="-lssl $LIBS")],
- AC_MSG_ERROR([OpenSSL not installed - please install first]))
-
AC_OUTPUT(Makefile)