2 # Source file for Makefile.in (and hence Makefile)
4 # Makefile.am need only be changed on a major version number
5 # change (e.g. libpng12 --> libpng14). In that case seach
6 # this file for every instance of the old base name (libpng12)
7 # and change to the new one (libpng14), then change the
8 # -version-number settings below so that the new values have
9 # the correct major part (first field).
11 PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
13 # libpng does not follow GNU file name conventions
14 AUTOMAKE_OPTIONS = foreign
16 # test programs - run on make check, make distcheck
17 check_PROGRAMS= pngtest
18 pngtest_SOURCES = pngtest.c
19 pngtest_LDADD = libpng12.la
20 TESTS = test-pngtest.sh
21 TESTS_ENVIRONMENT= srcdir=$(srcdir)
24 dist_man_MANS= libpng.3 libpngpf.3 png.5
26 # generate the -config scripts if required
27 binconfigs= libpng12-config
28 EXTRA_SCRIPTS= libpng-config libpng12-config
29 bin_SCRIPTS= @binconfigs@
31 # rules to build libpng, only build the old library on request
32 lib_LTLIBRARIES=libpng12.la @compatlib@
33 EXTRA_LTLIBRARIES= libpng.la
34 libpng12_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 \
38 libpng_la_SOURCES = $(libpng12_la_SOURCES)
40 libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
41 libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@
43 # MAJOR UPGRADE: the version-number settings below must be changed.
44 libpng12_la_LDFLAGS = -no-undefined -export-dynamic \
45 -version-number 0:@PNGLIB_RELEASE@:0
46 # -rpath is needed as automake doesn't know the directory
47 libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
48 -version-number 3:@PNGLIB_RELEASE@:0
50 if 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
55 # Only restricted exports when possible
56 libpng12_la_LDFLAGS += -export-symbols libpng.sym
57 libpng12_la_DEPENDENCIES = libpng.sym
59 libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES)
61 # Avoid depending upon Character Ranges.
62 AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
64 #distribute headers in /usr/include/libpng/*
65 pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
66 pkginclude_HEADERS= png.h pngconf.h
68 # pkg-config stuff, note that libpng.pc is always required in order
69 # to get the correct library
70 pkgconfigdir = @pkgconfigdir@
71 pkgconfig_DATA = libpng12.pc
73 #extra source distribution files.
75 ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
76 pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
78 ${srcdir}/projects/cbuilder5/* \
79 ${srcdir}/projects/beos/* \
80 ${srcdir}/projects/visualc6/* \
81 ${srcdir}/projects/visualc71/* \
82 ${srcdir}/projects/wince.txt \
83 ${srcdir}/projects/netware.txt \
84 ${srcdir}/projects/xcode/* \
86 ${srcdir}/contrib/gregbook/* \
87 ${srcdir}/contrib/pngminim/* \
88 ${srcdir}/contrib/pngminus/* \
89 ${srcdir}/contrib/pngsuite/* \
90 ${srcdir}/contrib/visupng/* \
92 example.c libpng-1.2.51.txt pnggccrd.c pngvcrd.c
94 CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \
97 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
98 config.sub configure depcomp install-sh ltmain.sh missing
100 $(PNGLIB_BASENAME).pc: libpng.pc
103 $(PNGLIB_BASENAME)-config: libpng-config
106 libpng.sym: png.h pngconf.h
108 $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
110 's|^.*PNG_FUNCTION_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
111 -e 's|^.*PNG_DATA_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
115 libpng.vers: libpng.sym
117 echo PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0 '{global:' > $@.new
118 $(SED) s/$$/\;/ libpng.sym >> $@.new
119 echo 'local: *; };' >> $@.new
124 # install the .../include headers as links to the new ones
126 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
127 cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
128 cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h
129 cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
130 cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
132 # do evil things to libpng to cause libpng12 to be used
134 cd $(DESTDIR)$(bindir); rm -f libpng-config
135 cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
137 cd $(DESTDIR)$(libdir);\
138 for ext in a la so sl dylib; do\
140 if test -f $(PNGLIB_BASENAME).$$ext; then\
141 $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
146 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
147 rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc
148 rm -f $(DESTDIR)$(bindir)/libpng-config
149 @if test -n "@compatlib@"; then\
151 cd $(DESTDIR)$(libdir);\
152 for ext in a la so sl dylib; do\