Skip to content

Commit 44e5cca

Browse files
committed
8348391: Keep case if possible for TOPDIR
Reviewed-by: erikj
1 parent 7460a0a commit 44e5cca

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

make/autoconf/basic.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
8484
8585
# We get the top-level directory from the supporting wrappers.
8686
BASIC_WINDOWS_VERIFY_DIR($TOPDIR, source)
87+
orig_topdir="$TOPDIR"
8788
UTIL_FIXUP_PATH(TOPDIR)
8889
AC_MSG_CHECKING([for top-level directory])
8990
AC_MSG_RESULT([$TOPDIR])
91+
if test "x$TOPDIR" != "x$orig_topdir"; then
92+
AC_MSG_WARN([Your top dir was originally represented as $orig_topdir,])
93+
AC_MSG_WARN([but after rewriting it became $TOPDIR.])
94+
AC_MSG_WARN([This typically means you have characters like space in the path, which can cause all kind of trouble.])
95+
fi
9096
AC_SUBST(TOPDIR)
9197
9298
if test "x$CUSTOM_ROOT" != x; then

make/autoconf/util_paths.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ AC_DEFUN([UTIL_FIXUP_PATH],
7777
imported_path=""
7878
fi
7979
fi
80-
if test "x$imported_path" != "x$path"; then
80+
[ imported_path_lower=`$ECHO $imported_path | $TR '[:upper:]' '[:lower:]'` ]
81+
[ orig_path_lower=`$ECHO $path | $TR '[:upper:]' '[:lower:]'` ]
82+
# If only case differs, keep original path
83+
if test "x$imported_path_lower" != "x$orig_path_lower"; then
8184
$1="$imported_path"
8285
fi
8386
else

0 commit comments

Comments
 (0)