mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Revised contrib/pngminim/decoder to build and use pnglibconf.h
This commit is contained in:
parent
6ff9ec81c5
commit
8c065ddbe6
@ -5,6 +5,8 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
LD=$(CC)
|
LD=$(CC)
|
||||||
AWK=awk
|
AWK=awk
|
||||||
|
SED=sed
|
||||||
|
CPP=cpp
|
||||||
|
|
||||||
RM=rm -f
|
RM=rm -f
|
||||||
|
|
||||||
@ -39,6 +41,18 @@ pnglibconf.h: pnglibconf.mak pnglibconf.dfn
|
|||||||
|
|
||||||
# used on demand to regenerate the standard header, CPPFLAGS should
|
# used on demand to regenerate the standard header, CPPFLAGS should
|
||||||
# be empty - no non-standard defines
|
# be empty - no non-standard defines
|
||||||
|
|
||||||
|
.dfn.out:
|
||||||
|
rm -f $@ dfn.c dfn?.out
|
||||||
|
echo '#include "$<"' >dfn.c
|
||||||
|
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
|
||||||
|
$(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out
|
||||||
|
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\
|
||||||
|
dfn1.out >dfn2.out
|
||||||
|
$(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out
|
||||||
|
rm -f dfn.c dfn[12].out
|
||||||
|
mv dfn3.out $@
|
||||||
|
|
||||||
pnglibconf.dfn: pnglibconf.dfa options.awk
|
pnglibconf.dfn: pnglibconf.dfa options.awk
|
||||||
rm -f $@ dfn?.out
|
rm -f $@ dfn?.out
|
||||||
test -z "$(CPPFLAGS)"
|
test -z "$(CPPFLAGS)"
|
||||||
|
|||||||
@ -12,10 +12,6 @@
|
|||||||
#ifndef MINRDPNGCONF_H
|
#ifndef MINRDPNGCONF_H
|
||||||
#define MINRDPNGCONF_H
|
#define MINRDPNGCONF_H
|
||||||
|
|
||||||
#ifdef NJET
|
|
||||||
/* No 16-bit support beyond reading with strip_16 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PNG_NO_WARNINGS
|
#define PNG_NO_WARNINGS
|
||||||
#define png_warning(s1,s2) ""
|
#define png_warning(s1,s2) ""
|
||||||
#define png_chunk_warning(s1,s2) ""
|
#define png_chunk_warning(s1,s2) ""
|
||||||
|
|||||||
@ -1,9 +1,23 @@
|
|||||||
|
|
||||||
|
# Get the source for the pngminus application
|
||||||
cp ../../pngminus/pnm2png.c pnm2pngm.c
|
cp ../../pngminus/pnm2png.c pnm2pngm.c
|
||||||
|
|
||||||
|
# Get the libpng sources
|
||||||
cp ../../../*.h .
|
cp ../../../*.h .
|
||||||
cp ../../../*.c .
|
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 pngr*.c pngpread.c
|
rm example.c pngtest.c pngr*.c pngpread.c
|
||||||
# Change the next 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/*.h .
|
||||||
cp ../../../../zlib/*.c .
|
cp ../../../../zlib/*.c .
|
||||||
rm inf*.[ch]
|
|
||||||
rm minigzip.c example.c gz*
|
# Remove zlib sources we won't use
|
||||||
|
rm minigzip.c example.c inf*.[ch] gz*
|
||||||
|
|||||||
@ -1,13 +1,17 @@
|
|||||||
|
|
||||||
# Makefile for PngMinus (pnm2pngm)
|
# Makefile for PngMinus (pnm2pngm)
|
||||||
# Linux / Unix
|
# Linux / Unix
|
||||||
|
|
||||||
#CC=cc
|
#CC=cc
|
||||||
CC=gcc
|
CC=gcc
|
||||||
LD=$(CC)
|
LD=$(CC)
|
||||||
|
AWK=awk
|
||||||
|
SED=sed
|
||||||
|
CPP=cpp
|
||||||
|
|
||||||
RM=rm -f
|
RM=rm -f
|
||||||
|
|
||||||
CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1
|
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. -O1
|
||||||
|
|
||||||
C=.c
|
C=.c
|
||||||
O=.o
|
O=.o
|
||||||
@ -31,6 +35,35 @@ OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
|||||||
|
|
||||||
all: pnm2pngm$(E)
|
all: pnm2pngm$(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
|
||||||
|
|
||||||
|
.dfn.out:
|
||||||
|
rm -f $@ dfn.c dfn?.out
|
||||||
|
echo '#include "$<"' >dfn.c
|
||||||
|
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
|
||||||
|
$(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out
|
||||||
|
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\
|
||||||
|
dfn1.out >dfn2.out
|
||||||
|
$(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out
|
||||||
|
rm -f dfn.c dfn[12].out
|
||||||
|
mv dfn3.out $@
|
||||||
|
|
||||||
|
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 $@
|
||||||
|
|
||||||
pnm2pngm$(E): $(OBJS)
|
pnm2pngm$(E): $(OBJS)
|
||||||
$(LD) -o pnm2pngm$(E) $(OBJS)
|
$(LD) -o pnm2pngm$(E) $(OBJS)
|
||||||
strip pnm2pngm$(E)
|
strip pnm2pngm$(E)
|
||||||
@ -40,4 +73,4 @@ clean:
|
|||||||
$(RM) pnm2pngm$(E)
|
$(RM) pnm2pngm$(E)
|
||||||
$(RM) $(OBJS)
|
$(RM) $(OBJS)
|
||||||
|
|
||||||
# End of makefile for pnm2pngm
|
# End of makefile for pngm2pnm
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user