changeset 424:e88b2993801c

Fix build for Win32.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 03 Nov 2012 08:21:29 +0200
parents 11b3adb3bdb1
children aa5f28c2cde1
files Makefile Makefile.gen Makefile.w32
diffstat 3 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat Nov 03 08:11:56 2012 +0200
+++ b/Makefile	Sat Nov 03 08:21:29 2012 +0200
@@ -10,6 +10,9 @@
 LIBPNG_CFLAGS=`pkg-config --cflags libpng`
 LIBPNG_LDFLAGS=`pkg-config --libs libpng`
 
+ZLIB_CFLAGS=`pkg-config --cflags zlib`
+ZLIB_LDFLAGS=`pkg-config --libs zlib`
+
 RANLIB=ranlib
 
 DMLIB = ./
--- a/Makefile.gen	Sat Nov 03 08:11:56 2012 +0200
+++ b/Makefile.gen	Sat Nov 03 08:21:29 2012 +0200
@@ -57,9 +57,9 @@
 ###
 ifeq ($(DM_USE_PACKFS),yes)
 BUILD_RES=yes
-DM_CFLAGS += -DDM_USE_PACKFS
+DM_CFLAGS += -DDM_USE_PACKFS $(ZLIB_CFLAGS)
+DM_LDFLAGS += $(ZLIB_LDFLAGS)
 DMLIB_OBJS += dmpack.o dmpackutil.o
-DM_LDFLAGS += -lz
 ifeq ($(DM_BUILD_TOOLS),yes)
 BINARIES += packed
 endif
@@ -219,7 +219,7 @@
 
 
 ifeq ($(DM_USE_LIBPNG),yes)
-DM_CFLAGS += -DDM_USE_LIBPNG $(LIBPNG_CFLAGS)
+DM_CFLAGS += -DDM_USE_LIBPNG $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS)
 endif
 
 ###
@@ -384,7 +384,7 @@
 
 $(BINPATH)gfxconv$(EXEEXT): $(OBJPATH)gfxconv.o $(DMLIB_A)
 	@echo " LINK $+"
-	@$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(LIBPNG_LDFLAGS)
+	@$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(LIBPNG_LDFLAGS) $(ZLIB_LDFLAGS)
 
 $(BINPATH)view64$(EXEEXT): $(OBJPATH)view64.o $(DMLIB_A)
 	@echo " LINK $+"
--- a/Makefile.w32	Sat Nov 03 08:11:56 2012 +0200
+++ b/Makefile.w32	Sat Nov 03 08:21:29 2012 +0200
@@ -17,9 +17,16 @@
 
 SDL_CFLAGS=`$(MINGW_PATH)/bin/sdl-config --cflags`
 SDL_LDFLAGS=`$(MINGW_PATH)/bin/sdl-config --libs` -lSDL -L$(BINPATH)
+
 TREMOR_CFLAGS=-I$(MINGW_PATH)/include/tremor
 TREMOR_LDFLAGS=$(MINGW_PATH)/lib/libvorbisidec.a  $(MINGW_PATH)/lib/libogg.a
 
+LIBPNG_CFLAGS=-I$(MINGW_PATH)/include
+LIBPNG_LDFLAGS=$(MINGW_PATH)/lib/libpng.a
+
+ZLIB_CFLAGS=
+ZLIB_LDFLAGS=$(MINGW_PATH)/lib/libz.a
+
 #CFLAGS=-mwindows
 LDFLAGS=-lmingw32 -s