On 12/03/2013 05:47 PM, Paul Eggert wrote: > On 12/03/2013 05:45 AM, Pádraig Brady wrote: >> I'll probably do this in coreutils configure.ac before gl_INIT, >> so as to at least set the default as coreutils wants and caters for, >> and allowing users to --without-openssl if they want. >> >> dnl Enable use of libcrypto by default >> AS_VAR_SET_IF([with_openssl], [], [with_openssl=maybe]) > > OK, but this means that the configure --help output is still wrong, since it > says the default is 'no'?
Yes, this is a limitation when we cant to have a different default than gnulib. I guess autoconf might be improved in future to allow overriding settings, but for now I'm ok to live with this limitation for coreutils. >> Hmm, I don't think the above mentioned fail if not available? >> I'm using "maybe" above anyway, so that "yes" may be >> treated like this in future. > > Perhaps I'm reading too much into the standards, but that's how > --with-jpeg etc. behave in GNU Emacs 'configure'. Well I agree, that's how I expect --with options to work generally. Making the existing gnulib --with options consistent in this regard might be awkward due to backwards compat though. So to have --with-openssl[=yes] fail without libcrypto we'd have something along the lines of: diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4 index f6c55b2..0396988 100644 --- a/m4/gl-openssl.m4 +++ b/m4/gl-openssl.m4 @@ -8,7 +8,8 @@ AC_DEFUN([gl_CRYPTO_CHECK], [ AC_ARG_WITH([openssl], [AS_HELP_STRING([--with-openssl], - [use libcrypto hash routines if available: default=no])], + [use libcrypto hash routines. Valid options are: + 'yes' => required, 'optional' => use if available, 'no' (default)])], [], [with_openssl=no]) @@ -26,9 +27,12 @@ AC_DEFUN([gl_CRYPTO_CHECK], [LIB_CRYPTO='-lcrypto' AC_DEFINE([HAVE_OPENSSL_$1],[1], [Define to 1 if libcrypto is used for $1])])]) - if test "x$with_openssl" = xyes; then - if test "x$LIB_CRYPTO" = x; then + if test "x$LIB_CRYPTO" = x; then + if test "x$with_openssl" = xyes; then + AC_MSG_ERROR([openssl development library not found for $1]) + else AC_MSG_WARN([openssl development library not found for $1]) + AC_MSG_WARN([AC_PACKAGE_NAME will be built without libcrypto]) fi fi fi