Makefile revision 414
c51f2c9a529b2130a8058cb7a32bd284fa6cfdb9Mark Andrews###############################################################################
d8e73b1c76f2c7dcc641bfa7759c15df58c82c7eMark Andrews# Fontconfig 2.x Makefile
d8e73b1c76f2c7dcc641bfa7759c15df58c82c7eMark Andrews# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
269c07173e24d7811e2fd09304023e3104fcbe0bMark Andrews# Use subject to license terms.
269c07173e24d7811e2fd09304023e3104fcbe0bMark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
962bf88eec1ea34a451769ba82c9389db7f0bef0Mark Andrews# copy of this software and associated documentation files (the
962bf88eec1ea34a451769ba82c9389db7f0bef0Mark Andrews# "Software"), to deal in the Software without restriction, including
962bf88eec1ea34a451769ba82c9389db7f0bef0Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
4bb9db2aed9860f7ca63f925a4b9d48e07917988Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
4bb9db2aed9860f7ca63f925a4b9d48e07917988Mark Andrews# to whom the Software is furnished to do so, provided that the above
c6581f1ae41f8cfdaf983a0cc4936365040060a2Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
c6581f1ae41f8cfdaf983a0cc4936365040060a2Mark Andrews# the Software and that both the above copyright notice(s) and this
c6581f1ae41f8cfdaf983a0cc4936365040060a2Mark Andrews# permission notice appear in supporting documentation.
e5bf06eedc08179fb93a09799915139370d08055Evan Hunt# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
e5bf06eedc08179fb93a09799915139370d08055Evan Hunt# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
a7ab4ad2d45930cf42d92b26e92c5a4e39a197f8Mark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
a7ab4ad2d45930cf42d92b26e92c5a4e39a197f8Mark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1864400107f7dc21e1797d602ab1f8523f599df9Mark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1864400107f7dc21e1797d602ab1f8523f599df9Mark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
261543671b70b078a2d55bbf16ef78ae2074bbdcEvan Hunt# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
261543671b70b078a2d55bbf16ef78ae2074bbdcEvan Hunt# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
261543671b70b078a2d55bbf16ef78ae2074bbdcEvan Hunt# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
490b05960c9956cc37f52f5fd4443829d75ce7d6Mark Andrews# Except as contained in this notice, the name of a copyright holder
89069e6b3abc5ab00c77227f31b771cc2fa4768fEvan Hunt# shall not be used in advertising or otherwise to promote the sale, use
89069e6b3abc5ab00c77227f31b771cc2fa4768fEvan Hunt# or other dealings in this Software without prior written authorization
89069e6b3abc5ab00c77227f31b771cc2fa4768fEvan Hunt# of the copyright holder.
6d386978b3a1f20a613ae10565c855aee084e2a0Mark Andrews# @(#)Makefile 1.74 08/03/20
4c34112a69735364713758c8a22f753389fd1753Mark Andrews# Build 32-bit, 64-bit, or both?
c478bb4c4658dddabe79118e2f84107640aa06c4Mark Andrews# Package name used in tarballs
936036e82337c5aba40e735e5b46f9112869772fMark Andrews# Version number (used in path names)
936036e82337c5aba40e735e5b46f9112869772fMark Andrews# Source tarball
81274f4b08b04eade0936cd32a4ba56281d7c2d2Mark AndrewsSOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
fc3b3e1f7e4ec1cf3bcc08f7ecc3ed8ebd29b034Mark Andrews# Download site for source
fc3b3e1f7e4ec1cf3bcc08f7ecc3ed8ebd29b034Mark AndrewsSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
99f6179191e583d23f3c5567d3c00b57b64eb52dEvan Hunt# Patches to apply to source after unpacking, in order
77cb7130e721c1352009c86fb2b38eedd06c4f97Mark Andrews# Directory created by unpacking source
77cb7130e721c1352009c86fb2b38eedd06c4f97Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/$(LIB_MODULE)-$(LIB_VERS)
adfc3ad3ce5db585fdb29d3d6000aa05ba077f13Evan Hunt# Library name (used for specfiles/mapfiles)
adfc3ad3ce5db585fdb29d3d6000aa05ba077f13Evan Hunt# Special version of freetype config to force certain arguments
93143fd81acd86e594bac20c6c58b930dfe63a80Evan Hunt# Install to /usr, not /usr/X11
93143fd81acd86e594bac20c6c58b930dfe63a80Evan Hunt# Path needed to find docbook2man, etc.
93143fd81acd86e594bac20c6c58b930dfe63a80Evan Hunt# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
c2e614115b19a4c28e0067e57a48f4ed5d5e12f8Mark Andrews# Command line options to GNU autoconf configure script
c2e614115b19a4c28e0067e57a48f4ed5d5e12f8Mark Andrews --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
c54dadd85337e9a8417103317a899dfba2a847d1Evan Hunt# Library built in tree
c54dadd85337e9a8417103317a899dfba2a847d1Evan HuntLIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.3.0
38b260f32d2be0e916e50e8bf77957ba2627a95aMark Andrews# What to build
bc298cd0f77dce2d452efd3e3d3153e2a9a17dbfMark Andrews# Options to autoconf configure script
1bb3831e13a65afd87078c88e0285d23b1e0bcdfMark AndrewsFONTCONFIG_CFG=--enable-shared=yes --enable-static=no --with-expat-includes=/usr/sfw/include \
1bb3831e13a65afd87078c88e0285d23b1e0bcdfMark Andrews --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) --prefix=/usr --with-confdir=/etc/fonts \
1bb3831e13a65afd87078c88e0285d23b1e0bcdfMark Andrews --with-cache-dir=/var/cache/fontconfig --with-default-fonts=/usr/openwin/lib/X11/fonts \
1bb3831e13a65afd87078c88e0285d23b1e0bcdfMark Andrews --with-add-fonts='--font-dirs-go-here--' --with-freetype-config=../freetype-config \
ef9f4d097794609e018963087fab10a8b51d8ad1Mark Andrews --libdir='$${exec_prefix}/lib$(LIBSUBDIR)' --bindir='$${exec_prefix}/bin$(ARCHLIBSUBDIR)' \
ef9f4d097794609e018963087fab10a8b51d8ad1Mark Andrews# Where to install most files
18d208a4a277eb460f5b47c6b167f60b04db3110Mark Andrews# Where to install libraries
9a020198893d8389f1f3172d88ba6b16d7da3c04Evan Hunt# Paths to find libraries
9a020198893d8389f1f3172d88ba6b16d7da3c04Evan HuntLIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/lib$(LIBSUBDIR) $(DOC_PATH)
9a020198893d8389f1f3172d88ba6b16d7da3c04Evan Hunt# Include common rulesets
c19cfefe7e345c37ef3bb98b0db2d14fe7b1d583Evan Hunt# Path to install fc-cache manifest & method script
c19cfefe7e345c37ef3bb98b0db2d14fe7b1d583Evan HuntFONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
19c4187e35333119a2d1e40c92a55e09a59a3e93Evan HuntFONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
19c4187e35333119a2d1e40c92a55e09a59a3e93Evan HuntFONTCONFIG_SMF_METHOD_dir=$(PROTODIR)/lib/svc/method
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan HuntFONTCONFIG_SMF_METHOD=$(FONTCONFIG_SMF_METHOD_dir)/fc-cache
41ca314cc2fafaaa9089438bdfd24880bafa9079Mark Andrews$(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/bin$(LIBSUBDIR)/freetype-config
949eefdda49701c14579d1fd251bd09df0751c2fEvan Hunt -if [ -f $@ ] ; then rm $@ ; fi
949eefdda49701c14579d1fd251bd09df0751c2fEvan Hunt sed -e 's|-L$$libdir|-L$(PROTODIR)$${exec_prefix}/lib$(LIBSUBDIR) -L$$libdir|' -e 's|^includedir=$${prefix}|includedir=$(PROTODIR)$${prefix}|' $(PROTODIR)/usr/bin$(LIBSUBDIR)/freetype-config > $@
15218d6ed062ec24c4a7ec10d22d1113b4c79556Evan Hunt# Run configure script
238e0e843834f24a40692a5ea28ace14ef5807ceMark Andrews$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) autoreconf $(FONTCONFIG_FT2CFG)
9ddf371552b3554a22632996acc41ef9917a30f4Mark Andrews CC=$(CC) CFLAGS="$(LIB_CFLAGS)" LDFLAGS="$(LIB_LDFLAGS)" $(LIBPATHS) ./configure $(FONTCONFIG_CFG))
9ddf371552b3554a22632996acc41ef9917a30f4Mark Andrews if [ -f $(SOURCE_DIR)/src/Makefile.bak ] ; then \
83878aaa47488a3529897bb8ab4c2027d98b64c1Mark Andrews$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fix-fonts.conf.pl
83878aaa47488a3529897bb8ab4c2027d98b64c1Mark Andrews perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
83878aaa47488a3529897bb8ab4c2027d98b64c1Mark Andrews$(LIB_BUILT): $(SOURCE_DIR)/Makefile $(SOURCE_DIR)/fonts.conf-SUNW
328e0fee6b6c91c258e5ce36eb70f5e017a85af2Mark Andrews (cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_LDFLAGS)" $(LIBPATHS) $(GNUMAKE) $(MFLAGS))
328e0fee6b6c91c258e5ce36eb70f5e017a85af2Mark Andrewsinstall_gen:: $(LIB_BUILT) $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST) $(FONTCONFIG_SMF_METHOD)
a5a30ae7c0636a57d8575acb98fdf906c0ea818fMark Andrews (cd $(SOURCE_DIR) ; $(LIBPATHS) $(GNUMAKE) -e DESTDIR=$(FONTCONFIG_prefix) libdir=/usr/lib$(ARCHLIBSUBDIR) bindir=/usr/bin$(ARCHLIBSUBDIR) install )
a5a30ae7c0636a57d8575acb98fdf906c0ea818fMark Andrews cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews# Quick inline perl script to fix up fc-cache & fc-list man pages
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews print "\047\\\" t\n"; \
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews s|__vendorversion__|"$$date"| ; \
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews s|__package__|SUNWfontconfig| ; \
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
67dc2f0536bcbbfa0970eb2893dcbc1c6713fad4Mark Andrews s%^\\\|\.%.IR \\|.%; \
b290d10fc42ae909f7319eeac68f876155dbf824Mark Andrews# 6368378: fc-cache and fc-list man pages are broken
1d32b1df372d6be6bac6450739b9e5ea23819995Evan Hunt mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
1d32b1df372d6be6bac6450739b9e5ea23819995Evan Hunt $(FC_MAN_FIX) $(FC_MAN_DIR)/man5/fonts-conf.5 sunman-notes-fonts.conf $(TOP)/common/sunman-stability | sed -e 's/.TH "FONTS-CONF" "5"/.TH "fonts.conf" "4"/' -e 's/SUNWfontconfig/SUNWfontconfig-root/' > $(FC_MAN_DIR)/man4/fonts.conf.4
9ca4e2411ca45c09494716f725b8b9a25ae887d7Mark Andrews -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
9ca4e2411ca45c09494716f725b8b9a25ae887d7Mark Andrews rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
108788443c2d4e4c5cc16c103bdfc7da665ed0c3Mark Andrews perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
b4d8192d210290112e07b0e22b491c45c50ba696Evan Hunt @case '$(MFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
f5dc94b026b5153de76eeb3c1161596251f26bcbMark Andrews APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
b4d8192d210290112e07b0e22b491c45c50ba696Evan Hunt $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \