Re: A suggestion for configure.in

2005-08-26 Thread Stepan Kasal
Hello,

On Fri, Aug 26, 2005 at 02:07:16PM +0200, Hrvoje Niksic wrote:
 I've applied a slightly modified version of this patch, thanks.
 [...]  I used elif instead.

thank you, also for correcting my mistake.

Actually, I wasn't aware about the fact that shell elif is portable.
(I checked, and it appears in autoconf source several times, so it really
is portable.)

Thank you.

Stepan


Re: A suggestion for configure.in

2005-08-24 Thread Hrvoje Niksic
Stepan Kasal [EMAIL PROTECTED] writes:

 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.)

You're right.  While I do prefer the old names, it's not that big a
deal and it doesn't make sense to needlessly duplicate the defines.

 2) Was it intentional that --without-ssl doesn't switch off OpenSSL
 autodetection?  I hope it wasn't.

Definitely not.

 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.

Agreed.

 (I know this is not common practice (yet), but I believe it's
 according to common sense.

Wget 1.10 did this.  The feature got lost when moving to
AC_LIB_HAVE_LINKFLAGS.


A suggestion for configure.in

2005-08-23 Thread Stepan Kasal
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