summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-11-28 12:47:10 -0800
committerOri Bernstein <ori@eigenstate.org>2015-11-28 12:47:10 -0800
commitfe1d3c6d5ffd02ec8904c7599e784fdbac5e6286 (patch)
tree83ebeb19a4e1022aaedcea543edc555f0cacfcda /mbld
parentb8af763052c93ba53fee75cb209e1f673c5caa66 (diff)
downloadmc-fe1d3c6d5ffd02ec8904c7599e784fdbac5e6286.tar.gz
Don't include spurious libpaths.
We don't need them for 6m; just add them to the link phase.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/build.myr11
-rw-r--r--mbld/main.myr5
2 files changed, 10 insertions, 6 deletions
diff --git a/mbld/build.myr b/mbld/build.myr
index 7d2b804..56283d7 100644
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -113,6 +113,7 @@ const runin = {b, cmd, dir
const buildbin = {b, targ, addsrc
var dg, src
+ var libpath, incs
setdir(b, targ.dir)
addincludes(b, targ)
@@ -123,7 +124,14 @@ const buildbin = {b, targ, addsrc
;;
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)
;;
}
@@ -299,6 +307,7 @@ const linkbin = {dg, bin, srcfiles, ldscript, rt, incs, extlibs
/* -L path -l lib... */
cmd = addlibs(cmd, dg.libs, incs)
+
/* add extra libs */
for l in dg.extlibs
cmd = std.slpush(cmd, std.fmt("-l{}", l))
diff --git a/mbld/main.myr b/mbld/main.myr
index 92c25ee..9ca1426 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -20,7 +20,6 @@ const main = {args : byte[:][:]
var targname
var bintarg
var cmd
- var libpath
var tags
dumponly = false
@@ -74,10 +73,6 @@ const main = {args : byte[:][:]
;;
;;
- 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)
if targname.len != 0