Makefile revision 165
2665d7759e63acff0bcd4135678f2cc6f2041d46Christian Maeder###############################################################################
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Fontconfig 2.x Makefile
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Use subject to license terms.
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Permission is hereby granted, free of charge, to any person obtaining a
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# copy of this software and associated documentation files (the
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# "Software"), to deal in the Software without restriction, including
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# without limitation the rights to use, copy, modify, merge, publish,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# distribute, and/or sell copies of the Software, and to permit persons
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# to whom the Software is furnished to do so, provided that the above
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# copyright notice(s) and this permission notice appear in all copies of
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# the Software and that both the above copyright notice(s) and this
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# permission notice appear in supporting documentation.
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
c4698c79f1f7de1a1f96a0c3ff1caf43f031ee3aChristian Maeder# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
937b288690ccf51ac6584efea1e0529f971181dbChristian Maeder# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Except as contained in this notice, the name of a copyright holder
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder# shall not be used in advertising or otherwise to promote the sale, use
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# or other dealings in this Software without prior written authorization
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maeder# of the copyright holder.
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# @(#)Makefile 1.64 07/05/17
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder# Package name used in tarballs
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Version number (used in path names)
05b9abe2e7d9e6126bf4ae29be6ef3693f32de73Christian Maeder# Source tarball
1ac36418f204bbe56f4cd951a979180721758999Christian MaederSOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Download site for source
1ac36418f204bbe56f4cd951a979180721758999Christian MaederSOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Patches to apply to source after unpacking, in order
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian MaederSOURCE_PATCHES=fontconfig-$(LIB_VERS).patch \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder# Library name (used for specfiles/mapfiles)
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maeder# Special version of freetype config to force certain arguments
1ac36418f204bbe56f4cd951a979180721758999Christian MaederFONTCONFIG_FT2CFG=$(BUILD_DIR)/freetype-config
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Install to /usr, not /usr/X11
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maeder# Path needed to find docbook2man, etc.
bfc5753e09c2f0f3290f617084b3e3a09df898afChristian Maeder# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
bfc5753e09c2f0f3290f617084b3e3a09df898afChristian Maeder# Command line options to GNU autoconf configure script
bfc5753e09c2f0f3290f617084b3e3a09df898afChristian MaederLIB_ADD_CONFIG_OPTS = --with-expat-includes=/usr/sfw/include \
bfc5753e09c2f0f3290f617084b3e3a09df898afChristian Maeder --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) \
bfc5753e09c2f0f3290f617084b3e3a09df898afChristian Maeder --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
1e3aca4178372af672efb237d16087c603fe5564Christian Maeder# Library built in tree
1ac36418f204bbe56f4cd951a979180721758999Christian MaederLIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.0.4
210dfc1dae8a99a85203384b282c36a0b91aad03Christian Maeder# Where to install most files
bfc5753e09c2f0f3290f617084b3e3a09df898afChristian Maeder# Where to install libraries
2686d4438ffde954ffbb3a3f307642a893b33570Christian MaederFONTCONFIG_libdir=$(FONTCONFIG_prefix)/usr/lib
116f6d65e5811fba9b64502302252084a3dd913aChristian Maeder# Paths to find libraries
116f6d65e5811fba9b64502302252084a3dd913aChristian MaederLIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/sfw/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/sfw/lib$(LIBSUBDIR) $(DOC_PATH)
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder# Path to install fc-cache manifest
1ac36418f204bbe56f4cd951a979180721758999Christian MaederFONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
60bf7f52638962c93ec43da9aad8cafc9f09c318Christian MaederFONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
60bf7f52638962c93ec43da9aad8cafc9f09c318Christian Maeder$(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/sfw/bin$(LIBSUBDIR)/freetype-config
e49fd57c63845c7806860a9736ad09f6d44dbaedChristian Maeder -if [ -f $@ ] ; then rm $@ ; fi
60bf7f52638962c93ec43da9aad8cafc9f09c318Christian Maeder 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 > $@
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maeder# Run configure script
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maeder$(SOURCE_DIR)/Makefile:= OPT_CFLAGS=$(FC_OPTFLAGS)
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maeder$(SOURCE_DIR)/Makefile: $(FONTCONFIG_FT2CFG)
2686d4438ffde954ffbb3a3f307642a893b33570Christian Maeder$(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fonts.conf.preuser fix-fonts.conf.pl
2686d4438ffde954ffbb3a3f307642a893b33570Christian Maeder perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
248ab4f138caa9a594cd3fe0815e7fd4150701efChristian Maederinstall_gen:: $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST)
c4698c79f1f7de1a1f96a0c3ff1caf43f031ee3aChristian Maeder cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
c4698c79f1f7de1a1f96a0c3ff1caf43f031ee3aChristian Maeder $(MAKE) $(MFLAGS) fontconfig-sunman-install
2686d4438ffde954ffbb3a3f307642a893b33570Christian Maeder# Quick inline perl script to fix up fc-cache & fc-list man pages
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder $$date=strftime("%e %b %Y",localtime((stat($$ARGV[0]))[9])); \
1f00fdae29d166de729f63ac7fc4f86fae9f0ca8Christian Maeder print "\047\\\" t\n"; \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder s|__vendorversion__|"$$date"| ; \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder s|__package__|SUNWfontconfig| ; \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder s|fontconfig\(3\)|libfontconfig\(3lib\)|; \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder s%^\\\|\.%.IR \\|.%; \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder $(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
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder -if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
22573c6b275549f2fe22f38daf53230edcdb6c6bChristian Maeder perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
9be1052882e8380405e446e5743d9b9d90fe4d46Christian Maeder if [ -f $(FC_MAN_DIR)/man1/$$i.1 ] ; then \
937b288690ccf51ac6584efea1e0529f971181dbChristian Maeder APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ; \
e49fd57c63845c7806860a9736ad09f6d44dbaedChristian Maeder $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.man $$APPEND > \