1 # Copyright
(C
) 2002, 2011 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 if [info exists env
(XGCC_FLAGS_FOR_TARGET
)] {
8 verbose
"GCC, newlib combined tree, build-tree testing; using standard search paths"
9 # ... instead of the search paths built here
, based
on 'objdir' as
set in
10 # newlib
's 'site.exp
', which always points to the default multilib.
14 # flags.exp: overrides the dejagnu versions of libgloss_link_flags,
15 # newlib_link_flags, and newlib_include_flags.
17 # These versions of the procedures generate link and include flags
18 # by searching for the needed files in the current build and source
19 # directories, rather than in the build and source paths of the
20 # compiler being used.
22 if {![llength [info procs saved_libgloss_link_flags]]} {
23 rename libgloss_link_flags saved_libgloss_link_flags
26 proc libgloss_link_flags { args } {
28 # These values come from the local site.exp.
32 if {![info exists multibuildtop]} {
33 return [saved_libgloss_link_flags $args]
36 verbose "In newlib version of libgloss_link_flags...\n"
46 set target_build_path "$objdir/.."
48 set gloss_srcdir [lookfor_file ${srcdir} libgloss/$target_cpu]
50 if { $gloss_srcdir == "" } {
54 if [file exists $target_build_path/libgloss/$target_cpu] {
55 verbose "libgloss path is $target_build_path/libgloss/$target_cpu" 2
56 return "-B$target_build_path/libgloss/$target_cpu/ -L$target_build_path/libgloss/$target_cpu -L$gloss_srcdir"
58 verbose -log "No libgloss support for this target." 2
63 proc newlib_link_flags { args } {
67 verbose "In newlib version of newlib_link_flags...\n"
73 set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"];
74 if { $ld_script_path != "" } {
75 set result "-L[file dirname $ld_script_path]"
80 return "$result -B$objdir -L$objdir"
83 proc newlib_include_flags { args } {
86 verbose "In newlib version of newlib_include_flags...\n"
92 set newlib_dir [lookfor_file ${srcdir} newlib/libc/include/assert.h]
93 if { ${newlib_dir} != "" } {
94 set newlib_dir [file dirname ${newlib_dir}]
96 return " -I$objdir/targ-include -I$objdir -I${newlib_dir}"