open-src/font/Makefile.inc
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Wed Aug 10 21:49:25 2016 -0700 (2016-08-10)
changeset 1653 9fcb30a2102b
parent 1479 4a76cf532c2c
permissions -rw-r--r--
24443559 Update deja-vu fonts to version 2.37
Alan@98
     1
# -*- Makefile -*- rules common to most X.Org font modules
Alan@98
     2
#
Alan@1610
     3
# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
Alan@98
     4
#
Alan@98
     5
# Permission is hereby granted, free of charge, to any person obtaining a
Alan@919
     6
# copy of this software and associated documentation files (the "Software"),
Alan@919
     7
# to deal in the Software without restriction, including without limitation
Alan@919
     8
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
Alan@919
     9
# and/or sell copies of the Software, and to permit persons to whom the
Alan@919
    10
# Software is furnished to do so, subject to the following conditions:
Alan@919
    11
#
Alan@919
    12
# The above copyright notice and this permission notice (including the next
Alan@919
    13
# paragraph) shall be included in all copies or substantial portions of the
Alan@919
    14
# Software.
Alan@919
    15
#
Alan@919
    16
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Alan@919
    17
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Alan@919
    18
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Alan@919
    19
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Alan@919
    20
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
Alan@919
    21
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Alan@919
    22
# DEALINGS IN THE SOFTWARE.
Alan@98
    23
#
Alan@98
    24
#
Alan@98
    25
Alan@156
    26
### Makefile settings/rules common to all X.Org font modules
Alan@98
    27
Alan@98
    28
PWD:sh=pwd
Alan@967
    29
TOP=$(PWD)/../../..
Alan@98
    30
Alan@493
    31
MODTYPE=font
Alan@98
    32
Alan@493
    33
### Include common definitions
Alan@967
    34
include $(TOP)/open-src/common/Makefile.init
Alan@98
    35
Alan@970
    36
# Default package name for font packages
Alan@970
    37
MODTYPE_PKGHIER_DEFAULT         = $(MODTYPE_PKGHIER_SET:yes=$(POUND_SIGN))
Alan@970
    38
$(MODTYPE_PKGHIER_DEFAULT)	MODTYPE_PKGHIER=system/font
Alan@970
    39
MODTYPE_PKGHIER_SET=yes
Alan@970
    40
MODULE_PKGTAIL_DEFAULT		= $(MODULE_PKGTAIL_SET:yes=$(POUND_SIGN))
Alan@970
    41
$(MODULE_PKGTAIL_DEFAULT)	MODULE_PKGTAIL:sh=basename $(pwd)
Alan@970
    42
MODULE_PKGTAIL_SET	      	= yes
Alan@970
    43
Alan@970
    44
# Package classification
Alan@970
    45
MODULE_PKGCLASS_DEFAULT		= $(MODULE_PKGCLASS_SET:yes=$(POUND_SIGN))
Alan@970
    46
$(MODULE_PKGCLASS_DEFAULT)	MODULE_PKGCLASS=System/Fonts
Alan@970
    47
MODULE_PKGCLASS_SET		= yes
Alan@970
    48
Alan@1356
    49
# Default module description for packages in this area
Alan@1356
    50
MODTYPE_DESC = the $(MODULE_NAME:font-%=%) fonts
Alan@1356
    51
Alan@1392
    52
# Default TPNO & license text for X.Org fonts
Alan@1395
    53
UPSTREAM_DEFAULT	= $(UPSTREAM_SET:yes=$(POUND_SIGN))	
Alan@1395
    54
$(UPSTREAM_DEFAULT)	ORACLE_TPNO = $(ORACLE_TPNO_xorg_fonts)
Alan@1395
    55
$(UPSTREAM_DEFAULT)	ORACLE_TPNO_SET = yes
Alan@1395
    56
$(UPSTREAM_DEFAULT)	XORG_FONT_LICENSE  = ../X11-font-license.txt
Alan@1395
    57
$(UPSTREAM_DEFAULT) 	ADD_LICENSE_HEADER = ../X11-font-license-add.txt
Alan@1395
    58
$(UPSTREAM_DEFAULT)	LICENSE_APPEND = $(ADD_LICENSE_FILES)
Alan@1395
    59
Alan@1395
    60
# If font makefile contains AUTO_ADD_LICENSE = no, we just display the X.Org
Alan@1395
    61
# font license, as there is no other attribution notice required for the 
Alan@1395
    62
# package.  Otherwise we display the X11 license, plus a header and the 
Alan@1395
    63
# package's own COPYING file.
Alan@1395
    64
ADD_LICENSE_YES  = $(AUTO_ADD_LICENSE:no=$(POUND_SIGN)) 
Alan@1395
    65
$(ADD_LICENSE_YES) ADD_LICENSE_NO = $(POUND_SIGN)
Alan@1395
    66
Alan@1395
    67
