Makefile revision 221
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass###############################################################################
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Fontconfig 2.x Makefile
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Use subject to license terms.
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Permission is hereby granted, free of charge, to any person obtaining a
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# copy of this software and associated documentation files (the
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# "Software"), to deal in the Software without restriction, including
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# without limitation the rights to use, copy, modify, merge, publish,
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# distribute, and/or sell copies of the Software, and to permit persons
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# to whom the Software is furnished to do so, provided that the above
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# copyright notice(s) and this permission notice appear in all copies of
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# the Software and that both the above copyright notice(s) and this
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# permission notice appear in supporting documentation.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Except as contained in this notice, the name of a copyright holder
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# shall not be used in advertising or otherwise to promote the sale, use
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# or other dealings in this Software without prior written authorization
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# of the copyright holder.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# @(#)Makefile 1.68 07/09/17
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Package name used in tarballs
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Version number (used in path names)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Source tarball
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Download site for source
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Patches to apply to source after unpacking, in order
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Library name (used for specfiles/mapfiles)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Special version of freetype config to force certain arguments
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Install to /usr, not /usr/X11
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Path needed to find docbook2man, etc.
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Command line options to GNU autoconf configure script
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIB_ADD_CONFIG_OPTS = --with-expat-includes=/usr/sfw/include \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Library built in tree
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.0.4
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Where to install most files
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Where to install libraries
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Paths to find libraries
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/sfw/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/sfw/lib$(LIBSUBDIR) $(DOC_PATH)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Path to install fc-cache manifest
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyFONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveFONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney$(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/sfw/bin$(LIBSUBDIR)/freetype-config
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney -if [ -f $@ ] ; then rm $@ ; fi
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass sed -e 's|-L$$libdir|-L$(PROTODIR)$${exec_prefix}/lib$(LIBSUBDIR) -L$$libdir|' -e 's|^includedir=$${prefix}|includedir=$(PROTODIR)$${prefix}|' $(PROTODIR)/usr/sfw/bin$(LIBSUBDIR)/freetype-config > $@
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Run configure script
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove$(SOURCE_DIR)/Makefile:= OPT_CFLAGS=$(FC_OPTFLAGS)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Need to regenerate configure with newer autoconf to work with Studio 12
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fonts.conf.preuser fix-fonts.conf.pl
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassinstall_gen:: $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Quick inline perl script to fix up fc-cache & fc-list man pages
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass print "\047\\\" t\n"; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s|__vendorversion__|"$$date"| ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s|__package__|SUNWfontconfig| ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s%^\\\|\.%.IR \\|.%; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# 6368378: fc-cache and fc-list man pages are broken
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $(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
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney @case '$(MFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \