Operating System - HP-UX
1823084 Members
3302 Online
109646 Solutions
New Discussion юеВ

libpng configure can't find zlib

 
Matt Hearn
Regular Advisor

libpng configure can't find zlib

Hey guys, I'm trying to compile PHP (the HP-supplied "HPWS" version sadly doesn't include Sybase modules, as far as I can tell) on an 11.11 D310 (our test server for this environment). Seeing as all the dependencies available are PA-RISC 2.0, I'm having to compile everything from scratch. Argh.

I've successfully compiled gnu make, zlib, and some other stuff, but now when I try and configure libpng (a PHP dependency) I get:

checking for zlibVersion in -lz... no
configure: error: zlib not installed

It is most definitely installed. I've even tried specifying the location of the headers and libraries:

./configure --libdir=/usr/local/lib/ --includedir=/usr/local/include/

No dice. It actually doesn't even look like it's getting to a point where it looks for headers; it seems like it's trying to run "zlibVersion()" and can't. A little googling seems to indicate I might have to get zlib-dev or zlib1g-dev, neither of which I can find in source form; they only seem to be available as Linux RPMs.

Anybody have any ideas? I'm completely stuck.
5 REPLIES 5
Aashique
Honored Contributor

Re: libpng configure can't find zlib

Hi,
Use this option

--with-zlib or
--with-zlib=/path-of-zlib

Thanks & Regards

Aashique
Matt Hearn
Regular Advisor

Re: libpng configure can't find zlib

No dice, same result. I also tried --with-zlib-dir=DIR, that didn't do it either. I don't think it's having trouble finding the headers and libraries; I don't think it's getting to that point, because it's failing to run zlibVersion().
Matti_Kurkela
Honored Contributor

Re: libpng configure can't find zlib

In order to run "zlibVersion()", the configure script must compile and run a small C program to do that. So it needs both the header and the actual library to do that.

The configure options --libdir and --includedir are not telling configure where the existing libraries and headers are located; they're telling where the build process is supposed to put the headers and libraries of the package you're going to build.

Read the INSTALL document file of the libpng package: at least in the source code package of libpng 1.2.26, it has very clear instructions on how to place the zlib package so that the libpng compilation process can find it. The procedure is simple but not quite what you'd expect.

Whenever you have problems with a configure script, examine the config.log file to find out exactly what the script did and how it failed.

zlib-dev and zlib1g-dev of the Linux world are various names for a package containing the header file(s) for zlib. Most Linux distributions split any given source-distributed library package into at least two RPMs (or equivalents) when packaging it for distribution: the first contains the actual library and anything needed to run _pre-compiled_ applications using that library. The second RPM, usually with a "-dev" or "-devel" in its name, contains the header files and anything else required in _compiling_ programs with that library.

Many beginning and intermediate Linux users can nowadays fulfill their computing needs without ever touching a compiler. So it makes sense to package the "compiler stuff" separately, so these users can avoid installing it altogether.

MK
MK
Steven Schweda
Honored Contributor

Re: libpng configure can't find zlib

I didn't think that it was with libpng, but I
did recently run into an interesting quirk
with some stuff which expected the zlib
library to be a shared object/library, not
the default static (".a") library.

As it says in zlib's "configure" script:
[...]
# To create a shared library, use "configure --shared"; by default a static
# library is created. [...]

It's pretty easy to try, anyway.

You'd need to look more closely at the
"configure" script here to see exactly what
it's doing, if you really want to know why it
complains as it does. If it's trying to make
a shared object/library linked with the zlib
stuff, then the zlib thing must also be a
shared thing (or so I gather).

Hmmm. I might have hit the problem with some
other package, and made the shared zlib
library before I got to libpng. My notes are
not good enough to say.
Steven Schweda
Honored Contributor

Re: libpng configure can't find zlib

By the way, I did get libpng built (including
the ".sl"'s), and I'd bet that I didn't need
to specify any of that --libdir or
--includedir stuff. (The default
/usr/local/whatever worked just fine.)