Subject: pkgsrc/archivers/dar: configure fails to find zlib.h
To: None <tech-pkg@netbsd.org>
From: Georg Schwarz <geos@epost.de>
List: tech-pkg
Date: 01/18/2004 17:36:14
When doing a bmake configure in pkgsrc/archivers/dar it fails to find
zlib.h. Here is the respective part from config.log:

configure:19184: checking zlib.h usability
configure:19197: /usr/bin/cc -c -O2   conftest.cc >&5
cfe: Error: configure: 19246: Cannot open file zlib.h for #include
configure:19200: $? = 1
configure: failed program was:
...

No wonder the test fails as it does not use -I${LOCALBASE}/include

pkgsrc calls configure as follows (${LOCALBASE} being /usr/local/pkg in
my case, the platform being IRIX 5.3):

./configure --disable-nodump-flag --disable-dar-static --enable-examples
--host=mips-sgi-irix5.3 --prefix=/usr/local/pkg
--x-includes=/usr/local/pkg/X11R6/include
--x-libraries=/usr/local/pkg/X11R6/lib 

I am not sure what is the pkgsrc or GNU configure policy on making
${LOCALBASE}/include known to the compiler, whether it is done with
CFLAGS, CPPFLAGS, or whatever way? (is there a good document on that
"philosophy"?)
Should dar's configure use -I${includedir} for the test (as well as for
later compilation), which defaults to ${prefix}/include? What's the
"policy" with GNU configures to that respect?
Should it simply add -I${includedir} to CPPFLAGS or CFLAGS?

-L${LOCALBASE}/lib, BTW, is already part of the LDFLAGS fed to configure
by pkgsrc.

As a further, unrelated, problem, configure checks for inttypes.h. On
IRIX 5.3 at least it seems to be a no-no to include both intypes.h and
sys/types.h (due to dual declarations that result).
One can get around this by using --enable-os-bits=32 (or 64 on a 64 bit
system, if they need it).

As a workaround (maybe a solution?) I added the following lines to
pkgsrc/archivers/dar/Makefile:

.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "IRIX"
CONFIGURE_ARGS+=        --enable-os-bits=${ABI}
.endif
CPPFLAGS+=      -I${LOCALBASE}/include

This gets me around the two aforementioned problems, but nevertheless
configure still later fails since IRIX 5.3 does not have fnmatch.h, nor
does pkgsrc provide for it.
  
 
-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 geos@epost.de     +49 177 8811442