Fix SSL -L -lssl order
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 13 May 2004 10:07:14 +0000 (10:07 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 13 May 2004 10:07:14 +0000 (10:07 +0000)
configure.in

index ac06478..3c6bb56 100644 (file)
@@ -1,6 +1,6 @@
 dnl YAZ Toolkit, Index Data 1994-2004
 dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.141 2004-05-10 11:24:59 adam Exp $
+dnl $Id: configure.in,v 1.142 2004-05-13 10:07:14 adam Exp $
 AC_INIT(include/yaz/yaz-version.h)
 AM_INIT_AUTOMAKE(yaz, 2.0.20)
 AM_MAINTAINER_MODE
@@ -37,50 +37,47 @@ openssl=no
 AC_ARG_WITH(openssl, [  --with-openssl[=PREFIX] OpenSSL library in PREFIX], [openssl=$withval])
 USE_SSL=0
 SSL_CFLAGS=""
-SSL_LIBS=""
+SSL_PATH=""
 if test "$openssl" != "no"; then
        sslver=no
        if test "$openssl" != "yes"; then
                if $openssl/bin/pkg-config --exists openssl; then
                        SSL_CFLAGS=`$openssl/bin/pkg-config --cflags openssl`
-                       SSL_LIBS=`$openssl/bin/pkg-config --libs openssl`
+                       LIBS="$LIBS `$openssl/bin/pkg-config --libs openssl`"
                        sslver=`$openssl/bin/pkg-config --modversion openssl`
                else
                        SSL_CFLAGS="-I$openssl/include -I$openssl/include/openssl"
-                       SSL_LIBS="-L$openssl/lib"
+                       SSL_LIBPATH="-L$openssl/lib"
                fi
        else
                if test "$pkgconfig" != "NONE"; then
                        if $pkgconfig --exists openssl; then
                                SSL_CFLAGS=`$pkgconfig --cflags openssl`
-                               SSL_LIBS=`$pkgconfig --libs openssl`
+                               LIBS="$LIBS `$pkgconfig --libs openssl`"
                                sslver=`$pkgconfig --modversion openssl`
                        fi
                fi
                if test "$sslver" = "no"; then
                        SSL_CFLAGS="-I/usr/include/openssl"
-                       SSL_LIBS=""
+                       SSL_LIBPATH=""
                fi
        fi
        if test "$sslver" = "no"; then
                xLIBS="$LIBS";
                xCFLAGS="$CFLAGS";
                CFLAGS="$CFLAGS $SSL_CFLAGS"
-               LIBS="$SSL_LIBS $LIBS"
-               AC_CHECK_LIB(crypto, main,[SSL_LIBS="$SSL_LIBS -lcrypto"])
-               LIBS="$LIBS $SSL_LIBS"
+               LIBS="$SSL_LIBPATH $LIBS"
+               AC_CHECK_LIB(crypto, main)
                AC_CHECK_LIB(ssl, SSL_new)
                if test "$ac_cv_lib_ssl_SSL_new" = "yes"; then
                        AC_CHECK_HEADER(openssl/ssl.h,[sslver=yes])
                fi
-               if test "$sslver" = "yes"; then
-                       SSL_LIBS="-lssl $SSL_LIBS"
+               if test "$sslver" != "yes"; then
+                       LIBS="$xLIBS"
                fi
-               LIBS="$xLIBS"
                CFLAGS="$xCFLAGS"
        fi
        if test "$sslver" != "no"; then
-               LIBS="$SSL_LIBS $LIBS"
                CFLAGS="$CFLAGS -DHAVE_OPENSSL_SSL_H=1 $SSL_CFLAGS"
                USE_SSL=1
        fi