8136764: ORIGINAL_PATH is broken if PATH contains directory with "#" in it's name
Reviewed-by: erikj, tbell
--- a/common/autoconf/basics.m4 Mon Sep 21 09:32:07 2015 +0200
+++ b/common/autoconf/basics.m4 Mon Sep 21 09:40:37 2015 +0200
@@ -445,6 +445,15 @@
# Save the current directory this script was started from
CURDIR="$PWD"
+ # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them
+ # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED
+ # was not available at that time.
+ REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'`
+ if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then
+ ORIGINAL_PATH="$REWRITTEN_PATH"
+ AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH])
+ fi
+
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
PATH_SEP=";"
BASIC_CHECK_PATHS_WINDOWS
--- a/common/autoconf/generated-configure.sh Mon Sep 21 09:32:07 2015 +0200
+++ b/common/autoconf/generated-configure.sh Mon Sep 21 09:40:37 2015 +0200
@@ -4362,7 +4362,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1442820670
+DATE_WHEN_GENERATED=1442820958
###############################################################################
#
@@ -13844,6 +13844,16 @@
# Save the current directory this script was started from
CURDIR="$PWD"
+ # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them
+ # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED
+ # was not available at that time.
+ REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'`
+ if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then
+ ORIGINAL_PATH="$REWRITTEN_PATH"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&5
+$as_echo "$as_me: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&6;}
+ fi
+
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
PATH_SEP=";"