Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / testsuite / lib / flags.exp
blob697291e7a555b07d64803c94164c24d8bcac2387
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.
11 return
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 } {
27 global target_cpu
28 # These values come from the local site.exp.
29 global srcdir objdir
30 global multibuildtop
32 if {![info exists multibuildtop]} {
33 return [saved_libgloss_link_flags $args]
36 verbose "In newlib version of libgloss_link_flags...\n"
38 if [isnative] {
39 return ""
42 if [is_remote host] {
43 return ""
46 set target_build_path "$objdir/.."
48 set gloss_srcdir [lookfor_file ${srcdir} libgloss/$target_cpu]
50 if { $gloss_srcdir == "" } {
51 return ""
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"
57 } else {
58 verbose -log "No libgloss support for this target." 2
59 return ""
63 proc newlib_link_flags { args } {
64 global tool_root_dir
65 global srcdir objdir
67 verbose "In newlib version of newlib_link_flags...\n"
69 if [is_remote host] {
70 return ""
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]"
76 } else {
77 set result ""
80 return "$result -B$objdir -L$objdir"
83 proc newlib_include_flags { args } {
84 global srcdir objdir
86 verbose "In newlib version of newlib_include_flags...\n"
88 if [is_remote host] {
89 return ""
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}"