2 # FreeType 2 configuration rules templates for Unix + configure
6 # Copyright (C) 1996-2023 by
7 # David Turner, Robert Wilhelm, and Werner Lemberg.
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
17 TOP_DIR := $(shell cd $(TOP_DIR); pwd)
24 # This is used for `make refdoc' and `make refdoc-venv'
29 # this is used for `make distclean' and `make install'
30 OBJ_BUILD ?= $(PLATFORM_DIR)
32 # don't use `:=' here since the path stuff will be included after this file
34 FTSYS_SRC = @FTSYS_SRC@
37 INSTALL_DATA := @INSTALL_DATA@
38 INSTALL_PROGRAM := @INSTALL_PROGRAM@
39 INSTALL_SCRIPT := @INSTALL_SCRIPT@
40 MKINSTALLDIRS := @MKDIR_P@
42 CLEAN += $(OBJ_BUILD)/freetype-config \
43 $(OBJ_BUILD)/freetype2.pc
45 DISTCLEAN += $(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 \
56 # Standard installation variables.
59 exec_prefix := @exec_prefix@
62 includedir := @includedir@
63 datarootdir := @datarootdir@
67 version_info := @version_info@
69 # Variables needed for `freetype-config' and `freetype.pc'.
71 PKG_CONFIG := @PKG_CONFIG@
72 PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@
73 PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@
74 PKGCONFIG_LIBS := @PKGCONFIG_LIBS@
75 PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@
76 LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
77 build_libtool_libs := @build_libtool_libs@
78 ft_version := @ft_version@
80 # The directory where all library files are placed.
82 # By default, this is the same as $(OBJ_DIR); however, this can be changed
83 # to suit particular needs.
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.
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.
95 SYSTEM_ZLIB := @SYSTEM_ZLIB@
98 # The NO_OUTPUT macro is appended to command lines in order to ignore
99 # the output of some programs.
101 NO_OUTPUT := 2> /dev/null
104 # To support calls like
106 # configure --includedir='${libdir}'/freetype2/include
108 # we generate `freetype-config' and `freetype.pc' at compile time so that
109 # those variables are properly expanded.
111 $(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
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)|' \
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.
133 # For this reason, we escape spaces with backslashes.
135 exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix))
136 includedir_x := $(subst $(space),\\$(space),$(includedir))
137 libdir_x := $(subst $(space),\\$(space),$(libdir))
138 prefix_x := $(subst $(space),\\$(space),$(prefix))
140 $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
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)|' \
157 # defines whether we should install `freetype-config' or not
158 INSTALL_FT2_CONFIG = @INSTALL_FT2_CONFIG@
160 all install: $(OBJ_BUILD)/freetype-config \
161 $(OBJ_BUILD)/freetype2.pc