浏览代码

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 年之前
父节点
当前提交
cc232f9b27
共有 1 个文件被更改,包括 9 次插入4 次删除
  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