We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1321 - SDL_image's configure script fails to detect libpng if –build argument is specified
Summary: SDL_image's configure script fails to detect libpng if –build argument is spe...
Status: WAITING
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.10
Hardware: x86 Mac OS X 10.6
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-27 11:08 UTC by alain.laferriere
Modified: 2013-06-03 01:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alain.laferriere 2011-10-27 11:08:25 UTC
NOTE: This is using the latest version of SDL_image (1.2.11) from Mercurial.

The configure script for SDL_image fails to detect libpng if a –build argument is specified for i386.

Repro Steps:

- get libpng-1.5.5.tar.gz from http://www.libpng.org/pub/png/libpng.html

- compile libpng from i386

	open console window and cd to libpng source folder
	./configure –build=i386-apple-darwin10.8.0
	make CFLAGS="-arch i386" LDFLAGS="-arch i386"
	make install
	lipo –info /usr/local/lib/libpng.dylib
	Non-fat file: /usr/local/lib/libpng.dylib is architecture: i386

- then, configure SDL_image

	cd _SDL_image_1.2.11
	./configure –build=i386-apple-darwin10 –disable-sdltest

> BUG: 

	configure: WARNING: *** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)
	configure: WARNING: PNG image loading disabled

However, if you compile libpng without the –build argument (i.e. building for x86_64) :

	./configure
	make
	make install

And then invoke SDL_image's configure script without the –build argument, then the libpng library is found:

	./configure –disable-sdltest

The work-around is to invoke SDL_image's configure script *with* the i386 build argument, and then modify the Makefile to add the missing info to the DEFS entry:

	-DLOAD_PNG=1
	-DLOAD_PNG_DYNAMIC="\libpng.dylib\"

I hope this helps!

Regards,
Alain
Comment 1 Sam Lantinga 2013-06-03 01:35:34 UTC
This is probably a general problem with all dependency library detection.  Please let me know if you find a fix!