From dae4f47f2b80c7ea7b1df0f713efe79a8a50c69f Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Mon, 18 Jan 2016 11:59:31 +0100 Subject: Added Library_Type to help with building libraries as shared or static. --- manual.en.html | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'manual.en.html') diff --git a/manual.en.html b/manual.en.html index 3d25fc2..9910afb 100755 --- a/manual.en.html +++ b/manual.en.html @@ -112,7 +112,7 @@ and is also

The following applies to all of Comfignat including this document:

-

Copyright 2013 - 2015 Björn Persson, Bjorn@Rombobjörn.se

+

Copyright 2013 - 2016 Björn Persson, Bjorn@Rombobjörn.se

This material is provided as is, with absolutely no warranty expressed or implied. Any use is at your own risk.

@@ -456,6 +456,43 @@ project will therefore automatically adapt to the current target architecture, so that 32-bit and 64-bit instances of the library can be installed in parallel and the right library will be used in every build.

+

Shared and Static Libraries

+ +

Many libraries can be built either as a shared library or as a static +library. To enable this, use the variable Comfignat.Library_Type for +Library_Kind in the build-controlling project file, and the +preprocessor symbol Library_Type in the usage project file. The +default will then be to build a shared library, but installing users and +distributions can build a static library instead by setting +library_type to “static” on the Make command line. +The possible values of Library_Type are the same as for +Library_Kind: “dynamic”, “static”, and +“relocatable” which is an alias for “dynamic”.

+ +

It may be necessary to also use Comfignat.Library_Type in a case +construction to set certain attributes only for one kind of library. It may for +example be desirable to set Library_Interface for a shared library +but not for a static library, to get the best automatic elaboration in both +cases. Here's a project file fragment that sets Library_Version and +Library_Interface only when building a shared library:

+ +
   for Library_Kind      use Comfignat.Library_Type;
+   case Comfignat.Library_Type is
+      when "dynamic" | "relocatable" =>
+         for Library_Version   use "libexample.so.1";
+         for Library_Interface use ("Example");
+      when "static" =>
+         null;
+   end case;
+ +

It is also possible to build both a shared and a static library in the same +Make invocation by overriding LIBRARY_TYPE on the builder command +line:

+ +
base: build_example.gpr
+	${build_GPR} -margs -XLIBRARY_TYPE=dynamic
+	${build_GPR} -margs -XLIBRARY_TYPE=static
+

Options

Your software may have optional features or properties that can be enabled @@ -510,7 +547,8 @@ have its own runstatedir.

There are several options variables that let installing users and distributions control which arguments the build tools are invoked with. They have names that end with “FLAGS”, and are documented in -INSTALL. The value of GNATFLAGS is a combination of the +INSTALL. +The value of GNATFLAGS is a combination of the other options variables and must not be modified in a way that disregards the other variables. Apart from that restriction you can assign default values to optional arguments in these variables, but be sure to do the assignments with -- cgit v1.2.3