OSDN Git Service

* testsuite/libgomp.exp (libgomp_init): Only set things that
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2008 15:37:05 +0000 (15:37 +0000)
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2008 15:37:05 +0000 (15:37 +0000)
depend on blddir if blddir exists.
(libgomp_target_compile): Likewise.
* testsuite/libgomp.c++/c++.exp: Likewise.
* testsuite/libgomp.fortran/fortran.exp: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139393 138bc75d-0d04-0410-961f-82ee72b054a4

libgomp/ChangeLog
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp.c++/c++.exp
libgomp/testsuite/libgomp.fortran/fortran.exp

index efa3639..2b9fedf 100644 (file)
@@ -1,3 +1,11 @@
+2008-08-12  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * testsuite/libgomp.exp (libgomp_init): Only set things that
+       depend on blddir if blddir exists.
+       (libgomp_target_compile): Likewise.
+       * testsuite/libgomp.c++/c++.exp: Likewise.
+       * testsuite/libgomp.fortran/fortran.exp: Likewise.
+
 2008-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * libgomp.texi: Update to GFDL 1.2.  Update copyright years.
 2008-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * libgomp.texi: Update to GFDL 1.2.  Update copyright years.
index 9aa891f..f86f1a1 100644 (file)
@@ -119,10 +119,13 @@ proc libgomp_init { args } {
     }
 
     set ALWAYS_CFLAGS ""
     }
 
     set ALWAYS_CFLAGS ""
-    lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
-    lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
+    if { $blddir != "" } {
+        lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
+        lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
+        lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
+    }
     lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
     lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
-    lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs -lgomp"
+    lappend ALWAYS_CFLAGS "ldflags=-lgomp"
 
     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
 
     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
@@ -164,8 +167,11 @@ proc libgomp_target_compile { source dest type options } {
     global lang_library_path
     global lang_link_flags
 
     global lang_library_path
     global lang_link_flags
 
-    if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
-       lappend options "ldflags=-L${blddir}/${lang_library_path} ${lang_link_flags}"
+    if { [info exists lang_test_file] } {
+        if { $blddir != "" } {
+            lappend options "ldflags=-L${blddir}/${lang_library_path}"
+        }
+        lappend options "ldflags=${lang_link_flags}"
     }
 
     if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
     }
 
     if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
index d9872cc..decda3d 100644 (file)
@@ -12,23 +12,36 @@ dg-init
 
 set blddir [lookfor_file [get_multilibs] libgomp]
 
 
 set blddir [lookfor_file [get_multilibs] libgomp]
 
-# Look for a static libstdc++ first.
-if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
-    set lang_test_file "${lang_library_path}/libstdc++.a"
-    set lang_test_file_found 1
-# We may have a shared only build, so look for a shared libstdc++.
-} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
-    set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+
+if { $blddir != "" } {
+    # Look for a static libstdc++ first.
+    if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
+        set lang_test_file "${lang_library_path}/libstdc++.a"
+        set lang_test_file_found 1
+        # We may have a shared only build, so look for a shared libstdc++.
+    } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
+        set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+        set lang_test_file_found 1
+    } else {
+        puts "No libstdc++ library found, will not execute c++ tests"
+    }
+} elseif { [info exists GXX_UNDER_TEST] } {
     set lang_test_file_found 1
     set lang_test_file_found 1
+    # Needs to exist for libgomp.exp.
+    set lang_test_file ""
 } else {
 } else {
-    puts "No libstdc++ library found, will not execute c++ tests"
+    puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
 }
 
 if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
 
 }
 
 if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
 
-    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+    if { $blddir != "" } {
+        set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+    } else {
+        set ld_library_path "$always_ld_library_path"
+    }
     append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
     set_ld_library_path_env_vars
 
     append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
     set_ld_library_path_env_vars
 
index 293ccbc..0f7ad6e 100644 (file)
@@ -1,18 +1,36 @@
 set lang_library_path  "../libgfortran/.libs"
 set lang_library_path  "../libgfortran/.libs"
-set lang_test_file     "${lang_library_path}/libgfortranbegin.a"
 set lang_link_flags    "-lgfortranbegin -lgfortran"
 set lang_link_flags    "-lgfortranbegin -lgfortran"
+set lang_test_file_found 0
 
 load_lib libgomp-dg.exp
 
 # Initialize dg.
 dg-init
 
 
 load_lib libgomp-dg.exp
 
 # Initialize dg.
 dg-init
 
-if [file exists "${blddir}/${lang_test_file}"] {
+if { $blddir != "" } {
+    if [file exists "${blddir}/${lang_library_path}/libgfortranbegin.a"] {
+        set lang_test_file "${lang_library_path}/libgfortranbegin.a"
+        set lang_test_file_found 1
+    } else {
+        puts "No libgfortranbegin library found, will not execute fortran tests"
+    }
+} elseif [info exists GFORTRAN_UNDER_TEST] {
+    set lang_test_file_found 1
+    # Needs to exist for libgomp.exp.
+    set lang_test_file ""
+} else {
+    puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+}
 
 
+if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
 
     # Gather a list of all tests.
     set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
 
-    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+    if { $blddir != "" } {
+        set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+    } else {
+        set ld_library_path "$always_ld_library_path"
+    }
     append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
     set_ld_library_path_env_vars
 
     append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
     set_ld_library_path_env_vars