Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51972 - DevIL throws exception with usual png compression due to incompatibility between configure.in and libpng3. (configure.in.patch provided)
Summary: DevIL throws exception with usual png compression due to incompatibility betw...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2004-05-25 00:03 UTC by Marc De Falco
Modified: 2004-05-31 12:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch replacement (1.6.6-configure.in.patch,7.34 KB, patch)
2004-05-25 00:04 UTC, Marc De Falco
Details | Diff
config.log before the patch (config.log,35.12 KB, text/plain)
2004-05-26 23:12 UTC, Marc De Falco
Details
config.log after the patch (config.log,35.18 KB, text/plain)
2004-05-26 23:13 UTC, Marc De Falco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc De Falco 2004-05-25 00:03:16 UTC
When trying to use devil, as in ogre for example, pngs files are not loaded, there's a decode exception. As stated in the FAQ of ogre, a simple fix to the configure.in can change this.
Taken from the ogre faq :
This is caused by an incompatibility between DevIL and libpng3. Alter the DevIL configure.in and change the line:

AC_CHECK_LIB(png, png_start_read_image, LIBPNG="-lpng", LIBPNG="", )

to:

AC_CHECK_LIB(png, png_start_read_image, LIBPNG="-lpng", LIBPNG="", -lm -lz) 

Reproducible: Always
Steps to Reproduce:
1. emerge devil ogre
2. run an ogre sample program
3.

Actual Results:  
The Ogre.log probably shows:
Error #: 0
Function: invalid enumerant Description:
IL Error.
File: OgrePNGCodec.cpp
Line: 80
Stack unwinding: PNGCodec::decode(..) <- Image::load(..) <- <<beginning of stack


Expected Results:  
It should have loaded the png...
Comment 1 Marc De Falco 2004-05-25 00:04:16 UTC
Created attachment 31982 [details, diff]
patch replacement
Comment 2 SpanKY gentoo-dev 2004-05-26 19:19:21 UTC
what does `ldd /usr/lib/libpng.so` so ?

this used to be a problem with older libpngs which didnt list libm and libz in the linker information but the newer libpngs pull in libm and libz automagically
Comment 3 Marc De Falco 2004-05-26 23:12:42 UTC
Created attachment 32124 [details]
config.log before the patch

You can clearly see :
configure:10989: checking for png_start_read_image in -lpng
configure:11019: gcc -o conftest -g -O2  -I/usr/X11R6/include  conftest.c -lpng
  >&5
configure:11025: $? = 0
There's no -lz -lm
Comment 4 Marc De Falco 2004-05-26 23:13:36 UTC
Created attachment 32125 [details]
config.log after the patch

You can clearly see :
configure:11178: checking for png_start_read_image in -lpng
configure:11208: gcc -o conftest -g -O2  -I/usr/X11R6/include  conftest.c -lpng
-lm -lz  >&5
configure:11214: $? = 0
Now there's the extra -lm -lz...
Comment 5 SpanKY gentoo-dev 2004-05-29 23:53:11 UTC
updated the patch to run `sdl-config --libs` instead of hardcoding -lz -lm

also noticed a few other configure bugs and fixed them with the update

thanks for the info ... update to 1.6.6-r2
Comment 6 SpanKY gentoo-dev 2004-05-31 12:54:39 UTC
i guess nobody ever bothered talking to the devil developers about fixing the configure.in logic ... i e-mailed them and they've fixed it in cvs ... should be in 1.6.7 :)