summaryrefslogtreecommitdiffhomepage
path: root/m4
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-26 19:18:14 +0000
committermidipix <writeonce@midipix.org>2024-03-26 23:00:07 +0000
commitdc73e4fb31f7fd48660c08adc1240197c56fd6c7 (patch)
treed3967a4ab9a8d1c8c3cdb25249d489d57a47e308 /m4
parente86543caba68fdcf018f8987a2467857d8a3f9cd (diff)
downloadslibtool-dc73e4fb31f7fd48660c08adc1240197c56fd6c7.tar.bz2
slibtool-dc73e4fb31f7fd48660c08adc1240197c56fd6c7.tar.xz
slibtool.m4: SLIBTOOL_PROG_NM: use llvm-nm as a cross-compilation fallback.
Diffstat (limited to 'm4')
-rw-r--r--m4/slibtool.m416
1 files changed, 13 insertions, 3 deletions
diff --git a/m4/slibtool.m4 b/m4/slibtool.m4
index ffce017..6b318ba 100644
--- a/m4/slibtool.m4
+++ b/m4/slibtool.m4
@@ -272,11 +272,21 @@ AC_DEFUN([SLIBTOOL_PROG_NM],[
# slibtool: SLIBTOOL_PROG_NM
# --------------------------
-if [[ -z "${NM:-}" ]]; then
- NM="${RANLIB%ranlib}nm"
+if [[ -n "${host_alias}" ]]; then
+ AC_CHECK_PROG([NM],"${host_alias}-"[nm],"${host_alias}-"[nm])
fi
-AC_SUBST([NM])
+if [[ -n "${host}" ]] && [[ "${host}" != "${host_alias:-}" ]] && [[ -z "${NM}" ]]; then
+ AC_CHECK_PROG([NM],"${host}-"[nm],"${host}-"[nm])
+fi
+
+if [[ -n "${host}" ]] && [[ -z "${NM}" ]]; then
+ AC_CHECK_PROG([NM],[llvm-nm],[llvm-nm])
+fi
+
+if [[ -z "${host}" ]]; then
+ AC_CHECK_PROG([NM],[nm],[nm])
+fi
])