Skip to content

Commit fc85d95

Browse files
committed
8289735: UTIL_LOOKUP_PROGS fails on pathes with space
8306976: UTIL_REQUIRE_SPECIAL warning on grep Reviewed-by: mbaesken Backport-of: bad6aa68e4d491e819ab22e91dd5d65bb094120e
1 parent 26e3971 commit fc85d95

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

make/autoconf/basic.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
5555

5656
###############################################################################
5757
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
58+
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
5859
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
5960
[
6061
# Save the current directory this script was started from

make/autoconf/basic_tools.m4

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#
2525

2626
###############################################################################
27-
# Setup the most fundamental tools that relies on not much else to set up,
28-
# but is used by much of the early bootstrap code.
27+
# Setup the most fundamental tools, used for setting up build platform and
28+
# path handling.
2929
AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
3030
[
3131
# Bootstrapping: These tools are needed by UTIL_LOOKUP_PROGS
@@ -37,15 +37,35 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
3737
UTIL_CHECK_NONEMPTY(FILE)
3838
AC_PATH_PROGS(LDD, ldd)
3939
40-
# First are all the fundamental required tools.
40+
# Required tools
41+
UTIL_REQUIRE_PROGS(ECHO, echo)
42+
UTIL_REQUIRE_PROGS(TR, tr)
43+
UTIL_REQUIRE_PROGS(UNAME, uname)
44+
UTIL_REQUIRE_PROGS(WC, wc)
45+
46+
# Required tools with some special treatment
47+
UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
48+
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
49+
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
50+
51+
# Tools only needed on some platforms
52+
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
53+
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
54+
])
55+
56+
###############################################################################
57+
# Setup further tools that should be resolved early but after setting up
58+
# build platform and path handling.
59+
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
60+
[
61+
# Required tools
4162
UTIL_REQUIRE_PROGS(BASH, bash)
4263
UTIL_REQUIRE_PROGS(CAT, cat)
4364
UTIL_REQUIRE_PROGS(CHMOD, chmod)
4465
UTIL_REQUIRE_PROGS(CP, cp)
4566
UTIL_REQUIRE_PROGS(CUT, cut)
4667
UTIL_REQUIRE_PROGS(DATE, date)
4768
UTIL_REQUIRE_PROGS(DIFF, gdiff diff)
48-
UTIL_REQUIRE_PROGS(ECHO, echo)
4969
UTIL_REQUIRE_PROGS(EXPR, expr)
5070
UTIL_REQUIRE_PROGS(FIND, find)
5171
UTIL_REQUIRE_PROGS(GUNZIP, gunzip)
@@ -67,28 +87,20 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
6787
UTIL_REQUIRE_PROGS(TAR, gtar tar)
6888
UTIL_REQUIRE_PROGS(TEE, tee)
6989
UTIL_REQUIRE_PROGS(TOUCH, touch)
70-
UTIL_REQUIRE_PROGS(TR, tr)
71-
UTIL_REQUIRE_PROGS(UNAME, uname)
72-
UTIL_REQUIRE_PROGS(WC, wc)
7390
UTIL_REQUIRE_PROGS(WHICH, which)
7491
UTIL_REQUIRE_PROGS(XARGS, xargs)
7592
76-
# Then required tools that require some special treatment.
93+
# Required tools with some special treatment
7794
UTIL_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
78-
UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
79-
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
8095
UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
81-
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
8296
8397
# Optional tools, we can do without them
8498
UTIL_LOOKUP_PROGS(DF, df)
8599
UTIL_LOOKUP_PROGS(NICE, nice)
86100
UTIL_LOOKUP_PROGS(READLINK, greadlink readlink)
87101
88-
# These are only needed on some platforms
89-
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
102+
# Tools only needed on some platforms
90103
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
91-
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
92104
93105
# For compare.sh only
94106
UTIL_LOOKUP_PROGS(CMP, cmp)

make/autoconf/configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
8585

8686
# Continue setting up basic stuff. Most remaining code require fundamental tools.
8787
BASIC_SETUP_PATHS
88+
BASIC_SETUP_TOOLS
8889

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

make/autoconf/platform.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
628628
])
629629

630630
#%%% Build and target systems %%%
631+
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
631632
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
632633
[
633634
# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
@@ -711,7 +712,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
711712
[
712713
###############################################################################
713714
#
714-
# Is the target little of big endian?
715+
# Is the target little or big endian?
715716
#
716717
AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"])
717718

0 commit comments

Comments
 (0)