$(UPSTREAM_DEFAULT)$(ADD_LICENSE_YES)	MODULE_LICENSE_PREPEND  = $(XORG_FONT_LICENSE)
Alan@1395
    68
$(UPSTREAM_DEFAULT)$(ADD_LICENSE_YES)	MODULE_LICENSE_PREPEND += $(ADD_LICENSE_HEADER)
Alan@1395
    69
$(UPSTREAM_DEFAULT)$(ADD_LICENSE_NO)	LICENSE_FILE = $(XORG_FONT_LICENSE)
Alan@1395
    70
$(UPSTREAM_DEFAULT)$(ADD_LICENSE_NO)	LICENSE_FILE_SET = yes
Alan@1392
    71
Alan@493
    72
# Most font modules have no man pages
Alan@493
    73
MODTYPE_SUNTOUCH_MAN_FLAGS= 
Alan@98
    74
Alan@493
    75
# No common dependencies
Alan@493
    76
MODTYPE_CONFIGURE_DEPS=
Alan@493
    77
Alan@837
    78
# Set default installation path for fonts
Alan@837
    79
MODTYPE_CONFIG_OPTS = --with-fontrootdir="$(X11_FONT_DIR)"
Alan@963
    80
MODTYPE_CONFIG_OPTS += $(MODULE_FONTDIR:%=--with-fontdir="%")
Alan@837
    81
Alan@837
    82
# Disable compression of pcf fonts
Alan@837
    83
MODTYPE_CONFIG_OPTS += --without-compression
Alan@837
    84
Alan@1288
    85
# Avoid races between modules that install to the same directory by not 
Alan@1288
    86
# running mkfontdir at build time, but waiting for later (either in the
Alan@1288
    87
# sun-aliases module or during packaging in generate_font_metadata.pl).
Alan@1288
    88
MODTYPE_CONFIG_OPTS += MKFONTDIR=/usr/bin/true
Alan@1288
    89
Alan@1425
    90
# Most font modules have nothing to build, but font-util builds some programs
Alan@1425
    91
MODTYPE_CFLAGS=$(PROG_CFLAGS)
Alan@1425
    92
MODTYPE_CPPFLAGS=$(PROG_CPPFLAGS)
Alan@1425
    93
MODTYPE_CXXFLAGS=$(PROG_CXXFLAGS)
Alan@1425
    94
MODTYPE_LDFLAGS=$(PROG_LDFLAGS)
Alan@493
    95
MODTYPE_LD_OPTIONS=
Alan@98
    96
Alan@306
    97
# Paths to find mkfontscale, fc-cache & the libraries they need in build area
Alan@1610
    98
FONT_UTILS_PATH=$(PROTODIR)/usr/bin
Alan@1610
    99
FONT_LIBS_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(LIBSUBDIR_64):$(PROTODIR)/usr/lib$(LIBSUBDIR_64)
Alan@306
   100
Alan@493
   101
# Additional environment variable options to GNU autoconf configure script
Alan@493
   102
MODTYPE_CONFIG_ENV = PATH="$(FONT_UTILS_PATH):$$PATH" \
Alan@493
   103
	LD_LIBRARY_PATH="$(FONT_LIBS_PATH)"
Alan@98
   104
Alan@98
   105
# Environment variable options needed when building
Alan@493
   106
MODTYPE_BUILD_ENV = PATH="$(FONT_UTILS_PATH):$$PATH" \
Alan@606
   107
	LD_LIBRARY_PATH="$(FONT_LIBS_PATH)"
Alan@98
   108
Alan@963
   109
# Need to install links in fontpath.d directory
Alan@963
   110
MODTYPE_ADD_INSTALL_TARGETS = install_fontpath_links
Alan@963
   111
Alan@493
   112
### Include common rulesets
Alan@967
   113
include $(TOP)/open-src/common/Makefile.inc
Alan@98
   114
Alan@963
   115
# Can't use Makefile substitutions or dependencies on the links themselves
Alan@963
   116
#  due to the : characters & shell math expansion in the link names
Alan@963
   117
# Ignores errors since /usr/bin/ln -sf can fail due to race conditions
Alan@963
   118
#  when parallel makes try making the same symlink at the same time
Alan@963
   119
install_fontpath_links: $(PROTODIR)$(X11_FONT_CATALOGUE)
Alan@963
   120
	@for l in $(FONTPATH_LINKS) ; do \
Alan@963
   121
	    if [[ ! -L $(PROTODIR)$(X11_FONT_CATALOGUE)/$$l ]] ; then \
Alan@963
   122
		( $(START_CMD_ECHO) ; ln -sf ../../..$(MODULE_FONTDIR) \
Alan@963
   123
		  $(PROTODIR)$(X11_FONT_CATALOGUE)/$$l || true ); \
Alan@963
   124
	    fi \
Alan@963
   125
	done
Alan@963
   126
Alan@963
   127
$(PROTODIR)$(X11_FONT_CATALOGUE):
Alan@963
   128
	mkdir -p $@