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