[libpng17] Ported libpng 1.5 options.awk/dfn file handling to 1.7, fixed one

bug.
This commit is contained in:
John Bowler
2013-02-05 10:16:42 -06:00
committed by Glenn Randers-Pehrson
parent 4245e6b1b2
commit 803493e19c
18 changed files with 314 additions and 164 deletions

View File

@@ -39,6 +39,7 @@ CPP = $(CC) -E
ECHO = echo
DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build
DFA_EXTRA = # extra files that can be used to control configuration
CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
@@ -50,23 +51,23 @@ all: libpng.a pngtest
# The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt,
# copy this if the following doesn't work.
pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
$(RM_F) $@ dfn?.out
$(AWK) -f scripts/options.awk out=dfn1.out version=search pngconf.h\
scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2
$(AWK) -f scripts/options.awk out=dfn2.out dfn1.out 1>&2
cp dfn2.out $@
$(RM_F) dfn?.out
pnglibconf.h: pnglibconf.dfn
$(RM_F) $@ dfn.c dfn?.out
$(ECHO) '#include "pnglibconf.dfn"' >dfn.c
$(CPP) $(DFNFLAGS) dfn.c >dfn1.out
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
dfn1.out >dfn2.out
$(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out
cp dfn3.out $@
$(RM_F) dfn.c dfn?.out
$(RM_F) $@ pnglibconf.c pnglibconf.out pnglibconf.tmp
$(ECHO) '#include "pnglibconf.dfn"' >pnglibconf.c
$(ECHO) "If '$(CC) -E' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
$(CPP) $(DFNFLAGS) pnglibconf.c >pnglibconf.out
$(AWK) -f "scripts/dfn.awk" out="pnglibconf.tmp" pnglibconf.out 1>&2
mv pnglibconf.tmp $@
pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
$(RM_F) $@ pnglibconf.pre pnglibconf.tmp
$(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2
$(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2
$(AWK) -f scripts/options.awk out="pnglibconf.pre"\
version=search pngconf.h scripts/pnglibconf.dfa\
pngusr.dfa $(DFA_XTRA) 1>&2
$(AWK) -f scripts/options.awk out="pnglibconf.tmp" pnglibconf.pre 1>&2
mv pnglibconf.tmp $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@@ -96,7 +97,7 @@ install: libpng.a pnglibconf.h
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.* dfn.c dfn?.out
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.*
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock: