From 1f41a1d415d2ab138050a96020ed39caa0c4e323 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 4 Jun 2008 11:02:16 +0200 Subject: [PATCH] Link SSL with libyaz.la and yaz-client only. --- client/Makefile.am | 2 +- configure.ac | 16 +++++++++++----- debian/control | 2 +- src/Makefile.am | 1 + util/Makefile.am | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index 680c289..5b84102 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 917a122..6d2b5b7 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/debian/control b/debian/control index 7d1c5b1..ed772d7 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index 90bce9e..1e79c0e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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) diff --git a/util/Makefile.am b/util/Makefile.am index ddfa3de..b4dbd54 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -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) -- 1.7.10.4