From 6ff9ec81c552b75dda64daa77847464386265ef2 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 17 Apr 2010 11:53:38 -0500 Subject: [PATCH] [devel] Attempt to get contrib/pngminim working with new pnglibconf.h not quite working yet (pow is undefined) --- contrib/pngminim/decoder/gather.sh | 17 ++++++++++++++++- contrib/pngminim/decoder/makefile | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/contrib/pngminim/decoder/gather.sh b/contrib/pngminim/decoder/gather.sh index 264564deb..915873d37 100755 --- a/contrib/pngminim/decoder/gather.sh +++ b/contrib/pngminim/decoder/gather.sh @@ -1,8 +1,23 @@ + +# Get the source for the pngminus application cp ../../pngminus/png2pnm.c pngm2pnm.c + +# Get the libpng sources cp ../../../*.h . cp ../../../*.c . + +# Get the libpng scripts for building pnglibconf.h +cp ../../../scripts/options.awk . +cp ../../../scripts/pnglibconf.dfa . +sed -e "s:scripts/::g" ../../../scripts/pnglibconf.mak > pnglibconf.mak +#14+% +# Remove libpng sources we won't use rm example.c pngtest.c pngpread.c pngw*.c -# change the following 2 lines if zlib is somewhere else + +# Get the zlib sources +# Change the following 2 lines if zlib is somewhere else cp ../../../../zlib/*.h . cp ../../../../zlib/*.c . + +# Remove zlib sources we won't use rm minigzip.c example.c compress.c deflate.c gz* diff --git a/contrib/pngminim/decoder/makefile b/contrib/pngminim/decoder/makefile index 36334efbb..356acdd5a 100644 --- a/contrib/pngminim/decoder/makefile +++ b/contrib/pngminim/decoder/makefile @@ -4,6 +4,7 @@ #CC=cc CC=gcc LD=$(CC) +AWK=awk RM=rm -f @@ -32,6 +33,24 @@ OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ all: pngm2pnm$(E) +# see scripts/pnglibconf.mak for more options +pnglibconf.h: pnglibconf.mak pnglibconf.dfn + make -f pnglibconf.mak pnglibconf.h + +# used on demand to regenerate the standard header, CPPFLAGS should +# be empty - no non-standard defines +pnglibconf.dfn: pnglibconf.dfa options.awk + rm -f $@ dfn?.out + test -z "$(CPPFLAGS)" + echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ + $(AWK) -f options.awk pre=1 out=dfn1.out\ + logunsupported=1 - pnglibconf.dfa 1>&2 + $(AWK) -f options.awk pre=0 out=dfn2.out\ + logunsupported=1 dfn1.out 1>&2 + rm dfn1.out + mv dfn2.out $@ + + pngm2pnm$(E): $(OBJS) $(LD) -o pngm2pnm$(E) $(OBJS) strip pngm2pnm$(E)