Skip to content

Commit d5ca519

Browse files
committed
Merge branch 'po/static-pic' into 'master'
Add static-pic build variant. See merge request eng/toolchain/aws!13
2 parents 166c303 + 5c31bdf commit d5ca519

File tree

6 files changed

+42
-60
lines changed

6 files changed

+42
-60
lines changed

Makefile

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ MAKE_OPT = -s
4949
BDIR = $(BROOTDIR)/$(TARGET)/release
5050
endif
5151

52+
LIBAWS_TYPES=static
53+
ifeq (${ENABLE_SHARED},true)
54+
LIBAWS_TYPES=static relocatable static-pic
55+
endif
56+
5257
#############################################################################
5358
# NO NEED TO CHANGE ANYTHING PAST THIS POINT
5459
#############################################################################
@@ -173,10 +178,6 @@ GPROPTS = -XPRJ_BUILD=$(PRJ_BUILD) -XPRJ_SOCKLIB=$(PRJ_SOCKLIB) \
173178

174179
GPR_STATIC = -XLIBRARY_TYPE=static -XXMLADA_BUILD=static
175180
GPR_SHARED = -XLIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable
176-
GPR_OTHER = -XLIBRARY_TYPE=$(OTHER_LIBRARY_TYPE) \
177-
-XXMLADA_BUILD=$(OTHER_LIBRARY_TYPE)
178-
GPR_DEFAULT = -XLIBRARY_TYPE=$(DEFAULT_LIBRARY_TYPE) \
179-
-XXMLADA_BUILD=$(DEFAULT_LIBRARY_TYPE)
180181

181182
#######################################################################
182183
# build
@@ -190,11 +191,11 @@ build-awsres-tool-native:
190191
build-tools-native: gen-templates build-lib-native
191192
$(GPRBUILD) -p $(GPROPTS) $(GPR_STATIC) tools/tools.gpr
192193

193-
build-lib-native:
194-
$(GPRBUILD) -p $(GPROPTS) aws.gpr
195-
ifeq (${ENABLE_SHARED}, true)
196-
$(GPRBUILD) -p $(GPROPTS) $(GPR_SHARED) aws.gpr
197-
endif
194+
build-libs-%:
195+
$(GPRBUILD) -p $(GPROPTS) \
196+
-XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* aws.gpr
197+
198+
build-lib-native: ${LIBAWS_TYPES:%=build-libs-%}
198199

199200
build-gps-support: build-lib-native
200201
$(GPRBUILD) -p $(GPROPTS) $(GPR_STATIC) gps/gps_support.gpr
@@ -206,12 +207,11 @@ build-tools-cross: build-lib-cross
206207
$(GPRBUILD) -p --target=$(TARGET) $(GPROPTS) \
207208
$(GPR_STATIC) tools/tools.gpr
208209

209-
build-lib-cross:
210-
$(GPRBUILD) -p --target=$(TARGET) $(GPROPTS) aws.gpr
211-
ifeq (${ENABLE_SHARED}, true)
210+
build-libs-cross-%:
212211
$(GPRBUILD) -p --target=$(TARGET) $(GPROPTS) \
213-
$(GPR_SHARED) aws.gpr
214-
endif
212+
-XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* aws.gpr
213+
214+
build-lib-cross: ${LIBAWS_TYPES:%=build-libs-cross-%}
215215

216216
build-dynamo:
217217
make -C config build-dynamo
@@ -234,18 +234,20 @@ gps: setup
234234
#######################################################################
235235
# clean
236236

237-
clean-native:
237+
clean-libs-%:
238+
$(GPRCLEAN) $(GPROPTS) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* aws.gpr
239+
240+
clean-lib-native: ${LIBAWS_TYPES:%=clean-libs-%}
241+
242+
clean-native: clean-libs-native
238243
-$(GPRCLEAN) $(GPROPTS) $(GPR_STATIC) tools/tools.gpr
239-
ifeq (${ENABLE_SHARED}, true)
240-
-$(GPRCLEAN) $(GPROPTS) $(GPR_SHARED) aws.gpr
241-
endif
242244
-$(GPRCLEAN) $(GPROPTS) $(GPR_STATIC) gps/gps_support.gpr
243245

244-
clean-cross:
245-
-$(GPRCLEAN) $(GPROPTS) --target=$(TARGET) $(GPR_STATIC) aws.gpr
246-
ifeq (${ENABLE_SHARED}, true)
247-
-$(GPRCLEAN) $(GPROPTS) --target=$(TARGET) $(GPR_SHARED) aws.gpr
248-
endif
246+
clean-libs-cross-%:
247+
$(GPRCLEAN) --target=$(TARGET) \
248+
-XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* aws.gpr
249+
250+
clean-cross: ${LIBAWS_TYPES:%=clean-libs-cross-%}
249251

250252
ifeq (${IS_CROSS}, true)
251253
clean: clean-cross
@@ -268,36 +270,33 @@ endif
268270
GPRINST_OPTS=-p -f --prefix=$(TPREFIX) \
269271
--build-var=LIBRARY_TYPE --build-var=AWS_BUILD
270272

271-
install-lib-native:
272-
$(GPRINSTALL) $(GPROPTS) $(GPRINST_OPTS) $(GPR_DEFAULT) \
273-
--build-name=$(DEFAULT_LIBRARY_TYPE) aws.gpr
274-
ifeq (${ENABLE_SHARED}, true)
273+
install-libs-%:
275274
$(GPRINSTALL) $(GPROPTS) $(GPRINST_OPTS) \
276-
$(GPR_OTHER) --build-name=$(OTHER_LIBRARY_TYPE) aws.gpr
277-
endif
275+
-XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* \
276+
--build-name=$* aws.gpr
277+
278+
install-lib-native: ${LIBAWS_TYPES:%=install-libs-%}
278279

