Rombobjörn

summaryrefslogtreecommitdiff
path: root/comfignat.mk
diff options
context:
space:
mode:
authorBjörn Persson <bjorn@rombobjörn.se>2016-01-18 11:59:31 +0100
committerBjörn Persson <bjorn@rombobjörn.se>2016-01-18 11:59:31 +0100
commitdae4f47f2b80c7ea7b1df0f713efe79a8a50c69f (patch)
tree9e92367d9bbca2a61b4b9f2f0240fab0fe2cbd70 /comfignat.mk
parentc108be85bf27d40d9b1c45d4de14185dc902b763 (diff)
Added Library_Type to help with building libraries as shared or static.
Diffstat (limited to 'comfignat.mk')
-rw-r--r--comfignat.mk17
1 files changed, 11 insertions, 6 deletions
diff --git a/comfignat.mk b/comfignat.mk
index a9847a8..c355a7d 100644
--- a/comfignat.mk
+++ b/comfignat.mk
@@ -148,6 +148,10 @@ relocatable_package = false
# breaking the project files.
# dirgpr takes precedence over relocatable_package.
+library_type = dynamic
+# If a library can be built as either shared or static, then library_type shall
+# be used to set the attribute Library_Kind in the project files.
+
prefix = /usr/local
exec_prefix = ${prefix}
datarootdir = ${prefix}/share
@@ -268,14 +272,14 @@ Make_miscdocdir = ${call Make_pathname,stage_miscdocdir}
preprocess_file = "${GNATPREP}" ${firstword ${filter %.gp,$^}} $@ \
${options_preprocessing} ${Gnatprep_arguments} \
${if ${filter ${notdir $@},${notdir ${usage_GPRs}}}, \
- ${usage_directories}, \
+ ${usage_directories} '-DLibrary_Type="${library_type}"', \
'-DSrcdir="${srcdir}"'} \
${GNATPREPFLAGS}
# preprocess_file is a command for use in recipes. It runs the first .gp file
# among the rule's prerequisites through Gnatprep to produce the target. If the
-# target is a usage project, then the usage-relevant directory variables are
-# conveyed to it as Gnatprep symbols. Otherwise srcdir is conveyed, as it's
-# needed by preprocessed build projects.
+# target is a usage project, then the usage-relevant variables are conveyed to
+# it as Gnatprep symbols. Otherwise srcdir is conveyed, as it's needed by
+# preprocessed build projects.
build_GPR = "${GNAT_BUILDER}" -P ${firstword ${filter %.gpr,$^}} \
${addprefix -aP,${VPATH}} -p \
@@ -407,7 +411,7 @@ configuration_variables += \
GNATPREPFLAGS GNAT_BUILDER_FLAGS ADAFLAGS CPPFLAGS CFLAGS CXXFLAGS FFLAGS \
GNATBINDFLAGS GNATLINKFLAGS LDFLAGS GNATFLAGS \
DESTDIR \
- dirgpr relocatable_package \
+ dirgpr relocatable_package library_type \
prefix exec_prefix datarootdir localstatedir \
bindir libexecdir \
datadir sysconfdir statedir cachedir logdir runstatedir lockdir \
@@ -692,7 +696,8 @@ show_configuration::
# How to preprocess the project Comfignat:
${Make_builddir}/comfignat.gpr: comfignat.gpr.gp | ${Make_builddir}/
- "${GNATPREP}" $< $@ -DInvoked_By_Makefile ${all_directories} ${GNATPREPFLAGS}
+ "${GNATPREP}" $< $@ -DInvoked_By_Makefile ${all_directories} \
+ '-DLibrary_Type="${library_type}"' ${GNATPREPFLAGS}
# How to preprocess files that are needed during the build:
${Make_builddir}/%: %.gp | ${Make_builddir}/