2 # FreeType 2 configuration rules templates for Unix + configure
6 # Copyright 1996-2000, 2002, 2004, 2006, 2008, 2013, 2014 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 distclean' and `make install'
25 OBJ_BUILD ?= $(BUILD_DIR)
27 # don't use `:=' here since the path stuff will be included after this file
29 FTSYS_SRC = @FTSYS_SRC@
32 INSTALL_DATA := @INSTALL_DATA@
33 INSTALL_PROGRAM := @INSTALL_PROGRAM@
34 INSTALL_SCRIPT := @INSTALL_SCRIPT@
35 MKINSTALLDIRS := $(BUILD_DIR)/mkinstalldirs
37 CLEAN += $(OBJ_BUILD)/freetype-config \
38 $(OBJ_BUILD)/freetype2.pc
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 \
50 # Standard installation variables.
53 exec_prefix := @exec_prefix@
56 includedir := @includedir@
57 datarootdir := @datarootdir@
61 version_info := @version_info@
63 # Variables needed for `freetype-config' and `freetype.pc'.
65 REQUIRES_PRIVATE := @REQUIRES_PRIVATE@
66 LIBS_PRIVATE := @LIBS_PRIVATE@
67 LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
68 build_libtool_libs := @build_libtool_libs@
69 ft_version := @ft_version@
71 # The directory where all library files are placed.
73 # By default, this is the same as $(OBJ_DIR); however, this can be changed
74 # to suit particular needs.
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.
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.
86 SYSTEM_ZLIB := @SYSTEM_ZLIB@
89 # The NO_OUTPUT macro is appended to command lines in order to ignore
90 # the output of some programs.
92 NO_OUTPUT := 2> /dev/null
95 # To support calls like
97 # configure --includedir='${libdir}'/freetype2/include
99 # we generate `freetype-config' and `freetype.pc' at compile time so that
100 # those variables are properly expanded.
102 $(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
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)|' \
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.
123 # For this reason, we escape spaces with backslashes.
125 exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix))
126 includedir_x := $(subst $(space),\\$(space),$(includedir))
127 libdir_x := $(subst $(space),\\$(space),$(libdir))
128 prefix_x := $(subst $(space),\\$(space),$(prefix))
130 $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
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)|' \
145 all: $(OBJ_BUILD)/freetype-config \
146 $(OBJ_BUILD)/freetype2.pc