Commit e03c5253 by Vincent Celier Committed by Arnaud Charlet

make.adb (Compile): Clarify the error message reported when gnatmake refuses to…

make.adb (Compile): Clarify the error message reported when gnatmake refuses to compile a runtime...

2013-04-11  Vincent Celier  <celier@adacore.com>

	* make.adb (Compile): Clarify the error message reported
	when gnatmake refuses to compile a runtime source.
	(Start_Compile_If_Possible): Ditto.

2013-04-11  Vincent Celier  <celier@adacore.com>

	* gnat_ugn.texi: Add documentation about -gnatc and gnatmake.

From-SVN: r197783
parent 9f5b865a
2013-04-11 Vincent Celier <celier@adacore.com> 2013-04-11 Vincent Celier <celier@adacore.com>
* make.adb (Compile): Clarify the error message reported
when gnatmake refuses to compile a runtime source.
(Start_Compile_If_Possible): Ditto.
2013-04-11 Vincent Celier <celier@adacore.com>
* gnat_ugn.texi: Add documentation about -gnatc and gnatmake.
2013-04-11 Vincent Celier <celier@adacore.com>
* switch-c.adb: Document internal switches. * switch-c.adb: Document internal switches.
* usage.adb: Remove lines for internal switches: -gnatea, -gnateO, * usage.adb: Remove lines for internal switches: -gnatea, -gnateO,
-gnatez and -gnateO. -gnatez and -gnateO.
......
...@@ -4153,7 +4153,15 @@ Assume no invalid (bad) values except for 'Valid attribute use ...@@ -4153,7 +4153,15 @@ Assume no invalid (bad) values except for 'Valid attribute use
@item -gnatc @item -gnatc
@cindex @option{-gnatc} (@command{gcc}) @cindex @option{-gnatc} (@command{gcc})
Check syntax and semantics only (no code generation attempted). Check syntax and semantics only (no code generation attempted). When the
compiler is invoked by @command{gnatmake}, if the switch @option{-gnatc} is
only given to the compiler (after @option{-cargs} or in package Compiler of
the project file, @command{gnatmake} will fail because it will not find the
object file after compilation. If @command{gnatmake} is called with
@option{-gnatc} as a builder switch (before @option{-cargs} or in package
Builder of the project file) then @command{gnatmake} will not fail because
it will not look for the object files after compilation, and it will not try
to build and link.
@item -gnatC @item -gnatC
@cindex @option{-gnatC} (@command{gcc}) @cindex @option{-gnatC} (@command{gcc})
...@@ -1321,8 +1321,8 @@ package body Make is ...@@ -1321,8 +1321,8 @@ package body Make is
then then
Errutil.Error_Msg Errutil.Error_Msg
('"' & Argv & ('"' & Argv &
""" is not a gnatmake switch. Consider moving " & """ is not a gnatmake switch. Consider moving "
"it to Global_Compilation_Switches.", & "it to Global_Compilation_Switches.",
Element.Location); Element.Location);
Make_Failed ("*** illegal switch """ & Argv & """"); Make_Failed ("*** illegal switch """ & Argv & """");
end if; end if;
...@@ -2982,8 +2982,8 @@ package body Make is ...@@ -2982,8 +2982,8 @@ package body Make is
Make_Failed Make_Failed
("not allowed to compile """ & ("not allowed to compile """ &
Get_Name_String (Fname) & Get_Name_String (Fname) &
"""; use -a switch, or compile file with " & """; use -a switch, or use the compiler directly with "
"""-gnatg"" switch"); & "the ""-gnatg"" switch");
end if; end if;
end if; end if;
end; end;
...@@ -3449,8 +3449,8 @@ package body Make is ...@@ -3449,8 +3449,8 @@ package body Make is
Fail Fail
("not allowed to compile """ & ("not allowed to compile """ &
Get_Name_String (Source.File) & Get_Name_String (Source.File) &
"""; use -a switch, or compile file with " & """; use -a switch, or use the compiler directly with "
"""-gnatg"" switch"); & "the ""-gnatg"" switch");
end if; end if;
Verbose_Msg Verbose_Msg
...@@ -3841,7 +3841,7 @@ package body Make is ...@@ -3841,7 +3841,7 @@ package body Make is
Last := 1; Last := 1;
Result (1) := Result (1) :=
new String' new String'
("-gnatec=" & Get_Name_String (For_Project.Config_File_Name)); ("-gnatec=" & Get_Name_String (For_Project.Config_File_Name));
else else
Temporary_Config_File := False; Temporary_Config_File := False;
...@@ -4233,8 +4233,7 @@ package body Make is ...@@ -4233,8 +4233,7 @@ package body Make is
(Index).Library_Dir.Display_Name) & (Index).Library_Dir.Display_Name) &
"lib" & "lib" &
Get_Name_String Get_Name_String
(Library_Projs.Table (Library_Projs.Table (Index).Library_Name) &
(Index).Library_Name) &
"." & "." &
MLib.Tgt.Archive_Ext); MLib.Tgt.Archive_Ext);
...@@ -4244,9 +4243,8 @@ package body Make is ...@@ -4244,9 +4243,8 @@ package body Make is
Linker_Switches.Increment_Last; Linker_Switches.Increment_Last;
Linker_Switches.Table (Linker_Switches.Last) := Linker_Switches.Table (Linker_Switches.Last) :=
new String'("-L" & new String'("-L" &
Get_Name_String Get_Name_String (Library_Projs.Table (Index).
(Library_Projs.Table (Index). Library_Dir.Display_Name));
Library_Dir.Display_Name));
-- Add the -l switch -- Add the -l switch
...@@ -4254,8 +4252,7 @@ package body Make is ...@@ -4254,8 +4252,7 @@ package body Make is
Linker_Switches.Table (Linker_Switches.Last) := Linker_Switches.Table (Linker_Switches.Last) :=
new String'("-l" & new String'("-l" &
Get_Name_String Get_Name_String
(Library_Projs.Table (Index). (Library_Projs.Table (Index).Library_Name));
Library_Name));
end if; end if;
end if; end if;
end loop; end loop;
...@@ -5592,8 +5589,8 @@ package body Make is ...@@ -5592,8 +5589,8 @@ package body Make is
-- No main program may be specified on the command line -- No main program may be specified on the command line
elsif Osint.Number_Of_Files /= 0 then elsif Osint.Number_Of_Files /= 0 then
Make_Failed ("-B cannot be used with a main specified on " & Make_Failed
"the command line"); ("-B cannot be used with a main specified on the command line");
-- And the project file cannot be a library project file -- And the project file cannot be a library project file
...@@ -5641,8 +5638,9 @@ package body Make is ...@@ -5641,8 +5638,9 @@ package body Make is
and then not Unique_Compile and then not Unique_Compile
and then ((not Make_Steps) or else Bind_Only or else Link_Only) and then ((not Make_Steps) or else Bind_Only or else Link_Only)
then then
Make_Failed ("cannot specify a main program " & Make_Failed
"on the command line for a library project file"); ("cannot specify a main program "
& "on the command line for a library project file");
end if; end if;
-- If no mains have been specified on the command line, and we are -- If no mains have been specified on the command line, and we are
...@@ -5652,8 +5650,8 @@ package body Make is ...@@ -5652,8 +5650,8 @@ package body Make is
else else
if Main_Index /= 0 then if Main_Index /= 0 then
Make_Failed ("cannot specify a multi-unit index but no main " & Make_Failed ("cannot specify a multi-unit index but no main "
"on the command line"); & "on the command line");
end if; end if;
declare declare
...@@ -5879,9 +5877,10 @@ package body Make is ...@@ -5879,9 +5877,10 @@ package body Make is
Add_Switch Add_Switch
("-I" & ("-I" &
Normalize_Directory_Name Normalize_Directory_Name
(Get_Primary_Src_Search_Directory.all).all, (Get_Primary_Src_Search_Directory.all).all,
Compiler, Append_Switch => False, Compiler,
And_Save => False); Append_Switch => False,
And_Save => False);
end if; end if;
...@@ -6440,9 +6439,8 @@ package body Make is ...@@ -6440,9 +6439,8 @@ package body Make is
if Prefix'Length > 0 then if Prefix'Length > 0 then
declare declare
PATH : constant String := PATH : constant String :=
Prefix & Directory_Separator & "bin" & Prefix & Directory_Separator & "bin" & Path_Separator &
Path_Separator & Getenv ("PATH").all;
Getenv ("PATH").all;
begin begin
Setenv ("PATH", PATH); Setenv ("PATH", PATH);
end; end;
...@@ -7423,8 +7421,8 @@ package body Make is ...@@ -7423,8 +7421,8 @@ package body Make is
elsif Program_Args = Linker elsif Program_Args = Linker
and then Argv = "-o" and then Argv = "-o"
then then
Make_Failed ("switch -o not allowed within a -largs. " & Make_Failed
"Use -o directly."); ("switch -o not allowed within a -largs. Use -o directly.");
-- Check to see if we are reading switches after a -cargs, -bargs or -- Check to see if we are reading switches after a -cargs, -bargs or
-- -largs switch. If so, save it. -- -largs switch. If so, save it.
...@@ -7573,16 +7571,16 @@ package body Make is ...@@ -7573,16 +7571,16 @@ package body Make is
elsif Src_Path_Name = null elsif Src_Path_Name = null
and then Lib_Path_Name = null and then Lib_Path_Name = null
then then
Make_Failed ("RTS path not valid: missing " & Make_Failed ("RTS path not valid: missing "
"adainclude and adalib directories"); & "adainclude and adalib directories");
elsif Src_Path_Name = null then elsif Src_Path_Name = null then
Make_Failed ("RTS path not valid: missing adainclude " & Make_Failed ("RTS path not valid: missing adainclude "
"directory"); & "directory");
elsif Lib_Path_Name = null then elsif Lib_Path_Name = null then
Make_Failed ("RTS path not valid: missing adalib " & Make_Failed ("RTS path not valid: missing adalib "
"directory"); & "directory");
end if; end if;
end; end;
end if; end if;
...@@ -7820,8 +7818,8 @@ package body Make is ...@@ -7820,8 +7818,8 @@ package body Make is
-- or a -P switch inside a project file. -- or a -P switch inside a project file.
Fail Fail
("either the tool is not ""project-aware"" or " & ("either the tool is not ""project-aware"" or "
"a project file is specified inside a project file"); & "a project file is specified inside a project file");
elsif Argv'Last = 2 then elsif Argv'Last = 2 then
......
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