From 78ceae822bde047eea1db841a5feeba94f57fe7d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 20 Sep 2020 13:17:12 +0200 Subject: [PATCH] * config.guess: Combine two heuristics to detect musl libc. Reported by Dmitry V. Levin. --- ChangeLog | 5 +++++ config.guess | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 834f4e5..63101b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-09-20 Bruno Haible + + * config.guess: Combine two heuristics to detect musl libc. + Reported by Dmitry V. Levin. + 2020-09-19 Bruno Haible * config.guess: Don't use 'ldd --version' to determine the presence of diff --git a/config.guess b/config.guess index 8d70ec2..cd8a0a3 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-09-19' +timestamp='2020-09-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -151,6 +151,7 @@ Linux|GNU|GNU/*) LIBC=dietlibc #else #include + /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #else @@ -159,6 +160,13 @@ Linux|GNU|GNU/*) #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # Second heuristic to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac -- 2.7.4