-
Notifications
You must be signed in to change notification settings - Fork 37
/
makefile.conf
303 lines (262 loc) · 8.67 KB
/
makefile.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# This makefile includes all default values used to configure AWS. You can
# update variables here or set the corresponding variable on the command
# line. You should not have do change the main makefile.
#
# IMPORTANT: each time you change the definitions here make sure you run
# $ make setup
# Is out of tree build
ifneq ($(BLD_DIR), $(SRC_DIR))
GPROOTOPTS = --relocate-build-tree=$(BLD_DIR) --root-dir=$(SRC_DIR)
ISOOT := true
else
ISOOT := false
endif
##############################################################################
# HOST platform
HOST := $(shell gcc -dumpmachine)
##############################################################################
# TARGET platform
#
# TARGET is the name for gprbuild --target option
#
TARGET := $(shell gcc -dumpmachine)
##############################################################################
# AWS will be installed under $(prefix). Update this variable to point to
# the install directory. By default, it is set to the current GNAT root
# directory to have AWS project files automatically available.
#
ifeq ($(TARGET), $(HOST))
prefix = $(dir $(shell which gnatls))..
else
prefix = $(dir $(shell which $(TARGET)-gnatls))..
endif
##############################################################################
# Set to true if the AWS shared runtime must be built. If ENABLE_SHARED is
# set to false only the static version is built. The default value is true if
# the platform supports shared libraries.
#
# Note that all dependents libraries (like XML/Ada) must have been compiled
# and installed as shared libraries if this option is set.
#
# ENABLE_SHARED = [true|false]
#
ENABLE_SHARED=$(shell gprbuild -c -q -p $(GPROOTOPTS) \
-XTARGET=$(TARGET) -XPRJ_TARGET=$(PRJ_TARGET) \
-XTGT_DIR=$(TGT_DIR) \
-P$(SRC_DIR)/config/setup/test_shared 2>/dev/null \
&& echo "true")
##############################################################################
# XMLADA optional, needed if you want to build SOAP's AWS support. Set XMLADA
# to true to activate XML/Ada support, you must also set ADA_PROJECT_PATH
# to point to the XML/Ada project files if not installed in the standard
# location.
#
# XMLADA = [true/false]
#
ifeq ($(shell gnat ls -Pxmlada 2>&1 | grep 'project file .* not found'),)
XMLADA = true
else
XMLADA = false
endif
##############################################################################
# LAL optional, needed if you want to build ada2wsdl tool. This tool can be
# used to create a WSDL document from an Ada spec. Set LAL to true to
# activate LAL support. You must also set ADA_PROJECT_PATH to point to the
# LAL project files if not installed in the standard location.
#
# If you activate LAL you also need to activate XMLADA above.
#
# LAL = [true|false]
#
ifeq ($(shell gnat ls -Plibadalang 2>&1 | grep 'project file .* not found'),)
LAL = true
else
LAL = false
endif
##############################################################################
# Zlib mandatory, check if zlib is already installed and recent enought,
# otherwise compile the one coming with AWS.
#
# ZLIB = [true|false]
#
ZLIB = $(shell gprbuild -q -p $(GPROOTOPTS) \
-XTARGET=$(TARGET) -XPRJ_TARGET=$(PRJ_TARGET) \
-XTGT_DIR=$(TGT_DIR) \
-Pconfig/setup/test_zlib 2>/dev/null \
&& $(BLD_DIR)/$(TARGET)/setup/zobj/mzlib \
&& echo "true")
##############################################################################
# NETLIB, optional. "gnat" option works on GNAT 20 version ans later. If you
# need backward compartibility you can choose either "ipv4" or "ipv6". "ipv4"
# based on GNAT.Sockets functionality without using new functions. "ipv6"
# option ipmlementing IPv6 functions without relation to GNAT.Sockets.
#
# NETLIB = [gnat|ipv6|ipv4]
#
NETLIB = gnat
##############################################################################
# AWS supports SSL (Secure Socket Layer). To build AWS's with SSL support
# you need to set SOCKET to openssl or gnutls, in this case you must have
# installed the corresponding SSL library on your computer.
#
# SOCKET = [std|openssl|gnutls]
#
SOCKET = std
##############################################################################
# AWS supports SSL (Secure Socket Layer). To be able to support SSL optionally
# at runtime only when appropriate dynamic libraries is available in search
# path, use this option. This option can be true only when SOCKET option has
# either "openssl" or "gnutls" value. If this option is true, application
# linked with AWS can start even if SSL library not found in dynamic library
# search pathes but runtime exception will be raised in attempt to open secure
# connection.
#
# SSL_DYNAMIC = [true|false]
#
SSL_DYNAMIC = false
##############################################################################
# AWS provides a binding to the LDAP API. This binding will use the standard
# LDAP DLL provided with Windows OS. On GNU/Linux you need to install OpenLDAP
# if it is not already installed. If LDAP is installed on your system you can
# set LDAP=true below.
#
# LDAP = [true|false]
#
LDAP = false
##############################################################################
# To activate the debug mode just uncomment the variable below. This will
# build AWS with debug information and will output more build information.
#
# DEBUG = [true|false]
#
DEBUG = true
##############################################################################
# Number of parallel compilations to do.
#
PROCESSORS = 0
##############################################################################
# HTTP2 server activated
#
SERVER_HTTP2 = $(strip \
$(shell sed -n 's/HTTP2_Activated.*:= *\([a-zA-Z]*\);/\1/p' \
$(SRC_DIR)/src/core/aws-default.ads | \
tr '[:upper:]' '[:lower:]'))
##############################################################################
# HTTP2 client activated
#
C_HTTP2 = $(shell sed -n 's/HTTP_Default.* renames *\([a-zA-Z1-9]*\);/\1/p' \
$(SRC_DIR)/src/core/aws-client.ads)
ifeq ($(strip $(C_HTTP2)),HTTPv1)
CLIENT_HTTP2=false
else
CLIENT_HTTP2=true
endif
##############################################################################
# Tools used by AWS
#
CP = cp -p
GNAT = gnat
GPRBUILD = gprbuild
GPRCLEAN = gprclean
GPRINSTALL = gprinstall
GPS = gps
MKDIR = mkdir -p
PYTHON = python
RM = rm
SED = sed
##############################################################################
# Load current setup if any
#
-include $(BLD_DIR)/$(TARGET)/makefile.setup
# user setup
##############################################################################
# Compute PRJ_TARGET which is a simplified set for the TARGET value.
# It can be UNIX, Darwin, Windows_NT and vxworks.
#
EXEEXT =
ifeq ($(strip $(findstring vxworks, $(TARGET))),vxworks)
PRJ_TARGET = vxworks
OS = UNIX
else
ifeq ($(strip $(findstring mingw32, $(TARGET))),mingw32)
PRJ_TARGET = Windows_NT
EXEEXT = .exe
OS = Windows_NT
else
ifeq ($(strip $(findstring darwin, $(TARGET))),darwin)
PRJ_TARGET = Darwin
OS = Darwin
else
ifeq ($(strip $(findstring freebsd, $(TARGET))),freebsd)
PRJ_TARGET = freebsd
else
PRJ_TARGET = UNIX
endif
OS = UNIX
endif
endif
endif
ifeq ($(TARGET), $(shell gcc -dumpmachine))
IS_CROSS=false
GCC= gcc
else
IS_CROSS=true
GCC = $(TARGET)-gcc
endif
# XML/Ada
ifeq (${XMLADA}, true)
PRJ_XMLADA=Installed
GEXT_MODULE := gxmlada_setup
else
PRJ_XMLADA=Disabled
GEXT_MODULE := gxmlada_dummy
endif
ifndef TP_XMLADA
TP_XMLADA=$(PRJ_XMLADA)
endif
# Ldap
ifeq (${LDAP}, true)
PRJ_LDAP=Installed
else
PRJ_LDAP=Disabled
endif
# LAL
ifeq (${LAL}, true)
PRJ_LAL=Installed
GEXT_MODULE := $(GEXT_MODULE) lal_setup
else
PRJ_LAL=Disabled
GEXT_MODULE := $(GEXT_MODULE) lal_dummy
endif
# Sockets
PRJ_SOCKLIB=$(NETLIB)
# Debug
ifeq ($(DEBUG), true)
PRJ_BUILD=Debug
else
PRJ_BUILD=Release
endif
ifeq ($(IS_CROSS), true)
TPREFIX=$(DESTDIR)$(prefix)/$(TARGET)
else
TPREFIX=$(DESTDIR)$(prefix)
endif
# Install directories
I_INC = $(TPREFIX)/include/aws
GPROPTS = -XPRJ_BUILD=$(PRJ_BUILD) -XPRJ_SOCKLIB=$(PRJ_SOCKLIB) \
-XPRJ_LDAP=$(PRJ_LDAP) \
-XPRJ_XMLADA=$(PRJ_XMLADA) -XPRJ_LAL=$(PRJ_LAL) \
-XPROCESSORS=$(PROCESSORS) -XSOCKET=$(SOCKET) \
-XPRJ_TARGET=$(PRJ_TARGET) -XTARGET=$(TARGET) \
-XTHREAD_SANITIZER=$(THREAD_SANITIZER) \
-XSSL_DYNAMIC=$(SSL_DYNAMIC) -XTGT_DIR=$(TGT_DIR) \
$(GPROOTOPTS)
export GPROPTS
GPR_STATIC = -XLIBRARY_TYPE=static -XXMLADA_BUILD=static
GPR_SHARED = -XLIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable
# Get PATH separator for the host
ifeq ($(strip $(findstring mingw32, $(HOST))),mingw32)
PSEP = ;
else
PSEP = :
endif