1 # Copyright
(C
) 2002 by Red Hat
, Incorporated. All rights
reserved.
3 # Permission to use
, copy
, modify
, and distribute this software
4 # is freely granted
, provided that this notice is preserved.
7 # flags.exp overrides the dejagnu versions of libgloss_link_flags
,
8 # newlib_link_flags
, and newlib_include_flags.
11 proc newlib_version
{ } {
14 verbose
"In newlib version...\n"
19 set newlib_initialized
0
21 proc newlib_init
{ args } {
22 global gluefile wrap_flags
23 global newlib_initialized
25 # These
values are initialized in the local site.exp file.
27 global host_triplet target_triplet
28 global old_ld_library_path
30 verbose
"In newlib_init...\n"
32 if { $newlib_initialized
== 1 } { return; }
34 if {[target_info needs_status_wrapper
] != "" && \
35 [target_info needs_status_wrapper
] != "0" && \
36 ![info exists gluefile
]} {
37 set gluefile $
{objdir
}/testsuite
/testglue.o
;
38 set result
[build_wrapper $gluefile
];
39 if { $result
!= "" } {
40 set gluefile
[lindex $result
0];
41 set wrap_flags
[lindex $result
1];
47 if [string match $host_triplet $target_triplet
] then {
48 if [string match
"i686-pc-linux-gnu" $host_triplet] then {
49 set old_ld_library_path
[getenv LD_LIBRARY_PATH
]
50 setenv LD_LIBRARY_PATH
"$objdir/.libs"
55 proc newlib_target_compile
{ source dest type options
} {
56 global gluefile wrap_flags
58 global host_triplet target_triplet
60 verbose
"In newlib_target_compile...\n"
62 lappend options
"libs=-I$srcdir/include"
63 verbose
"srcdir is $srcdir"
65 if {[target_info needs_status_wrapper
] != "" && \
66 [target_info needs_status_wrapper
] != "0" && \
67 [info exists gluefile
] } {
68 lappend options
"libs=$gluefile"
69 lappend options
"ldflags=$wrap_flags"
72 if [string match $host_triplet $target_triplet
] then {
73 if [string match
"i686-pc-linux-gnu" $host_triplet] then {
74 lappend options
"libs=$objdir/crt0.o -lc -lgcc"
75 lappend options
"ldflags=-nostdlib -L$objdir/.libs [newlib_include_flags]"
79 return [target_compile $source $dest $type $options
]
82 proc newlib_finish
{ } {
83 global old_ld_library_path
84 global host_triplet target_triplet
86 verbose
"In newlib_finish...\n"
88 if [string match $host_triplet $target_triplet
] then {
89 if [string match
"i686-pc-linux-gnu" $host_triplet] then {
90 setenv LD_LIBRARY_PATH
"$old_ld_library_path"
95 proc newlib_exit
{ } {
98 verbose
"In newlib_exit...\n"
100 if [info exists gluefile
] {
101 file_on_build
delete $gluefile
;