Imported Upstream version 2.13.2
[platform/upstream/freetype2.git] / builds / unix / unix-def.in
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
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 refdoc' and `make refdoc-venv'
25 #
26 PYTHON := @PYTHON@
27 BIN    := bin
28
29 # this is used for `make distclean' and `make install'
30 OBJ_BUILD ?= $(PLATFORM_DIR)
31
32 # don't use `:=' here since the path stuff will be included after this file
33 #
34 FTSYS_SRC = @FTSYS_SRC@
35
36 INSTALL         := @INSTALL@
37 INSTALL_DATA    := @INSTALL_DATA@
38 INSTALL_PROGRAM := @INSTALL_PROGRAM@
39 INSTALL_SCRIPT  := @INSTALL_SCRIPT@
40 MKINSTALLDIRS   := @MKDIR_P@
41
42 CLEAN += $(OBJ_BUILD)/freetype-config \
43          $(OBJ_BUILD)/freetype2.pc
44
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    \
52              $(LIBTOOL)                 \
53              $(OBJ_BUILD)/Makefile
54
55
56 # Standard installation variables.
57 #
58 prefix       := @prefix@
59 exec_prefix  := @exec_prefix@
60 libdir       := @libdir@
61 bindir       := @bindir@
62 includedir   := @includedir@
63 datarootdir  := @datarootdir@
64 datadir      := @datadir@
65 mandir       := @mandir@
66
67 version_info := @version_info@
68
69 # Variables needed for `freetype-config' and `freetype.pc'.
70 #
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@
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 #
85 LIB_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.
90 ftmac_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.
95 SYSTEM_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 #
101 NO_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
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))
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
158 INSTALL_FT2_CONFIG = @INSTALL_FT2_CONFIG@
159
160 all install: $(OBJ_BUILD)/freetype-config \
161      $(OBJ_BUILD)/freetype2.pc
162
163 # EOF