1# 2# FreeType 2 configuration rules templates for Unix + configure 3# 4 5 6# Copyright (C) 1996-2023 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 refdoc' and `make refdoc-venv' 25# 26PYTHON := @PYTHON@ 27BIN := bin 28 29# this is used for `make distclean' and `make install' 30OBJ_BUILD ?= $(PLATFORM_DIR) 31 32# don't use `:=' here since the path stuff will be included after this file 33# 34FTSYS_SRC = @FTSYS_SRC@ 35 36INSTALL := @INSTALL@ 37INSTALL_DATA := @INSTALL_DATA@ 38INSTALL_PROGRAM := @INSTALL_PROGRAM@ 39INSTALL_SCRIPT := @INSTALL_SCRIPT@ 40MKINSTALLDIRS := @MKDIR_P@ 41 42CLEAN += $(OBJ_BUILD)/freetype-config \ 43 $(OBJ_BUILD)/freetype2.pc 44 45DISTCLEAN += $(OBJ_BUILD)/config.cache \ 46 $(OBJ_BUILD)/config.log \ 47 $(OBJ_BUILD)/config.status \ 48 $(OBJ_BUILD)/unix-def.mk \ 49 $(OBJ_BUILD)/unix-cc.mk \ 50 $(OBJ_BUILD)/ftconfig.h \ 51 $(OBJ_BUILD)/ftoption.h \ 52 $(LIBTOOL) \ 53 $(OBJ_BUILD)/Makefile 54 55 56# Standard installation variables. 57# 58prefix := @prefix@ 59exec_prefix := @exec_prefix@ 60libdir := @libdir@ 61bindir := @bindir@ 62includedir := @includedir@ 63datarootdir := @datarootdir@ 64datadir := @datadir@ 65mandir := @mandir@ 66 67version_info := @version_info@ 68 69# Variables needed for `freetype-config' and `freetype.pc'. 70# 71PKG_CONFIG := @PKG_CONFIG@ 72PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@ 73PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@ 74PKGCONFIG_LIBS := @PKGCONFIG_LIBS@ 75PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@ 76LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@ 77build_libtool_libs := @build_libtool_libs@ 78ft_version := @ft_version@ 79 80# The directory where all library files are placed. 81# 82# By default, this is the same as $(OBJ_DIR); however, this can be changed 83# to suit particular needs. 84# 85LIB_DIR := $(OBJ_DIR) 86 87# The BASE_SRC macro lists all source files that should be included in 88# src/base/ftbase.c. When configure sets up CFLAGS to build ftmac.c, 89# ftmac.c should be added to BASE_SRC. 90ftmac_c := @ftmac_c@ 91 92# The SYSTEM_ZLIB macro is defined if the user wishes to link dynamically 93# with its system wide zlib. If SYSTEM_ZLIB is 'yes', the zlib part of the 94# ftgzip module is not compiled in. 95SYSTEM_ZLIB := @SYSTEM_ZLIB@ 96 97 98# The NO_OUTPUT macro is appended to command lines in order to ignore 99# the output of some programs. 100# 101NO_OUTPUT := 2> /dev/null 102 103 104# To support calls like 105# 106# configure --includedir='${libdir}'/freetype2/include 107# 108# we generate `freetype-config' and `freetype.pc' at compile time so that 109# those variables are properly expanded. 110 111$(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in 112 rm -f $@ $@.tmp 113 sed -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \ 114 -e 's|%PKG_CONFIG%|$(PKG_CONFIG)|' \ 115 -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ 116 -e 's|%exec_prefix%|$(exec_prefix)|' \ 117 -e 's|%ft_version%|$(ft_version)|' \ 118 -e 's|%includedir%|$(includedir)|' \ 119 -e 's|%libdir%|$(libdir)|' \ 120 -e 's|%prefix%|$(prefix)|' \ 121 $< \ 122 > $@.tmp 123 chmod +x $@.tmp 124 chmod go-w $@.tmp 125 mv $@.tmp $@ 126 127# To support directory names with spaces (as might easily happen on Windows 128# platforms), the right solution would be to surround the pkg-variables in 129# `freetype2.pc' with double quotes. However, doing so ironically disables 130# the prefix override mechanism especially written for Windows. This is a 131# bug in pkg-config version 0.28 and earlier. 132# 133# For this reason, we escape spaces with backslashes. 134 135exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix)) 136includedir_x := $(subst $(space),\\$(space),$(includedir)) 137libdir_x := $(subst $(space),\\$(space),$(libdir)) 138prefix_x := $(subst $(space),\\$(space),$(prefix)) 139 140$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in 141 rm -f $@ $@.tmp 142 sed -e 's|%PKGCONFIG_REQUIRES%|$(PKGCONFIG_REQUIRES)|' \ 143 -e 's|%PKGCONFIG_REQUIRES_PRIVATE%|$(PKGCONFIG_REQUIRES_PRIVATE)|' \ 144 -e 's|%PKGCONFIG_LIBS%|$(PKGCONFIG_LIBS)|' \ 145 -e 's|%PKGCONFIG_LIBS_PRIVATE%|$(PKGCONFIG_LIBS_PRIVATE)|' \ 146 -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ 147 -e 's|%exec_prefix%|$(exec_prefix_x)|' \ 148 -e 's|%ft_version%|$(ft_version)|' \ 149 -e 's|%includedir%|$(includedir_x)|' \ 150 -e 's|%libdir%|$(libdir_x)|' \ 151 -e 's|%prefix%|$(prefix_x)|' \ 152 $< \ 153 > $@.tmp 154 chmod a-w $@.tmp 155 mv $@.tmp $@ 156 157# defines whether we should install `freetype-config' or not 158INSTALL_FT2_CONFIG = @INSTALL_FT2_CONFIG@ 159 160all install: $(OBJ_BUILD)/freetype-config \ 161 $(OBJ_BUILD)/freetype2.pc 162 163# EOF 164