Patchwork [Ada] gnatmake ignores "-largs" in package Linker

login
register
mail settings
Submitter Arnaud Charlet
Date Aug. 29, 2011, 1:48 p.m.
Message ID <20110829134843.GA10311@adacore.com>
Download mbox | patch
Permalink /patch/112054/
State New
Headers show

Comments

Arnaud Charlet - Aug. 29, 2011, 1:48 p.m.
It is not possible to specify "-largs" as a switch in package linker of
the main project file, to link with an external library libargs. This
patch corrects this. Now any option found in the switches of packages
Compiler, Binder or Linker is taken as is into account.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-29  Vincent Celier  <celier@adacore.com>

	* make.adb (Scan_Make_Arg): Take any option as is in packages Compiler,
	Binder or Linker of the main project file.

Patch

Index: make.adb
===================================================================
--- make.adb	(revision 178228)
+++ make.adb	(working copy)
@@ -7373,15 +7373,15 @@ 
 
          end if;
 
-      --  Then check if we are dealing with -cargs/-bargs/-largs/-margs
+      --  Then check if we are dealing with -cargs/-bargs/-largs/-margs. These
+      --  options are taken as is when found in package Compiler, Binder or
+      --  Linker of the main project file.
 
-      elsif Argv = "-bargs"
-              or else
-            Argv = "-cargs"
-              or else
-            Argv = "-largs"
-              or else
-            Argv = "-margs"
+      elsif (And_Save or else Program_Args = None)
+        and then (Argv = "-bargs" or else
+                  Argv = "-cargs" or else
+                  Argv = "-largs" or else
+                  Argv = "-margs")
       then
          case Argv (2) is
             when 'c' => Program_Args := Compiler;