diff options
author | Vincent Celier <celier@adacore.com> | 2007-09-26 12:44:26 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-09-26 12:44:26 +0200 |
commit | 226302378ab388a063589e070715a0032b6c56f6 (patch) | |
tree | 9de288085d47932d60eac2b2ca05b2b741d4d76d /gcc/ada/gnatbind.adb | |
parent | 37d54b99bf0547aaf22ba1929c81354c7ea89514 (diff) | |
download | gcc-226302378ab388a063589e070715a0032b6c56f6.zip gcc-226302378ab388a063589e070715a0032b6c56f6.tar.gz gcc-226302378ab388a063589e070715a0032b6c56f6.tar.bz2 |
gnatbind.adb: If there are several ALI files specified and there is a main program to bind...
2007-09-26 Vincent Celier <celier@adacore.com>
* gnatbind.adb: If there are several ALI files specified and there is
a main program to bind, the first ALI is expected to contain the main
subprogram and the names of the binder generated files will be derived
from the first ALI file name.
(Gnatbind): Fix insertion character in invocation of Error_Msg
From-SVN: r128793
Diffstat (limited to 'gcc/ada/gnatbind.adb')
-rw-r--r-- | gcc/ada/gnatbind.adb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb index 7cc353d..8a16699 100644 --- a/gcc/ada/gnatbind.adb +++ b/gcc/ada/gnatbind.adb @@ -64,6 +64,10 @@ procedure Gnatbind is Main_Lib_File : File_Name_Type; -- Current main library file + First_Main_Lib_File : File_Name_Type := No_File; + -- The first library file, that should be a main subprogram if neither -n + -- nor -z are used. + Std_Lib_File : File_Name_Type; -- Standard library @@ -593,6 +597,10 @@ begin while More_Lib_Files loop Main_Lib_File := Next_Main_Lib_File; + if First_Main_Lib_File = No_File then + First_Main_Lib_File := Main_Lib_File; + end if; + if Verbose_Mode then if Check_Only then Write_Str ("Checking: "); @@ -683,6 +691,15 @@ begin Set_Source_Table; + -- If there is main program to bind, set Main_Lib_File to the first + -- library file, and the name from which to derive the binder generate + -- file to the first ALI file. + + if Bind_Main_Program then + Main_Lib_File := First_Main_Lib_File; + Set_Current_File_Name_Index (To => 1); + end if; + -- Check that main library file is a suitable main program if Bind_Main_Program @@ -690,7 +707,7 @@ begin and then not No_Main_Subprogram then Error_Msg_File_1 := Main_Lib_File; - Error_Msg ("% does not contain a unit that can be a main program"); + Error_Msg ("{ does not contain a unit that can be a main program"); end if; -- Perform consistency and correctness checks |