X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=macros%2Fssl-check.m4;h=8a58142be879c1a8402dce97797e67feadee1ab6;hb=42eb54de3f6373cd394fbd6abfb86d85c8dde935;hp=9fa7b3729b008ad7390a0babe7e7282961f1b25d;hpb=c2e550bfac1057f6df812dcaaa29a618ca9b1879;p=netatalk.git diff --git a/macros/ssl-check.m4 b/macros/ssl-check.m4 index 9fa7b372..8a58142b 100644 --- a/macros/ssl-check.m4 +++ b/macros/ssl-check.m4 @@ -1,42 +1,22 @@ -dnl $Id: ssl-check.m4,v 1.9 2003-06-08 16:04:49 srittau Exp $ dnl Autoconf macro to check for SSL or OpenSSL -AC_DEFUN([AC_PATH_GCRYPT], [ +AC_DEFUN([AC_NETATALK_CRYPT], [ - GCRYPT_CFLAGS="" - GCRYPT_LIBS="" + saveLIBS=$LIBS + LIBS="" + CRYPT_LIBS="" - search="yes" - errifnotfound="no" + AC_CHECK_HEADERS(crypt.h) + AC_CHECK_LIB(crypt, main) - AC_ARG_ENABLE(libgcrypt, [ --disable-gcrypt disable compilation with libgcrypt], [ - if test "x$enableval" != "xdisable"; then - errifnotfound="yes" - else - search="no" - fi - ]) - - GCRYPT_CONFIG="" - if test "x$search" == "xyes"; then - AC_PATH_PROG([GCRYPT_CONFIG], [libgcrypt-config], [no]) - - if test "x$GCRYPT_CONFIG" == "xno"; then - if test "x$errifnotfound" == "xyes"; then - AC_MSG_ERROR([libgcrypt-config not found]) - fi - else - GCRYPT_CFLAGS="`$GCRYPT_CONFIG --cflags`" - GCRYPT_LIBS="`$GCRYPT_CONFIG --libs`" - fi - fi + CRYPT_LIBS=$LIBS + LIBS=$saveLIBS - AC_SUBST(GCRYPT_CFLAGS) - AC_SUBST(GCRYPT_LIBS) - AM_CONDITIONAL(HAVE_GCRYPT, test -n "$GCRYPT_CONFIG") + AC_SUBST(CRYPT_LIBS) ]) -AC_DEFUN([AC_PATH_SSL], [ + +AC_DEFUN([AC_NETATALK_PATH_SSL], [ AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to OpenSSL installation (must contain lib and include dirs)], [ @@ -55,18 +35,26 @@ AC_DEFUN([AC_PATH_SSL], [ SSL_CFLAGS="" SSL_LIBS="" - compile_ssl=no + saved_LIBS=$LIBS + saved_CFLAGS=$CFLAGS + neta_cv_have_openssl=no +dnl compile_ssl=no + + dnl make sure atalk_libname is defined beforehand + [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined]) if test "$tryssl" = "yes"; then AC_MSG_CHECKING([for SSL]) - for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do + for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/$atalk_libname/openssl /usr/local/ssl /usr/$atalk_libname/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do if test -f "$ssldir/include/openssl/cast.h" ; then SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl" - SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto" + SSL_LIBS="$SSL_LIBS -L$ssldir/$atalk_libname -L$ssldir -lcrypto" if test "x$need_dash_r" = "xyes"; then - SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir" + SSL_LIBS="$SSL_LIBS -R$ssldir/$atalk_libname -R$ssldir" fi AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)]) + CFLAGS="$CFLAGS $SSL_CFLAGS" + LIBS="$LIBS $SSL_LIBS" dnl FIXME: The following looks crude and probably doesn't work properly. dnl Check for the crypto library: @@ -76,14 +64,20 @@ dnl FIXME: The following looks crude and probably doesn't work properly. AC_DEFINE(OPENSSL_DHX, 1, [Define if the OpenSSL DHX modules should be built]) AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled]) - compile_ssl=yes + neta_cv_have_openssl=yes + neta_cv_compile_dhx=yes + CFLAGS=$saved_CFLAGS + LIBS=$saved_LIBS break fi done - if test "x$compile_ssl" = "xno"; then + if test "x$neta_cv_have_openssl" = "xno"; then AC_MSG_RESULT([no]) fi fi + CFLAGS_REMOVE_USR_INCLUDE(SSL_CFLAGS) + LIB_REMOVE_USR_LIB(SSL_LIBS) AC_SUBST(SSL_CFLAGS) AC_SUBST(SSL_LIBS) + LIBS=$saved_LIBS ])