| 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 |
|
| 11 |
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@ |
| 12 |
|
| 13 |
# libpng does not follow GNU file name conventions |
| 14 |
AUTOMAKE_OPTIONS = foreign |
| 15 |
|
| 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) |
| 22 |
|
| 23 |
# man pages |
| 24 |
dist_man_MANS= libpng.3 libpngpf.3 png.5 |
| 25 |
|
| 26 |
# generate the -config scripts if required |
| 27 |
binconfigs= libpng12-config |
| 28 |
EXTRA_SCRIPTS= libpng-config libpng12-config |
| 29 |
bin_SCRIPTS= @binconfigs@ |
| 30 |
|
| 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 pnggccrd.c \ |
| 37 |
png.h pngconf.h |
| 38 |
libpng_la_SOURCES = $(libpng12_la_SOURCES) |
| 39 |
|
| 40 |
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@ |
| 41 |
libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@ |
| 42 |
|
| 43 |
# MAJOR UPGRADE: the version-number settings below must be changed. |
| 44 |
libpng12_la_LDFLAGS = -no-undefined -export-dynamic \ |
| 45 |
-version-number 0:@PNGLIB_MINOR@: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_MINOR@:0 |
| 49 |
|
| 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 |
| 54 |
else |
| 55 |
# Only restricted exports when possible |
| 56 |
libpng12_la_LDFLAGS += -export-symbols libpng.sym |
| 57 |
libpng12_la_DEPENDENCIES = libpng.sym |
| 58 |
endif |
| 59 |
libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES) |
| 60 |
|
| 61 |
#distribute headers in /usr/include/libpng/* |
| 62 |
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME) |
| 63 |
pkginclude_HEADERS= png.h pngconf.h |
| 64 |
|
| 65 |
# pkg-config stuff, note that libpng.pc is always required in order |
| 66 |
# to get the correct library |
| 67 |
pkgconfigdir = @pkgconfigdir@ |
| 68 |
pkgconfig_DATA = libpng12.pc |
| 69 |
|
| 70 |
#extra source distribution files. |
| 71 |
EXTRA_DIST= \ |
| 72 |
ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \ |
| 73 |
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ |
| 74 |
${srcdir}/projects/cbuilder5/* \ |
| 75 |
${srcdir}/projects/beos/* \ |
| 76 |
${srcdir}/projects/visualc6/* \ |
| 77 |
${srcdir}/projects/visualc71/* \ |
| 78 |
${srcdir}/projects/wince.txt \ |
| 79 |
${srcdir}/projects/netware.txt \ |
| 80 |
${srcdir}/scripts/* \ |
| 81 |
${srcdir}/contrib/gregbook/* \ |
| 82 |
${srcdir}/contrib/pngminus/* \ |
| 83 |
${srcdir}/contrib/pngsuite/* \ |
| 84 |
${srcdir}/contrib/visupng/* \ |
| 85 |
$(TESTS) \ |
| 86 |
example.c libpng.txt pngvcrd.c |
| 87 |
|
| 88 |
CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \ |
| 89 |
libpng.sym |
| 90 |
|
| 91 |
$(PNGLIB_BASENAME).pc: libpng.pc |
| 92 |
cp libpng.pc $@ |
| 93 |
|
| 94 |
$(PNGLIB_BASENAME)-config: libpng-config |
| 95 |
cp libpng-config $@ |
| 96 |
|
| 97 |
libpng.sym: png.h pngconf.h |
| 98 |
rm -f $@ [email protected] |
| 99 |
$(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS png.h | \ |
| 100 |
$(SED) -n -e 's|^.*PNG_FUNCTION_EXPORT[ ]*\([a-zA-Z0-9_]*\).*$$|\1|p' \ |
| 101 |
-e 's|^.*PNG_DATA_EXPORT[ ]*\([a-zA-Z0-9_]*\).*$$|\1|p' \ |
| 102 |
>[email protected] |
| 103 |
mv [email protected] $@ |
| 104 |
|
| 105 |
libpng.vers: libpng.sym |
| 106 |
rm -f $@ [email protected] |
| 107 |
$(ECHO) PNG@PNGLIB_MAJOR@_0 '{global:' > [email protected] |
| 108 |
$(SED) s/$$/\;/ libpng.sym >> [email protected] |
| 109 |
$(ECHO) 'local: *; };' >> [email protected] |
| 110 |
mv [email protected] $@ |
| 111 |
|
| 112 |
# install the .../include headers as links to the new ones |
| 113 |
install-data-hook: |
| 114 |
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h |
| 115 |
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h |
| 116 |
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h |
| 117 |
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc |
| 118 |
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc |
| 119 |
|
| 120 |
# do evil things to libpng to cause libpng12 to be used |
| 121 |
install-exec-hook: |
| 122 |
cd $(DESTDIR)$(bindir); rm -f libpng-config |
| 123 |
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config |
| 124 |
@set -x;\ |
| 125 |
cd $(DESTDIR)$(libdir);\ |
| 126 |
for ext in a la so; do\ |
| 127 |
rm -f libpng.$$ext;\ |
| 128 |
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\ |
| 129 |
done |
| 130 |
|
| 131 |
uninstall-hook: |
| 132 |
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h |
| 133 |
rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc |
| 134 |
rm -f $(DESTDIR)$(bindir)/libpng-config |
| 135 |
@if test -n "@compatlib@"; then\ |
| 136 |
set -x;\ |
| 137 |
cd $(DESTDIR)$(libdir);\ |
| 138 |
for ext in a la so; do\ |
| 139 |
rm -f libpng.$$ext;\ |
| 140 |
done;\ |
| 141 |
fi |