shithub: mc

Download patch

ref: 232a0351a3ab39812140fe74499b1330e5e0f514
parent: 5c4e12b31f1e35c0a915bfaf8dffec06c625bcea
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Apr 20 17:41:55 EDT 2015

Muck more correctly with the inc path.

--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -115,7 +115,7 @@
 const addincludes = {b, targ
 	for (inc, lib, subtarg) in targ.libdeps
 		if !hasinc(targ.incpath, inc)
-			targ.incpath = std.slpush(targ.incpath, inc)
+			targ.incpath = std.slput(targ.incpath, 0, inc)
 		;;
 	;;
 }
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -333,9 +333,6 @@
 	ldscript = ""
 	runtime = ""
 	incpath = [][:]
-	for inc in bld.opt_incpaths
-		incpath = std.slpush(incpath, std.sldup(inc))
-	;;
 	for elt in attrs
 		match elt
 		| ("ldscript", lds):	ldscript = std.sldup(lds)
@@ -346,6 +343,9 @@
 		| (invalid, _):
 			std.fatal(1, "%s: got invalid attr '%s'\n", targ, invalid)
 		;;
+	;;
+	for inc in bld.opt_incpaths
+		incpath = std.slpush(incpath, std.sldup(inc))
 	;;
 	-> std.mk([
 		/* target */