4343#
4444# Project specific:
4545#
46- # GNATCOLL_MMAP : whether MMAP is supported (yes/no)
47- # default is "yes"; has no effect on Windows
48- # GNATCOLL_MADVISE : whether MADVISE is supported (yes/no)
49- # default is "yes"; has no effect on Windows
46+ # GNATCOLL_MMAP : whether MMAP is supported (yes/no)
47+ # default is "yes"; has no effect on Windows
48+ # GNATCOLL_MADVISE : whether MADVISE is supported (yes/no)
49+ # default is "yes"; has no effect on Windows
50+ # GNATCOLL_PROJECTS : whether GNATCOLL projects package is included (yes/no)
51+ # default is "yes";
5052
5153# helper programs
5254CAT := cat
5355ECHO := echo
5456WHICH := which
57+ SED := sed
5558
5659# check for out-of-tree build
5760SOURCE_DIR := $(dir $(MAKEFILE_LIST ) )
@@ -83,6 +86,7 @@ prefix := $(dir $(shell $(WHICH) gnatls))..
8386GNATCOLL_VERSION := $(shell $(CAT ) $(SOURCE_DIR ) /version_information)
8487GNATCOLL_MMAP := yes
8588GNATCOLL_MADVISE := yes
89+ GNATCOLL_PROJECTS := yes
8690
8791BUILD = PROD
8892PROCESSORS = 0
@@ -123,6 +127,7 @@ endif
123127
124128GPR_VARS=-XGNATCOLL_MMAP =$(GNATCOLL_MMAP ) \
125129 -XGNATCOLL_MADVISE=$(GNATCOLL_MADVISE ) \
130+ -XGNATCOLL_PROJECTS=$(GNATCOLL_PROJECTS ) \
126131 -XGNATCOLL_VERSION=$(GNATCOLL_VERSION ) \
127132 -XGNATCOLL_OS=$(GNATCOLL_OS ) \
128133 -XBUILD=$(BUILD )
@@ -145,6 +150,18 @@ UNINSTALLER=$(INSTALLER) -p -f --install-name=gnatcoll --uninstall
145150build : $(LIBRARY_TYPES:%=build-% )
146151
147152build-% : $(GNATCOV_RTS )
153+
154+ # Gnatcoll projects related packages need libgpr. As conditional
155+ # with does not exist in GPR, `with "gpr"` at the beginning of
156+ # gnatcoll.gpr needs to be commented or uncommented depending on
157+ # the user choice.
158+
159+ ifeq ($(GNATCOLL_PROJECTS ) , yes)
160+ $(SED) -i 's/^-- with "gpr"/with "gpr"/g' $(GNATCOLL_GPR)
161+ else
162+ $(SED) -i 's/^with "gpr"/-- with "gpr"/g' $(GNATCOLL_GPR)
163+ endif
164+
148165ifeq ($(GNATCOV ) , yes)
149166 $(GNATCOV_PROJECT_PATH) gnatcov instrument -P $(GNATCOLL_GPR) $(RBD) \
150167 --no-subprojects --level=stmt+decision
@@ -204,6 +221,7 @@ setup:
204221 $(ECHO ) " GNATCOLL_VERSION=$( GNATCOLL_VERSION) " >> makefile.setup
205222 $(ECHO ) " GNATCOLL_MMAP=$( GNATCOLL_MMAP) " >> makefile.setup
206223 $(ECHO ) " GNATCOLL_MADVISE=$( GNATCOLL_MADVISE) " >> makefile.setup
224+ $(ECHO ) " GNATCOLL_PROJECTS=$( GNATCOLL_PROJECTS) " >> makefile.setup
207225
208226# Let gprbuild handle parallelisation. In general, we don't support parallel
209227# runs in this Makefile, as concurrent gprinstall processes may crash.
0 commit comments