Browse Source

gcc-plugin: update compilation system

    gcc-plugin/tests/run-test.in: executables are created in the build directory, not in the source directory
Nathalie Furmento 13 years ago
parent
commit
cc232f9b27
1 changed files with 9 additions and 4 deletions
  1. 9 4
      gcc-plugin/tests/run-test.in

+ 9 - 4
gcc-plugin/tests/run-test.in

@@ -261,10 +261,15 @@ unsatisfied directives."
 
 (define (executable-file source)
   "Return the name of the executable file corresponding to SOURCE."
-  (let ((dot (string-rindex source #\.)))
-    (if dot
-        (substring source 0 dot)
-        (string-append source ".exe"))))
+  (let* ((dot (string-rindex source #\.))
+         (exe (if dot
+                  (substring source 0 dot)
+                  (string-append source ".exe")))
+         )
+  (if (string-prefix? %srcdir exe)
+      (string-append %builddir (substring exe (string-length %srcdir)))
+      exe
+      )))
 
 (define (compile/match file cc cflags ldflags)
   "Read directives from FILE, and compiler/link/run it.  Make sure directives