Skip to content

Commit 57346a4

Browse files
authored
Merge pull request #3 from openjdk/master
Merge from openjdk/jdk
2 parents 333c87c + 3d2d039 commit 57346a4

File tree

190 files changed

+5902
-2033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+5902
-2033
lines changed

.github/workflows/submit.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
platforms:
1111
description: "Platform(s) to execute on"
1212
required: true
13-
default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows aarch64, Windows x64, macOS x64"
13+
default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows aarch64, Windows x64, macOS x64, macOS aarch64"
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
@@ -78,7 +78,10 @@ jobs:
7878
FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }}
7979
INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }}
8080
UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }}
81-
if [ "x${UPDATE}" != "x0" ]; then
81+
PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }}
82+
if [ "x${PATCH}" != "x0" ]; then
83+
V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH}
84+
elif [ "x${UPDATE}" != "x0" ]; then
8285
V=${FEATURE}.${INTERIM}.${UPDATE}
8386
elif [ "x${INTERIM}" != "x0" ]; then
8487
V={FEATURE}.${INTERIM}

make/autoconf/basic.m4

Lines changed: 80 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,82 @@ AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
116116
fi
117117
])
118118

119+
###############################################################################
120+
AC_DEFUN([BASIC_SETUP_XCODE_SYSROOT],
121+
[
122+
AC_MSG_CHECKING([for sdk name])
123+
AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
124+
[use the Xcode platform SDK of the given name. @<:@macosx@:>@])],
125+
[SDK_NAME=$with_sdk_name]
126+
)
127+
if test "x$SDK_NAME" = x; then
128+
SDK_NAME=macosx
129+
fi
130+
AC_MSG_RESULT([$SDK_NAME])
131+
132+
if test "x$DEVKIT_ROOT" != x; then
133+
# We need to use xcodebuild from the devkit, if provided
134+
UTIL_LOOKUP_PROGS(XCODEBUILD, xcodebuild, $DEVKIT_TOOLCHAIN_PATH)
135+
if test "x$XCODEBUILD" = x; then
136+
AC_MSG_ERROR([No xcodebuild tool found in the provided devkit])
137+
fi
138+
XCODEBUILD_OUTPUT=`"$XCODEBUILD" -version 2>&1`
139+
if test $? -ne 0; then
140+
AC_MSG_ERROR([The xcodebuild tool in the devkit reports an error: $XCODEBUILD_OUTPUT])
141+
fi
142+
else
143+
UTIL_LOOKUP_PROGS(XCODEBUILD, xcodebuild)
144+
if test "x$XCODEBUILD" != x; then
145+
XCODEBUILD_OUTPUT=`"$XCODEBUILD" -version 2>&1`
146+
if test $? -ne 0; then
147+
AC_MSG_WARN([Ignoring the located xcodebuild tool $XCODEBUILD due to an error: $XCODEBUILD_OUTPUT])
148+
XCODEBUILD=
149+
fi
150+
fi
151+
fi
152+
153+
if test "x$SYSROOT" != x; then
154+
if ! test -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
155+
AC_MSG_ERROR([Invalid sysroot, framework headers not found])
156+
fi
157+
if test "x$with_sdk_name" != x; then
158+
AC_MSG_WARN([--with-sdk-name will be ignored since a sysroot or devkit is provided])
159+
fi
160+
AC_MSG_NOTICE([Setting sysroot from devkit or --with-sysroot])
161+
else
162+
if test "x$XCODEBUILD" != x; then
163+
SYSROOT=`"$XCODEBUILD" -sdk "$SDK_NAME" -version | $GREP '^Path: ' | $SED 's/Path: //'`
164+
if test "x$SYSROOT" = x; then
165+
AC_MSG_ERROR([No sysroot found for SDK $SDK_NAME from xcodebuild. Check your Xcode installation.])
166+
fi
167+
if ! test -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
168+
AC_MSG_ERROR([Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly])
169+
fi
170+
AC_MSG_NOTICE([Setting sysroot from xcodebuild with SDK $SDK_NAME])
171+
else
172+
UTIL_LOOKUP_PROGS(XCRUN, xcrun)
173+
if test "x$XCRUN" != x; then
174+
XCRUN_SDK_PATH=`"$XCRUN" --show-sdk-path -sdk "$SDK_NAME"`
175+
fi
176+
177+
if test "x$XCRUN_SDK_PATH" != x && test -f "$XCRUN_SDK_PATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
178+
AC_MSG_NOTICE([Setting sysroot from xcrun with SDK $SDK_NAME])
179+
SYSROOT="$XCRUN_SDK_PATH"
180+
elif test -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; then
181+
AC_MSG_WARN([No devkit provided and no xcodebuild found. Proceeding using system headers.])
182+
if test "x$with_sdk_name" != x; then
183+
AC_MSG_WARN([--with-sdk-name will be ignored since no xcodebuild could be found])
184+
fi
185+
else
186+
AC_MSG_NOTICE([No devkit provided, no xcodebuild tool and no system headers found in the system.])
187+
AC_MSG_NOTICE([Check that Xcode is properly installed, or set a devkit with --with-devkit,])
188+
AC_MSG_NOTICE([or override SDK selection using --with-sysroot or --with-sdk-name.])
189+
AC_MSG_ERROR([Cannot continue])
190+
fi
191+
fi
192+
fi
193+
])
194+
119195
###############################################################################
120196
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
121197
[
@@ -218,87 +294,20 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
218294
)
219295
220296
if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
221-
# If a devkit has been supplied, find xcodebuild in the toolchain_path.
222-
# If not, detect if Xcode is installed by running xcodebuild -version
223-
# if no Xcode installed, xcodebuild exits with 1
224-
# if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
225-
if test "x$DEVKIT_ROOT" != x || /usr/bin/xcodebuild -version >/dev/null 2>&1; then
226-
# We need to use xcodebuild in the toolchain dir provided by the user
227-
UTIL_LOOKUP_PROGS(XCODEBUILD, xcodebuild, $TOOLCHAIN_PATH)
228-
if test x$XCODEBUILD = x; then
229-
# fall back on the stub binary in /usr/bin/xcodebuild
230-
XCODEBUILD=/usr/bin/xcodebuild
231-
fi
232-
else
233-
# this should result in SYSROOT being empty, unless --with-sysroot is provided
234-
# when only the command line tools are installed there are no SDKs, so headers
235-
# are copied into the system frameworks
236-
XCODEBUILD=
237-
AC_SUBST(XCODEBUILD)
238-
fi
239-
240-
AC_MSG_CHECKING([for sdk name])
241-
AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
242-
[use the platform SDK of the given name. @<:@macosx@:>@])],
243-
[SDKNAME=$with_sdk_name]
244-
)
245-
AC_MSG_RESULT([$SDKNAME])
246-
247-
# if toolchain path is specified then don't rely on system headers, they may not compile
248-
HAVE_SYSTEM_FRAMEWORK_HEADERS=0
249-
test -z "$TOOLCHAIN_PATH" && \
250-
HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?`
251-
252-
if test -z "$SYSROOT"; then
253-
if test -n "$XCODEBUILD"; then
254-
# if we don't have system headers, use default SDK name (last resort)
255-
if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
256-
SDKNAME=${SDKNAME:-macosx}
257-
fi
258-
259-
if test -n "$SDKNAME"; then
260-
# Call xcodebuild to determine SYSROOT
261-
SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | $GREP '^Path: ' | $SED 's/Path: //'`
262-
fi
263-
else
264-
if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
265-
AC_MSG_ERROR([No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK])
266-
fi
267-
fi
268-
else
269-
# warn user if --with-sdk-name was also set
270-
if test -n "$with_sdk_name"; then
271-
AC_MSG_WARN([Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used])
272-
fi
273-
fi
274-
275-
if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then
276-
# If no system framework headers, then SYSROOT must be set, or we won't build
277-
AC_MSG_ERROR([Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments.])
278-
fi
279-
280-
# Perform a basic sanity test
281-
if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
282-
if test -z "$SYSROOT"; then
283-
AC_MSG_ERROR([Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly])
284-
else
285-
AC_MSG_ERROR([Invalid SDK or SYSROOT path, dependent framework headers not found])
286-
fi
287-
fi
288-
289-
# set SDKROOT too, Xcode tools will pick it up
290-
SDKROOT="$SYSROOT"
291-
AC_SUBST(SDKROOT)
297+
BASIC_SETUP_XCODE_SYSROOT
292298
fi
293299
294300
# Prepend the extra path to the global path
295301
UTIL_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
296302
297303
AC_MSG_CHECKING([for sysroot])
298304
AC_MSG_RESULT([$SYSROOT])
305+
AC_SUBST(SYSROOT)
306+
299307
AC_MSG_CHECKING([for toolchain path])
300308
AC_MSG_RESULT([$TOOLCHAIN_PATH])
301309
AC_SUBST(TOOLCHAIN_PATH)
310+
302311
AC_MSG_CHECKING([for extra path])
303312
AC_MSG_RESULT([$EXTRA_PATH])
304313
])

