]> arthur.barton.de Git - netatalk.git/commitdiff
Moved the SSL checking code into its own function, cleaned it up, and
authorsrittau <srittau>
Thu, 25 Oct 2001 20:37:04 +0000 (20:37 +0000)
committersrittau <srittau>
Thu, 25 Oct 2001 20:37:04 +0000 (20:37 +0000)
added the substitutions SSL_CFLAGS and SSL_LDFLAGS.

configure.in

index df4d44fdbb659910c2d4b1ee7cc84d2bb52c9f40..0fc92d238928055e1382dcdff28c28a0622eeada 100644 (file)
@@ -1,6 +1,65 @@
-dnl $Id: configure.in,v 1.117 2001-10-24 16:18:00 srittau Exp $
+dnl $Id: configure.in,v 1.118 2001-10-25 20:37:04 srittau Exp $
 dnl configure.in for netatalk
 
+dnl Check for SSL
+AC_DEFUN([AM_PATH_SSL], [
+       tryssl=yes
+
+       AC_ARG_WITH(ssl-dir, [
+  --with-ssl-dir=PATH     specify path to OpenSSL installation (must contain
+                          lib and include dirs)],
+               [
+                       if test "x$withval" != "xno"; then
+                               tryssldir=$withval
+                       else
+                               tryssl=no
+                       fi
+               ]
+       )
+
+       SSL_CFLAGS=""
+       SSL_LIBS=""
+       compile_ssl=no
+
+       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
+                       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"
+                               if test "$need_dash_r" = "yes"; then
+                                       SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
+                               fi
+                               AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
+
+                               dnl Check for the crypto library:
+                               AC_CHECK_LIB(crypto, main)
+                               dnl Check for "DES" library (for SSLeay, not openssl):
+                               AC_CHECK_LIB(des, main)
+
+                               dnl FIXME: do that temporarily
+                               LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
+                               CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
+                               if test "$need_dash_r" = "yes"; then
+                                       LIBS="$LIBS -R$ssldir/lib -R$ssldir"
+                               fi
+
+                               AC_DEFINE(OPENSSL_DHX,  1)
+                               AC_DEFINE(UAM_DHX,      1)
+                               compile_ssl=yes
+                               break
+                       fi
+               done
+               if test "x$compile_ssl" = "xno"; then
+                       AC_MSG_RESULT([no])
+               fi
+       fi
+       AC_SUBST(SSL_CFLAGS)
+       AC_SUBST(SSL_LIBS)
+])
+
+
+
 AC_INIT(bin/adv1tov2/adv1tov2.c)
 
 NETATALK_VERSION=`cat VERSION`
@@ -610,7 +669,6 @@ if test x"$this_os" = "xnetbsd"; then
 
        dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
        AC_DEFINE(UAM_DHX, 1)
-       AC_DEFINE(UAM_RNDNUM, 1)
        AC_DEFINE(NO_CRYPT_H, 1)
 fi
 
@@ -625,7 +683,6 @@ if test x"$this_os" = "xopenbsd"; then
 
        dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
        AC_DEFINE(UAM_DHX, 1)
-       AC_DEFINE(UAM_RNDNUM, 1)
        AC_DEFINE(NO_CRYPT_H, 1)
 fi
 
@@ -666,43 +723,7 @@ if test x"$this_os" = "xtru64"; then
 fi
 
 dnl -- look for openssl
-tryssl=yes
-AC_ARG_WITH(ssl-dir,
-       [  --with-ssl-dir=PATH     specify path to openssl installation (must contain
-                          lib and include dirs) ],
-       [
-               if test "x$withval" != "xno"; then
-                       tryssldir=$withval
-               else
-                       tryssl=no
-               fi
-       ]
-)
-
-if test "$tryssl" = "yes"; then
-       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
-               if test -f "$ssldir/include/openssl/cast.h" ; then
-                       LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
-                       CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
-                       if test "$need_dash_r" = "yes"; then
-                               LIBS="$LIBS -R$ssldir/lib -R$ssldir"
-                       fi
-
-                       dnl Check for the crypto library:
-                       AC_CHECK_LIB(crypto, main)
-                       dnl LIBS="$LIBS -lcrypto"
-                       dnl Check for "DES" library (for SSLeay, not openssl):
-                       AC_CHECK_LIB(des, main)
-
-                       AC_DEFINE(OPENSSL_DHX,  1)
-                       AC_DEFINE(UAM_DHX,      1)
-                       AC_DEFINE(UAM_RNDNUM,   1)
-                       compile_ssl=yes
-                       AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
-                       break
-               fi
-       done
-fi
+AM_PATH_SSL
 
 dnl --------------------- check for building PGP UAM module