Re: Building libpng16 from source with zlib v1.2.10

John Bowler <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <CAP7U39_X6gWO241eyLdxB6AGyxWa+5g=E8nENm-wjL7ZZd=4iw@mail.gmail.com>
On Fri, Jan 6, 2017 at 7:59 AM, GLENN PEHRSON <[email protected]> wrote:
> I think you may be misusing zlib_prefix which is just a string that gets
> prefixed to exported symbols.

True, but it never gets used.  This is the relevant pair of lines from
configure.ac:

AC_CHECK_LIB(z, zlibVersion, ,
    AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))

So, regardless of ZPREFIX, the first check is for 'zlibVersion' (no
prefix) in 'libz.a' and, apparently, that succeeds because the one
using ZPREFIX certainly won't.

Notice that using --prefix does not change the search paths (-I or
-L), here's the actual compile line for pngrutil.c:

/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../code     -g -O2 -MT pngrutil.lo -MD -MP -MF $depbase.Tpo -c -o
pngrutil.lo ../code/pngrutil.c &&\
mv -f $depbase.Tpo $depbase.Plo

All --prefix does is change where the stuff gets installed, and
--prefix=/usr/local is the default.  To control where the include
files are it is necessary to set CPPFLAGS and to control where the
libraries are it is necessary to set LDFLAGS.  It is necessary to get
them both correct.

John Bowler

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.