From daf2b81fc7314a8091a023c920596683147d1031 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Thu, 2 Feb 2023 22:41:05 +0400 Subject: [PATCH 1/8] Add copyright header --- config/vss_config.gpr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/vss_config.gpr b/config/vss_config.gpr index 9e64dc4e..60609e50 100644 --- a/config/vss_config.gpr +++ b/config/vss_config.gpr @@ -1,3 +1,9 @@ +-- +-- Copyright (C) 2020-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + -- This file is stub to build VSS outside of the Alire environment. Alire will -- overwrite it during builds. -- From f72d84fad5b9f6fa3a63d1c1c89b1ae0ab042273 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 18:38:48 +0400 Subject: [PATCH 2/8] Remove use of BUILD_MODE variable. --- Makefile | 17 ++++++++--------- testsuite/text/performance/U816-022/Makefile | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index f0b81be6..e5c0d0bc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ -# Build mode (dev or prod) -BUILD_MODE=dev GPRBUILD_FLAGS = -p -j0 + PREFIX ?= /usr GPRDIR ?= $(PREFIX)/share/gpr LIBDIR ?= $(PREFIX)/lib @@ -27,13 +26,13 @@ endif .PHONY: docs all: - gprbuild $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_text.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_json.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_text.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_json.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr -cargs $(ADAFLAGS) generate: gprbuild $(GPRBUILD_FLAGS) gnat/tools/gen_ucd.gpr diff --git a/testsuite/text/performance/U816-022/Makefile b/testsuite/text/performance/U816-022/Makefile index 6ed8e286..1e63f579 100644 --- a/testsuite/text/performance/U816-022/Makefile +++ b/testsuite/text/performance/U816-022/Makefile @@ -1,6 +1,6 @@ all: - gprbuild -p -P test.gpr -XSUPERPROJECT= -XBUILD_MODE=prod + gprbuild -p -P test.gpr -XSUPERPROJECT= -XBUILD_PROFILE=release run: all valgrind --tool=callgrind .objs/main From 495cadc64219b461444270ff1d6624c2d0561fc7 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 18:48:49 +0400 Subject: [PATCH 3/8] Remove explicit ADAFLAGS, it is exported by VSS_Config. --- Makefile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e5c0d0bc..f4343b93 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,14 @@ +# Common scenario variables of the GPR files: +# +# VSS_BUILD_PROFILE | BUILD_PROFILE = release | validation | development +# +# VSS_COVERAGE_MODE | COVERAGE_MODE = none | gcov +# +# VSS_CI_MODE | CI_MODE = none | on +# +# ADAFLAGS = ... + GPRBUILD_FLAGS = -p -j0 PREFIX ?= /usr @@ -26,13 +36,13 @@ endif .PHONY: docs all: - gprbuild $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_text.gpr -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_json.gpr -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml.gpr -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr -cargs $(ADAFLAGS) + gprbuild $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr + gprbuild $(GPRBUILD_FLAGS) gnat/vss_text.gpr + gprbuild $(GPRBUILD_FLAGS) gnat/vss_json.gpr + gprbuild $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr + gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml.gpr + gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr + gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr generate: gprbuild $(GPRBUILD_FLAGS) gnat/tools/gen_ucd.gpr From 98a0776146757d4257228db2eb957157a225353b Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 19:23:46 +0400 Subject: [PATCH 4/8] Add targets to build and install all kinds of libraries --- Makefile | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index f4343b93..c8e333c4 100644 --- a/Makefile +++ b/Makefile @@ -16,14 +16,17 @@ GPRDIR ?= $(PREFIX)/share/gpr LIBDIR ?= $(PREFIX)/lib BINDIR ?= $(PREFIX)/bin INSTALL_PROJECT_DIR ?= $(DESTDIR)$(GPRDIR) -INSTALL_INCLUDE_DIR ?= $(DESTDIR)$(PREFIX)/include/vss +INSTALL_INCLUDE_DIR ?= $(DESTDIR)$(PREFIX)/include/vss/$* INSTALL_EXEC_DIR ?= $(DESTDIR)$(BINDIR) INSTALL_LIBRARY_DIR ?= $(DESTDIR)$(LIBDIR) -INSTALL_ALI_DIR ?= $(INSTALL_LIBRARY_DIR)/vss +INSTALL_ALI_DIR ?= $(INSTALL_LIBRARY_DIR)/vss/$* -GPRINSTALL_FLAGS = --prefix=$(PREFIX) --exec-subdir=$(INSTALL_EXEC_DIR)\ - --lib-subdir=$(INSTALL_ALI_DIR) --project-subdir=$(INSTALL_PROJECT_DIR)\ - --link-lib-subdir=$(INSTALL_LIBRARY_DIR) --sources-subdir=$(INSTALL_INCLUDE_DIR) +GPRINSTALL_FLAGS = \ + -XVSS_LIBRARY_TYPE=$* \ + --build-name=$* --build-var=LIBRARY_TYPE --build-var=VSS_LIBRARY_TYPE \ + --prefix=$(PREFIX) --exec-subdir=$(INSTALL_EXEC_DIR) \ + --lib-subdir=$(INSTALL_ALI_DIR) --project-subdir=$(INSTALL_PROJECT_DIR) \ + --link-lib-subdir=$(INSTALL_LIBRARY_DIR) --sources-subdir=$(INSTALL_INCLUDE_DIR) OK_RE_TESTS := 504 # Number of re_tests to be passed @@ -35,14 +38,18 @@ endif .PHONY: docs -all: - gprbuild $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/vss_text.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/vss_json.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr +all: build-libs-relocatable + +all-build-libs: build-libs-relocatable build-libs-static build-libs-static-pic + +build-libs-%: + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_text.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_json.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr generate: gprbuild $(GPRBUILD_FLAGS) gnat/tools/gen_ucd.gpr @@ -51,12 +58,12 @@ generate: gnatchop .objs/ucd.ada source/text/ucd build_tests: - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_text_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_os_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_json_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_stream_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_regexp_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_html_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_text_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_os_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_json_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_stream_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_regexp_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_html_tests.gpr check: build_tests check_text check_json check_regexp check_html @@ -157,7 +164,11 @@ docs: clean: rm -rf .objs .libs re_tests -install: +install: install-libs-relocatable + +install-all-libs: install-libs-relocatable install-libs-static install-libs-static-pic + +install-libs-%: gprinstall $(GPRINSTALL_FLAGS)/gnat -f -p -P gnat/vss_gnat.gpr gprinstall $(GPRINSTALL_FLAGS)/text -f -p -P gnat/vss_text.gpr gprinstall $(GPRINSTALL_FLAGS)/json -f -p -P gnat/vss_json.gpr From 7a57aa21076b55c48e493dc28484652e0c043d82 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 19:33:20 +0400 Subject: [PATCH 5/8] Remove SUPERPROJECT variable --- gnat/vss_common.gpr | 10 ++++------ testsuite/text/performance/U816-022/Makefile | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gnat/vss_common.gpr b/gnat/vss_common.gpr index 91a84a3a..b4e7913a 100644 --- a/gnat/vss_common.gpr +++ b/gnat/vss_common.gpr @@ -26,16 +26,14 @@ abstract project VSS_Common is CI_Mode : VSS_CI_Mode := external ("VSS_CI_MODE", external ("CI_MODE", "none")); - Superproject := external ("SUPERPROJECT", ""); - Ada_Switches := (); Ada_Coverage_Switches := (); Linker_Options := (); - Library_Dir := "../.libs/" & Superproject & "/" & Library_Kind; - Object_Dir := "../.objs/" & Superproject & "/" & Library_Kind; - Tests_Object_Dir := "../../.objs/" & Superproject & "/tests"; - Tools_Object_Dir := "../../.objs/" & Superproject & "/tools"; + Library_Dir := "../.libs/" & "/" & Library_Kind; + Object_Dir := "../.objs/" & "/" & Library_Kind; + Tests_Object_Dir := "../../.objs/" & "/tests"; + Tools_Object_Dir := "../../.objs/" & "/tools"; -- Build Profile diff --git a/testsuite/text/performance/U816-022/Makefile b/testsuite/text/performance/U816-022/Makefile index 1e63f579..771773d1 100644 --- a/testsuite/text/performance/U816-022/Makefile +++ b/testsuite/text/performance/U816-022/Makefile @@ -1,6 +1,6 @@ all: - gprbuild -p -P test.gpr -XSUPERPROJECT= -XBUILD_PROFILE=release + gprbuild -p -P test.gpr -XBUILD_PROFILE=release run: all valgrind --tool=callgrind .objs/main From 8a4a49b004f379f343e6694f9e0bebb86283bc42 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 22:22:09 +0400 Subject: [PATCH 6/8] Rename Makefile target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c8e333c4..b4274126 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ endif all: build-libs-relocatable -all-build-libs: build-libs-relocatable build-libs-static build-libs-static-pic +build-all-libs: build-libs-relocatable build-libs-static build-libs-static-pic build-libs-%: gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr From f33625914f731c1b3cf4f5bc1b4ba45bdea10447 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 22:36:34 +0400 Subject: [PATCH 7/8] Specify library type for XmlAda. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b4274126..2a2ea8e1 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ build-libs-%: gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml.gpr gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr - gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* -XXMLADA_BUILD=$* $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr generate: gprbuild $(GPRBUILD_FLAGS) gnat/tools/gen_ucd.gpr @@ -63,7 +63,7 @@ build_tests: gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_json_tests.gpr gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_stream_tests.gpr gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_regexp_tests.gpr - gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_html_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static -XXMLADA_BUILD=static $(GPRBUILD_FLAGS) gnat/tests/vss_html_tests.gpr check: build_tests check_text check_json check_regexp check_html @@ -175,7 +175,7 @@ install-libs-%: gprinstall $(GPRINSTALL_FLAGS)/regexp -f -p -P gnat/vss_regexp.gpr gprinstall $(GPRINSTALL_FLAGS)/xml -f -p -P gnat/vss_xml.gpr gprinstall $(GPRINSTALL_FLAGS)/xml_templates -f -p -P gnat/vss_xml_templates.gpr - gprinstall $(GPRINSTALL_FLAGS)/xml_xmlada -f -p -P gnat/vss_xml_xmlada.gpr + gprinstall -XXMLADA_BUILD=$* $(GPRINSTALL_FLAGS)/xml_xmlada -f -p -P gnat/vss_xml_xmlada.gpr misc: # Check compilation of other projects gprbuild $(GPRBUILD_FLAGS) -aPgnat gnat/tools/json_schema.gpr From 609ec9d7c0146b510cc0196144b83a7baa77b304 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 6 Feb 2023 22:41:12 +0400 Subject: [PATCH 8/8] Disable parallel recipe execution by make. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 2a2ea8e1..3b7d1998 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,8 @@ endif .PHONY: docs +.NOTPARALLEL: + all: build-libs-relocatable build-all-libs: build-libs-relocatable build-libs-static build-libs-static-pic