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/cbuilder5/* \
66 ${srcdir}/projects/visualc6/* \
67 ${srcdir}/projects/visualc71/* \
68 ${srcdir}/projects/xcode/* \
70 ${srcdir}/contrib/gregbook/* \
71 ${srcdir}/contrib/pngminim/* \
72 ${srcdir}/contrib/pngminus/* \
73 ${srcdir}/contrib/pngsuite/* \
74 ${srcdir}/contrib/visupng/* \
76 example.c libpng-1.4.1.txt
78 CLEANFILES= pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \
81 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
82 config.sub configure depcomp install-sh ltmain.sh missing
84 $(PNGLIB_BASENAME).pc: libpng.pc
87 $(PNGLIB_BASENAME)-config: libpng-config
90 libpng.sym: png.h pngconf.h
92 $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
94 's|^.*PNG_FUNCTION_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
95 -e 's|^.*PNG_DATA_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
99 libpng.vers: libpng.sym
101 echo PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0 '{global:' > $@.new
102 $(SED) s/$$/\;/ libpng.sym >> $@.new
103 echo 'local: *; };' >> $@.new
108 # install the .../include headers as links to the new ones
110 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
111 cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
112 cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
114 cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
115 cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
117 # do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
119 cd $(DESTDIR)$(bindir); rm -f libpng-config
120 cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
122 cd $(DESTDIR)$(libdir);\
123 for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib; do\
125 if test -f $(PNGLIB_BASENAME).$$ext; then\
126 $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
131 cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
132 rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc
133 rm -f $(DESTDIR)$(bindir)/libpng-config