$NetBSD: patch-aa,v 1.13 2000/11/09 09:18:24 itojun Exp $ --- configure.in.orig Sun Nov 5 18:08:45 2000 +++ configure.in Thu Nov 9 18:03:33 2000 @@ -389,6 +389,7 @@ saved_LIBS="$LIBS" saved_LDFLAGS="$LDFLAGS" saved_CFLAGS="$CFLAGS" +crypto_LIBS="" if test "x$prefix" != "xNONE" ; then tryssldir="$tryssldir $prefix" fi @@ -405,12 +406,25 @@ LDFLAGS="$saved_LDFLAGS" fi - LIBS="$saved_LIBS -lcrypto" - - # Basic test to check for compatible version and correct linking - # *does not* test for RSA - that comes later. - AC_TRY_RUN( - [ + # Some ELF systems can't resolve all the symbols in libcrypto + # if libcrypto was linked against RSAREF, and fail to link the + # test program correctly, even though a correct installation + # of OpenSSL exists. So we test the linking three times in + # case the RSAREF libraries are needed right away. We'll test + # for them explicitly later on. + # + for libcrypto in \ + "-lcrypto" \ + "-lcrypto -lrsaref" \ + "-lcrypto -lRSAglue -lrsaref" + do + LIBS="$saved_LIBS $libcrypto" + + # Basic test to check for compatible version and + # correct linking *does not* test for RSA - that comes + # later. + AC_TRY_RUN( + [ #include #include int main(void) @@ -420,12 +434,14 @@ RAND_add(a, sizeof(a), sizeof(a)); return(RAND_status() <= 0); } - ], - [ - found_crypto=1 - break; - ], [] - ) + ], + [ + found_crypto=1 + crypto_LIBS=$libcrypto + break; + ], [] + ) + done if test ! -z "$found_crypto" ; then break; @@ -455,7 +471,7 @@ blibpath="$blibpath:$ssldir:$ssldir/lib" fi fi -LIBS="$saved_LIBS -lcrypto" +LIBS="$saved_LIBS $crypto_LIBS" # Now test RSA support saved_LIBS="$LIBS"