summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@mmarkovcorp.com>2017-09-05 11:45:59 -0700
committerOri Bernstein <ori@mmarkovcorp.com>2017-09-05 11:45:59 -0700
commit5fa05936d56f927db90c52d07fae2db63bca7d29 (patch)
tree4b7a17019ce005111da9dfd9171106714804cebb /mbld
parentea067be32dd52602d1f36051e51baefe01135aa3 (diff)
downloadmc-5fa05936d56f927db90c52d07fae2db63bca7d29.tar.gz
Improve error messages for missing libs.
It's useful to know which target is missing them.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/deps.myr4
-rw-r--r--mbld/libs.myr19
2 files changed, 13 insertions, 10 deletions
diff --git a/mbld/deps.myr b/mbld/deps.myr
index b68e80f..2783dee 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -147,7 +147,7 @@ const myrdeps = {b, name, mt
depends(g, n, d)
;;
for `Xdep d : deps
- scrapelib(b, d, mt.incpath)
+ scrapelib(b, mt.name, d, mt.incpath)
xdepends(b, g, n, d)
std.slpush(&libs, d)
;;
@@ -329,7 +329,7 @@ const addalt = {b, mt, kind, f
depends(g, n, d)
;;
for `Xdep d : deps
- scrapelib(b, d, mt.incpath)
+ scrapelib(b, mt.name, d, mt.incpath)
xdepends(b, g, n, d)
std.slpush(&libs, d)
;;
diff --git a/mbld/libs.myr b/mbld/libs.myr
index 457a55d..f3deec5 100644
--- a/mbld/libs.myr
+++ b/mbld/libs.myr
@@ -16,7 +16,10 @@ pkg bld =
dep : byte[:][:], \
dyndep : byte[:][:] -> void)
- const scrapelib : (b : build#, libs : byte[:], incs : byte[:][:] -> void)
+ const scrapelib : (b : build#, \
+ targ : byte[:], \
+ libs : byte[:], \
+ incs : byte[:][:] -> void)
;;
const Abiversion = 14
@@ -37,12 +40,12 @@ const builtlib = {b, mt, dep, dyndep
std.slfree(l)
std.slfree(u)
for d : dep
- scrapelib(b, d, mt.incpath)
+ scrapelib(b, mt.name, d, mt.incpath)
;;
std.htput(b.libs, mt.name, ldep)
}
-const scrapelib = {b, lib, incs
+const scrapelib = {b, targ, lib, incs
var dep, dyndep, ldep
var f, dir
@@ -50,7 +53,7 @@ const scrapelib = {b, lib, incs
-> void
;;
- (f, dir) = openlib(lib, incs)
+ (f, dir) = openlib(lib, targ, incs)
match bio.getc(f)
| `bio.Ok 'U': /* ok */
| `bio.Ok _: std.fput(1, "{}/{}: not a usefile\n", dir, lib)
@@ -87,11 +90,11 @@ const scrapelib = {b, lib, incs
std.htput(b.libs, lib, ldep)
for d : dep
- scrapelib(b, d, incs)
+ scrapelib(b, targ, d, incs)
;;
}
-const openlib = {lib, incs : byte[:][:]
+const openlib = {lib, targ, incs
var path, libname
path = ""
@@ -107,11 +110,11 @@ const openlib = {lib, incs : byte[:][:]
-> (file, p)
| `std.Err m:
;;
- std.fatal("{} does not exist in {j=, }\n", lib, incs)
+ std.fatal("{}: {} does not exist in {j=, }\n", targ, lib, incs)
;;
std.slfree(path)
;;
- std.fatal("{} does not exist in {j= }\n", lib, incs)
+ std.fatal("{}: {} does not exist in {j= }\n", targ, lib, incs)
}
const addlibs = {b, sl, libs, incs