From 297d0a00ea3ff10b48a0005c7393c57493d1e2a7 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 23 Jan 2025 11:13:26 +0100 Subject: [PATCH] 8348391: Keep case if possible for TOPDIR --- make/autoconf/basic.m4 | 6 ++++++ make/autoconf/util_paths.m4 | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/make/autoconf/basic.m4 b/make/autoconf/basic.m4 index f574174a12e8a..35eb63bea0c84 100644 --- a/make/autoconf/basic.m4 +++ b/make/autoconf/basic.m4 @@ -84,9 +84,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # We get the top-level directory from the supporting wrappers. BASIC_WINDOWS_VERIFY_DIR($TOPDIR, source) + orig_topdir="$TOPDIR" UTIL_FIXUP_PATH(TOPDIR) AC_MSG_CHECKING([for top-level directory]) AC_MSG_RESULT([$TOPDIR]) + if test "x$TOPDIR" != "x$orig_topdir"; then + AC_MSG_WARN([Your top dir was originally represented as $orig_topdir,]) + AC_MSG_WARN([but after rewriting it became $TOPDIR.]) + AC_MSG_WARN([This typically means you have characters like space in the path, which can cause all kind of trouble.]) + fi AC_SUBST(TOPDIR) if test "x$CUSTOM_ROOT" != x; then diff --git a/make/autoconf/util_paths.m4 b/make/autoconf/util_paths.m4 index 7717150dfd9ea..57e53b536414a 100644 --- a/make/autoconf/util_paths.m4 +++ b/make/autoconf/util_paths.m4 @@ -77,7 +77,10 @@ AC_DEFUN([UTIL_FIXUP_PATH], imported_path="" fi fi - if test "x$imported_path" != "x$path"; then + [ imported_path_lower=`$ECHO $imported_path | $TR '[:upper:]' '[:lower:]'` ] + [ orig_path_lower=`$ECHO $path | $TR '[:upper:]' '[:lower:]'` ] + # If only case differs, keep original path + if test "x$imported_path_lower" != "x$orig_path_lower"; then $1="$imported_path" fi else