Description: Tweak Makefile for Debian's needs
	Upstream Makefile needs some tweaks to properly work for us.
Author: Kapil Hari Paranjape <kapil@debian.org>
Author: Nelson A. de Oliveira <naoliv@debian.org>
Forwarded: not-needed
Last-Update: 2010-03-12

--- pngcrush-1.7.9/Makefile	2010-02-26 01:21:23.000000000 -0300
+++ pngcrush-1.7.9/Makefile	2010-03-09 19:09:47.000000000 -0300
@@ -11,11 +11,13 @@
 # macros --------------------------------------------------------------------
 
 # uncomment these 2 lines only if you are using an external copy of libpng:
-PNGINC = /usr/local/include
-PNGLIB = /usr/local/lib
+#PNGINC = /usr/local/include
+#PNGLIB = /usr/local/lib
 # uncomment these 2 lines only if you are using an external copy of zlib:
-ZINC = /usr/local/include
-ZLIB = /usr/local/lib
+#ZINC = /usr/local/include
+#ZLIB = /usr/local/lib
+
+PNGINC = /usr/include
 
 CC = gcc
 LD = gcc
@@ -28,11 +30,15 @@
 O = .o
 E =
 
+# additional defines
+DEFINES = -DPNG_USE_PNGGCCRD -DPNG_iCCP_SUPPORTED \
+	-DPNG_iTXt_SUPPORTED -DPNG_USE_GLOBAL_ARRAYS
+
 PNGCRUSH  = pngcrush
 
 # LIBS = -lm
-LIBS = -L$(PNGLIB) -lpng -lz -lm
-# LIBS = -lpng -lz -lm
+#LIBS = -L$(PNGLIB) -lpng -lz -lm
+LIBS = -lpng -lz
 #LIBS = ${ZLIB}/libz.a -lm
 
 # uncomment these 4 lines only if you are NOT using an external copy of zlib:
@@ -53,7 +59,7 @@
 # implicit make rules -------------------------------------------------------
 
 .c$(O): png.h cexcept.h $(ZHDR)
-	$(CC) -c $(CFLAGS) $<
+	$(CC) -c $(CFLAGS) $(DEFINES) $<
 #.c$(O): png.h pngconf.h pngcrush.h cexcept.h pngpriv.h $(ZHDR)
 #	$(CC) -c $(CFLAGS) $<
 
@@ -66,7 +72,7 @@
 	ln -s $(PNGINC)/png.h png.h
  
 pngcrush$(O): pngcrush.c cexcept.h
-	$(CC) -c $(CFLAGS) $<
+	$(CC) -c $(CFLAGS) $(DEFINES) $<
 # pngcrush$(O): pngcrush.c png.h pngconf.h pngcrush.h cexcept.h $(ZHDR)
 # 	$(CC) -c $(CFLAGS) $<
 
