On Thu, 2018-01-25 at 19:29 +1100, Ben Elliston wrote:
> On Thu, Jan 25, 2018 at 05:35:10PM +1300, Henri wrote:
>
> >
> > >
> > > Another option to determine the libc version would be to parse the
> > > output of "ldd --version".
> It's fine to assume the presence of ldd(1) since you know you are on a
> Linux system. Within each case in the big case statement, you don't
> need to rely on univerally available shell utilities.
>
> How about just running ldd --version | grep -q ^musl ?
Sounds good to me. A new patch is attached. I had to pipe stderr to stdout
though because musl ldd writes version info to stderr.
>
> If that pipeline returns 0, you have your answer.
>
> Ben
diff --git a/config.guess b/config.guess
index ae5ffc7..cc500c1 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2018 Free Software Foundation, Inc.
-timestamp='2018-01-16'
+timestamp='2018-01-26'
# 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
@@ -150,6 +150,11 @@ Linux|GNU|GNU/*)
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # use ldd to detect musl
+ if `ldd --version 2>&1 | grep -q ^musl`; then
+ LIBC=musl
+ fi
;;
esac
_______________________________________________
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches