Subject: Re: BUG (v1.5.6.1): ./configure missing check for zlib.h

From: Jakub Narebski <[email-masked]>
Date: Sat, 28 Jun 2008 01:03:18 +0200

On Fri, 27 Jun 2008, tom fogal wrote:
> Jakub Narebski <[email-masked]> writes:
>> Mircea Bardac <[email-masked]> writes:
>> 
>>> $ ./configure
>> [...]
>>> configure: CHECKS for header files
>>> In file included from daemon.c:1:
>>> cache.h:9:18: error: zlib.h: No such file or directory
>>> make: *** [daemon.o] Error 1
>>> 
>>> (installing zlib1g-dev on Ubuntu 7.10 fixed the problem)
>> 
>> What should ./configure do (what ./configure for other programs
>> or packages do)?
>> 
>> You cannot compile git without zlib!
> 
> If one can determine during configure time that a required library is
> not found, it (IMHO) is nice to give an error message and bomb out (via
> AC_MSG_ERROR).
> 
> The AC macro archive has a zlib macro which does this, as an example:
> 
>    http://autoconf-archive.cryp.to/check_zlib.html
> 
> I should note, however, that I disagree with that macro's logic in that
> it `searches' for zlib if the user does not specify it.  IMO, if the
> user does not give a --with option, and it doesn't work `out of the
> box' (without hacking FLAGS), macros should die with an error rather
> than retry with changed FLAGS.

On Fri, 27 Jun 2008, Mircea Bardac wrote:
>
> Well, as far as I know, if a program depends on any external headers, 
> they should *all* be checked, not only "those that can be skipped by 
> defining some macro" (I personally do not know which are these).

In git (not like usually in other projects) ./configure script (autoconf)
is used *only* to generate Makefile configuration.  It tries to configure
compile (build) process in such a way that building git is possible even
if some features are missing or are found not in standard place (and also
use compat version of functions if they are not in library).  It helps you
build system.

I'm not sure if checking if prerequisites exists and failing loudly
otherwise would be a good feature to have.  Git would fail anyway during
build process, so it is not some new feature.  The only advantage is that
required and unavoidable dependency would be found earlier; on the other
hand there is now disadvantage of build process (./configure process)
if it misdetects lack of needed header files, i.e. it is possible to
compile (build) git, but ./configure detects that it is not so.  This
happened once to me, and is very annoying...

But as they say, "code speaks louder than words"

-- 
Jakub Narebski
Poland