This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] dejagnu lib/target.exp env cleanup
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: Re: [PATCH] dejagnu lib/target.exp env cleanup
- From: Jimmy Guo <guo at cup dot hp dot com>
- Date: Wed, 2 Aug 2000 15:39:16 -0700 (PDT)
FYI I've committed the patch.
- Jimmy Guo
On Tue, 1 Aug 2000, Jimmy Guo wrote:
>Further env() cleanup for *_FOR_TARGET settings. All of these were
>introduced by HP, and some commented out later on by Andrew Cagney since
>it interferes with build from top level (e.g. using GNU make which
>creates make macros as environment variables).
>
>I greped for env() usage in dejagnu/lib/*.exp and it seems that the only
>remaining direct use of env() is PATH. Indeed it appears that the
>current practice of having an env() equivalent is mainly introduced by
>HP and should be backed out since it is not what dejagnu was originally
>implemented as. I have since introduced the use of site.exp in gdb
>testing at HP to pass settings via TCL variables instead of environment
>variables.
>
>- Jimmy
>
>Tue Aug 1 10:55:14 Jimmy Guo <guo@cup.hp.com>
>
> * lib/target.exp (default_target_compile,default_target_assemble,
> default_link): Remove env() interface for *_FOR_TARGET TCL vars.
>
>Index: lib/target.exp
>/usr/local/bin/diff -c -L lib/target.exp lib/target.exp@@/main/cygnus/12 lib/target.exp
>*** lib/target.exp
>--- lib/target.exp Tue Aug 1 10:54:35 2000
>***************
>*** 289,295 ****
> proc default_target_compile {source destfile type options} {
> global target_triplet
> global tool_root_dir
>- global env
> global CFLAGS_FOR_TARGET
> global compiler_flags
>
>--- 289,294 ----
>***************
>*** 306,316 ****
>
> if [info exists CFLAGS_FOR_TARGET] {
> append add_flags " $CFLAGS_FOR_TARGET"
>- # The top level Makefile sets (and exports) a *FLAGS_FOR_TARGET
>- # that may not be applicable to testsuite runs. This conflict
>- # needs to be resolved.
>- # } elseif [info exists env(CFLAGS_FOR_TARGET)] {
>- # append add_flags " $env(CFLAGS_FOR_TARGET)"
> }
>
> if [info exists target_info(host,name)] {
>--- 305,310 ----
>***************
>*** 404,446 ****
> if { $compiler == "" } {
> set compiler $CC_FOR_TARGET
> }
>- # When started from a mid-level directory (eg gdb)
>- # the Makefile may export a *_FOR_TARGET that isn't
>- # applicable.
>- # } elseif [info exists env(CC_FOR_TARGET)] {
>- # if { $compiler == "" } {
>- # set compiler $env(CC_FOR_TARGET)
>- # }
>- } elseif { [info exists env(CC_FOR_TARGET)] && $env(CC_FOR_TARGET) != "" } {
>- if { $compiler == "" } {
>- set compiler $env(CC_FOR_TARGET)
>- }
> }
>
> if [info exists CXX_FOR_TARGET] {
> if { $compiler_type == "c++" } {
> set compiler $CXX_FOR_TARGET
> }
>- # When started from a mid-level directory (eg gdb)
>- # the Makefile may export a *_FOR_TARGET that isn't
>- # applicable.
>- # } elseif [info exists env(CXX_FOR_TARGET)] {
>- # if { $compiler_type == "c++" } {
>- # set compiler $env(CXX_FOR_TARGET)
>- # }
> }
>
> if [info exists F77_FOR_TARGET] {
> if { $compiler_type == "f77" } {
> set compiler $F77_FOR_TARGET
> }
>- # When started from a mid-level directory (eg gdb)
>- # the Makefile may export a *_FOR_TARGET that isn't
>- # applicable.
>- # } elseif [info exists env(F77_FOR_TARGET)] {
>- # if { $compiler_type == "f77" } {
>- # set compiler $env(F77_FOR_TARGET)
>- # }
> }
>
> if { $compiler == "" } {
>--- 398,415 ----
>***************
>*** 655,668 ****
> }
>
> proc default_target_assemble { source destfile flags } {
>! global env
>! global AS_FOR_TARGET;
>! global ASFLAGS_FOR_TARGET;
>
> if [info exists AS_FOR_TARGET] {
> set AS "$AS_FOR_TARGET";
>- } elseif [info exists env(AS_FOR_TARGET)] {
>- set AS $env(AS_FOR_TARGET)
> } else {
> if ![board_info target exists assembler] {
> set AS [find_gas];
>--- 624,634 ----
> }
>
> proc default_target_assemble { source destfile flags } {
>! global AS_FOR_TARGET
>! global ASFLAGS_FOR_TARGET
>
> if [info exists AS_FOR_TARGET] {
> set AS "$AS_FOR_TARGET";
> } else {
> if ![board_info target exists assembler] {
> set AS [find_gas];
>***************
>*** 673,683 ****
>
> if [info exists ASFLAGS_FOR_TARGET] {
> append flags " $ASFLAGS_FOR_TARGET";
>- # The top level Makefile sets (and exports) a *FLAGS_FOR_TARGET
>- # that may not be applicable to testsuite runs. This conflict
>- # needs to be resolved.
>- # } elseif [info exists env(ASFLAGS_FOR_TARGET)] {
>- # append flags " $env(ASFLAGS_FOR_TARGET)"
> }
>
> if [is_remote host] {
>--- 639,644 ----
>***************
>*** 711,719 ****
> }
>
> proc default_link { board objects destfile flags } {
>! global env
>! global LD_FOR_TARGET;
>! global LDFLAGS_FOR_TARGET;
>
> # return -L's in ldflags
> proc only--Ls { ldflags } {
>--- 672,679 ----
> }
>
> proc default_link { board objects destfile flags } {
>! global LD_FOR_TARGET
>! global LDFLAGS_FOR_TARGET
>
> # return -L's in ldflags
> proc only--Ls { ldflags } {
>***************
>*** 742,749 ****
>
> if [info exists LD_FOR_TARGET] {
> set LD "$LD_FOR_TARGET";
>- } elseif [info exists env(LD_FOR_TARGET)] {
>- set LD $env(LD_FOR_TARGET)
> } else {
> if ![board_info target exists linker] {
> set LD [find_ld];
>--- 702,707 ----
>***************
>*** 754,764 ****
>
> if [info exists LDFLAGS_FOR_TARGET] {
> append flags " $LDFLAGS_FOR_TARGET";
>- # The top level Makefile sets (and exports) a *FLAGS_FOR_TARGET
>- # that may not be applicable to testsuite runs. This conflict
>- # needs to be resolved.
>- # } elseif [info exists env(LDFLAGS_FOR_TARGET)] {
>- # append flags " $env(LDFLAGS_FOR_TARGET)"
> }
>
> # `ldflags' consists of arguments to gcc (that are then
>--- 712,717 ----
>
>
Jimmy Guo, guo@cup.hp.com ADO eDL WDB
Voice: 800-477-6111 ext. 7451 Hewlett-Packard Company
(HP T-447-5229) 11000 Wolfe Road, MS 42UD
Fax: 408-447-4629 Cupertino, CA 95014-0678