changeset 421:f18f07d8a731

Fix building with libpng.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 03 Nov 2012 07:54:23 +0200
parents 8d15443ce209
children 066d93830743
files Makefile Makefile.gen config.mak.in
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat Nov 03 07:54:13 2012 +0200
+++ b/Makefile	Sat Nov 03 07:54:23 2012 +0200
@@ -7,8 +7,8 @@
 TREMOR_CFLAGS=-I/usr/local/lib/
 TREMOR_LDFLAGS=/usr/local/lib/libvorbisidec.a /usr/lib/i386-linux-gnu/libogg.a
 
-LIBPNG_CFLAGS=`pkg-config --cflags libpng` -DHAVE_LIBPNG
-LIBPNG_CFLAGS=`pkg-config --libs libpng`
+LIBPNG_CFLAGS=`pkg-config --cflags libpng`
+LIBPNG_LDFLAGS=`pkg-config --libs libpng`
 
 RANLIB=ranlib
 
--- a/Makefile.gen	Sat Nov 03 07:54:13 2012 +0200
+++ b/Makefile.gen	Sat Nov 03 07:54:23 2012 +0200
@@ -218,6 +218,10 @@
 endif
 
 
+ifeq ($(DM_USE_LIBPNG),yes)
+DM_CFLAGS += -DDM_USE_LIBPNG $(LIBPNG_CFLAGS)
+endif
+
 ###
 ### Rest of the rules
 ###
@@ -380,7 +384,7 @@
 
 $(BINPATH)gfxconv$(EXEEXT): $(OBJPATH)gfxconv.o $(DMLIB_A)
 	@echo " LINK $+"
-	@$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(LIBPNG_CFLAGS) $(LIBPNG_LDFLAGS)
+	@$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(LIBPNG_LDFLAGS)
 
 $(BINPATH)view64$(EXEEXT): $(OBJPATH)view64.o $(DMLIB_A)
 	@echo " LINK $+"
--- a/config.mak.in	Sat Nov 03 07:54:13 2012 +0200
+++ b/config.mak.in	Sat Nov 03 07:54:23 2012 +0200
@@ -3,6 +3,11 @@
 DM_BUILD_TESTS=yes
 DM_BUILD_TOOLS=yes
 
+# Use libpng? Required for PNG read/write support in some tools.
+# NOTICE!!!! _NOT_ required for simple PNG read support via dmimage,
+# that is implemented via modified stb_image.c's PNG loader.
+DM_USE_LIBPNG=yes
+
 # Build Qt based demo editor?
 DM_BUILD_EDITOR=yes