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)