279280
install-tools-native:
280281
$(GPRINSTALL) $(GPROPTS) $(GPRINST_OPTS) $(GPR_STATIC) --mode=usage \
281-
--build-name=$(DEFAULT_LIBRARY_TYPE) \
282+
--build-name=static \
282283
--install-name=aws tools/tools.gpr
283284

284-
install-native: install-clean install-lib-native install-tools-native
285+
install-native: install-clean install-libs-native install-tools-native
285286

286-
install-lib-cross:
287-
$(GPRINSTALL) $(GPROPTS) $(GPRINST_OPTS) \
288-
--target=$(TARGET) $(GPR_DEFAULT) aws.gpr
289-
ifeq (${ENABLE_SHARED}, true)
287+
install-libs-cross-%:
290288
$(GPRINSTALL) $(GPROPTS) $(GPRINST_OPTS) \
291-
--target=$(TARGET) $(GPR_OTHER) \
292-
--build-name=$(OTHER_LIBRARY_TYPE) aws.gpr
293-
endif
289+
--target=$(TARGET) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* \
290+
--build-name=$* aws.gpr
291+
292+
install-lib-cross: ${LIBAWS_TYPES:%=install-libs-cross-%}
294293

295294
install-tools-cross:
296295
$(GPRINSTALL) $(GPROPTS) $(GPRINST_OPTS) --mode=usage \
297296
--target=$(TARGET) $(GPROPTS) \
298297
--install-name=aws tools/tools.gpr
299298

300-
install-cross: install-clean install-lib-cross install-tools-cross
299+
install-cross: install-clean install-libs-cross install-tools-cross
301300

302301
ifeq (${IS_CROSS}, true)
303302
install: install-cross
@@ -368,7 +367,6 @@ setup_modules: $(MODULES_SETUP)
368367

369368
gen_setup:
370369
echo "prefix=$(prefix)" > makefile.setup
371-
echo "DEFAULT_LIBRARY_TYPE=$(DEFAULT_LIBRARY_TYPE)" >> makefile.setup
372370
echo "ENABLE_SHARED=$(ENABLE_SHARED)" >> makefile.setup
373371
echo "ZLIB=$(ZLIB)" >> makefile.setup
374372
echo "XMLADA=$(XMLADA)" >> makefile.setup

aws.gpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ aggregate library project AWS is
3636
for Library_Dir use Shared'Library_Dir & "/aws";
3737

3838
case Shared.Library_Type is
39-
when "static" =>
39+
when "static" | "static-pic" =>
4040
null;
4141

4242
when "relocatable" =>

include/zlib/zlib.gpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ library project Zlib is
3434
-- Always build the static Z library as needed by some AWS tools
3535

3636
case Shared.Library_Type is
37-
when "static" =>
37+
when "static" | "static-pic" =>
3838
Zlib_Activated := "Yes";
3939

4040
when "relocatable" =>

makefile.checks

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ $(error SSL_DYNAMIC variable must be set to true or false)
6969
endif
7070
endif
7171

72-
ifneq ($(DEFAULT_LIBRARY_TYPE), static)
73-
ifneq ($(DEFAULT_LIBRARY_TYPE), relocatable)
74-
$(error DEFAULT_LIBRARY_TYPE variable must be set to static or relocatable)
75-
endif
76-
endif
77-
7872
ifneq ($(LAL), true)
7973
ifneq ($(LAL), false)
8074
$(error LAL variable must be set to true or false)

makefile.conf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ ENABLE_SHARED=$(shell $(GNAT) make -c -q -p \
3939
-XTARGET=$(TARGET) -XPRJ_TARGET=$(PRJ_TARGET) \
4040
-Pconfig/setup/test_shared 2>/dev/null && echo "true")
4141

42-
##############################################################################
43-
# Specify the default library type to setup for the installed AWS project.
44-
#
45-
# DEFAULT_LIBRARY_TYPE = [static|relocatable]
46-
#
47-
DEFAULT_LIBRARY_TYPE = static
48-
4942
##############################################################################
5043
# XMLADA optional, needed if you want to build SOAP's AWS support. Set XMLADA
5144
# to true to activate XML/Ada support, you must also set ADA_PROJECT_PATH
@@ -204,9 +197,6 @@ endif
204197
endif
205198
endif
206199

207-
OTHER_LIBRARY_TYPE = \
208-
$(if $(filter-out static,$(DEFAULT_LIBRARY_TYPE)),static,relocatable)
209-
210200
ifeq ($(TARGET), $(shell gcc -dumpmachine))
211201
IS_CROSS=false
212202
GCC= gcc

shared.gpr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Ada Web Server --
33
-- --
4-
-- Copyright (C) 2003-2022, AdaCore --
4+
-- Copyright (C) 2003-2023, AdaCore --
55
-- --
66
-- This is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the --
@@ -51,7 +51,7 @@ abstract project Shared is
5151
-- Static / Relocatable --
5252
--------------------------
5353

54-
type Library_Kind is ("relocatable", "static");
54+
type Library_Kind is ("relocatable", "static", "static-pic");
5555
Library_Type : Library_Kind := external ("LIBRARY_TYPE", "static");
5656

5757
---------------------

0 commit comments

Comments
 (0)