]> git.saurik.com Git - wxWidgets.git/blame - src/png/Makefile.am
Add wxAnyScrollHelperBase to reduce code duplication in wxVarScrollHelperBase.
[wxWidgets.git] / src / png / Makefile.am
CommitLineData
72281370
DS
1# Makefile.am:
2# Source file for Makefile.in (and hence Makefile)
3#
4
5PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
6
fff5f7d5 7ACLOCAL_AMFLAGS = -I scripts
72281370
DS
8
9# test programs - run on make check, make distcheck
fff5f7d5
VZ
10check_PROGRAMS= pngtest pngunknown pngstest pngvalid
11
72281370
DS
12pngtest_SOURCES = pngtest.c
13pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
72281370 14
72281370
DS
15pngvalid_SOURCES = contrib/libtests/pngvalid.c
16pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
fff5f7d5
VZ
17
18pngstest_SOURCES = contrib/libtests/pngstest.c
19pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
20
21pngunknown_SOURCES = contrib/libtests/pngunknown.c
22pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
23
24# Generally these are single line shell scripts to run a test with a particular
25# set of parameters:
26TESTS =\
27 tests/pngtest\
28 tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
29 tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
30 tests/pngvalid-gamma-expand16-background\
31 tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
32 tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
33 tests/pngvalid-progressive-interlace-size\
34 tests/pngvalid-progressive-interlace-standard\
35 tests/pngvalid-progressive-interlace-transform\
36 tests/pngvalid-progressive-standard tests/pngvalid-standard\
37 tests/pngstest-0g01 tests/pngstest-0g02 tests/pngstest-0g04\
38 tests/pngstest-0g08 tests/pngstest-0g16 tests/pngstest-2c08\
39 tests/pngstest-2c16 tests/pngstest-3p01 tests/pngstest-3p02\
40 tests/pngstest-3p04 tests/pngstest-3p08 tests/pngstest-4a08\
41 tests/pngstest-4a16 tests/pngstest-6a08 tests/pngstest-6a16\
42 tests/pngstest-error tests/pngunknown-IDAT\
43 tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
44 tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg
45
46# These tests are expected, and required, to fail:
47XFAIL_TESTS = tests/pngstest-error
72281370
DS
48
49# man pages
50dist_man_MANS= libpng.3 libpngpf.3 png.5
51
52# generate the -config scripts if required
53binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
54EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
55bin_SCRIPTS= @binconfigs@
56
57# rules to build libpng, only build the old library on request
58lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
59# EXTRA_LTLIBRARIES= libpng.la
60libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
61 pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\
62 pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\
fff5f7d5 63 png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
72281370
DS
64
65if PNG_ARM_NEON
fff5f7d5
VZ
66libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
67 arm/filter_neon.S
72281370
DS
68endif
69
70nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
71
72281370
DS
72libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
73 -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
74
75if HAVE_LD_VERSION_SCRIPT
76# Versioned symbols and restricted exports
77if HAVE_SOLARIS_LD
78 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers
79else
80 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers
81endif
82
83 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers
84else
85# Only restricted exports when possible
86 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym
87 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
88endif
89
90#distribute headers in /usr/include/libpng/*
91pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
92pkginclude_HEADERS= png.h pngconf.h
93nodist_pkginclude_HEADERS= pnglibconf.h
94
95# pkg-config stuff, note that libpng.pc is always required in order
96# to get the correct library
97pkgconfigdir = @pkgconfigdir@
98pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
99
fff5f7d5
VZ
100# Extra source distribution files, '${srcdir}' is used below to stop build files
101# from those directories being included. This only works if the configure is
102# not done in the source directory!
72281370
DS
103EXTRA_DIST= \
104 ANNOUNCE CHANGES INSTALL LICENSE README TODO \
105 pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
106 ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
fff5f7d5 107 $(TESTS) $(XFAIL_TESTS) tests/pngstest \
72281370
DS
108 CMakeLists.txt example.c libpng-manual.txt
109
110SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
111
fff5f7d5 112CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
72281370 113 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
fff5f7d5 114 check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \
72281370
DS
115 $(SCRIPT_CLEANFILES)
116
117MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
118config.sub configure depcomp install-sh ltmain.sh missing
119
fff5f7d5
VZ
120# PNG_COPTS give extra options for the C compiler to be used on all compilation
121# steps (unless targe_CFLAGS is specified; that will take precedence over
122# AM_CFLAGS)
123PNG_COPTS = @PNG_COPTS@
124AM_CFLAGS = ${PNG_COPTS}
125
72281370
DS
126# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
127# other operating systems (NeXT?) the C preprocessor selected by configure
128# checks input tokens for validity - effectively it performs part of the ANSI-C
129# parsing - and therefore fails with the .df files. configure.ac has special
130# checks for this and sets DFNCPP appropriately.
131DFNCPP = @DFNCPP@
132
133SUFFIXES = .chk .dfn .out
134
135$(PNGLIB_BASENAME).pc: libpng.pc
136 cp libpng.pc $@
137
138$(PNGLIB_BASENAME)-config: libpng-config
139 cp libpng-config $@
140
141scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
fff5f7d5 142scripts/prefix.out: png.h pngconf.h pnglibconf.out
72281370 143scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
fff5f7d5 144scripts/intprefix.out: pnglibconf.h
72281370
DS
145
146libpng.sym: scripts/sym.out
147 rm -f $@
148 cp $? $@
149libpng.vers: scripts/vers.out
150 rm -f $@
151 cp $? $@
fff5f7d5
VZ
152
153if DO_PNG_PREFIX
154# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
155# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
156# implementation of the macro).
157pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
158 rm -f $@
159 $(AWK) 's==0 && NR>1{print prev}\
160 s==0{prev=$$0}\
161 s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\
162 s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\
163 END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\
164 s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8
165 mv pnglibconf.tf8 $@
166
167pngprefix.h: scripts/intprefix.out
168 rm -f pngprefix.tf1
169 $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
170 mv pngprefix.tf1 $@
171else
72281370
DS
172pnglibconf.h: pnglibconf.out
173 rm -f $@
174 cp $? $@
fff5f7d5
VZ
175
176pngprefix.h: # is empty
177 :>$@
178endif
179
72281370
DS
180$(srcdir)/scripts/pnglibconf.h.prebuilt:
181 @echo "Attempting to build $@" >&2
182 @echo "This is a machine generated file, but if you want to make" >&2
183 @echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2
184 @exit 1
185
186# The following is necessary to ensure that the local pnglibconf.h is used, not
187# an installed one (this can happen immediately after on a clean system if
188# 'make test' is the first thing the user does.)
fff5f7d5
VZ
189contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
190contrib/libtests/pngunknown.o: pnglibconf.h
72281370
DS
191
192# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
193# be built with PNG_USE_READ_MACROS; this prevents the read macros from
194# interfering with the symbol file format.
195SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
196 -DPNGLIB_VERSION='@PNGLIB_VERSION@'\
197 -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
198 -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
199
fff5f7d5
VZ
200if DO_PNG_PREFIX
201SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
202endif
203
72281370 204.dfn.out:
fff5f7d5
VZ
205 rm -f $@ $*.c $*.tf[12]
206 test -d scripts || mkdir scripts || test -d scripts
207 echo '#include "$<"' >$*.c
208 $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
209 $(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
210 $(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
211 rm -f $*.c $*.tf1
212 mv $*.tf2 $@
72281370
DS
213
214# The .dfn file for pnglibconf.h is machine generated
fff5f7d5
VZ
215pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
216 rm -f $@ $*.tf[45]
217 $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
72281370 218 ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
fff5f7d5
VZ
219 ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
220 $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
221 rm $*.tf4
222 mv $*.tf5 $@
72281370
DS
223
224# Symbol checks (.def and .out files should match)
225scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
fff5f7d5 226
72281370 227.out.chk:
fff5f7d5 228 rm -f $@ $*.new
72281370 229 $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
fff5f7d5
VZ
230 of="$*.new" $< >&2
231 mv $*.new $@
72281370
DS
232
233# used on demand to regenerate the standard header, CPPFLAGS should
234# be empty - no non-standard defines
235scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
fff5f7d5 236 rm -f $@ pnglibconf.tf[67]
72281370
DS
237 test -z "$(CPPFLAGS)"
238 echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
fff5f7d5
VZ
239 $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
240 logunsupported=1 version=search ${srcdir}/pngconf.h -\
241 ${srcdir}/scripts/pnglibconf.dfa 1>&2
242 $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\
243 pnglibconf.tf6 1>&2
244 rm pnglibconf.tf6
245 mv pnglibconf.tf7 $@
72281370
DS
246
247$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
fff5f7d5 248 pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
72281370
DS
249
250test: check-am
251
252# Extra checks
253check: scripts/symbols.chk
254
255# Don't distribute the generated script files
256dist-hook:
257 cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
258
259# install the .../include headers as links to the new ones
260install-data-hook:
fff5f7d5
VZ
261 cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
262 cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
263 cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
72281370 264 pngconf.h
fff5f7d5 265 cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \
72281370 266 pnglibconf.h
fff5f7d5
VZ
267 cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc
268 cd '$(DESTDIR)$(pkgconfigdir)'; $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
72281370
DS
269
270# do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
271install-exec-hook:
fff5f7d5
VZ
272 cd '$(DESTDIR)$(bindir)'; rm -f libpng-config
273 cd '$(DESTDIR)$(bindir)';\
274 $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
72281370 275 @set -x;\
fff5f7d5
VZ
276 cd '$(DESTDIR)$(libdir)';\
277 for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@\
278 sl dylib dll.a; do\
72281370
DS
279 rm -f libpng.$$ext;\
280 if test -f $(PNGLIB_BASENAME).$$ext; then\
281 $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
282 fi;\
283 done
284
285uninstall-hook:
fff5f7d5
VZ
286 cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
287 rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
288 rm -f '$(DESTDIR)$(bindir)/libpng-config'
289 rm -f '$(DESTDIR)$(libdir)/libpng.a'
290 rm -f '$(DESTDIR)$(libdir)/libpng.la'
291 rm -f '$(DESTDIR)$(libdir)/libpng.so'
292 rm -f '$(DESTDIR)$(libdir)/libpng.so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@'
293 rm -f '$(DESTDIR)$(libdir)/libpng.sl'
294 rm -f '$(DESTDIR)$(libdir)/libpng.dylib'
295 rm -f '$(DESTDIR)$(libdir)/libpng.dll.a'