cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: wrong use of AC_ARG_WITH in configure.ac

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 14 Mar 2011 10:54:49 +0100 (CET)

On Mon, 14 Mar 2011, Vincent Torri wrote:

> My understood of the macros above is:
>
> --enable is intended to provide a variable with 2 values (but is not limited
> to 2 values). Quoting autoconf doc, it should be used "If a software package
> has optional compile-time features". It's imo the case here. libssh2 is
> optional. If the user want to decide whether to use that option or not, it's
> --enable that should be used. Usually, I use --enable if I need a boolean
> value (yes/no).

I don't think the autoconf manual agrees with that description and in fact the
difference between "with" and "enable" is mostly academic and I will not
change the current use unless you point out specific flaws with it that makes
it not work. We're a project used by many and lots of scripts are already made
to run our configure script, so changing options is not something we do
lightly since we know it'll cause annoyances.

The manual clearly documents "--with-package" to be about "External Software":

    http://www.gnu.org/software/autoconf/manual/autoconf.html#External-Software

... while "--enable-feature" is about optional compile-time features:

    http://www.gnu.org/software/autoconf/manual/autoconf.html#Package-Options

Picking one of these two, I think the libssh2 usage is more of the first than
the second.

> Of course, one can use them as one wants, it's just a matter of taste.

Sure, but also a matter of what other autoconf users usually do to minimize
surprises.

> Anyway, the behavior of the current libssh2 option is not what is described
> in the help : /usr/local is not a default value. It's the same for gnutls
> iirc (i'm at work right now, i can't check)

I agree that it is a faulty claim so it should be removed. I found several
such bad claims in AC_ARG_WITH and I cleaned them up a bit just now.

> I can send a patch, but actually, when looking at the configure.ac file, I
> want to rewrite it completely :) (what i did for libopenjpeg and other
> libraries, btw :) ). It's working for now so maybe just fixing that default
> value bug should be sufficient.

You should be aware that I don't like rewrites. I like iterative developments
done in incremental steps.

Our configure script may not be a very fun read (and parts of it would indeed
benefit from some love), but it is the outcome of some 13 years of development
and the changes we have in there are the collected experiences from that.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-14