Makefile revision 464
c960dffe35970da729219b72f2e41350d3b64c35Mark Andrews###############################################################################
5da49e379c79fbd597cf0d47e7697b65991f761fMark Andrews# Fontconfig 2.x Makefile
31b3dc1c6b4fe99a2af2ee63314e842af4a20070Mark Andrews# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
31b3dc1c6b4fe99a2af2ee63314e842af4a20070Mark Andrews# Use subject to license terms.
59f51f864c752d2e4bf8d1ad94404ada0c9aa6e9Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
59f51f864c752d2e4bf8d1ad94404ada0c9aa6e9Mark Andrews# copy of this software and associated documentation files (the
a207a2835e37de52e11d4c143c0425e749409c46Mark Andrews# "Software"), to deal in the Software without restriction, including
a207a2835e37de52e11d4c143c0425e749409c46Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
03760eeb542cc5e91193eec478cae022df4bcc58Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
03760eeb542cc5e91193eec478cae022df4bcc58Mark Andrews# to whom the Software is furnished to do so, provided that the above
838d608e6f37038f2fb43980a7a9d6b6a490db36Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
838d608e6f37038f2fb43980a7a9d6b6a490db36Mark Andrews# the Software and that both the above copyright notice(s) and this
64cc9c8818db2552cbdd77f1050e890ffa5a17d8Mark Andrews# permission notice appear in supporting documentation.
64cc9c8818db2552cbdd77f1050e890ffa5a17d8Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
64cc9c8818db2552cbdd77f1050e890ffa5a17d8Mark Andrews# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0f09ef5a50ef09eaed8e6630b4004d5143d6b52cMark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
0f09ef5a50ef09eaed8e6630b4004d5143d6b52cMark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
0f09ef5a50ef09eaed8e6630b4004d5143d6b52cMark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
0f09ef5a50ef09eaed8e6630b4004d5143d6b52cMark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
c7fc6434fe5949c8e3f76bf69f5655eb3a76dfaeMark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
c7fc6434fe5949c8e3f76bf69f5655eb3a76dfaeMark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9bd478a5e6df956a79bbdb5c182d5b44763786ceMark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9bd478a5e6df956a79bbdb5c182d5b44763786ceMark Andrews# Except as contained in this notice, the name of a copyright holder
421e4cf66e4cba0b0751a34a9c027e39fe0474f9Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
421e4cf66e4cba0b0751a34a9c027e39fe0474f9Mark Andrews# or other dealings in this Software without prior written authorization
421e4cf66e4cba0b0751a34a9c027e39fe0474f9Mark Andrews# of the copyright holder.
b0c15bd9792112fb47f6d956e580e4369e92f4e7Mark Andrews# @(#)Makefile 1.74 08/03/20
bf7f253e306d0ced8ae24d7a0598773950da11f4Mark Andrews# Build 32-bit, 64-bit, or both?
0ffaee887ff5674b8c3bb0435ae838f641981706Mark Andrews# Package name used in tarballs
c86eed4bdecad9df12f992f9d743dfee3a6c5bdcMark Andrews# Version number (used in path names)
12ff7274fe2ea531ecca6a71fb9f7e1ae92da389Mark Andrews# Source tarball
9d3ad53203f1ac49f9e876dbbcaca18656eb3e19Mark AndrewsSOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
767fd19da4b699aae46959d834f53af0e1166e80Mark Andrews# Download site for source
767fd19da4b699aae46959d834f53af0e1166e80Mark AndrewsSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
5b76a09697bfc76f5acefd65d5b37b1214d271a8Mark Andrews# Patches to apply to source after unpacking, in order
5b76a09697bfc76f5acefd65d5b37b1214d271a8Mark AndrewsSOURCE_PATCHES=fontconfig-$(LIB_VERS).patch,-p1 \
93e353425a81da7793dde3776f4caca658f57c11Mark Andrews# Directory created by unpacking source
93e353425a81da7793dde3776f4caca658f57c11Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/$(LIB_MODULE)-$(LIB_VERS)
93e353425a81da7793dde3776f4caca658f57c11Mark Andrews# Library name (used for specfiles/mapfiles)
49a940dc68b30d9e4f9e1bd3c0503d8b90bb1726Mark Andrews# Special version of freetype config to force certain arguments
59ab128c972622f5aeafe3229966dcba73b62243Mark Andrews# Install to /usr, not /usr/X11
90295f915c883d1aeeda856f518584d4219a704aMark Andrews# Path needed to find docbook2man, etc.
90295f915c883d1aeeda856f518584d4219a704aMark Andrews# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
1c75ea91cdb49dac65f0f592ddbf66bfdfc4a2d7Mark Andrews# Command line options to GNU autoconf configure script
142d155dd68fd601dc38c6b6f7c35f2798ec24caMark Andrews --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
2ffb3eb384ae71ae9f8edbf5fa2219d965ff0552Mark Andrews# Library built in tree
2ffb3eb384ae71ae9f8edbf5fa2219d965ff0552Mark AndrewsLIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.3.0
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews# What to build
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews# Options to autoconf configure script
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark AndrewsFONTCONFIG_CFG=--enable-shared=yes --enable-static=no --with-expat-includes=/usr/sfw/include \
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) --prefix=/usr --with-confdir=/etc/fonts \
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews --with-cache-dir=/var/cache/fontconfig --with-default-fonts=/usr/openwin/lib/X11/fonts \
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews --with-add-fonts='--font-dirs-go-here--' --with-freetype-config=../freetype-config \
52fc1457e44c476a81ec9dee6a664958cb64b8e2Mark Andrews --libdir='$${exec_prefix}/lib$(LIBSUBDIR)' --bindir='$${exec_prefix}/bin$(ARCHLIBSUBDIR)' \
6526fd032fc418411da3af4201214e95c113d3e2Mark Andrews# Where to install most files
757bf8a1e5d85806c648d7a6267da8d49a8ab822Tatuya JINMEI 神明達哉# Where to install libraries
757bf8a1e5d85806c648d7a6267da8d49a8ab822Tatuya JINMEI 神明達哉FONTCONFIG_libdir=$(FONTCONFIG_prefix)/usr/lib
be0e075ac2c10ade3e80edef7fa14ac0fda92690Mark Andrews# Paths to find libraries
be0e075ac2c10ade3e80edef7fa14ac0fda92690Mark AndrewsLIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/lib$(LIBSUBDIR) $(DOC_PATH)
2a908588fbeacebc5f13b153b73c96e12dacaadcTatuya JINMEI 神明達哉# Include common rulesets
af2be1a46813e228cb9d71230d3f41222fdb69baTatuya JINMEI 神明達哉# Path to install fc-cache manifest & method script
af2be1a46813e228cb9d71230d3f41222fdb69baTatuya JINMEI 神明達哉FONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
af2be1a46813e228cb9d71230d3f41222fdb69baTatuya JINMEI 神明達哉FONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
2945ac15af547df0268e449252902ead599e2451Mark AndrewsFONTCONFIG_SMF_METHOD_dir=$(PROTODIR)/lib/svc/method
2945ac15af547df0268e449252902ead599e2451Mark AndrewsFONTCONFIG_SMF_METHOD=$(FONTCONFIG_SMF_METHOD_dir)/fc-cache
285761cf91626976e211f69d9678c138b25f8629Tatuya JINMEI 神明達哉$(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/bin$(LIBSUBDIR)/freetype-config
285761cf91626976e211f69d9678c138b25f8629Tatuya JINMEI 神明達哉 -if [ -f $@ ] ; then rm $@ ; fi
285761cf91626976e211f69d9678c138b25f8629Tatuya JINMEI 神明達哉 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 > $@
ca70688bf60b4f50c4e3ec7d40567341c9962fafMark Andrews# Run configure script
ca70688bf60b4f50c4e3ec7d40567341c9962fafMark Andrews$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) autoreconf $(FONTCONFIG_FT2CFG)
aec2d57d5b9f5ca97763a1b49b76f0bcb5852e1aMark Andrews CC=$(CC) CFLAGS="$(LIB_CFLAGS)" LDFLAGS="$(LIB_LDFLAGS)" $(LIBPATHS) ./configure $(FONTCONFIG_CFG))
aec2d57d5b9f5ca97763a1b49b76f0bcb5852e1aMark Andrews if [ -f $(SOURCE_DIR)/src/Makefile.bak ] ; then \
a9ae9d743c7f85bec44e95b1f62c7a2a114a2fd6Mark Andrews$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fix-fonts.conf.pl
a9ae9d743c7f85bec44e95b1f62c7a2a114a2fd6Mark Andrews perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
75ace6601e66840436f52e61353ee0d400577b55Mark Andrews$(LIB_BUILT): $(SOURCE_DIR)/Makefile $(SOURCE_DIR)/fonts.conf-SUNW
75ace6601e66840436f52e61353ee0d400577b55Mark Andrews (cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_LDFLAGS)" $(LIBPATHS) $(GNUMAKE) $(MFLAGS))
75ace6601e66840436f52e61353ee0d400577b55Mark Andrewsinstall_gen:: $(LIB_BUILT) $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST) $(FONTCONFIG_SMF_METHOD)
75ace6601e66840436f52e61353ee0d400577b55Mark Andrews (cd $(SOURCE_DIR) ; $(LIBPATHS) $(GNUMAKE) -e DESTDIR=$(FONTCONFIG_prefix) libdir=/usr/lib$(ARCHLIBSUBDIR) bindir=/usr/bin$(ARCHLIBSUBDIR) install )
75ace6601e66840436f52e61353ee0d400577b55Mark Andrews cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
ab2ac96c4e71dc803e47c35592044e116f61aca5Tatuya JINMEI 神明達哉# Quick inline perl script to fix up fc-cache & fc-list man pages
3bdf879a5301bce17e0a955585eb3decc541ba79Mark Andrews $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
3bdf879a5301bce17e0a955585eb3decc541ba79Mark Andrews print "\047\\\" t\n"; \
3bdf879a5301bce17e0a955585eb3decc541ba79Mark Andrews s|__vendorversion__|"$$date"| ; \
1b5b46942d149f891bb91e90c6f52944b77c8a68Mark Andrews s|__package__|SUNWfontconfig| ; \
1b5b46942d149f891bb91e90c6f52944b77c8a68Mark Andrews s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
6b25d2f7f7a1125508f8d225a8fef94e1db83555Mark Andrews s%^\\\|\.%.IR \\|.%; \
b6309ed962c4988a314d61742c4fbc4935467d68Mark Andrews# 6368378: fc-cache and fc-list man pages are broken
5613bf7de9760875da9f5fbc6ffcd93e0af967ffMark Andrews mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
ab5d8edc1bd391a1b306db68114fac303484b30fMark Andrews $(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
ab5d8edc1bd391a1b306db68114fac303484b30fMark Andrews -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
5613bf7de9760875da9f5fbc6ffcd93e0af967ffMark Andrews rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
8689f943a4859a8f68344236a1dcb81299a98347Mark Andrews perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
5613bf7de9760875da9f5fbc6ffcd93e0af967ffMark Andrews @case '$(MFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
2434ccfde7efa30b6fedf4630e5036eeb5d647d0Mark Andrews for i in fc-cache fc-list fc-match fc-cat ; do \
5bd76af084edfdcd1cb4db9453ac781d32dde6f7Mark Andrews APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
7f32428506d55083fe5ac9aa515294bdef7c6e27Mark Andrews $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \