Makefile revision 400
cc6d67469cf390842adf1bd35dd2b21fc3b7df18Mark Andrews###############################################################################
cc6d67469cf390842adf1bd35dd2b21fc3b7df18Mark Andrews# Fontconfig 2.x Makefile
1e9848fb2b4573711c02696dc4ee6540de4c81f6Mark Andrews# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1e9848fb2b4573711c02696dc4ee6540de4c81f6Mark Andrews# Use subject to license terms.
c45d848e2a5898975a14a6311a406f45028a45b0Tatuya JINMEI 神明達哉# Permission is hereby granted, free of charge, to any person obtaining a
c45d848e2a5898975a14a6311a406f45028a45b0Tatuya JINMEI 神明達哉# copy of this software and associated documentation files (the
c45d848e2a5898975a14a6311a406f45028a45b0Tatuya JINMEI 神明達哉# "Software"), to deal in the Software without restriction, including
7dc38ccd52efe59c8fef8e73f9313080652a1c4aShawn Routhier# without limitation the rights to use, copy, modify, merge, publish,
7dc38ccd52efe59c8fef8e73f9313080652a1c4aShawn Routhier# distribute, and/or sell copies of the Software, and to permit persons
7dc38ccd52efe59c8fef8e73f9313080652a1c4aShawn Routhier# to whom the Software is furnished to do so, provided that the above
7dc38ccd52efe59c8fef8e73f9313080652a1c4aShawn Routhier# copyright notice(s) and this permission notice appear in all copies of
ce164dbd9c97331a54994748df3ba72c35920946Tatuya JINMEI 神明達哉# the Software and that both the above copyright notice(s) and this
ce164dbd9c97331a54994748df3ba72c35920946Tatuya JINMEI 神明達哉# permission notice appear in supporting documentation.
ce164dbd9c97331a54994748df3ba72c35920946Tatuya JINMEI 神明達哉# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
c6217b2899ea2bca7f5870ea5dbb3e46fbb72391Mark Andrews# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
86077a2e87bcf2b13cbe2ecfeb17502cc2c12b04Mark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
b8d036c434d68e358c95bcb7268b5c310ed0579cMark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
b8d036c434d68e358c95bcb7268b5c310ed0579cMark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
b8d036c434d68e358c95bcb7268b5c310ed0579cMark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
003fd2f720f79404b62d49f6dfe7aa1257f03b08Mark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
003fd2f720f79404b62d49f6dfe7aa1257f03b08Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
003fd2f720f79404b62d49f6dfe7aa1257f03b08Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
a80d26914afece7324158918e8d74c7c8384a0dfMark Andrews# Except as contained in this notice, the name of a copyright holder
a80d26914afece7324158918e8d74c7c8384a0dfMark Andrews# shall not be used in advertising or otherwise to promote the sale, use
a80d26914afece7324158918e8d74c7c8384a0dfMark Andrews# or other dealings in this Software without prior written authorization
c19f322914f380404b613fbb31f5ac2582098f9dMark Andrews# of the copyright holder.
c19f322914f380404b613fbb31f5ac2582098f9dMark Andrews# @(#)Makefile 1.74 08/03/20
08fb52ec8c3923e501c7f8d74c524cced52551f9Mark Andrews# Build 32-bit, 64-bit, or both?
64c43af4f464b4ead99c3d2a561f0013fd26308cMark Andrews# Package name used in tarballs
c5259c013bba297cb0d38b85bd1c83fc26ef268cMark Andrews# Version number (used in path names)
c5259c013bba297cb0d38b85bd1c83fc26ef268cMark Andrews# Source tarball
ce0a4906ad27a8743e4f59e8ea06433640d78e54Mark AndrewsSOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
b1003ace6f6e15ffa212c7982c80845f549e6cefMark Andrews# Download site for source
b1003ace6f6e15ffa212c7982c80845f549e6cefMark AndrewsSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
92348098ebe7ef4c26bfe2204a7364fa18735afcMark Andrews# Patches to apply to source after unpacking, in order
637a4234fab5dacacfa0d4fb8b41290b634b252fMark AndrewsSOURCE_PATCHES=fontconfig-$(LIB_VERS).patch,-p1 \
2e20dea9fc0a84217c7debdef8b4b6c6f04d3998Mark Andrews# Directory created by unpacking source
2e20dea9fc0a84217c7debdef8b4b6c6f04d3998Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/$(LIB_MODULE)-$(LIB_VERS)
13396661f46572d7b94703a25721aad040fbd91aMark Andrews# Library name (used for specfiles/mapfiles)
64f8608ed6b7f42a4a7d358fade2c82dfd1e9c01Mark Andrews# Special version of freetype config to force certain arguments
d3cbd6b05c16c6e0e86c1651bda3b3ee06574d62Mark Andrews# Install to /usr, not /usr/X11
3a28f0dc73549d8c59ad18898540892c7eed957bTatuya JINMEI 神明達哉# Path needed to find docbook2man, etc.
139cedabf9242add24d8326e216e451dd2d5a935Tatuya JINMEI 神明達哉# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
8ac908b38a2fd9b780ae3a27ff26932a17823ae0Mark Andrews# Command line options to GNU autoconf configure script
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
ebaf977ecfe6b26ba4482e00d1fd78914a1e17ebMark Andrews# Library built in tree
ebaf977ecfe6b26ba4482e00d1fd78914a1e17ebMark AndrewsLIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.3.0
140cf92b3bbff9da00a782c8afe27f5fa63bd7f7Evan Hunt# What to build
fd3a3783538312dc8f61a85ce4d3720f43b912c0Mark Andrews# Options to autoconf configure script
fd3a3783538312dc8f61a85ce4d3720f43b912c0Mark AndrewsFONTCONFIG_CFG=--enable-shared=yes --enable-static=no --with-expat-includes=/usr/sfw/include \
0185a9358cb8324f44e114c6fd3cbbc4b9c507e4Francis Dupont --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) --prefix=/usr --with-confdir=/etc/fonts \
8a198fa776a09beb4dabf40b73a54d9c7bd70ac9Evan Hunt --with-cache-dir=/var/cache/fontconfig --with-default-fonts=/usr/openwin/lib/X11/fonts \
8a198fa776a09beb4dabf40b73a54d9c7bd70ac9Evan Hunt --with-add-fonts='--font-dirs-go-here--' --with-freetype-config=../freetype-config \
8a198fa776a09beb4dabf40b73a54d9c7bd70ac9Evan Hunt --libdir='$${exec_prefix}/lib$(LIBSUBDIR)' --bindir='$${exec_prefix}/bin$(ARCHLIBSUBDIR)' \
ce0a4906ad27a8743e4f59e8ea06433640d78e54Mark Andrews# Where to install most files
0185a9358cb8324f44e114c6fd3cbbc4b9c507e4Francis Dupont# Where to install libraries
0185a9358cb8324f44e114c6fd3cbbc4b9c507e4Francis Dupont# Paths to find libraries
b47d410f8409294863f214542a05c92cbe86cf04Evan HuntLIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/lib$(LIBSUBDIR) $(DOC_PATH)
6ff7cd9fa57e8f8092c08df8f9ceccbffb6b19c9Francis Dupont# Include common rulesets
f77148e02902a96bddd5948e594bd4be2efe67ffFrancis Dupont# Path to install fc-cache manifest & method script
f77148e02902a96bddd5948e594bd4be2efe67ffFrancis DupontFONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
0185a9358cb8324f44e114c6fd3cbbc4b9c507e4Francis DupontFONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
0185a9358cb8324f44e114c6fd3cbbc4b9c507e4Francis DupontFONTCONFIG_SMF_METHOD_dir=$(PROTODIR)/lib/svc/method
a91029a00e83e3933046cc9354357bccaa66c272Francis DupontFONTCONFIG_SMF_METHOD=$(FONTCONFIG_SMF_METHOD_dir)/fc-cache
a91029a00e83e3933046cc9354357bccaa66c272Francis Dupont$(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/bin$(LIBSUBDIR)/freetype-config
05b1ab91a62c09b052cdd9641355671997430d15Evan Hunt -if [ -f $@ ] ; then rm $@ ; fi
05b1ab91a62c09b052cdd9641355671997430d15Evan 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 > $@
03e5afa4c09d57f85a007149999619e87f501138Evan Hunt# Run configure script
03e5afa4c09d57f85a007149999619e87f501138Evan Hunt$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) autoreconf $(FONTCONFIG_FT2CFG)
03e5afa4c09d57f85a007149999619e87f501138Evan Hunt CC=$(CC) CFLAGS="$(LIB_CFLAGS)" LDFLAGS="$(LIB_LDFLAGS)" $(LIBPATHS) ./configure $(FONTCONFIG_CFG))
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fix-fonts.conf.pl
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt$(LIB_BUILT): $(SOURCE_DIR)/Makefile $(SOURCE_DIR)/fonts.conf-SUNW
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt (cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_LDFLAGS)" $(LIBPATHS) $(GNUMAKE) $(MFLAGS))
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Huntinstall_gen:: $(LIB_BUILT) $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST) $(FONTCONFIG_SMF_METHOD)
8ebf67b7f0aeea7ef8c6e034c57a1dc57a7b216aEvan Hunt (cd $(SOURCE_DIR) ; $(LIBPATHS) $(GNUMAKE) -e DESTDIR=$(FONTCONFIG_prefix) libdir=/usr/lib$(ARCHLIBSUBDIR) bindir=/usr/bin$(ARCHLIBSUBDIR) install )
8ebf67b7f0aeea7ef8c6e034c57a1dc57a7b216aEvan Hunt cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
d8680445d6212d5552ea8a22fd2f9951b11c4b10Tatuya JINMEI 神明達哉# Quick inline perl script to fix up fc-cache & fc-list man pages
9ead684875ab0ab5fdb8b5dd837a88f7dbd0e01dEvan Hunt $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
9ead684875ab0ab5fdb8b5dd837a88f7dbd0e01dEvan Hunt print "\047\\\" t\n"; \
687b6322fb189c41c3672226a59461cc5c24c087Evan Hunt s|__vendorversion__|"$$date"| ; \
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews s|__package__|SUNWfontconfig| ; \
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews s%^\\\|\.%.IR \\|.%; \
5b77627c09dea9a65a70d2a0b95a22ff75b3ac04Mark Andrews# 6368378: fc-cache and fc-list man pages are broken
5773d3c007c0c065f83480aa17e61bea728221f9Mark Andrews mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
85c5ed3577655f4f710f0af5ee93edd71c336055Evan 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
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
0faf1492c711ddb063efda9f3f03b7afa938cff8Francis Dupont perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
0faf1492c711ddb063efda9f3f03b7afa938cff8Francis Dupont @case '$(MFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
0faf1492c711ddb063efda9f3f03b7afa938cff8Francis Dupont for i in fc-cache fc-list fc-match fc-cat ; do \
1361014b02f11cf8de8725d1770a3dccbc1c8975Evan Hunt APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
b09559fd36c5081ffaf58ab64bdef170c1a720f1Evan Hunt $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \