Makefile revision 493
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein###############################################################################
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# Fontconfig 2.x Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Use subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Permission is hereby granted, free of charge, to any person obtaining a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copy of this software and associated documentation files (the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# "Software"), to deal in the Software without restriction, including
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# without limitation the rights to use, copy, modify, merge, publish,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# distribute, and/or sell copies of the Software, and to permit persons
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# to whom the Software is furnished to do so, provided that the above
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copyright notice(s) and this permission notice appear in all copies of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the Software and that both the above copyright notice(s) and this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# permission notice appear in supporting documentation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
cedb0bd0c1e3c461b7e479a16d3adfd5b150f1f4Mark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Except as contained in this notice, the name of a copyright holder
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# shall not be used in advertising or otherwise to promote the sale, use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or other dealings in this Software without prior written authorization
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# of the copyright holder.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# @(#)Makefile 1.77 08/08/08
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Package name used in tarballs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Version number (used in path names)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Source tarball
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSOURCE_TARBALL_NAME=fontconfig-$(MODULE_VERSION).tar.gz
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Download site for source
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Patches to apply to source after unpacking, in order
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsSOURCE_PATCHES=fontconfig-$(MODULE_VERSION).patch,-p1 \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Library name (used for specfiles/mapfiles)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Directory created by unpacking source
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(MODULE_VERSION)
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews# Install to /usr, not /usr/X11
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews# Additional command line options to GNU autoconf configure script
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein --with-freetype-config=$(PROTODIR)/usr/bin$(LIBSUBDIR)/freetype-config \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Need to use GNU Make to build
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews# What to build
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsBUILD_TARGETS=$(GNUMAKE) default_build $(SOURCE_DIR)/fonts.conf-SUNW
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews# Paths to find libraries
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_BUILD_ENV = LD_LIBRARY_PATH=$(PROTODIR)/usr/lib$(LIBSUBDIR) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Need to rebuild autoconf/automake files
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Path to install fc-cache manifest & method script
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsFONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinFONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsFONTCONFIG_SMF_METHOD_dir=$(PROTODIR)/lib/svc/method
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark AndrewsFONTCONFIG_SMF_METHOD=$(FONTCONFIG_SMF_METHOD_dir)/fc-cache
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# Include common rulesets
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fix-fonts.conf.pl
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(SOURCE_DIR)/fonts.conf: $(UNPACK_TARGET) $(CONFIGURE_TARGETS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininstall_gen:: $(LIB_BUILT) $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST) $(FONTCONFIG_SMF_METHOD)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Quick inline perl script to fix up fc-cache & fc-list man pages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print "\047\\\" t\n"; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein s|__vendorversion__|"$$date"| ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein s|__package__|SUNWfontconfig| ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein s%^\\\|\.%.IR \\|.%; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein for i in fc-cache fc-list fc-match fc-cat ; do \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \