libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] libtool.m4: Handle "/" as a sysroot more correctly


From: Richard Purdie
Subject: [PATCH] libtool.m4: Handle "/" as a sysroot more correctly
Date: Tue, 16 Jan 2024 21:47:12 +0000

If $CC has --sysroot=/, it is a valid configuration however libtool will
then set lt_sysroot to "/".

This means references like $lt_sysroot$libdir become //usr/lib instead
of the more normally expected /usr/lib. This may or may not break something
but certainly is confusing to the user and gives confusing output. Making
"/" simply unset lt_sysroot is much cleaner.

* m4/libtool.m4: Improve '/' sysroot handling
---
 m4/libtool.m4 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 695ccac4..1c8ea182 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1256,6 +1256,10 @@ case $with_sysroot in #(
  yes)
    if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+     # Treat "/" the same a an unset sysroot to avoid ugly // expansion for 
$lt_sysroot$libdir
+     if test "$lt_sysroot" = /; then
+       lt_sysroot=
+     fi
    fi
    ;; #(
  /*)
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]