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