2 # Source file for Makefile.in (and hence Makefile)
5 PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
7 # libpng does not follow GNU file name conventions
8 AUTOMAKE_OPTIONS = foreign
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)
18 dist_man_MANS= libpng.3 libpngpf.3 png.5
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@
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
34 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@
36 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
37 -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
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
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
49 # Avoid depending upon Character Ranges.
50 AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
52 #distribute headers in /usr/include/libpng/*
53 pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
54 pkginclude_HEADERS= png.h pngconf.h
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
61 #extra source distribution files.
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/* \
69 ${srcdir}/contrib/gregbook/* \
70 ${srcdir}/contrib/pngminim/* \
71 ${srcdir}/contrib/pngminus/* \
72 ${srcdir}/contrib/pngsuite/* \
73 ${srcdir}/contrib/visupng/* \
75 example.c libpng-*.txt
77 CLEANFILES= pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \
80 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
81 config.sub configure depcomp install-sh ltmain.sh missing
83 $(PNGLIB_BASENAME).pc: libpng.pc
86 $(PNGLIB_BASENAME)-config: libpng-config
89 libpng.sym: png.h pngconf.h
91 $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
93 's|^.*PNG_FUNCTION_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
94 -e 's|^.*PNG_DATA_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
98 libpng.vers: libpng.sym
100 echo PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0 '{global:' > $@.new
101 $(SED) s/$$/\;/ libpng.sym >> $@.new
102 echo 'local: *; };' >> $@.new
107 # install the .../include headers as links to the new ones
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 \
113 cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
114 cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
116 # do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
118 cd $(DESTDIR)$(bindir); rm -f libpng-config
119 cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
121 cd $(DESTDIR)$(libdir);\
122 for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib dll.a; do\
124 if test -f $(PNGLIB_BASENAME).$$ext; then\
125 $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
130 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
131 rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc
132 rm -f $(DESTDIR)$(bindir)/libpng-config