ref: fe1d3c6d5ffd02ec8904c7599e784fdbac5e6286
parent: b8af763052c93ba53fee75cb209e1f673c5caa66
author: Ori Bernstein <[email protected]>
date: Sat Nov 28 07:47:10 EST 2015
Don't include spurious libpaths. We don't need them for 6m; just add them to the link phase.
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -113,6 +113,7 @@
const buildbin = {b, targ, addsrc
var dg, src
+ var libpath, incs
setdir(b, targ.dir)
addincludes(b, targ)
@@ -123,7 +124,14 @@
;;
if builddep(b, dg, targ.name, targ.incpath) || !freshlibs(targ, dg.libs)
src = std.htkeys(dg.sources)
- linkbin(dg, targ.name, src, targ.ldscript, targ.runtime, targ.incpath, targ.libdeps)
+
+ incs = std.sldup(targ.incpath)
+ if opt_instroot.len > 0 && !std.sleq(opt_instroot, "none")
+ libpath = std.pathcat(bld.opt_instroot, config.Libpath)
+ incs = std.slpush(incs, libpath)
+ ;;
+ linkbin(dg, targ.name, src, targ.ldscript, targ.runtime, incs, targ.libdeps)
+ std.slfree(incs)
std.slfree(src)
;;
}
@@ -298,6 +306,7 @@
/* -L path -l lib... */
cmd = addlibs(cmd, dg.libs, incs)
+
/* add extra libs */
for l in dg.extlibs
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -20,7 +20,6 @@
var targname
var bintarg
var cmd
- var libpath
var tags
dumponly = false
@@ -73,10 +72,6 @@
| _: std.die("unreachable\n")
;;
- ;;
- if bld.opt_instroot.len > 0 && !std.sleq(bld.opt_instroot, "none")
- libpath = std.pathcat(bld.opt_instroot, config.Libpath)
- bld.opt_incpaths = std.slpush(bld.opt_incpaths, libpath)
;;
b = mkbuild(tags)