Link SSL with libyaz.la and yaz-client only.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 4 Jun 2008 09:02:16 +0000 (11:02 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 4 Jun 2008 09:02:16 +0000 (11:02 +0200)
client/Makefile.am
configure.ac
debian/control
src/Makefile.am
util/Makefile.am

index 680c289..5b84102 100644 (file)
@@ -11,7 +11,7 @@ yaz_client_SOURCES=client.c $(COMMON)
 
 AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS)
 
-yaz_client_LDADD = ../src/libyaz.la $(READLINE_LIBS) 
+yaz_client_LDADD = ../src/libyaz.la $(SSL_LIBS) $(READLINE_LIBS) 
 bertorture_LDADD = ../src/libyaz.la 
 
 bertorture_SOURCES=bertorture.c
index 917a122..6d2b5b7 100644 (file)
@@ -58,6 +58,7 @@ AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
 dnl
 dnl ------ OpenSSL
 AC_SUBST([SSL_CFLAGS])
+AC_SUBST([SSL_LIBS])
 openssl=default
 AC_ARG_WITH([openssl], [  --with-openssl[=PREFIX]   OpenSSL library in PREFIX], [openssl=$withval])
 SSL_CFLAGS=""
@@ -68,7 +69,7 @@ if test "$openssl" != "no"; then
        if test -x $openssl/bin/pkg-config; then
            if $openssl/bin/pkg-config --exists openssl; then
                SSL_CFLAGS=`$openssl/bin/pkg-config --cflags openssl`
-               LIBS="$LIBS `$openssl/bin/pkg-config --libs openssl`"
+               SSL_LIBS="`$openssl/bin/pkg-config --libs openssl`"
                sslver=`$openssl/bin/pkg-config --modversion openssl`
            fi
        fi
@@ -80,7 +81,7 @@ if test "$openssl" != "no"; then
        if test "$pkgconfigpath" != "NONE"; then
            if $pkgconfigpath --exists openssl; then
                SSL_CFLAGS=`$pkgconfigpath --cflags openssl`
-               LIBS="$LIBS `$pkgconfigpath --libs openssl`"
+               SSL_LIBS="`$pkgconfigpath --libs openssl`"
                sslver=`$pkgconfigpath --modversion openssl`
            fi
        fi
@@ -91,16 +92,21 @@ if test "$openssl" != "no"; then
     if test "$sslver" = "no"; then
        xLIBS="$LIBS";
        xCPPFLAGS="$CPPFLAGS";
-       CPPFLAGS="$CPPFLAGS $SSL_CFLAGS $SSL_LIBPATH"
+       CPPFLAGS="$CPPFLAGS ${SSL_CFLAGS} ${SSL_LIBPATH}"
+       SSL_LIBS="${SSL_LIBPATH}"
        AC_CHECK_LIB([crypto],[main])
+       if test "$ac_cv_lib_crypto_main" = "yes"; then
+           SSL_LIBS="${SSL_LIBS} -lcrypto"
+       fi
        AC_CHECK_LIB([ssl],[SSL_new])
        if test "$ac_cv_lib_ssl_SSL_new" = "yes"; then
            AC_CHECK_HEADER([openssl/ssl.h],[sslver=yes])
-           LIBS="$SSL_LIBPATH $LIBS"
+           SSL_LIBS="${SSL_LIBS} -lssl"
        fi
        if test "$sslver" != "yes"; then
-           LIBS="$xLIBS"
+           SSL_LIBS=""
        fi
+        LIBS="$xLIBS"
        CPPFLAGS="$xCPPFLAGS"
     fi
     AC_MSG_CHECKING([for SSL])
index 7d1c5b1..ed772d7 100644 (file)
@@ -37,7 +37,7 @@ Description: The YAZ Z39.50 toolkit (documentation)
  This packages includes HTML documentation for YAZ.
 
 Package: libyaz3-dev
-Depends: libyaz3 (= ${Source-Version}), libxslt1-dev, libwrap0-dev, libssl-dev, libicu36-dev|libicu38-dev, tcl8.3|tclsh
+Depends: libyaz3 (= ${Source-Version}), libxslt1-dev, libwrap0-dev, libicu36-dev|libicu38-dev, tcl8.3|tclsh
 Replaces: yaz-devel
 Conflicts: yaz-devel, libyaz-dev, libyaz2-dev
 Section: libdevel
index 90bce9e..1e79c0e 100644 (file)
@@ -26,6 +26,7 @@ YAZCOMP_Z = $(YAZCOMP) -d $(srcdir)/z.tcl -i yaz -I$(top_srcdir)/include
 YAZCOMP_I = $(YAZCOMP) -d $(srcdir)/ill.tcl -i yaz -I$(top_srcdir)/include
 
 AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS) 
+libyaz_la_LIBADD = $(SSL_LIBS)
 libyaz_server_la_CFLAGS = $(PTHREAD_CFLAGS)
 libyaz_server_la_LIBADD = libyaz.la
 libyaz_icu_la_CPPFLAGS = $(AM_CPPFLAGS) $(ICU_CPPFLAGS)
index ddfa3de..b4dbd54 100644 (file)
@@ -40,7 +40,7 @@ yaz_xmlquery_SOURCES = yaz-xmlquery.c
 yaz_xmlquery_LDADD = ../src/libyaz.la
 
 yaz_illclient_SOURCES = yaz-illclient.c
-yaz_illclient_LDADD = ../src/libyaz.la $(READLINE_LIBS)
+yaz_illclient_LDADD = ../src/libyaz.la
 
 yaz_icu_SOURCES = yaz-icu.c
 yaz_icu_LDADD =../src/libyaz_icu.la $(ICU_LIBS)