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