dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIM env. variable question in baseboards


From: Hans-Peter Nilsson
Subject: Re: SIM env. variable question in baseboards
Date: Fri, 25 May 2012 03:14:57 +0200

> From: Steve Ellcey <address@hidden>
> Date: Fri, 25 May 2012 02:06:34 +0200

> Are you thinking of something like:
> 
> if {[info exists DEJAGNU_SIM_LDFLAGS]} {
>   set_board_info ldflags "$DEJAGNU_SIM_LDFLAGS"
> }
> else {
>   set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
> }

No, "appending" was key.

if {[info exists DEJAGNU_SIM_LDFLAGS]} {
  set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] 
$DEJAGNU_SIM_LDFLAGS"
}
else {
  set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
}

or rather preferred using environment variables (still cleaner
appending to board_info ldflags left as an exercise):

set ldflags "[libgloss_link_flags] [newlib_link_flags]"
if {[info exists env(DEJAGNU_SIM_LDFLAGS)]} {
  append ldflags " $env(DEJAGNU_SIM_LDFLAGS)"
}
set_board_info ldflags $ldflags

> I might go with SIM_LDFLAGS instead of DEJAGNU_SIM_LDFLAGS just to match
> SIM (not DEJAGNU_SIM).  I don't think name pollution is a problem if
> these are Tcl variables and not env. variables as Ben indicated in his
> email.

Using environment variables would IMO be better, else you'll
still have to modify something in the GCC setup to use the
generic baseboard, right?

(And if you do that, IMHO it's less intrusive to have a
directory outside that setup with a specific baseboard file and
at home a ~/.dejagnurc with the directory, e.g.  "set boards_dir
~/dejagnuboards" which would DTRT .)

brgds, H-P



reply via email to

[Prev in Thread] Current Thread [Next in Thread]