BUG (v1.5.6.1): ./configure missing check for zlib.h
$ ./configure configure: CHECKS for programs checking for cc... cc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ANSI C... none needed checking for gar... no checking for ar... ar checking for gtar... no checking for tar... tar checking for asciidoc... no configure: CHECKS for libraries checking for SHA1_Init in -lcrypto... no checking for SHA1_Init in -lssl... no checking for curl_global_init in -lcurl... no checking for XML_ParserCreate in -lexpat... no checking for iconv in -lc... yes checking for deflateBound in -lz... no checking for socket in -lc... yes configure: CHECKS for header files checking how to run the C preprocessor... cc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking for old iconv()... no configure: CHECKS for typedefs, structures, and compiler characteristics checking for struct dirent.d_ino... yes checking for struct dirent.d_type... yes checking for struct sockaddr_storage... yes checking for struct addrinfo... yes checking for getaddrinfo... yes checking whether formatted IO functions support C99 size specifiers... yes checking whether system succeeds to read fopen'ed directory... no checking whether snprintf() and/or vsnprintf() return bogus value... no configure: CHECKS for library functions checking for strcasestr... yes checking for memmem... yes checking for strlcpy... no checking for strtoumax... yes checking for setenv... yes checking for unsetenv... yes checking for mkdtemp... yes configure: CHECKS for site configuration configure: creating ./config.status config.status: creating config.mak.autogen
$ make
GIT_VERSION = 1.5.6.1
* new build flags or prefix
CC daemon.o
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)
--
Mircea
http://mircea.bardac.net
Quoted 1 line · Mircea Bardac
$ ./configure
[...]
Quoted 1 line
configure: CHECKS for header files
Here ./configure check for existence of heder files, but only those that can be skipped by defining some macro...
Quoted 1 line
configure: CHECKS for site configuration
...and here is check for --with-zlib=<path to zlib>
Quoted 11 lines
configure: creating ./config.status
config.status: creating config.mak.autogen$ make GIT_VERSION = 1.5.6.1 * new build flags or prefix CC daemon.o In file included from daemon.c:1: cache.h:9:18: error: zlib.h: No such file or directory make: *** [daemon.o] Error 1
Quoted 1 line
(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!
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
Quoted 9 lines · Jakub Narebski
Quoted 1 line · Mircea Bardac
$ ./configure[...]
Quoted 5 lines
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
Quoted 4 lines
Quoted 1 line
(installing zlib1g-dev on Ubuntu 7.10 fixed the problem)
What should ./configure do (what ./configure for other programs or packages do)?
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.
-tom
Quoted 30 lines · tom fogal
Quoted 9 lines · Jakub Narebski
Quoted 1 line · Mircea Bardac
$ ./configure[...]
Quoted 5 lines
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 1Quoted 6 lines
Quoted 1 line
(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 workout of the box' (without hacking FLAGS), macros should die with an error rather than retry with changed FLAGS.
Quoted 4 lines · Mircea Bardac
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"
Signature · 2 lines
Jakub Narebski Poland
Quoted 7 lines · tom fogal
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 workout of the box' (without hacking FLAGS), macros should die with an error rather than retry with changed FLAGS.-tom
Or, one could read the INSTALL file included with git,
- Git is reasonably self-sufficient, but does depend on a few external programs and libraries:
- "zlib", the compression library. Git won't build without it.
Signature · 3 lines
Ian Hilt Ian.Hilt (at) gmx.com GnuPG key: 0x4AFC1EE3
Quoted 9 lines · Jakub Narebski
Quoted 1 line · Mircea Bardac
$ ./configure[...]
Quoted 1 line
configure: CHECKS for header files
Here ./configure check for existence of heder files, but only those that can be skipped by defining some macro...
Quoted 8 lines
[...]
Quoted 2 lines
(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!
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).
Mircea