aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2005-11-15 14:59:20 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-11-15 14:59:20 +0100
commit0bce6c77ca1f0e57afe1ff257d0a4ea87a94e75f (patch)
tree41efa2de467becf48b45b43704607122b1ba151f /gcc/ada
parent2989065ea677fe30bfa1021e327b876c1a2e6855 (diff)
downloadgcc-0bce6c77ca1f0e57afe1ff257d0a4ea87a94e75f.zip
gcc-0bce6c77ca1f0e57afe1ff257d0a4ea87a94e75f.tar.gz
gcc-0bce6c77ca1f0e57afe1ff257d0a4ea87a94e75f.tar.bz2
gnatbind.adb (Is_Cross_Compiler): New function returning True for cross-compiler.
2005-11-14 Pascal Obry <obry@adacore.com> * gnatbind.adb (Is_Cross_Compiler): New function returning True for cross-compiler. (Scan_Bind_Arg): Fail with an error message if -M option is used on a native compiler. From-SVN: r106982
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/gnatbind.adb24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index 270d334..e9222c9 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -87,6 +87,9 @@ procedure Gnatbind is
-- All the one character arguments are still handled by Switch. This
-- routine handles -aO -aI and -I-.
+ function Is_Cross_Compiler return Boolean;
+ -- Returns True iff this is a cross-compiler
+
---------------------------------
-- Gnatbind_Supports_Auto_Init --
---------------------------------
@@ -99,6 +102,17 @@ procedure Gnatbind is
return gnat_binder_supports_auto_init /= 0;
end Gnatbind_Supports_Auto_Init;
+ -----------------------
+ -- Is_Cross_Compiler --
+ -----------------------
+
+ function Is_Cross_Compiler return Boolean is
+ Cross_Compiler : Integer;
+ pragma Import (C, Cross_Compiler, "__gnat_is_cross_compiler");
+ begin
+ return Cross_Compiler = 1;
+ end Is_Cross_Compiler;
+
----------------------------------
-- List_Applicable_Restrictions --
----------------------------------
@@ -350,8 +364,12 @@ procedure Gnatbind is
-- -Mname
elsif Argv'Length >= 3 and then Argv (2) = 'M' then
- Opt.Bind_Alternate_Main_Name := True;
- Opt.Alternate_Main_Name := new String'(Argv (3 .. Argv'Last));
+ if Is_Cross_Compiler then
+ Opt.Bind_Alternate_Main_Name := True;
+ Opt.Alternate_Main_Name := new String'(Argv (3 .. Argv'Last));
+ else
+ Fail ("-M option only valid for a cross-compiler");
+ end if;
-- All other options are single character and are handled by
-- Scan_Binder_Switches.