OSDN Git Service

2009-04-24 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Apr 2009 13:48:25 +0000 (13:48 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Apr 2009 13:48:25 +0000 (13:48 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146722 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 383d65c..ab3a3b7 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 bc86f15..41daf24 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 dc9a86d..df66228 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 c5bd942..b1b8239 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 ec2e646..dae628b 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;