Commit 6db828c3 by Arnaud Charlet

[multiple changes]

2009-04-24  Robert Dewar  <dewar@adacore.com>

	* errout.ads: Minor reformatting

2009-04-24  Emmanuel Briot  <briot@adacore.com>

	* gnat_ugn.texi (Library Projects): add documentation on gnatmake's
	behavior when the project includes sources from multiple languages

2009-04-24  Vincent Celier  <celier@adacore.com>

	* prj.adb (Has_Foreign_Sources): Returns True in Ada_Only mode if there
	is a language other than Ada declared.

	* makeutl.adb (Linker_Options_Switches): Call For_All_Projects with
	Imported_First set to True.

From-SVN: r146722
parent ad58aabe
2009-04-24 Robert Dewar <dewar@adacore.com>
* errout.ads: Minor reformatting
2009-04-24 Emmanuel Briot <briot@adacore.com>
* gnat_ugn.texi (Library Projects): add documentation on gnatmake's
behavior when the project includes sources from multiple languages
2009-04-24 Vincent Celier <celier@adacore.com>
* prj.adb (Has_Foreign_Sources): Returns True in Ada_Only mode if there
is a language other than Ada declared.
* makeutl.adb (Linker_Options_Switches): Call For_All_Projects with
Imported_First set to True.
2009-04-24 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb: additional optimization to inhibit creation of
......
......@@ -651,8 +651,8 @@ package Errout is
-- suppressed.
procedure Error_Msg_F (Msg : String; N : Node_Id);
-- Similar to Error_Msg_N except that the message is placed on the
-- first node of the construct N (First_Node (N)).
-- Similar to Error_Msg_N except that the message is placed on the first
-- node of the construct N (First_Node (N)).
procedure Error_Msg_NE
(Msg : String;
......
......@@ -13675,6 +13675,15 @@ operating system).
for Spec ("MyPack.MyChild") use "mypack.mychild.spec";
@end smallexample
When the source file contains several units, you can indicate at what
position the unit occurs in the file, with the following. The first unit
in the file has index 1
@smallexample @c projectfile
for Body ("top") use "foo.a" at 1;
for Body ("foo") use "foo.a" at 2;
@end smallexample
@item @code{Body}
You can use the associative array attribute @code{Body} to
......@@ -13698,7 +13707,20 @@ sensitive or insensitive depending on the operating system).
@noindent
@emph{Library projects} are projects whose object code is placed in a library.
(Note that this facility is not yet supported on all platforms)
(Note that this facility is not yet supported on all platforms).
@code{gnatmake} or @code{gprbuild} will collect all object files into a
single archive, which might either be a shared or a static library. This
library can later on be linked with multiple executables, potentially
reducing their sizes.
If your project file specifies languages other than Ada, but you are still
using @code{gnatmake} to compile and link, the latter will not try to
compile your sources other than Ada (you should use @code{gprbuild} if that
is your intent). However, @code{gnatmake} will automatically link all object
files found in the object directory, whether or not they were compiled from
an Ada source file. This specific behavior only applies when multiple
languages are specified.
To create a library project, you need to define in its project file
two project-level attributes: @code{Library_Name} and @code{Library_Dir}.
......@@ -412,7 +412,7 @@ package body Makeutl is
begin
Linker_Opts.Init;
For_All_Projects (Project, In_Tree, Dummy);
For_All_Projects (Project, In_Tree, Dummy, Imported_First => True);
Last_Linker_Option := 0;
......
......@@ -1231,7 +1231,8 @@ package body Prj is
Lang := Data.Languages;
while Lang /= No_Language_Index loop
if Lang.Name /= Name_Ada
and then Lang.First_Source /= No_Source
and then
(Current_Mode = Ada_Only or else Lang.First_Source /= No_Source)
then
return True;
end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment