From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jimmy Guo To: gdb-patches@sourceware.cygnus.com Subject: [PATCH] dejagnu lib/target.exp env cleanup Date: Tue, 01 Aug 2000 11:04:00 -0000 Message-id: X-SW-Source: 2000-08/msg00018.html 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 * 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 ----