threads / discuss / 52792

How to force configure script to use curl ?

Subject: How to force configure script to use curl ?

## tl;dr

6 messages between Feb 12, 2020 and Feb 14, 2020.

replies: 5people: 4as markdown or json

Philippe Blain· Feb 12, 2020, 22:08 UTC · lore
Hi,
I was trying to build Git yesterday on a Ubuntu 14 machine that was missing the package "libcurl4-gnutls-dev" necessary to build the http(s) remote helper [1]. 
Doing just
    ./configure 
    make
built Git without support for the http remote helper, as expected. 
However, doing 
    ./configure --with-curl
    make
did the same; it did not result in an error saying that the curl headers could not be found (which I expected). 
Is there a way to force the configure script to error out if it does not find curl (or any one of the optional dependencies that I happen to need for my build?)
Thanks,
Philippe. 

[1] this is one of the package suggested by the progit book : https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

Christian Couder· Feb 13, 2020, 10:07 UTC · re: Philippe Blain · lore

Re: How to force configure script to use curl ?

Hi,

On Wed, Feb 12, 2020 at 11:09 PM Philippe Blain <levraiphilippeblain@gmail.com> wrote:

Show 17 quoted lines
> I was trying to build Git yesterday on a Ubuntu 14 machine that was missing the package "libcurl4-gnutls-dev" necessary to build the http(s) remote helper [1].
>
> Doing just
>
>     ./configure
>     make
>
> built Git without support for the http remote helper, as expected.
>
> However, doing
>
>     ./configure --with-curl
>     make
>
> did the same; it did not result in an error saying that the curl headers could not be found (which I expected).
>
> Is there a way to force the configure script to error out if it does not find curl (or any one of the optional dependencies that I happen to need for my build?)

Using the configure script is not needed. Building Git using just a make command can work.

You might want to try it and see if it fails as you expect when libcurl4-gnutls-dev is not installed.

In the top level Makefile you can see all the variables that can be set to customize the build.

These days the configure infrastructure is not as well maintained as the Makefile.

Best, Christian.

Jeff King· Feb 14, 2020, 06:17 UTC · re: Philippe Blain · lore

Re: How to force configure script to use curl ?

On Wed, Feb 12, 2020 at 05:08:06PM -0500, Philippe Blain wrote:
> Is there a way to force the configure script to error out if it does
> not find curl (or any one of the optional dependencies that I happen
> to need for my build?)

I don't think so. It would probably be possible for configure.ac to behave this way. Looking at the code, I think GIT_PARSE_WITH would have to record the affirmative for "--with" instead of just canceling a previous "--without", and then the part that does curl auto-detection would need to complain if it doesn't find curl at that point.

But our use of autoconf is not very extensive, and in fact most developers do not use it at all. If you know you want curl, you're better off just overriding it explicitly with the Makefile knob:

  make NO_CURL=
or:
  echo NO_CURL= >>config.mak
  make

Either of those will override the NO_CURL setting done by the configure script (you can see the full list of knobs set by configure in config.mak.autogen).

-Peff
Junio C Hamano· Feb 14, 2020, 16:31 UTC · re: Jeff King · lore

Re: How to force configure script to use curl ?

Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> But our use of autoconf is not very extensive, and in fact most
> developers do not use it at all. If you know you want curl, you're
> better off just overriding it explicitly with the Makefile knob:
>
>   make NO_CURL=
>
> or:
>
>   echo NO_CURL= >>config.mak
>   make
>
> Either of those will override the NO_CURL setting done by the configure
> script (you can see the full list of knobs set by configure in
> config.mak.autogen).

Heh, I didn't even know that things were expected to work if you further tweak ./configure generated settings.

You are correct to point out that our use of autoconf is merely is an afterthought ;-), and the list of knobs near the top of Makefile is more authoritative and fresh than what configure.in knows about.

Thanks.
Jeff King· Feb 14, 2020, 16:43 UTC · re: Junio C Hamano · lore

Re: How to force configure script to use curl ?

On Fri, Feb 14, 2020 at 08:31:52AM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> > Either of those will override the NO_CURL setting done by the configure
> > script (you can see the full list of knobs set by configure in
> > config.mak.autogen).
> 
> Heh, I didn't even know that things were expected to work if you
> further tweak ./configure generated settings.

I always assume the order of includes was intentional to provide a priority from low to high:

  - platform defaults in config.mak.uname
  - auto-detected defaults in config.mak.autogen
  - explict user-provided settings in config.mak
  - command-line overrides when you're trying to debug something. ;)

The last one is due to "make" being sensible, but the rest come from our order in the Makefile.

-Peff
Philippe Blain· Feb 14, 2020, 16:49 UTC · re: Jeff King · lore

Re: How to force configure script to use curl ?

Hi Peff,
Thanks for a very sensible suggestion!
Philippe. 
Show 30 quoted lines
> Le 14 févr. 2020 à 01:17, Jeff King <peff@peff.net> a écrit :
> 
>> On Wed, Feb 12, 2020 at 05:08:06PM -0500, Philippe Blain wrote:
>> 
>> Is there a way to force the configure script to error out if it does
>> not find curl (or any one of the optional dependencies that I happen
>> to need for my build?)
> 
> I don't think so. It would probably be possible for configure.ac to
> behave this way. Looking at the code, I think GIT_PARSE_WITH would have
> to record the affirmative for "--with" instead of just canceling a
> previous "--without", and then the part that does curl auto-detection
> would need to complain if it doesn't find curl at that point.
> 
> But our use of autoconf is not very extensive, and in fact most
> developers do not use it at all. If you know you want curl, you're
> better off just overriding it explicitly with the Makefile knob:
> 
>  make NO_CURL=
> 
> or:
> 
>  echo NO_CURL= >>config.mak
>  make
> 
> Either of those will override the NO_CURL setting done by the configure
> script (you can see the full list of knobs set by configure in
> config.mak.autogen).
> 
> -Peff

← back to recent threads