[lsb-discuss] "png_set_tRNS_to_alpha()" of libpng is a valid interface in LSB 3.1/3.2?

Till Kamppeter till.kamppeter at gmail.com
Fri Sep 7 14:37:26 PDT 2007


Hi,

I am trying to make an LSB package of CUPS 1.3, but since some time CUPS
does not build any more in the LSB build environment chroot (I am using
version 3.1.1-2, an RPM alienized by me under Ubuntu Gutsy on i386 (in a
chroot the distro should not have any influence as long as the kernel is
not involved).

On a Ubuntu Feisty amd64 box CUPS 1.3 builds perfectly. That machine
also has version 3.1.1-2 of the LSB build environment chroot.

On both machines /opt/lsb/include/png.h of the chroot does not contain
png_set_tRNS_to_alpha but /usr/include/png.h contains it. If I grep the
library binaries (/opt/lsb/lib*/libpng*.a) for png_set_tRNS_to_alpha,
they all contain it, on both machines.

In the CUPS package I am linking libpng statically (as LSB 3.1 does not
provide libpng).

Here is the error message of building CUPS on Gutsy i386 in the chroot:

------------------------------------------------------------------------

[...]

Compiling image-png.c...
/opt/lsb/bin/lsbcc  -Wshadow -Wunused -Wall -Wno-format-y2k -Os -g
-DOPENSSL_DISABLE_OLD_DES_SUPPORT -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT  -I..  -O2 -g
-march=i486 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE
-D_REENTRANT  -c image-png.c
image-png.c: In function '_cupsImageReadPNG':
image-png.c:147: warning: implicit declaration of function
'png_set_tRNS_to_alpha'

[...]

Linking imagetops...
/opt/lsb/bin/lsbcc -L../cups -L../filter  -O2 -g -march=i486
-L/opt/lsb/lib -ltiff -ljpeg -lpng -lssl -lcrypto -lz -lpthread -lm
-lcrypt  -Wshadow -Wunused -Wall -Wno-format-y2k -Os -g -o imagetops
imagetops.o common.o ../filter/libcupsimage.a \
                 -ltiff -lpng -ljpeg -lz ../cups/libcups.a -lssl
-lcrypto -lpthread
../filter/libcupsimage.a(image-png.o): In function `_cupsImageReadPNG':
/home/till/rpm/BUILD/cups-1.3.0/filter/image-png.c:147: undefined
reference to `png_set_tRNS_to_alpha'
collect2: ld returned 1 exit status
make: *** [imagetops] Error 1

------------------------------------------------------------------------

To work around this I add

LIBPNG='-lpng /opt/lsb/lib/libpng.a'


to the "make" command which leads to the following linking command line:

------------------------------------------------------------------------
Linking imagetops...
/opt/lsb/bin/lsbcc -L../cups -L../filter  -O2 -g -march=i486
-L/opt/lsb/lib -ltiff -ljpeg -lpng -lssl -lcrypto -lz -lpthread -lm
-lcrypt  -Wshadow -Wunused -Wall -Wno-format-y2k -Os -g -o imagetops
imagetops.o common.o ../filter/libcupsimage.a \
                 -ltiff -lpng /opt/lsb/lib/libpng.a -ljpeg -lz 
../cups/libcups.a -lssl
-lcrypto -lpthread
------------------------------------------------------------------------

This way CUPS builds. But now the question is: Which static libpng does 
the simple "-lpng" select? And why must I insert /opt/lsb/lib/libpng.a 
AFTER ../filter/libcupsimage.a? (If I insert it before, I get the error 
again)

Why does it work without workaround on amd64 Feisty but needs the 
workaround for i386 Gutsy? On both machines the chroot is used, and the 
same version of the chroot is used.

    Till



More information about the lsb-discuss mailing list