shithub: mc

Download patch

ref: 0daad047dcbfae0c6650dada4195efecbbe2b883
parent: aee3a905c030959ffcf3b2cc9e2b1b9ba83e1f7d
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Aug 29 06:40:49 EDT 2015

Copy the search paths.

    We modify them in build sometimes.

--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -326,16 +326,20 @@
 }
 
 const putlib = {cmd, head, lib, incs
+	var sep
+
 	if !config.Directlib
 		-> std.slput(cmd, head, std.fmt("-l{}", lib))
 	else
 		match findlib(lib, incs)
 		| `std.None:
-			std.put("searched:\n")
+			std.put("in path: ")
+			sep = ""
 			for inc in incs
-				std.put("\t{}\n", inc)
+				std.put("\t{}{}\n", sep, inc)
+				sep = ", "
 			;;
-			std.fatal("could not find library lib{}.a\n", lib)
+			std.fatal("could not find library lib{}.a.\n", lib)
 		| `std.Some p:
 			-> std.slput(cmd, head, p)
 		;;
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -622,7 +622,7 @@
 const libpath = {p, libpath
 	var dir, lib, targ
 
-	match(std.strrfind(libpath, ":"))
+	match std.strrfind(libpath, ":")
 	| `std.None:
 		dir = std.sldup(".")
 		lib = std.sldup(libpath)
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -21,10 +21,10 @@
 	ok = true
 	hastest = false
 	if std.fexists("test")
-		hastest = true
 		for tn in b.all
 			match gettarg(b.targs, tn)
 			| `Bin bt:
+				hastest = true
 				if !dotest(b, bt)
 					ok = false
 				;;
@@ -85,13 +85,15 @@
 				.dir = targ.dir,
 				.inputs = [path][:],
 				.install = false,
-				.libdeps = targ.libdeps,
-				.incpath = targ.incpath,
+				.libdeps = std.sldup(targ.libdeps),
+				.incpath = std.sldup(targ.incpath),
 			]
 
 			cleantest(b, path)
 			buildbin(b, &tt, true)
 			tests = std.slpush(tests, bin)
+			std.slfree(tt.libdeps)
+			std.slfree(tt.incpath)
 		;;
 		std.slfree(path)
 	;;