OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / lib / libjava.exp
index 09d4f09..b05c568 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation
 
 proc load_gcc_lib { filename } {
     global srcdir
@@ -145,6 +145,13 @@ proc libjava_init { args } {
     setenv LC_ALL C
     setenv LANG C
 
+    # Many hosts now default to a non-ASCII C locale, however, so
+    # they can set a charset encoding here if they need.
+    if { [ishost "*-*-cygwin*"] } {
+      setenv LC_ALL C.ASCII
+      setenv LANG C.ASCII
+    }
+
     if { $libjava_initialized == 1 } { return; }
 
     if ![info exists GCJ_UNDER_TEST] {
@@ -202,6 +209,8 @@ proc libjava_init { args } {
 
     if { [istarget "*-*-darwin*"] } {
        set so_extension "dylib"
+    } elseif { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } {
+       set so_extension "dll"
     } else {
        set so_extension "so"
     }
@@ -379,6 +388,11 @@ proc libjava_arguments {{mode compile}} {
     if {$mode == "link"} {
        global wrapper_file wrap_compile_flags
        lappend args "additional_flags=$wrap_compile_flags"
+
+       if { [regexp "linux" $target_triplet] } {
+           lappend args "additional_flags=-specs=libgcj-test.spec"
+       }
+
        lappend args "libs=$wrapper_file"
        lappend args "libs=$libjava"
        lappend args debug
@@ -417,13 +431,18 @@ proc libjava_arguments {{mode compile}} {
     # Avoid libtool wrapper scripts when possible.
     # but not if libtool warnings results in FAILs
     if {$mode == "link"} {
-       if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
+       if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"]
+           && ! [istarget "*-*-darwin*"] } { 
            lappend args "additional_flags=-no-install"
        }
        if { [istarget "*-*-darwin*"] } {
            lappend args "additional_flags=-bind_at_load"
            lappend args "additional_flags=-multiply_defined suppress"
        }
+       if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"] || [istarget "*-*-darwin2*"] } {
+           lappend args "additional_flags=-Wl,-allow_stack_execute"
+       }
+
     }
 
     return $args
@@ -494,7 +513,7 @@ proc gcj_invoke {program expectFile ld_library_additions} {
   }
 }
 
-proc exec_gij {jarfile expectFile ld_library_additions} {
+proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} {
   global env
   global libjava_ld_library_path
   global ld_library_path
@@ -512,9 +531,9 @@ proc exec_gij {jarfile expectFile ld_library_additions} {
   set gij [libjava_find_gij]
   set classname [file rootname [file tail $jarfile]]
   
-  puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $classname"
+  puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $addl_flags $classname"
        
-  set result [libjava_load $gij "-cp $jarfile $classname"]
+  set result [libjava_load $gij "-cp $jarfile $addl_flags $classname"]
   set status [lindex $result 0]
   set output [lindex $result 1]
 
@@ -572,6 +591,8 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile
        return 1
     }
 
+    send_log "invoke: $executable $args $inpfile\n"
+
     set result [libjava_load $executable $args "$inpfile"]
     set status [lindex $result 0]
     set output [lindex $result 1]