Makefile revision 422
1186N/A###############################################################################
949N/A#
1294N/A# Fontconfig 2.x Makefile
1186N/A#
949N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
949N/A# Use subject to license terms.
1186N/A#
949N/A# Permission is hereby granted, free of charge, to any person obtaining a
1186N/A# copy of this software and associated documentation files (the
1186N/A# "Software"), to deal in the Software without restriction, including
1186N/A# without limitation the rights to use, copy, modify, merge, publish,
1186N/A# distribute, and/or sell copies of the Software, and to permit persons
1186N/A# to whom the Software is furnished to do so, provided that the above
1186N/A# copyright notice(s) and this permission notice appear in all copies of
1186N/A# the Software and that both the above copyright notice(s) and this
1186N/A# permission notice appear in supporting documentation.
1186N/A#
1186N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1186N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1186N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1186N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1186N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1186N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1186N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1186N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1186N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1186N/A#
1186N/A# Except as contained in this notice, the name of a copyright holder
1186N/A# shall not be used in advertising or otherwise to promote the sale, use
1186N/A# or other dealings in this Software without prior written authorization
1186N/A# of the copyright holder.
1186N/A#
1186N/A# @(#)Makefile 1.74 08/03/20
1186N/A#
1186N/A
1186N/APWD:sh=pwd
1186N/ATOP=$(PWD)/../..
1186N/A
1186N/A# Build 32-bit, 64-bit, or both?
1186N/ABUILD_TYPES=32 64
1186N/ABUILD_TYPES_SET=yes
1390N/A
1390N/A# Package name used in tarballs
1390N/ALIB_MODULE=fontconfig
1390N/A
1390N/A# Version number (used in path names)
1186N/ALIB_VERS=2.5.0
1186N/A
1390N/A# Source tarball
1390N/ASOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
1390N/ASOURCE_TARBALL_SET=yes
1186N/ASOURCE_UNCOMPRESS=gzcat
1186N/A
1186N/A# Download site for source
1186N/ASOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
1186N/ASOURCE_URL_SET=yes
1186N/A
1186N/A# Patches to apply to source after unpacking, in order
1186N/ASOURCE_PATCHES=fontconfig-$(LIB_VERS).patch,-p1 \
1186N/A fontconfig-$(LIB_VERS).patch.hide,-p1 \
1186N/A fontconfig-$(LIB_VERS)-fonts.conf.patch
1186N/A
1186N/A# Directory created by unpacking source
1186N/ASOURCE_DIR=$(BUILD_DIR)/$(LIB_MODULE)-$(LIB_VERS)
1186N/A
1186N/A# Library name (used for specfiles/mapfiles)
1186N/ALIBNAME=fontconfig
1186N/A
1186N/A# Special version of freetype config to force certain arguments
1186N/AFONTCONFIG_FT2CFG=$(BUILD_DIR)/freetype-config
1302N/A
1186N/A# Install to /usr, not /usr/X11
1186N/ALIB_PREFIX=/usr
1186N/ALIB_PREFIX_SET=yes
1186N/A
1186N/A# Path needed to find docbook2man, etc.
1186N/A# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
1390N/A
1390N/A# Command line options to GNU autoconf configure script
1390N/ALIB_ADD_CONFIG_OPTS = \
1390N/A --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
1390N/A --with-freetype-config=../freetype-config
1390N/A
1390N/ALIB_ADD_CONFIG_ENV = $(LIBPATHS)
1390N/A
1186N/A# Library built in tree
1186N/ALIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.3.0
1186N/A
1186N/A# What to build
1186N/ABUILD_TARGETS=$(GNUMAKE) $(LIB_BUILT)
1186N/A
1186N/A# Options to autoconf configure script
1390N/AFONTCONFIG_CFG=--enable-shared=yes --enable-static=no --with-expat-includes=/usr/sfw/include \
1390N/A --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) --prefix=/usr --with-confdir=/etc/fonts \
1390N/A --with-cache-dir=/var/cache/fontconfig --with-default-fonts=/usr/openwin/lib/X11/fonts \
1390N/A --with-add-fonts='--font-dirs-go-here--' --with-freetype-config=../freetype-config \
1390N/A --libdir='$${exec_prefix}/lib$(LIBSUBDIR)' --bindir='$${exec_prefix}/bin$(ARCHLIBSUBDIR)' \
1390N/A --mandir='$${prefix}/share/man'
1390N/A
1390N/A# Where to install most files
1390N/AFONTCONFIG_prefix=$(PROTODIR)
1390N/A
1390N/A# Where to install libraries
1390N/AFONTCONFIG_libdir=$(FONTCONFIG_prefix)/usr/lib
1390N/A
1186N/A# Paths to find libraries
1186N/ALIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/lib$(LIBSUBDIR) $(DOC_PATH)
1186N/A
1186N/A# Include common rulesets
1186N/Ainclude $(TOP)/common/Makefile.inc
1186N/A
1186N/A# Path to install fc-cache manifest & method script
1390N/AFONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
1186N/AFONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
1186N/AFONTCONFIG_SMF_METHOD_dir=$(PROTODIR)/lib/svc/method
1186N/AFONTCONFIG_SMF_METHOD=$(FONTCONFIG_SMF_METHOD_dir)/fc-cache
1186N/A
1186N/A$(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/bin$(LIBSUBDIR)/freetype-config
1186N/A -if [ -f $@ ] ; then rm $@ ; fi
1186N/A 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 > $@
1186N/A chmod +x $@
1186N/A
1186N/A# Run configure script
1186N/A$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) autoreconf $(FONTCONFIG_FT2CFG)
1186N/A (cd $(SOURCE_DIR) ; \
1186N/A chmod a+x configure ; \
1186N/A CC=$(CC) CFLAGS="$(LIB_CFLAGS)" LDFLAGS="$(LIB_LDFLAGS)" $(LIBPATHS) ./configure $(FONTCONFIG_CFG))
1384N/A if [ -f $(SOURCE_DIR)/src/Makefile.bak ] ; then \
1384N/A rm -f $(SOURCE_DIR)/src/Makefile.bak ; \
1384N/A fi
1186N/A
1186N/A$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fix-fonts.conf.pl
1186N/A perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
1186N/A
1186N/A$(LIB_BUILT): $(SOURCE_DIR)/Makefile $(SOURCE_DIR)/fonts.conf-SUNW
1186N/A (cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_LDFLAGS)" $(LIBPATHS) $(GNUMAKE) $(MFLAGS))
1186N/A
1186N/Ainstall_gen:: $(LIB_BUILT) $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST) $(FONTCONFIG_SMF_METHOD)
1186N/A (cd $(SOURCE_DIR) ; $(LIBPATHS) $(GNUMAKE) -e DESTDIR=$(FONTCONFIG_prefix) libdir=/usr/lib$(ARCHLIBSUBDIR) bindir=/usr/bin$(ARCHLIBSUBDIR) install )
949N/A rm $(PROTODIR)/etc/fonts/fonts.conf
1390N/A cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
1390N/A $(MAKE) $(MFLAGS) fontconfig-sunman-install
1186N/A
1186N/A$(FONTCONFIG_SMF_MANIFEST): fc-cache.xml
1186N/A /usr/sbin/svccfg validate fc-cache.xml
1186N/A mkdir -p $(FONTCONFIG_SMF_MANIFEST_dir)
1390N/A if [ -f $@ ] ; then /bin/rm -f $@ ; fi
1186N/A cp fc-cache.xml $@
1186N/A
1186N/A$(FONTCONFIG_SMF_METHOD): fc-cache.sh
1390N/A mkdir -p $(FONTCONFIG_SMF_METHOD_dir)
1186N/A if [ -f $@ ] ; then /bin/rm -f $@ ; fi
1186N/A cp fc-cache.sh $@
1186N/A chmod 755 $@
1186N/A
1186N/A# Quick inline perl script to fix up fc-cache & fc-list man pages
1294N/AFC_MAN_FIX=perl -n -MPOSIX=strftime -e \
1186N/A 'BEGIN { \
1186N/A $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
1186N/A print "\047\\\" t\n"; \
1186N/A } \
1186N/A { \
1186N/A s|__vendorversion__|"$$date"| ; \
1186N/A s|__package__|SUNWfontconfig| ; \
1186N/A s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
1186N/A s%^\\\|\.%.IR \\|.%; \
1186N/A print \
1186N/A }'
1186N/A#
1186N/A# 6368378: fc-cache and fc-list man pages are broken
1186N/A#
1186N/AFC_MAN_DIR=$(PROTODIR)/usr/share/man
1186N/A
1186N/Afontconfig-sunman-install:
1186N/A mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
1186N/A $(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
949N/A -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
949N/A rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
1388N/A fi
1186N/A perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
1186N/A @case '$(MFLAGS)' in *[ik]*) set +e;; esac; set -x ; \
949N/A for i in fc-cache fc-list fc-match fc-cat ; do \
1388N/A if [ -f $(FC_MAN_DIR)/man1/$$i.1 ] ; then \
1186N/A rm -f $(FC_MAN_DIR)/man1/$$i.1 ; \
1186N/A fi ; \
1186N/A if [ -f sunman-notes-$$i ] ; then \
1186N/A APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
1388N/A else \
1186N/A APPEND=$(TOP)/common/sunman-stability ; \
1388N/A fi ; \
1388N/A if [ -f $(SOURCE_DIR)/$$i/$$i.1 ] ; then \
1186N/A $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.1 $$APPEND > \
1388N/A $(FC_MAN_DIR)/man1/$$i.1 ; \
1186N/A else \
1186N/A $(FC_MAN_FIX) $$i.man $$APPEND > \
1388N/A $(FC_MAN_DIR)/man1/$$i.1 ; \
1388N/A fi ; \
949N/A done
1388N/A
1388N/Ainstall_64::
1388N/A -/bin/rm -f $(FONTCONFIG_libdir)/64
1388N/A ln -s $(FONTCONFIG_libdir)/$(SUBDIR64) $(FONTCONFIG_libdir)/64
1186N/A
1186N/A
1186N/A