summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorCarlin Bingham <cb@viennan.net>2018-01-10 02:57:37 +1300
committerCarlin Bingham <cb@viennan.net>2018-01-10 02:57:37 +1300
commit59a098256a8e983f8e46473b70f4e35241b22a72 (patch)
treeab500ceabf9b27490b1a9ce12d4ef5653b33263a /mbld
parent93db6a9fd69794d74e56cbdfc7796b46da407812 (diff)
downloadmc-59a098256a8e983f8e46473b70f4e35241b22a72.tar.gz
Dynamically link if any deps use dynamic libs
Diffstat (limited to 'mbld')
-rw-r--r--mbld/deps.myr3
-rw-r--r--mbld/libs.myr1
-rw-r--r--mbld/parse.myr1
-rw-r--r--mbld/types.myr4
4 files changed, 5 insertions, 4 deletions
diff --git a/mbld/deps.myr b/mbld/deps.myr
index 4941557..46d522f 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -177,7 +177,6 @@ const myrdeps = {b, name, mt
for l : ll
std.slpush(&dynlibs, l)
;;
- mt.isdyn = true
elif std.hassuffix(f, config.Objsuffix)
depends(g, go, p)
else
@@ -462,7 +461,7 @@ const linkcmd = {b, n, mt, bin, libs, dynlibs, istest
if std.sleq(opt_sys, "osx")
std.slpush(&n.cmd, std.sldup("-macosx_version_min"))
std.slpush(&n.cmd, std.sldup("10.6"))
- elif std.sleq(opt_sys, "linux") && mt.isdyn
+ elif std.sleq(opt_sys, "linux") && b.dynlink
std.slpush(&n.cmd, std.sldup("-dynamic-linker"))
std.slpush(&n.cmd, std.sldup("/lib64/ld-linux-x86-64.so.2"))
;;
diff --git a/mbld/libs.myr b/mbld/libs.myr
index 544181a..8d8bf9a 100644
--- a/mbld/libs.myr
+++ b/mbld/libs.myr
@@ -146,6 +146,7 @@ const addlib = {b, sl, lib, added, diradded, looped
match std.htget(b.libs, lib)
| `std.None:
std.slpush(sl, std.fmt("-l{}", lib))
+ b.dynlink = true
| `std.Some ld:
for l : ld.dep
addlib(b, sl, l, added, diradded, looped)
diff --git a/mbld/parse.myr b/mbld/parse.myr
index fa1c095..5f82c05 100644
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -472,7 +472,6 @@ const myrtarget = {b, p, targ
.islib=false,
.istest=istest,
.isbench=isbench,
- .isdyn=false,
/* attrs */
.tags=tags,
.install=install,
diff --git a/mbld/types.myr b/mbld/types.myr
index e170b00..baa7536 100644
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -20,6 +20,9 @@ pkg bld =
system : byte[:]
arch : byte[:]
+ /* dynmically link */
+ dynlink : bool
+
;;
type targ = union
@@ -46,7 +49,6 @@ pkg bld =
islib : bool
istest : bool
isbench : bool
- isdyn : bool
install : bool
;;