[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 24 Apr 2009 13:48:25 +0000 (15:48 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 24 Apr 2009 13:48:25 +0000 (15:48 +0200)
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

gcc/ada/ChangeLog
gcc/ada/errout.ads
gcc/ada/gnat_ugn.texi
gcc/ada/makeutl.adb
gcc/ada/prj.adb

index 383d65c9ed59b6bd7c3f3846046179c21df007b6..ab3a3b7374d99b12d93992992c4819f845587807 100644 (file)
@@ -1,3 +1,20 @@
+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
index bc86f15d233556a97449733422215f0bf4a4e9e0..41daf243babacf8deec84ecfa3a362c04aa42424 100644 (file)
@@ -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;
index dc9a86deee1a54ccc938ec65c90e767e522ce693..df66228bb00e46b774af65ff71fbd8eec5996abc 100644 (file)
@@ -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}.
index c5bd942881e7572f55916b31c1426641b140427f..b1b82398dae9e26a5d3fbee7be445137674ee7a8 100644 (file)
@@ -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;
 
index ec2e6467141ee57304bbd26408371e6ba18db127..dae628b7c5e3a9537b6847497c0aecc39016644c 100644 (file)
@@ -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;