--- ntp-4.2.4p7/configure.ac.orig 2009-05-19 10:22:32.000000000 +0200 +++ ntp-4.2.4p7/configure.ac 2009-05-19 10:29:41.000000000 +0200 @@ -3126,7 +3126,6 @@ AC_SUBST(OPENSSL_INC) AC_SUBST(OPENSSL_LIB) -AC_MSG_CHECKING([for openssl library directory]) AC_ARG_WITH(openssl-libdir, AC_HELP_STRING([--with-openssl-libdir], [+ =/something/reasonable]), [ans=$withval], @@ -3136,39 +3135,14 @@ esac]) case "$ans" in no) ;; - yes) # Look in: - ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib" - ;; - *) # Look where they said - ;; -esac -case "$ans" in - no) ;; - *) # Look for libcrypto.a and libssl.a: - for i in $ans no - do - case "$host" in - *-*-darwin*) - test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break - ;; - *) - test -f $i/libcrypto.so -a -f $i/libssl.so && break - test -f $i/libcrypto.a -a -f $i/libssl.a && break - ;; - esac - done - case "$i" in - no) - ans=no - OPENSSL_LIB= - ;; - *) ans=$i - OPENSSL_LIB=$ans - ;; - esac + *) + if test "$ans" != "yes" ; then + LDFLAGS="$LDFLAGS -L$ans" + fi + AC_CHECK_LIB([crypto],[DES_crypt],[AC_SUBST(LCRYPTO,[-lcrypto])]) + AC_CHECK_LIB([ssl],[SSL_CTX_new],[AC_SUBST(LSSL,[-lssl])]) ;; esac -AC_MSG_RESULT([$ans]) AC_MSG_CHECKING([for openssl include directory]) AC_ARG_WITH(openssl-incdir, @@ -3212,19 +3186,17 @@ case "$ans" in no) ;; yes|openssl) - if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC" + if test -z "$LCRYPTO" -o -z "$OPENSSL_INC" then ans=no else # We have OpenSSL inc/lib - use them. ans=openssl CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC" - LDFLAGS="$LDFLAGS -L$OPENSSL_LIB" case "$need_dash_r" in 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB" ;; esac - AC_SUBST(LCRYPTO, [-lcrypto]) AC_DEFINE(OPENSSL, , [Use OpenSSL?]) AC_CHECK_FUNCS(EVP_md2 EVP_mdc2) fi