summaryrefslogtreecommitdiff
path: root/mbld/libs.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-16 10:04:07 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-16 10:04:07 -0800
commit8f8899df9181abbde98ca28f8f7a8ff39cf17146 (patch)
tree14517ce08006226d026c26b359c0adc80784afe7 /mbld/libs.myr
parentac6c06f906d356b0004ed450558dd890c7057fbf (diff)
parent4db2895318842a451a5036652ea9373667a603b1 (diff)
downloadmc-8f8899df9181abbde98ca28f8f7a8ff39cf17146.tar.gz
Merge branch 'clink-obsd' of https://github.com/moreais/mc into trait-syntaxtrait-syntax
Diffstat (limited to 'mbld/libs.myr')
-rw-r--r--mbld/libs.myr16
1 files changed, 11 insertions, 5 deletions
diff --git a/mbld/libs.myr b/mbld/libs.myr
index b29becb..9652c15 100644
--- a/mbld/libs.myr
+++ b/mbld/libs.myr
@@ -9,7 +9,7 @@ pkg bld =
const addlibs : (b : build#, \
sl : byte[:][:]#, \
libs : byte[:][:], \
- incs : byte[:][:] -> void)
+ incs : byte[:][:] -> bool)
const builtlib : (b : build#, \
lt : myrtarg#, \
@@ -117,6 +117,7 @@ const openlib = {lib, targ, incs
const addlibs = {b, sl, libs, incs
var added, diradded, looped
+ var dynlink
var lo
added = std.mkht()
@@ -124,8 +125,9 @@ const addlibs = {b, sl, libs, incs
diradded = std.mkht()
lo = sl#.len
+ dynlink = false
for l : libs
- addlib(b, sl, l, added, diradded, looped)
+ dynlink = addlib(b, sl, l, added, diradded, looped, dynlink)
;;
for var i = 0; i < sl#[lo:].len/2; i++
std.swap(&sl#[lo+i], &sl#[sl#.len - i - 1])
@@ -134,9 +136,11 @@ const addlibs = {b, sl, libs, incs
std.htfree(diradded)
std.htfree(looped)
std.htfree(added)
+
+ -> dynlink
}
-const addlib = {b, sl, lib, added, diradded, looped
+const addlib = {b, sl, lib, added, diradded, looped, dl
var ar
if std.hthas(looped, lib)
@@ -146,12 +150,13 @@ const addlib = {b, sl, lib, added, diradded, looped
match std.htget(b.libs, lib)
| `std.None:
std.slpush(sl, std.fmt("-l{}", lib))
+ dl = true
| `std.Some ld:
for l : ld.dep
- addlib(b, sl, l, added, diradded, looped)
+ dl = addlib(b, sl, l, added, diradded, looped, dl)
;;
for l : ld.dyndep
- addlib(b, sl, l, added, diradded, looped)
+ dl = addlib(b, sl, l, added, diradded, looped, dl)
;;
if !std.hthas(added, lib)
if config.Directlib
@@ -169,6 +174,7 @@ const addlib = {b, sl, lib, added, diradded, looped
;;
;;
std.htdel(looped, lib)
+ -> dl
}