summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Smit <frank@61924.nl>2020-09-20 21:22:22 +0000
committerFrank Smit <frank@61924.nl>2020-09-20 21:22:22 +0000
commitc8a5f3d79cd198facac5491f20249f6945db62b9 (patch)
tree4b801c5f5e7b4b53b26b869aedf02ca4aa3ba02b
parent1b52ea9d5660f5b21a465f59448941212b2f921e (diff)
downloadmc-c8a5f3d79cd198facac5491f20249f6945db62b9.tar.gz
Use correct dynamic linker/loader on musl-based systems (Alpine).
-rwxr-xr-xconfigure9
1 files changed, 8 insertions, 1 deletions
diff --git a/configure b/configure
index b895748..08c7b7f 100755
--- a/configure
+++ b/configure
@@ -45,12 +45,19 @@ sysinit=''
env='[][:]'
case $OS in
*Linux*)
+ ldd_version=`ldd --version 2>&1 | head -1 | cut -f1 -d' '`
+ if [ x"${ldd_version}" = x"musl" ]; then
+ dyn_loader='/lib/ld-musl-x86_64.so.1'
+ else
+ dyn_loader='/lib64/ld-linux-x86-64.so.2'
+ fi
+
echo 'export SYS=linux' >> config.mk
echo export INST_MAN=$prefix/share/man/man >> config.mk
echo 'const Sys = "Linux"' >> mbld/config.myr
echo 'const Linkcmd = ["ld", "--gc-sections"]' >> mbld/config.myr
echo 'const Dlflags = ["-dynamic-linker",' \
- '"/lib64/ld-linux-x86-64.so.2"]' >> mbld/config.myr
+ "\"$dyn_loader\"]" >> mbld/config.myr
echo "const Manpath = \"share/man/man\"" >> mbld/config.myr
;;
*Darwin*)