Hello,
attached please find a patch with several suggestions.
(I'm not sending it to wget-patches, as I'm not sure all the suggestions
will be welcome.)
1) I removed the AC_DEFINEs of symbols HAVE_GNUTLS, and HAVE_OPENSSL.
AC_LIB_HAVE_LINKFLAGS defines HAVE_LIBGNUTLS and HAVE_LIBSSL, which
can be used instead. wget.h was fixed to expect these symnbols.
(You might think your defines are more aptly named, but they are used
only once, in wget.h.)
2) Was it intentional that --without-ssl doesn't switch off OpenSSL
autodetection? I hope it wasn't.
3) Explicit --with-ssl=gnutls should fail if libgnutls is not found.
If the user explicitely asked for it, we shouldn't silently ignore the
request if we cannot fulfill it.
And likewise with ./configre --with-ssl.
(I know this is not common practice (yet), but I believe it's according
to common sense. This is discussed in the CVS version of Autoconf manual,
you can get it from savannah.)
4) A typo in a comment (a spare dnl).
All these issues are resolved by the combined patch, attached to this mail.
Please cc the replies to me, I'm not subscribed.
Regards,
Stepan Kasal
Index: configure.in
===
--- configure.in(revision 2062)
+++ configure.in(working copy)
@@ -248,15 +248,15 @@
if test x$LIBGNUTLS != x
then
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
-AC_DEFINE([HAVE_GNUTLS], 1,
- [Define if support for the GnuTLS library is being compiled in.])
SSL_OBJ='gnutls.o'
+ else
+AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not available.])
fi
-else
+else if test x$with_ssl != xno; then
dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library
dnl doesn't record its dependency on libdl, so we need to make sure
dnl -ldl ends up in LIBS on systems that have it. Most OSes use
- dnl dlopen(), but HP-UX uses dnl shl_load().
+ dnl dlopen(), but HP-UX uses shl_load().
AC_CHECK_LIB(dl, dlopen, [], [
AC_CHECK_LIB(dl, shl_load)
])
@@ -274,9 +274,10 @@
if test x$LIBSSL != x
then
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
-AC_DEFINE([HAVE_OPENSSL], 1,
- [Define if support for the OpenSSL library is being compiled in.])
SSL_OBJ='openssl.o'
+ else if -n $with_ssl
+ then
+AC_MSG_ERROR([--with-ssl was given, but OpenSSL is not available.])
fi
fi
Index: src/wget.h
===
--- src/wget.h (revision 2062)
+++ src/wget.h (working copy)
@@ -40,7 +40,8 @@
# define NDEBUG
#endif
-#if defined HAVE_OPENSSL || defined HAVE_GNUTLS
+/* Is OpenSSL or GNUTLS available? */
+#if defined HAVE_LIBSSL || defined HAVE_LIBGNUTLS
# define HAVE_SSL
#endif