cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: wrong use of AC_ARG_WITH in configure.ac

From: Vincent Torri <vincent.torri_at_gmail.com>
Date: Mon, 14 Mar 2011 10:23:04 +0100

On Mon, Mar 14, 2011 at 9:29 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Mon, 14 Mar 2011, Vincent Torri wrote:
>
> there are a lots of improvements that can be done in the configure.acfile, but first, i would like to mention a wrong use of AC_ARG_WITH for
>> libssh2 path check:
>>
>
> ...
>
> I'm sorry, I don't follow. What's the effect of this problem?
>
> and instead of
>>
>
> ...
>
> use
>>
>
> As far as I understand autoconf (and I don't claim to be an expert on
> this), _with_ is what's usually used when pointing out additional softwares
> while _enable_ is used to just alter the build.
>
> Or did I misunderstand what you suggested?
>

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

--with is intended to provide any value for a package. In case of libssh2,
the prefix. Usually, I use --with if I do not need just a boolean value

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

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

regards

Vincent Torri

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