Makefile revision 221
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass###############################################################################
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass#
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Fontconfig 2.x Makefile
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove#
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Use subject to license terms.
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove#
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#
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.
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney#
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.
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney#
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# @(#)Makefile 1.68 07/09/17
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass#
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Package name used in tarballs
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveLIB_MODULE=fontconfig
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Version number (used in path names)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIB_VERS=2.3.2
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Source tarball
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassSOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassSOURCE_TARBALL_SET=yes
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneySOURCE_UNCOMPRESS=gzcat
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Download site for source
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneySOURCE_URL_SET=yes
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Patches to apply to source after unpacking, in order
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneySOURCE_PATCHES=fontconfig-$(LIB_VERS).patch \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass fontconfig-$(LIB_VERS).patch.hide
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Library name (used for specfiles/mapfiles)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIBNAME=fontconfig
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Special version of freetype config to force certain arguments
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyFONTCONFIG_FT2CFG=$(BUILD_DIR)/freetype-config
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Install to /usr, not /usr/X11
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassLIB_PREFIX=/usr
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassLIB_PREFIX_SET=yes
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Path needed to find docbook2man, etc.
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Command line options to GNU autoconf configure script
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIB_ADD_CONFIG_OPTS = --with-expat-includes=/usr/sfw/include \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass --with-freetype-config=../freetype-config
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveLIB_ADD_CONFIG_ENV = $(LIBPATHS)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Library built in tree
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyLIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.0.4
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Where to install most files
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassFONTCONFIG_prefix=$(PROTODIR)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Where to install libraries
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveFONTCONFIG_libdir=$(FONTCONFIG_prefix)/usr/lib
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
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)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassinclude ../Makefile.inc
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
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
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 > $@
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney chmod +x $@
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove# Run configure script
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove$(SOURCE_DIR)/Makefile:= OPT_CFLAGS=$(FC_OPTFLAGS)
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveFC_OPTFLAGS_i386 =
1909339da3105dc509908ff39ecc298f2f94f446Ryan GroveFC_OPTFLAGS_sparc = $(DEFAULT_OPT_CFLAGS)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyFC_OPTFLAGS=$(FC_OPTFLAGS_$(MACH))
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass$(SOURCE_DIR)/Makefile: $(FONTCONFIG_FT2CFG)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass# Need to regenerate configure with newer autoconf to work with Studio 12
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glasssource_gen::
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass (cd $(SOURCE_DIR) && autoreconf -v)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
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
1909339da3105dc509908ff39ecc298f2f94f446Ryan Grove
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass$(LIB_BUILT): $(SOURCE_DIR)/fonts.conf-SUNW
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassinstall_gen:: $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass rm $(PROTODIR)/etc/fonts/fonts.conf
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass $(MAKE) $(MFLAGS) fontconfig-sunman-install
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass$(FONTCONFIG_SMF_MANIFEST): fc-cache.xml
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney /usr/sbin/svccfg validate fc-cache.xml
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass mkdir -p $(FONTCONFIG_SMF_MANIFEST_dir)
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney if [ -f $@ ] ; then /bin/rm -f $@ ; fi
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney cp fc-cache.xml $@
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# Quick inline perl script to fix up fc-cache & fc-list man pages
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyFC_MAN_FIX=perl -n -MPOSIX=strftime -e \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass 'BEGIN { \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass print "\047\\\" t\n"; \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass } \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney { \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s|__vendorversion__|"$$date"| ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s|__package__|SUNWfontconfig| ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney s%^\\\|\.%.IR \\|.%; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney print \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney }'
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney#
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney# 6368378: fc-cache and fc-list man pages are broken
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney#
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt SweeneyFC_MAN_DIR=$(PROTODIR)/usr/share/man
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeneyfontconfig-sunman-install:
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 fi
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 for i in fc-cache fc-list fc-match ; do \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney if [ -f $(FC_MAN_DIR)/man1/$$i.1 ] ; then \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass rm -f $(FC_MAN_DIR)/man1/$$i.1 ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney fi ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney if [ -f sunman-notes-$$i ] ; then \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney else \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass APPEND=$(TOP)/common/sunman-stability ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney fi ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney if [ -f $(SOURCE_DIR)/$$i/$$i.1 ] ; then \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $(FC_MAN_DIR)/man1/$$i.1 ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney else \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $(FC_MAN_FIX) $$i.man $$APPEND > \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney $(FC_MAN_DIR)/man1/$$i.1 ; \
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney fi ; \
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass done
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeneyinstall_64::
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney -/bin/rm -f $(FONTCONFIG_libdir)/64
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass ln -s $(FONTCONFIG_libdir)/$(SUBDIR64) $(FONTCONFIG_libdir)/64
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney
04b64da9f66b8791f4519ebf215ca4ee5771dfe3Matt Sweeney