Commit 576e4d82 by Rainer Orth Committed by Rainer Orth

gnat.exp (gnat_init): Remove GNAT_UNDER_TEST_ORIG.

	* lib/gnat.exp (gnat_init): Remove GNAT_UNDER_TEST_ORIG.
	(gnat_target_compile): Likewise.
	Reinitialize GNAT_UNDER_TEST if target changes.
	Set ADA_INCLUDE_PATH, ADA_OBJECTS_PATH in environment.
	(local_find_gnatmake): Pass full --GCC to gnatlink.
	Remove --LINK.

From-SVN: r157240
parent 714902c8
2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/gnat.exp (gnat_init): Remove GNAT_UNDER_TEST_ORIG.
(gnat_target_compile): Likewise.
Reinitialize GNAT_UNDER_TEST if target changes.
Set ADA_INCLUDE_PATH, ADA_OBJECTS_PATH in environment.
(local_find_gnatmake): Pass full --GCC to gnatlink.
Remove --LINK.
2010-03-04 Andrew Pinski <andrew_pinski@caviumnetworks.com> 2010-03-04 Andrew Pinski <andrew_pinski@caviumnetworks.com>
PR c/43248 PR c/43248
......
# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. # Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -83,7 +83,6 @@ proc gnat_init { args } { ...@@ -83,7 +83,6 @@ proc gnat_init { args } {
global gluefile wrap_flags global gluefile wrap_flags
global gnat_initialized global gnat_initialized
global GNAT_UNDER_TEST global GNAT_UNDER_TEST
global GNAT_UNDER_TEST_ORIG
global TOOL_EXECUTABLE global TOOL_EXECUTABLE
global gnat_libgcc_s_path global gnat_libgcc_s_path
global gnat_target_current global gnat_target_current
...@@ -98,7 +97,6 @@ proc gnat_init { args } { ...@@ -98,7 +97,6 @@ proc gnat_init { args } {
} else { } else {
set GNAT_UNDER_TEST "[local_find_gnatmake]" set GNAT_UNDER_TEST "[local_find_gnatmake]"
} }
set GNAT_UNDER_TEST_ORIG "$GNAT_UNDER_TEST"
} }
if ![info exists tmpdir] then { if ![info exists tmpdir] then {
...@@ -129,22 +127,31 @@ proc gnat_target_compile { source dest type options } { ...@@ -129,22 +127,31 @@ proc gnat_target_compile { source dest type options } {
global gluefile wrap_flags global gluefile wrap_flags
global srcdir global srcdir
global GNAT_UNDER_TEST global GNAT_UNDER_TEST
global GNAT_UNDER_TEST_ORIG
global TOOL_OPTIONS global TOOL_OPTIONS
global ld_library_path global ld_library_path
global gnat_libgcc_s_path global gnat_libgcc_s_path
global gnat_target_current global gnat_target_current
# If we detect a change of target we need to recompute # If we detect a change of target, we need to recompute both
# the appropriate RTS by calling get_multilibs. # GNAT_UNDER_TEST and the appropriate RTS.
if { $gnat_target_current!="[current_target_name]" } { if { $gnat_target_current!="[current_target_name]" } {
set gnat_target_current "[current_target_name]" set gnat_target_current "[current_target_name]"
if [info exists TOOL_OPTIONS] { if [info exists TOOL_OPTIONS] {
set gnat_rts_opt "--RTS=[get_multilibs ${TOOL_OPTIONS}]/libada" set rtsdir "[get_multilibs ${TOOL_OPTIONS}]/libada"
} else { } else {
set gnat_rts_opt "--RTS=[get_multilibs]/libada" set rtsdir "[get_multilibs]/libada"
} }
set GNAT_UNDER_TEST "$GNAT_UNDER_TEST_ORIG $gnat_rts_opt" if [info exists TOOL_EXECUTABLE] {
set GNAT_UNDER_TEST "$TOOL_EXECUTABLE"
} else {
set GNAT_UNDER_TEST "[local_find_gnatmake]"
}
set GNAT_UNDER_TEST "$GNAT_UNDER_TEST --RTS=$rtsdir"
# gnatlink looks for system.ads itself and has no --RTS option, so
# specify via environment
setenv ADA_INCLUDE_PATH "$rtsdir/adainclude"
setenv ADA_OBJECTS_PATH "$rtsdir/adainclude"
} }
set ld_library_path ".:${gnat_libgcc_s_path}" set ld_library_path ".:${gnat_libgcc_s_path}"
...@@ -263,7 +270,13 @@ proc local_find_gnatmake {} { ...@@ -263,7 +270,13 @@ proc local_find_gnatmake {} {
} }
if { $file != "" } { if { $file != "" } {
set root [file dirname $file] set root [file dirname $file]
set CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --LINK=$root/xgcc -B$root -margs"; # Need to pass full --GCC, including multilib flags, to gnatlink,
# otherwise gcc from PATH is invoked.
set dest [target_info name]
set gnatlink_gcc "--GCC=$root/xgcc -B$root [board_info $dest multilib_flags]"
# Escape blanks to get them through DejaGnu's exec machinery.
regsub -all {\s} "$gnatlink_gcc" {\\&} gnatlink_gcc
set CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs $gnatlink_gcc -margs";
} else { } else {
set CC [transform gnatmake] set CC [transform gnatmake]
} }
......
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