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