1# 2# FreeType 2 configuration rules templates for Unix + configure 3# 4 5 6# Copyright 1996-2016 by 7# David Turner, Robert Wilhelm, and Werner Lemberg. 8# 9# This file is part of the FreeType project, and may only be used, modified, 10# and distributed under the terms of the FreeType project license, 11# LICENSE.TXT. By continuing to use, modify, or distribute this file you 12# indicate that you have read the license and understand and accept it 13# fully. 14 15SHELL := @SHELL@ 16 17TOP_DIR := $(shell cd $(TOP_DIR); pwd) 18 19DELETE := rm -f 20DELDIR := rm -rf 21CAT := cat 22SEP := / 23 24# this is used for `make distclean' and `make install' 25OBJ_BUILD ?= $(BUILD_DIR) 26 27# don't use `:=' here since the path stuff will be included after this file 28# 29FTSYS_SRC = @FTSYS_SRC@ 30 31INSTALL := @INSTALL@ 32INSTALL_DATA := @INSTALL_DATA@ 33INSTALL_PROGRAM := @INSTALL_PROGRAM@ 34INSTALL_SCRIPT := @INSTALL_SCRIPT@ 35MKINSTALLDIRS := @MKDIR_P@ 36 37CLEAN += $(OBJ_BUILD)/freetype-config \ 38 $(OBJ_BUILD)/freetype2.pc 39 40DISTCLEAN += $(OBJ_BUILD)/config.cache \ 41 $(OBJ_BUILD)/config.log \ 42 $(OBJ_BUILD)/config.status \ 43 $(OBJ_BUILD)/unix-def.mk \ 44 $(OBJ_BUILD)/unix-cc.mk \ 45 $(OBJ_BUILD)/ftconfig.h \ 46 $(LIBTOOL) \ 47 $(OBJ_BUILD)/Makefile 48 49 50# Standard installation variables. 51# 52prefix := @prefix@ 53exec_prefix := @exec_prefix@ 54libdir := @libdir@ 55bindir := @bindir@ 56includedir := @includedir@ 57datarootdir := @datarootdir@ 58datadir := @datadir@ 59mandir := @mandir@ 60 61version_info := @version_info@ 62 63# Variables needed for `freetype-config' and `freetype.pc'. 64# 65REQUIRES_PRIVATE := @REQUIRES_PRIVATE@ 66LIBS_PRIVATE := @LIBS_PRIVATE@ 67LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@ 68build_libtool_libs := @build_libtool_libs@ 69ft_version := @ft_version@ 70 71# The directory where all library files are placed. 72# 73# By default, this is the same as $(OBJ_DIR); however, this can be changed 74# to suit particular needs. 75# 76LIB_DIR := $(OBJ_DIR) 77 78# The BASE_SRC macro lists all source files that should be included in 79# src/base/ftbase.c. When configure sets up CFLAGS to build ftmac.c, 80# ftmac.c should be added to BASE_SRC. 81ftmac_c := @ftmac_c@ 82 83# The SYSTEM_ZLIB macro is defined if the user wishes to link dynamically 84# with its system wide zlib. If SYSTEM_ZLIB is 'yes', the zlib part of the 85# ftgzip module is not compiled in. 86SYSTEM_ZLIB := @SYSTEM_ZLIB@ 87 88 89# The NO_OUTPUT macro is appended to command lines in order to ignore 90# the output of some programs. 91# 92NO_OUTPUT := 2> /dev/null 93 94 95# To support calls like 96# 97# configure --includedir='${libdir}'/freetype2/include 98# 99# we generate `freetype-config' and `freetype.pc' at compile time so that 100# those variables are properly expanded. 101 102$(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in 103 rm -f $@ $@.tmp 104 sed -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \ 105 -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ 106 -e 's|%exec_prefix%|$(exec_prefix)|' \ 107 -e 's|%ft_version%|$(ft_version)|' \ 108 -e 's|%includedir%|$(includedir)|' \ 109 -e 's|%libdir%|$(libdir)|' \ 110 -e 's|%prefix%|$(prefix)|' \ 111 $< \ 112 > $@.tmp 113 chmod +x $@.tmp 114 chmod a-w $@.tmp 115 mv $@.tmp $@ 116 117# To support directory names with spaces (as might easily happen on Windows 118# platforms), the right solution would be to surround the pkg-variables in 119# `freetype2.pc' with double quotes. However, doing so ironically disables 120# the prefix override mechanism especially written for Windows. This is a 121# bug in pkg-config version 0.28 and earlier. 122# 123# For this reason, we escape spaces with backslashes. 124 125exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix)) 126includedir_x := $(subst $(space),\\$(space),$(includedir)) 127libdir_x := $(subst $(space),\\$(space),$(libdir)) 128prefix_x := $(subst $(space),\\$(space),$(prefix)) 129 130$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in 131 rm -f $@ $@.tmp 132 sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \ 133 -e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \ 134 -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ 135 -e 's|%exec_prefix%|$(exec_prefix_x)|' \ 136 -e 's|%ft_version%|$(ft_version)|' \ 137 -e 's|%includedir%|$(includedir_x)|' \ 138 -e 's|%libdir%|$(libdir_x)|' \ 139 -e 's|%prefix%|$(prefix_x)|' \ 140 $< \ 141 > $@.tmp 142 chmod a-w $@.tmp 143 mv $@.tmp $@ 144 145all install: $(OBJ_BUILD)/freetype-config \ 146 $(OBJ_BUILD)/freetype2.pc 147 148# EOF 149