libgomp.exp (libgomp_init): Only set things that depend on blddir if blddir exists.
authorNathan Froyd <froydnj@codesourcery.com>
Thu, 21 Aug 2008 15:37:05 +0000 (15:37 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Thu, 21 Aug 2008 15:37:05 +0000 (15:37 +0000)
* 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.

From-SVN: r139393

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

index efa3639920d5fcf65fb8ba56c12f96e0c786a447..2b9fedfd4b705a411da0b8c4deaa4840c11e096a 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.
index 9aa891f202d6b2a48750b6828e65b93c41f56225..f86f1a18ed04923049585f239bcfcca3973c8b9b 100644 (file)
@@ -119,10 +119,13 @@ proc libgomp_init { args } {
     }
 
     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 "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-*-*])
@@ -164,8 +167,11 @@ proc libgomp_target_compile { source dest type options } {
     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] } {
index d9872cc1ef34cab9433f41d607d78cdaaaa6cd38..decda3d1a122ebab2d2bc1dfa27dbb431418c056 100644 (file)
@@ -12,23 +12,36 @@ dg-init
 
 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
+    # Needs to exist for libgomp.exp.
+    set lang_test_file ""
 } 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]]
 
-    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
 
index 293ccbc653133799179126a6bec618c758376141..0f7ad6e5a911c059f7262839e86735efc94b669b 100644 (file)
@@ -1,18 +1,36 @@
 set lang_library_path  "../libgfortran/.libs"
-set lang_test_file     "${lang_library_path}/libgfortranbegin.a"
 set lang_link_flags    "-lgfortranbegin -lgfortran"
+set lang_test_file_found 0
 
 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}]]
 
-    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