X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=configure.ac;h=36e9ca62fce4ab454c9e14a1a474bdc3b08fa873;hp=b2ca8309cc33aadc64b14da661a32ac4d122d6b1;hb=76d7a32ad18dfab123315e59b2b941d7cdf3632a;hpb=dedba382ec4773d8abdf244290020f3da42113b6 diff --git a/configure.ac b/configure.ac index b2ca830..36e9ca6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl This file is part of the YAZ toolkit. dnl Copyright (C) 1995-2008 Index Data AC_PREREQ([2.60]) -AC_INIT([yaz],[3.0.28],[yaz-help@indexdata.dk]) +AC_INIT([yaz],[3.0.30],[yaz-help@indexdata.dk]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([1.9]) @@ -56,19 +56,21 @@ if test "$checkBoth" = "1"; then fi AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])]) dnl + dnl ------ OpenSSL AC_SUBST([SSL_CFLAGS]) -openssl=default +AC_SUBST([SSL_LIBS]) +openssl=no +sslver=no AC_ARG_WITH([openssl], [ --with-openssl[=PREFIX] OpenSSL library in PREFIX], [openssl=$withval]) SSL_CFLAGS="" SSL_LIBPATH="" if test "$openssl" != "no"; then - sslver=no if test "$openssl" != "yes" -a "$openssl" != "default"; then if test -x $openssl/bin/pkg-config; then if $openssl/bin/pkg-config --exists openssl; then SSL_CFLAGS=`$openssl/bin/pkg-config --cflags openssl` - LIBS="$LIBS `$openssl/bin/pkg-config --libs openssl`" + SSL_LIBS="`$openssl/bin/pkg-config --libs openssl`" sslver=`$openssl/bin/pkg-config --modversion openssl` fi fi @@ -80,7 +82,7 @@ if test "$openssl" != "no"; then if test "$pkgconfigpath" != "NONE"; then if $pkgconfigpath --exists openssl; then SSL_CFLAGS=`$pkgconfigpath --cflags openssl` - LIBS="$LIBS `$pkgconfigpath --libs openssl`" + SSL_LIBS="`$pkgconfigpath --libs openssl`" sslver=`$pkgconfigpath --modversion openssl` fi fi @@ -91,16 +93,21 @@ if test "$openssl" != "no"; then if test "$sslver" = "no"; then xLIBS="$LIBS"; xCPPFLAGS="$CPPFLAGS"; - CPPFLAGS="$CPPFLAGS $SSL_CFLAGS $SSL_LIBPATH" + CPPFLAGS="$CPPFLAGS ${SSL_CFLAGS} ${SSL_LIBPATH}" + SSL_LIBS="${SSL_LIBPATH}" AC_CHECK_LIB([crypto],[main]) + if test "$ac_cv_lib_crypto_main" = "yes"; then + SSL_LIBS="${SSL_LIBS} -lcrypto" + fi AC_CHECK_LIB([ssl],[SSL_new]) if test "$ac_cv_lib_ssl_SSL_new" = "yes"; then AC_CHECK_HEADER([openssl/ssl.h],[sslver=yes]) - LIBS="$SSL_LIBPATH $LIBS" + SSL_LIBS="${SSL_LIBS} -lssl" fi if test "$sslver" != "yes"; then - LIBS="$xLIBS" + SSL_LIBS="" fi + LIBS="$xLIBS" CPPFLAGS="$xCPPFLAGS" fi AC_MSG_CHECKING([for SSL]) @@ -115,6 +122,40 @@ if test "$openssl" != "no"; then fi fi fi +dnl ------ GNU TLS +gnutls=default +AC_ARG_WITH([gnutls], [ --with-gnutls[=PREFIX] GNU TLS library in PREFIX], [gnutls=$withval]) +if test "$gnutls" != "no" -a "$sslver" = "no"; then + gnutlsver=no + if test "$gnutls" != "yes" -a "$gnutls" != "default"; then + if test -x $gnutls/bin/pkg-config; then + if $gnutls/bin/pkg-config --exists gnutls; then + SSL_CFLAGS=`$gnutls/bin/pkg-config --cflags gnutls` + SSL_LIBS="`$gnutls/bin/pkg-config --libs gnutls` -lgnutls-openssl" + gnutlsver=`$gnutls/bin/pkg-config --modversion gnutls` + fi + fi + else + if test "$pkgconfigpath" != "NONE"; then + if $pkgconfigpath --exists gnutls; then + SSL_CFLAGS=`$pkgconfigpath --cflags gnutls` + SSL_LIBS="`$pkgconfigpath --libs gnutls` -lgnutls-openssl" + gnutlsver=`$pkgconfigpath --modversion gnutls` + fi + fi + fi + AC_MSG_CHECKING([for GNU TLS]) + if test "$gnutlsver" != "no"; then + SSL_CFLAGS="-DHAVE_GNUTLS_H=1 $SSL_CFLAGS" + AC_MSG_RESULT([$gnutlsver]) + else + SSL_CFLAGS="" + AC_MSG_RESULT([None]) + if test "$gnutls" != "default"; then + AC_MSG_ERROR([GNU TLS development libraries missing]) + fi + fi +fi dnl dnl ------ GNU Readline READLINE_SHARED_LIBADD=""