]> git.saurik.com Git - wxWidgets.git/blame - src/png/Makefile.am
bracket 10.5 only code
[wxWidgets.git] / src / png / Makefile.am
CommitLineData
970f6abe
VZ
1# Makefile.am:
2# Source file for Makefile.in (and hence Makefile)
3#
4# Makefile.am need only be changed on a major version number
5# change (e.g. libpng12 --> libpng13). In that case seach
6# this file for every instance of the old base name (libpng12)
7# and change to the new one (libpng13), then change the
8# -version-number settings below so that the new values have
9# the correct major part (first field).
10
11PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
12
13# libpng does not follow GNU file name conventions
14AUTOMAKE_OPTIONS = foreign
15
16# test programs - run on make check, make distcheck
17check_PROGRAMS= pngtest
18pngtest_SOURCES = pngtest.c
19pngtest_LDADD = libpng12.la
20TESTS = test-pngtest.sh
21TESTS_ENVIRONMENT= srcdir=$(srcdir)
22
23# man pages
24dist_man_MANS= libpng.3 libpngpf.3 png.5
25
26# generate the -config scripts if required
27binconfigs= libpng12-config
28EXTRA_SCRIPTS= libpng-config libpng12-config
29bin_SCRIPTS= @binconfigs@
30
31# rules to build libpng, only build the old library on request
32lib_LTLIBRARIES=libpng12.la @compatlib@
33EXTRA_LTLIBRARIES= libpng.la
34libpng12_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
35 pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
36 pngwtran.c pngmem.c pngerror.c pngpread.c \
37 png.h pngconf.h
38libpng_la_SOURCES = $(libpng12_la_SOURCES)
39
40libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
41libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@
42
43# MAJOR UPGRADE: the version-number settings below must be changed.
44libpng12_la_LDFLAGS = -no-undefined -export-dynamic \
45 -version-number 0:@PNGLIB_RELEASE@:0
46# -rpath is needed as automake doesn't know the directory
47libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
48 -version-number 3:@PNGLIB_RELEASE@:0
49
50if HAVE_LD_VERSION_SCRIPT
51 # Versioned symbols and restricted exports
52 libpng12_la_LDFLAGS += -Wl,--version-script=libpng.vers
53 libpng12_la_DEPENDENCIES = libpng.vers
54else
55 # Only restricted exports when possible
56 libpng12_la_LDFLAGS += -export-symbols libpng.sym
57 libpng12_la_DEPENDENCIES = libpng.sym
58endif
59libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES)
60
61# Avoid depending upon Character Ranges.
62AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
63
64#distribute headers in /usr/include/libpng/*
65pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
66pkginclude_HEADERS= png.h pngconf.h
67
68# pkg-config stuff, note that libpng.pc is always required in order
69# to get the correct library
70pkgconfigdir = @pkgconfigdir@
71pkgconfig_DATA = libpng12.pc
72
73#extra source distribution files.
74EXTRA_DIST= \
75 ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
76 pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
77 ${srcdir}/projects/cbuilder5/* \
78 ${srcdir}/projects/beos/* \
79 ${srcdir}/projects/visualc6/* \
80 ${srcdir}/projects/visualc71/* \
81 ${srcdir}/projects/wince.txt \
82 ${srcdir}/projects/netware.txt \
83 ${srcdir}/scripts/* \
84 ${srcdir}/contrib/gregbook/* \
85 ${srcdir}/contrib/pngminus/* \
86 ${srcdir}/contrib/pngsuite/* \
87 ${srcdir}/contrib/visupng/* \
88 $(TESTS) \
89 example.c libpng-1.2.34.txt pngvcrd.c
90
91CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \
92libpng.sym
93
94MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
95config.sub configure depcomp install-sh ltmain.sh missing
96
97$(PNGLIB_BASENAME).pc: libpng.pc
98 cp libpng.pc $@
99
100$(PNGLIB_BASENAME)-config: libpng-config
101 cp libpng-config $@
102
103libpng.sym: png.h pngconf.h
104 rm -f $@ $@.new
105 $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
106 $(SED) -n -e \
107 's|^.*PNG_FUNCTION_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
108 -e 's|^.*PNG_DATA_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
109 >$@.new
110 mv $@.new $@
111
112libpng.vers: libpng.sym
113 rm -f $@ $@.new
114 echo PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0 '{global:' > $@.new
115 $(SED) s/$$/\;/ libpng.sym >> $@.new
116 echo 'local: *; };' >> $@.new
117 mv $@.new $@
118
119test: check
120
121# install the .../include headers as links to the new ones
122install-data-hook:
123 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
124 cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
125 cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h
126 cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
127 cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
128
129# do evil things to libpng to cause libpng12 to be used
130install-exec-hook:
131 cd $(DESTDIR)$(bindir); rm -f libpng-config
132 cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
133 @set -x;\
134 cd $(DESTDIR)$(libdir);\
135 for ext in a la so sl dylib; do\
136 rm -f libpng.$$ext;\
137 if test -f $(PNGLIB_BASENAME).$$ext; then\
138 $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
139 fi;\
140 done
141
142uninstall-hook:
143 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
144 rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc
145 rm -f $(DESTDIR)$(bindir)/libpng-config
146 @if test -n "@compatlib@"; then\
147 set -x;\
148 cd $(DESTDIR)$(libdir);\
149 for ext in a la so sl dylib; do\
150 rm -f libpng.$$ext;\
151 done;\
152 fi