1 |
# Copyright (C) 92 - 2000, 2001 Free Software Foundation, Inc. |
# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999, 2000, 2002 |
2 |
|
# Free Software Foundation, Inc. |
3 |
|
|
4 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
5 |
# 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 |
71 |
"d10v*" { |
"d10v*" { |
72 |
set cpu libnosys |
set cpu libnosys |
73 |
} |
} |
74 |
|
"xscale*" { |
75 |
|
set cpu arm |
76 |
|
} |
77 |
default { |
default { |
78 |
set cpu $target_cpu |
set cpu $target_cpu |
79 |
} |
} |
214 |
|
|
215 |
proc g++_include_flags { args } { |
proc g++_include_flags { args } { |
216 |
global srcdir |
global srcdir |
217 |
|
global target_alias |
218 |
|
|
219 |
if [is_remote host] { |
if [is_remote host] { |
220 |
return "" |
return "" |
226 |
|
|
227 |
set dir [lookfor_file ${srcdir} libg++] |
set dir [lookfor_file ${srcdir} libg++] |
228 |
if { ${dir} != "" } { |
if { ${dir} != "" } { |
229 |
append flags "-I${dir} -I${dir}/src " |
append flags " -I${dir} -I${dir}/src" |
230 |
|
} |
231 |
|
|
232 |
|
set dir [lookfor_file ${srcdir} libstdc++-v3] |
233 |
|
if { ${dir} != "" } { |
234 |
|
append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++" |
235 |
|
} |
236 |
|
|
237 |
|
set dir [lookfor_file ${gccpath} libstdc++-v3] |
238 |
|
if { ${dir} != "" } { |
239 |
|
append flags " -I${dir}/include -I${dir}/include/${target_alias}" |
240 |
} |
} |
241 |
|
|
242 |
set dir [lookfor_file ${srcdir} libstdc++] |
set dir [lookfor_file ${srcdir} libstdc++] |
243 |
if { ${dir} != "" } { |
if { ${dir} != "" } { |
244 |
append flags "-I${dir} -I${dir}/stl" |
append flags " -I${dir} -I${dir}/stl" |
245 |
} |
} |
246 |
|
|
247 |
return "$flags" |
return "$flags" |
248 |
} |
} |
249 |
|
|
268 |
append flags "-L${gccpath}/libstdc++ " |
append flags "-L${gccpath}/libstdc++ " |
269 |
append ld_library_path ":${gccpath}/libstdc++" |
append ld_library_path ":${gccpath}/libstdc++" |
270 |
} |
} |
271 |
|
if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] { |
272 |
|
append flags "-L${gccpath}/libstdc++-v3/src/.libs " |
273 |
|
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" |
274 |
|
} |
275 |
if [file exists "${gccpath}/libiberty/libiberty.a"] { |
if [file exists "${gccpath}/libiberty/libiberty.a"] { |
276 |
append flags "-L${gccpath}/libiberty " |
append flags "-L${gccpath}/libiberty " |
277 |
} |
} |
305 |
|
|
306 |
proc libstdc++_include_flags { args } { |
proc libstdc++_include_flags { args } { |
307 |
global srcdir |
global srcdir |
308 |
|
global target_alias |
309 |
|
|
310 |
if [is_remote host] { |
if [is_remote host] { |
311 |
return "" |
return "" |
315 |
set libio_dir "" |
set libio_dir "" |
316 |
set flags "" |
set flags "" |
317 |
|
|
318 |
|
set dir [lookfor_file ${srcdir} libstdc++-v3] |
319 |
|
if { ${dir} != "" } { |
320 |
|
append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++" |
321 |
|
} |
322 |
|
|
323 |
|
set gccpath [get_multilibs] |
324 |
|
|
325 |
|
set dir [lookfor_file ${gccpath} libstdc++-v3] |
326 |
|
if { ${dir} != "" } { |
327 |
|
append flags " -I${dir}/include -I${dir}/include/${target_alias}" |
328 |
|
} |
329 |
|
|
330 |
set dir [lookfor_file ${srcdir} libstdc++] |
set dir [lookfor_file ${srcdir} libstdc++] |
331 |
if { ${dir} != "" } { |
if { ${dir} != "" } { |
332 |
append flags "-I${dir} -I${dir}/stl" |
append flags " -I${dir} -I${dir}/stl" |
333 |
} |
} |
334 |
|
|
335 |
return "$flags" |
return "$flags" |
336 |
} |
} |
337 |
|
|
453 |
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]]; |
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]]; |
454 |
} |
} |
455 |
|
|
456 |
|
# search for the top level multilib directory |
457 |
|
set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"] |
458 |
|
if { $multitop == "" } { |
459 |
|
set multitop [lookfor_file "${comp_base_dir}" "libraries"] |
460 |
|
if { $multitop == "" } { |
461 |
|
set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" |
462 |
|
if { $multitop != "" } { |
463 |
|
set multitop [file dirname [file dirname $multitop]]; |
464 |
|
} else { |
465 |
|
return "" |
466 |
|
} |
467 |
|
} |
468 |
|
} |
469 |
|
|
470 |
|
set gccpath [eval exec "$compiler" --print-multi-directory $mopts]; |
471 |
|
set gccpath [lindex $gccpath 0]; |
472 |
|
if { $gccpath != "" } { |
473 |
|
verbose "GCC path is $gccpath"; |
474 |
|
if { [llength $args] == 0 } { |
475 |
|
set board_info($target_board,multitop) "$multitop/$gccpath" |
476 |
|
} |
477 |
|
return "$multitop/$gccpath"; |
478 |
|
} |
479 |
|
|
480 |
# set output [exec $objdump_name --file-headers objfmtst.o ] |
# set output [exec $objdump_name --file-headers objfmtst.o ] |
481 |
set default_multilib [exec $compiler --print-multi-lib] |
set default_multilib [exec $compiler --print-multi-lib] |
482 |
set default_multilib [lindex $default_multilib 0]; |
set default_multilib [lindex $default_multilib 0]; |
483 |
set extra [string trimleft $default_multilib ".;@"] |
set extra [string trimleft $default_multilib ".;@@"] |
484 |
|
|
485 |
# extract the options and their directory names as know by gcc |
# extract the options and their directory names as know by gcc |
486 |
foreach i "[exec $compiler --print-multi-lib]" { |
foreach i "[exec $compiler --print-multi-lib]" { |
487 |
if {$extra != ""} { |
if {$extra != ""} { |
488 |
# string trimright would do the wrong thing if we included |
# string trimright would do the wrong thing if we included |
489 |
# the leading @ in $extra |
# the leading @@ in $extra |
490 |
set i [string trimright $i $extra] |
set i [string trimright $i $extra"] |
491 |
set i [string trimright $i "@"] |
set i [string trimright $i "@@"] |
492 |
} |
} |
493 |
set opts "" |
set opts "" |
494 |
set dir "" |
set dir "" |
495 |
regexp -- "\[a-z0-9=/\.-\]*;" $i dir |
regexp -- "\[a-z0-9=/\.-\]*;" $i dir |
496 |
set dir [string trimright $dir "\;@"] |
set dir [string trimright $dir "\;@"] |
497 |
regexp -- "\;@*\[\@a-zA-Z0-9=/\.-\]*" $i opts |
regexp -- "\;@*\[\@a-zA-Z0-9=/\.-\]*" $i opts |
498 |
set opts [split [string trimleft $opts "\;@"] "@"] |
set opts [split [string trimleft $opts "\;@@"] "@@"] |
499 |
lappend multilibs "$dir {$opts }" |
lappend multilibs "$dir {$opts }" |
500 |
} |
} |
501 |
|
|
535 |
verbose "options after multimatches: $moptions" 3 |
verbose "options after multimatches: $moptions" 3 |
536 |
} |
} |
537 |
|
|
|
# search for the top level multilib directory |
|
|
set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"] |
|
|
if { $multitop == "" } { |
|
|
set multitop [lookfor_file "${comp_base_dir}" "libraries"] |
|
|
if { $multitop == "" } { |
|
|
set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" |
|
|
if { $multitop != "" } { |
|
|
set multitop [file dirname [file dirname $multitop]]; |
|
|
} else { |
|
|
return "" |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
538 |
# make a list of -m<foo> options from the various compiler config variables |
# make a list of -m<foo> options from the various compiler config variables |
539 |
set gccpath "" |
set gccpath "" |
540 |
|
|
823 |
set flags ""; |
set flags ""; |
824 |
if [target_info exists is_vxworks] { |
if [target_info exists is_vxworks] { |
825 |
set flags "additional_flags=-DVXWORKS"; |
set flags "additional_flags=-DVXWORKS"; |
826 |
|
set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort"; |
827 |
|
} else { |
828 |
|
set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort"; |
829 |
} |
} |
|
set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort"; |
|
830 |
} |
} |
831 |
if [target_info exists wrap_compile_flags] { |
if [target_info exists wrap_compile_flags] { |
832 |
lappend flags "additional_flags=[target_info wrap_compile_flags]"; |
lappend flags "additional_flags=[target_info wrap_compile_flags]"; |