fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / testsuite / lib / flags.exp
blobf6bffde1f5253e26f962ddf8daa9a3bea723dea0
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.
10 # These versions of the procedures generate link and include flags
11 # by searching for the needed files in the current build and source
12 # directories, rather than in the build and source paths of the
13 # compiler being used.
15 proc libgloss_link_flags { args } {
16 global target_cpu
17 # These values come from the local site.exp.
18 global srcdir objdir
19 global multibuildtop
21 verbose "In newlib version of libgloss_link_flags...\n"
23 if [isnative] {
24 return ""
27 if [is_remote host] {
28 return ""
31 set target_build_path "$objdir/$multibuildtop.."
33 set gloss_srcdir [lookfor_file ${srcdir} libgloss/$target_cpu]
35 if { $gloss_srcdir == "" } {
36 return ""
39 if [file exists $target_build_path/libgloss/$target_cpu] {
40 verbose "libgloss path is $target_build_path/libgloss/$target_cpu" 2
41 return "-B$target_build_path/libgloss/$target_cpu/ -L$target_build_path/libgloss/$target_cpu -L$gloss_srcdir"
42 } else {
43 verbose -log "No libgloss support for this target." 2
44 return ""
48 proc newlib_link_flags { args } {
49 global tool_root_dir
50 global srcdir objdir
52 verbose "In newlib version of newlib_link_flags...\n"
54 if [is_remote host] {
55 return ""
58 set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"];
59 if { $ld_script_path != "" } {
60 set result "-L[file dirname $ld_script_path]"
61 } else {
62 set result ""
65 return "$result -B$objdir -L$objdir"
68 proc newlib_include_flags { args } {
69 global srcdir objdir
71 verbose "In newlib version of newlib_include_flags...\n"
73 if [is_remote host] {
74 return ""
77 set newlib_dir [lookfor_file ${srcdir} newlib/libc/include/assert.h]
78 if { ${newlib_dir} != "" } {
79 set newlib_dir [file dirname ${newlib_dir}]
81 return " -I$objdir/targ-include -I${newlib_dir}"