Skip to content

Commit bad6aa6

Browse files
committed
8289735: UTIL_LOOKUP_PROGS fails on pathes with space
Reviewed-by: erikj, mbaesken
1 parent 5f50e99 commit bad6aa6

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

make/autoconf/basic.m4

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
6060

6161
###############################################################################
6262
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
63+
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
6364
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
6465
[
6566
# Save the current directory this script was started from

make/autoconf/basic_tools.m4

+25-13
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
RECOMMENDED_PANDOC_VERSION=2.19.2
3030

3131
###############################################################################
32-
# Setup the most fundamental tools that relies on not much else to set up,
33-
# but is used by much of the early bootstrap code.
32+
# Setup the most fundamental tools, used for setting up build platform and
33+
# path handling.
3434
AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
3535
[
3636
# Bootstrapping: These tools are needed by UTIL_LOOKUP_PROGS
@@ -42,15 +42,34 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
4242
UTIL_CHECK_NONEMPTY(FILE)
4343
AC_PATH_PROGS(LDD, ldd)
4444
45-
# First are all the fundamental required tools.
45+
# Required tools
46+
UTIL_REQUIRE_PROGS(ECHO, echo)
47+
UTIL_REQUIRE_PROGS(TR, tr)
48+
UTIL_REQUIRE_PROGS(UNAME, uname)
49+
UTIL_REQUIRE_PROGS(WC, wc)
50+
51+
# Required tools with some special treatment
52+
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
53+
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
54+
55+
# Tools only needed on some platforms
56+
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
57+
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
58+
])
59+
60+
###############################################################################
61+
# Setup further tools that should be resolved early but after setting up
62+
# build platform and path handling.
63+
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
64+
[
65+
# Required tools
4666
UTIL_REQUIRE_PROGS(BASH, bash)
4767
UTIL_REQUIRE_PROGS(CAT, cat)
4868
UTIL_REQUIRE_PROGS(CHMOD, chmod)
4969
UTIL_REQUIRE_PROGS(CP, cp)
5070
UTIL_REQUIRE_PROGS(CUT, cut)
5171
UTIL_REQUIRE_PROGS(DATE, date)
5272
UTIL_REQUIRE_PROGS(DIFF, gdiff diff)
53-
UTIL_REQUIRE_PROGS(ECHO, echo)
5473
UTIL_REQUIRE_PROGS(EXPR, expr)
5574
UTIL_REQUIRE_PROGS(FIND, find)
5675
UTIL_REQUIRE_PROGS(GUNZIP, gunzip)
@@ -72,16 +91,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
7291
UTIL_REQUIRE_PROGS(TAR, gtar tar)
7392
UTIL_REQUIRE_PROGS(TEE, tee)
7493
UTIL_REQUIRE_PROGS(TOUCH, touch)
75-
UTIL_REQUIRE_PROGS(TR, tr)
76-
UTIL_REQUIRE_PROGS(UNAME, uname)
77-
UTIL_REQUIRE_PROGS(WC, wc)
7894
UTIL_REQUIRE_PROGS(XARGS, xargs)
7995
80-
# Then required tools that require some special treatment.
96+
# Required tools with some special treatment
8197
UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
82-
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
8398
UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
84-
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
8599
86100
# Optional tools, we can do without them
87101
UTIL_LOOKUP_PROGS(DF, df)
@@ -90,10 +104,8 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
90104
UTIL_LOOKUP_PROGS(READLINK, greadlink readlink)
91105
UTIL_LOOKUP_PROGS(WHOAMI, whoami)
92106
93-
# These are only needed on some platforms
94-
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
107+
# Tools only needed on some platforms
95108
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
96-
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
97109
98110
# For compare.sh only
99111
UTIL_LOOKUP_PROGS(CMP, cmp)

make/autoconf/configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
8686

8787
# Continue setting up basic stuff. Most remaining code require fundamental tools.
8888
BASIC_SETUP_PATHS
89+
BASIC_SETUP_TOOLS
8990
BASIC_SETUP_BUILD_ENV
9091

9192
# Check if it's a pure open build or if custom sources are to be used.

make/autoconf/platform.m4

+2-1
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
640640
])
641641

642642
#%%% Build and target systems %%%
643+
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
643644
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
644645
[
645646
# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
@@ -723,7 +724,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
723724
[
724725
###############################################################################
725726
#
726-
# Is the target little of big endian?
727+
# Is the target little or big endian?
727728
#
728729
AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"])
729730

0 commit comments

Comments
 (0)