From 1cba1a7659719535800d4fd53d689c9e758babdc Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 4 Apr 2011 00:13:53 +0200 Subject: [PATCH] Fix openssl detection under Windows. --- ChangeLog | 4 ++++ configure.ac | 27 ++++++++------------------- src/ChangeLog | 4 ++++ src/Makefile.am | 2 +- tests/ChangeLog | 4 ++++ tests/Makefile.am | 2 +- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27e1d068..70894d43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-04-04 Giuseppe Scrivano + + * configure.ac: Use AC_CHECK_LIB to look for the openssl library. + 2011-04-03 Giuseppe Scrivano * bootstrap.conf (gnulib_modules): Add `fcntl'. diff --git a/configure.ac b/configure.ac index 205b6533..e16f2cb3 100644 --- a/configure.ac +++ b/configure.ac @@ -223,11 +223,12 @@ WGET_NSL_SOCKET dnl Deal with specific hosts case $host_os in *mingw32* ) - AC_SUBST(W32LIBS, '-lws2_32 -lgdi32') + LIBS+='-lws2_32 -lgdi32' AC_LIBOBJ([mswindows]) ;; esac + dnl dnl Checks for libraries. dnl @@ -241,29 +242,17 @@ AS_IF([test x"$with_ssl" = xopenssl], [ AC_CHECK_LIB(dl, shl_load) ]) - dnl Now actually check for -lssl - AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [ - #include - #include - #include - #include - #include - #include - #include - ], [SSL_library_init ()]) - if test x"$LIBSSL" != x - then - AC_MSG_NOTICE([compiling in support for SSL via OpenSSL]) - AC_LIBOBJ([openssl]) - elif test x"$with_ssl" != x - then - AC_MSG_ERROR([--with-ssl=openssl was given, but SSL is not available.]) - fi + AC_CHECK_LIB(z, compress) + AC_CHECK_LIB(crypto, EVP_MD_CTX_init) + AC_CHECK_LIB(ssl, ERR_func_error_string,, + AC_MSG_ERROR([openssl development libraries not found])) + AC_LIBOBJ([openssl]) ], [ # --with-ssl is not gnutls: check if it's no AS_IF([test x"$with_ssl" != xno], [ dnl Now actually check for -lssl + AC_CHECK_LIB(z, compress) AC_CHECK_LIB(gpg-error, gpg_err_init) AC_CHECK_LIB(gcrypt, gcry_control) AC_CHECK_LIB(gnutls, main) diff --git a/src/ChangeLog b/src/ChangeLog index 4c0ff9cd..5186f0c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-04-04 Giuseppe Scrivano + + * Makefile.am (LIBS): Remove @LIBSSL@ @W32LIBS@ + 2011-04-03 Giuseppe Scrivano * gnutls.c: Include . diff --git a/src/Makefile.am b/src/Makefile.am index ba429b1d..6a3e9947 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -37,7 +37,7 @@ endif # The following line is losing on some versions of make! DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\" -LIBS = @LIBSSL@ @LIBICONV@ @LIBINTL@ @LIBS@ @W32LIBS@ +LIBS = @LIBICONV@ @LIBINTL@ @LIBS@ bin_PROGRAMS = wget wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c \ diff --git a/tests/ChangeLog b/tests/ChangeLog index 23455664..9c853164 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2011-04-04 Giuseppe Scrivano + + * Makefile.am (LIBS): Remove @LIBSSL@ @W32LIBS@ + 2010-10-23 Giuseppe Scrivano * Makefile.am (LIBS): Remove @LIBGNUTLS@ and use @W32LIBS@ as last diff --git a/tests/Makefile.am b/tests/Makefile.am index 2bd27f34..c27e3903 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,7 +34,7 @@ PERL = perl PERLRUN = $(PERL) -I$(srcdir) -LIBS = @LIBSSL@ @LIBICONV@ @LIBINTL@ @LIBS@ @W32LIBS@ +LIBS = @LIBICONV@ @LIBINTL@ @LIBS@ .PHONY: test run-unit-tests run-px-tests