make/autoconf/spec.gmk.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,7 @@ CPP := @CPP@
548548
# The linker can be gcc or ld on unix systems, or link.exe on windows systems.
549549
LD := @LD@
550550

551-
# Xcode SDK path
552-
SDKROOT:=@SDKROOT@
551+
SYSROOT := @SYSROOT@
553552

554553
# LDFLAGS used to link the jdk native libraries (C-code)
555554
LDFLAGS_JDKLIB:=@LDFLAGS_JDKLIB@
@@ -776,7 +775,6 @@ SETFILE:=@SETFILE@
776775
XATTR:=@XATTR@
777776
JT_HOME:=@JT_HOME@
778777
JIB_HOME:=@JIB_HOME@
779-
XCODEBUILD=@XCODEBUILD@
780778
DTRACE := @DTRACE@
781779
FIXPATH := @FIXPATH@
782780
FIXPATH_BASE := @FIXPATH_BASE@

make/autoconf/toolchain.m4

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -231,34 +231,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
231231
toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS
232232
VALID_TOOLCHAINS=${!toolchain_var_name}
233233
234-
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
235-
if test -n "$XCODEBUILD"; then
236-
# On Mac OS X, default toolchain to clang after Xcode 5
237-
XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version | $HEAD -n 1`
238-
$ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
239-
if test $? -ne 0; then
240-
AC_MSG_NOTICE([xcodebuild output: $XCODE_VERSION_OUTPUT])
241-
AC_MSG_ERROR([Failed to determine Xcode version.])
242-
fi
243-
XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
244-
$SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \
245-
$CUT -f 1 -d .`
246-
AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION])
247-
if test $XCODE_MAJOR_VERSION -ge 5; then
248-
DEFAULT_TOOLCHAIN="clang"
249-
else
250-
DEFAULT_TOOLCHAIN="gcc"
251-
fi
252-
else
253-
# If Xcode is not installed, but the command line tools are
254-
# then we can't run xcodebuild. On these systems we should
255-
# default to clang
256-
DEFAULT_TOOLCHAIN="clang"
257-
fi
258-
else
259-
# First toolchain type in the list is the default
260-
DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
261-
fi
234+
# First toolchain type in the list is the default
235+
DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
262236
263237
if test "x$with_toolchain_type" = xlist; then
264238
# List all toolchains
@@ -341,10 +315,19 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
341315
# autoconf magic only relies on PATH, so update it if tools dir is specified
342316
OLD_PATH="$PATH"
343317
344-
if test "x$XCODE_VERSION_OUTPUT" != x; then
345-
# For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
346-
TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
347-
TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION"
318+
if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
319+
if test "x$XCODEBUILD" != x; then
320+
XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2> /dev/null | $HEAD -n 1`
321+
$ECHO "$XCODE_VERSION_OUTPUT" | $GREP "^Xcode " > /dev/null
322+
if test $? -ne 0; then
323+
AC_MSG_NOTICE([xcodebuild -version output: $XCODE_VERSION_OUTPUT])
324+
AC_MSG_ERROR([Failed to determine Xcode version])
325+
fi
326+
327+
# For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
328+
TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
329+
TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION"
330+
fi
348331
fi
349332
AC_SUBST(TOOLCHAIN_VERSION)
350333

0 commit comments

Comments
 (0)