mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-13 04:49:41 +01:00
Compare commits
385 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
706b421cca | ||
|
|
fe0227e978 | ||
|
|
064628471b | ||
|
|
4895a15a77 | ||
|
|
fd331ff173 | ||
|
|
9fd78022b1 | ||
|
|
192ec387bc | ||
|
|
03e84178eb | ||
|
|
ff3e76fd0c | ||
|
|
811aadd9e7 | ||
|
|
5841cb3b51 | ||
|
|
89129e3f67 | ||
|
|
9445047d05 | ||
|
|
d2f9a1eb97 | ||
|
|
e4021adb28 | ||
|
|
3ccbc6d4d0 | ||
|
|
7744b0046a | ||
|
|
9d63fee49c | ||
|
|
01bda278d6 | ||
|
|
2fe2f3aff8 | ||
|
|
cd4c3aac63 | ||
|
|
e57a322d70 | ||
|
|
c8702ede97 | ||
|
|
f6f038a678 | ||
|
|
fb4cf1cc3c | ||
|
|
d1c6cd104e | ||
|
|
76cbe4883b | ||
|
|
f7c84137b5 | ||
|
|
941bee197f | ||
|
|
2ede14335a | ||
|
|
90df3b7fbb | ||
|
|
f11a496de6 | ||
|
|
bfff02eef6 | ||
|
|
e073d5b374 | ||
|
|
6e77d918e6 | ||
|
|
61fa4d45b6 | ||
|
|
56ff87a096 | ||
|
|
8a5b86c529 | ||
|
|
58911ccc2c | ||
|
|
97c180892b | ||
|
|
def257727d | ||
|
|
2f11afdae9 | ||
|
|
33d7127555 | ||
|
|
8de2f6f883 | ||
|
|
0203c7e612 | ||
|
|
2885469c4b | ||
|
|
31a1f9c493 | ||
|
|
274c805c51 | ||
|
|
140f56718b | ||
|
|
a293bdff91 | ||
|
|
da75e015b5 | ||
|
|
ddc3921cf9 | ||
|
|
273df6286a | ||
|
|
a3fecdb2f4 | ||
|
|
60d88b7ae2 | ||
|
|
3f1d9c441e | ||
|
|
5404b4eafc | ||
|
|
d22d560871 | ||
|
|
bc1a1a5861 | ||
|
|
b486709b06 | ||
|
|
1abb826210 | ||
|
|
c1c99a669b | ||
|
|
b9ef9f667e | ||
|
|
28b2019559 | ||
|
|
68f86dccce | ||
|
|
397d948310 | ||
|
|
f7069494f4 | ||
|
|
0f78d017af | ||
|
|
b8f675f45b | ||
|
|
3e9c381166 | ||
|
|
77a217df60 | ||
|
|
717a07b932 | ||
|
|
aebfd53e9d | ||
|
|
006a516aa0 | ||
|
|
c7fcd62302 | ||
|
|
2c8b432b89 | ||
|
|
2c45eca159 | ||
|
|
bde3fc0c03 | ||
|
|
e45fea5a80 | ||
|
|
ece7d4349a | ||
|
|
0db42906e3 | ||
|
|
5808f30b89 | ||
|
|
31ee5108e0 | ||
|
|
0656f08092 | ||
|
|
16061874ff | ||
|
|
2e3682a7f2 | ||
|
|
63684cd183 | ||
|
|
ecc603ca9b | ||
|
|
ff5c9a4dde | ||
|
|
9acce7a6f3 | ||
|
|
f0cd866a37 | ||
|
|
8817ba450c | ||
|
|
f778642613 | ||
|
|
7df492627b | ||
|
|
2ceeb6c001 | ||
|
|
b04b3047ff | ||
|
|
d9c84e763a | ||
|
|
5e544f1510 | ||
|
|
643dd48a2a | ||
|
|
70944ca54a | ||
|
|
279ed0ddd5 | ||
|
|
9731b1c8b0 | ||
|
|
c5150c7b81 | ||
|
|
86cb76728d | ||
|
|
b49ba426a7 | ||
|
|
dd6e4533eb | ||
|
|
e0fd6c4c9e | ||
|
|
51ed69a586 | ||
|
|
bea9acc55a | ||
|
|
d037a597a9 | ||
|
|
bab70193dd | ||
|
|
47df14590c | ||
|
|
b81b86da98 | ||
|
|
6276789fb5 | ||
|
|
316361b95c | ||
|
|
b80ba08518 | ||
|
|
4bba445d83 | ||
|
|
6736792b9a | ||
|
|
1e02a13a7f | ||
|
|
23d161de29 | ||
|
|
2e925f263d | ||
|
|
e75e1cb02c | ||
|
|
f9bc2db9a9 | ||
|
|
a8fbeec9e9 | ||
|
|
3b6629cec7 | ||
|
|
5fb5e6c8f0 | ||
|
|
2fcb816858 | ||
|
|
635cb3c976 | ||
|
|
5c9f03686d | ||
|
|
492b954f81 | ||
|
|
87131fb2f7 | ||
|
|
5ea21c3a61 | ||
|
|
a48289ac30 | ||
|
|
8907eda779 | ||
|
|
b9331cd25c | ||
|
|
71c5bbcec7 | ||
|
|
58e39c1932 | ||
|
|
19a99d023e | ||
|
|
b4ddddeff1 | ||
|
|
dfaf11a3d8 | ||
|
|
fbc1e6661e | ||
|
|
a887fd2144 | ||
|
|
e702646545 | ||
|
|
7e5ef79f95 | ||
|
|
94677200fb | ||
|
|
a4dd2e9532 | ||
|
|
212a253697 | ||
|
|
dd930c573b | ||
|
|
115f4193eb | ||
|
|
9ac3b77d0d | ||
|
|
747582484c | ||
|
|
6439375bb9 | ||
|
|
3ebf8c9359 | ||
|
|
be45de1f93 | ||
|
|
8648890f86 | ||
|
|
fc18201bbd | ||
|
|
7c66465763 | ||
|
|
6f087cbcd5 | ||
|
|
d1aad71209 | ||
|
|
51b0abc874 | ||
|
|
3a3b77dd4f | ||
|
|
d771ec6296 | ||
|
|
49d8e63833 | ||
|
|
3d50eaa6ed | ||
|
|
862e615696 | ||
|
|
040c93565c | ||
|
|
4a11db8b60 | ||
|
|
46d3d7b967 | ||
|
|
29992e1fca | ||
|
|
27353ad367 | ||
|
|
18c925cd33 | ||
|
|
3f4b167c97 | ||
|
|
8bc1867da7 | ||
|
|
8efe569b8d | ||
|
|
71d48bcc3d | ||
|
|
b71acc704a | ||
|
|
1131bb77ec | ||
|
|
6bc6392d2b | ||
|
|
9da5170a0e | ||
|
|
c1cfb43d8d | ||
|
|
5860a48c71 | ||
|
|
0b01144ece | ||
|
|
34f7974a40 | ||
|
|
27cfcef99f | ||
|
|
e1183ac044 | ||
|
|
12ad09a966 | ||
|
|
d80d478182 | ||
|
|
83eba863fe | ||
|
|
28216aa971 | ||
|
|
4276d5c004 | ||
|
|
6382a1290f | ||
|
|
d90e5b5b9f | ||
|
|
f3db2796b8 | ||
|
|
21867c929a | ||
|
|
b9da14012d | ||
|
|
a169c06361 | ||
|
|
8efd7aa6c1 | ||
|
|
f26e430899 | ||
|
|
e5e21a8a6e | ||
|
|
f762637be2 | ||
|
|
2931458711 | ||
|
|
41966885b9 | ||
|
|
802018306f | ||
|
|
8267d6565d | ||
|
|
16576b87b7 | ||
|
|
375bfac8e7 | ||
|
|
233619b3fb | ||
|
|
023f7f176b | ||
|
|
8dc43aa0fe | ||
|
|
1c691938e9 | ||
|
|
ee09801afd | ||
|
|
bea493bcb8 | ||
|
|
80c54b484f | ||
|
|
d954f3bd0c | ||
|
|
bdd9438b45 | ||
|
|
e3e6c2a899 | ||
|
|
16b842af8e | ||
|
|
92f5c0be8e | ||
|
|
866e7b6b77 | ||
|
|
f88f31dcbf | ||
|
|
021ed6aea9 | ||
|
|
3057dded48 | ||
|
|
db159149c1 | ||
|
|
925d82931c | ||
|
|
dd5d7d0770 | ||
|
|
6ae1cf12ce | ||
|
|
7eb78e3320 | ||
|
|
5ac067f6d6 | ||
|
|
5ae849d66f | ||
|
|
ed821cbe85 | ||
|
|
5cf457b743 | ||
|
|
8b934aab14 | ||
|
|
3b582dff84 | ||
|
|
816638e3be | ||
|
|
3d2283800a | ||
|
|
5cddc2de49 | ||
|
|
6b1b0e9d45 | ||
|
|
bc546c21a5 | ||
|
|
af7c6af0cc | ||
|
|
d3fc8df8af | ||
|
|
a85c8493ae | ||
|
|
70c8ff1c9a | ||
|
|
ecd2b7112a | ||
|
|
c2979c150b | ||
|
|
5698f7ad29 | ||
|
|
4a14cba2f1 | ||
|
|
9f5464ee95 | ||
|
|
3f5b75a5ef | ||
|
|
1e76e1fdfa | ||
|
|
9d052e9331 | ||
|
|
f2e5808b46 | ||
|
|
37c2279148 | ||
|
|
20cb6e786f | ||
|
|
d1b51e39c9 | ||
|
|
8a0ef811ed | ||
|
|
5b05f8e0c4 | ||
|
|
59c2aff1ed | ||
|
|
418deaf5a1 | ||
|
|
245514da51 | ||
|
|
df01cc528d | ||
|
|
bf93e77e72 | ||
|
|
991e04e7d7 | ||
|
|
4eefda9102 | ||
|
|
341dd57fa1 | ||
|
|
7ac2f914aa | ||
|
|
85cb4a9942 | ||
|
|
aa595dbda4 | ||
|
|
2af0312c95 | ||
|
|
7c7b961e73 | ||
|
|
2b79c22c43 | ||
|
|
47f33a59ea | ||
|
|
d580bcf956 | ||
|
|
4fa77a2ad4 | ||
|
|
3eb1d05d85 | ||
|
|
0cb0b5db2a | ||
|
|
e3588bba04 | ||
|
|
cc5b9c63cb | ||
|
|
892b8bb6d1 | ||
|
|
05854fd704 | ||
|
|
614db2ea9e | ||
|
|
d292aabf05 | ||
|
|
d0a265039a | ||
|
|
37a5a08378 | ||
|
|
788d2bc40c | ||
|
|
4dfcc6df17 | ||
|
|
9e566d76d1 | ||
|
|
8fc9097b37 | ||
|
|
2725405ac9 | ||
|
|
db01fcd6d8 | ||
|
|
89e0889ab3 | ||
|
|
153410f480 | ||
|
|
da8a095a19 | ||
|
|
472fcb6e6e | ||
|
|
cc1800fa4d | ||
|
|
b9c76dedf4 | ||
|
|
7b1f2c801f | ||
|
|
9d441e3e56 | ||
|
|
44549b605a | ||
|
|
5d19d15517 | ||
|
|
5f7432f7b1 | ||
|
|
7560dbb925 | ||
|
|
4047a3623a | ||
|
|
27ac39a2bc | ||
|
|
fb8f2a0a92 | ||
|
|
447436e18c | ||
|
|
c7cf602078 | ||
|
|
78d1b90468 | ||
|
|
907e30ff00 | ||
|
|
70a15c7363 | ||
|
|
a1fbbffb5e | ||
|
|
26b2ec4847 | ||
|
|
af15c68f3c | ||
|
|
142c311e3b | ||
|
|
cb2a671359 | ||
|
|
0c1b254be9 | ||
|
|
29ba4b7d1e | ||
|
|
f67ec19e23 | ||
|
|
93579c29e3 | ||
|
|
b235682a18 | ||
|
|
19a0151a52 | ||
|
|
cf9b5a71bd | ||
|
|
acc4a82818 | ||
|
|
9f920b9bbf | ||
|
|
c7b9dc463a | ||
|
|
bc73963974 | ||
|
|
476421efe5 | ||
|
|
c013fa1811 | ||
|
|
f33a8445eb | ||
|
|
4324e3be9e | ||
|
|
c7bbf84929 | ||
|
|
23ebd9c3c6 | ||
|
|
4d932d615c | ||
|
|
ce7ebaa606 | ||
|
|
b7a51dd0e8 | ||
|
|
739957ca1e | ||
|
|
13cf0707f9 | ||
|
|
709410d8a4 | ||
|
|
f207aa94f9 | ||
|
|
e80619a032 | ||
|
|
638708cad8 | ||
|
|
e06b568c3c | ||
|
|
528efe206d | ||
|
|
d379afbc11 | ||
|
|
cd534f8197 | ||
|
|
38e3cda442 | ||
|
|
b334a8e5fc | ||
|
|
e669d14d47 | ||
|
|
940d1965f8 | ||
|
|
d44aaa37f9 | ||
|
|
9bc741d04f | ||
|
|
256d48b196 | ||
|
|
177b8a241c | ||
|
|
da009214f1 | ||
|
|
4d36c4adcc | ||
|
|
0efd9dc09b | ||
|
|
46809b396c | ||
|
|
f7f291c5d4 | ||
|
|
771f6a2f8e | ||
|
|
4210e507a0 | ||
|
|
ab183e437c | ||
|
|
ab28045d77 | ||
|
|
ba05c6d0b6 | ||
|
|
fa823bd21c | ||
|
|
e81374e050 | ||
|
|
cc5cda5587 | ||
|
|
ef2bd57213 | ||
|
|
e66788c165 | ||
|
|
1496b5de90 | ||
|
|
16ed191329 | ||
|
|
581b1e29ae | ||
|
|
75195aab49 | ||
|
|
725d87bbc2 | ||
|
|
e41bc42deb | ||
|
|
43080173e8 | ||
|
|
700d2b91de | ||
|
|
bb3e84bd1f | ||
|
|
ac2f8e5af8 | ||
|
|
c434b79cff | ||
|
|
700679011e | ||
|
|
68170ae222 | ||
|
|
9f5ad43358 | ||
|
|
684678f9e8 | ||
|
|
93d1700f23 | ||
|
|
a5a2eca155 | ||
|
|
65d9f119c4 |
24
.github/workflows/build-cross-compile.yml
vendored
24
.github/workflows/build-cross-compile.yml
vendored
@@ -61,27 +61,32 @@ jobs:
|
||||
debian-arch: arm64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: arm
|
||||
gnu-arch: arm
|
||||
debian-arch: armhf
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
gnu-abi: eabihf
|
||||
- target-cpu: s390x
|
||||
gnu-arch: s390x
|
||||
debian-arch: s390x
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: ppc64le
|
||||
gnu-arch: powerpc64le
|
||||
debian-arch: ppc64el
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: riscv64
|
||||
gnu-arch: riscv64
|
||||
debian-arch: riscv64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: sid
|
||||
tolerate-sysroot-errors: true
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@@ -93,13 +98,6 @@ jobs:
|
||||
with:
|
||||
platform: linux-x64
|
||||
|
||||
# Use linux-x64 JDK bundle as build JDK
|
||||
- name: 'Get build JDK'
|
||||
id: buildjdk
|
||||
uses: ./.github/actions/get-bundles
|
||||
with:
|
||||
platform: linux-x64
|
||||
|
||||
- name: 'Get GTest'
|
||||
id: gtest
|
||||
uses: ./.github/actions/get-gtest
|
||||
@@ -130,6 +128,7 @@ jobs:
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Create sysroot'
|
||||
id: create-sysroot
|
||||
run: >
|
||||
sudo debootstrap
|
||||
--arch=${{ matrix.debian-arch }}
|
||||
@@ -140,6 +139,7 @@ jobs:
|
||||
${{ matrix.debian-version }}
|
||||
sysroot
|
||||
${{ matrix.debian-repository }}
|
||||
continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Prepare sysroot'
|
||||
@@ -151,7 +151,12 @@ jobs:
|
||||
rm -rf sysroot/usr/{sbin,bin,share}
|
||||
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
|
||||
rm -rf sysroot/usr/libexec/gcc
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Remove broken sysroot'
|
||||
run: |
|
||||
sudo rm -rf sysroot/
|
||||
if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Configure'
|
||||
run: >
|
||||
@@ -165,7 +170,6 @@ jobs:
|
||||
--disable-precompiled-headers
|
||||
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
|
||||
--with-sysroot=sysroot
|
||||
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
|
||||
--with-jmod-compress=zip-1
|
||||
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
|
||||
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
|
||||
@@ -173,6 +177,7 @@ jobs:
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
@@ -180,3 +185,4 @@ jobs:
|
||||
with:
|
||||
make-target: 'hotspot ${{ inputs.make-arguments }}'
|
||||
platform: linux-${{ matrix.target-cpu }}
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
|
||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -133,8 +133,7 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
if: needs.select.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x86:
|
||||
name: linux-x86
|
||||
@@ -214,7 +213,6 @@ jobs:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
|
||||
@@ -613,7 +613,7 @@ be accepted by <code>configure</code>.</p>
|
||||
<p>To use clang instead of gcc on Linux, use
|
||||
<code>--with-toolchain-type=clang</code>.</p>
|
||||
<h3 id="apple-xcode">Apple Xcode</h3>
|
||||
<p>The oldest supported version of Xcode is 8.</p>
|
||||
<p>The oldest supported version of Xcode is 13.0.</p>
|
||||
<p>You will need the Xcode command line developer tools to be able to
|
||||
build the JDK. (Actually, <em>only</em> the command line tools are
|
||||
needed, not the IDE.) The simplest way to install these is to run:</p>
|
||||
|
||||
@@ -420,7 +420,7 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
|
||||
|
||||
### Apple Xcode
|
||||
|
||||
The oldest supported version of Xcode is 8.
|
||||
The oldest supported version of Xcode is 13.0.
|
||||
|
||||
You will need the Xcode command line developer tools to be able to build the
|
||||
JDK. (Actually, *only* the command line tools are needed, not the IDE.) The
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -28,6 +28,9 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include MakeIO.gmk
|
||||
|
||||
PRODUCT_TARGETS :=
|
||||
LEGACY_TARGETS :=
|
||||
TEST_TARGETS :=
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -31,8 +31,9 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include NativeCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -28,6 +28,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
|
||||
@@ -105,7 +107,7 @@ define SetupInterimModule
|
||||
Standard.java, \
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
|
||||
$($1.interim_EXTRA_FILES), \
|
||||
COPY := .gif .png .xml .css .svg .js .js.template .txt javax.tools.JavaCompilerTool, \
|
||||
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
|
||||
DISABLED_WARNINGS := module options, \
|
||||
JAVAC_FLAGS := \
|
||||
|
||||
@@ -53,7 +53,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
|
||||
build/tools/jigsaw, \
|
||||
COPY := .properties .html, \
|
||||
BIN := $(TOOLS_CLASSES_DIR), \
|
||||
DISABLED_WARNINGS := fallthrough this-escape, \
|
||||
DISABLED_WARNINGS := fallthrough, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-modules jdk.jdeps \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
|
||||
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
|
||||
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
|
||||
|
||||
@@ -28,6 +28,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
##########################################################################################
|
||||
|
||||
### TZDB tool needs files from java.time.zone package
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include ModuleTools.gmk
|
||||
|
||||
@@ -31,6 +31,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -31,6 +31,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
|
||||
@@ -136,11 +136,17 @@ ifeq ($(HSDIS_BACKEND), binutils)
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libhsdis
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
|
||||
NAME := hsdis, \
|
||||
LINK_TYPE := $(HSDIS_LINK_TYPE), \
|
||||
SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \
|
||||
EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
java.base:include \
|
||||
$(TOPDIR)/src/utils/hsdis, \
|
||||
OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \
|
||||
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
|
||||
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include Utils.gmk
|
||||
|
||||
@@ -536,6 +536,31 @@ else # $(HAS_SPEC)=true
|
||||
endef
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Functions for timers
|
||||
##############################################################################
|
||||
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
|
||||
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
|
||||
endef
|
||||
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
|
||||
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
|
||||
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
|
||||
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
|
||||
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
|
||||
endef
|
||||
|
||||
define StartGlobalTimer
|
||||
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(BUILDTIMESDIR) && \
|
||||
|
||||
@@ -27,6 +27,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include JarArchive.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
default: bundles
|
||||
|
||||
@@ -931,6 +931,11 @@ else
|
||||
java.base-copy: build-hsdis
|
||||
endif
|
||||
|
||||
# On Windows, we need to copy tzmappings generated by gensrc
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
java.base-copy: java.base-gensrc
|
||||
endif
|
||||
|
||||
# jdk.accessibility depends on java.desktop
|
||||
jdk.accessibility-libs: java.desktop-libs
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
MODULE_SRC := $(TOPDIR)/src/$(MODULE)
|
||||
|
||||
# All makefiles should add the targets to be built to this variable.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -176,7 +176,3 @@ ULIMIT := ulimit
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
PATHTOOL := cygpath
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Simple macros from spec.gmk.in
|
||||
SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -41,6 +41,16 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
|
||||
|
||||
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as absolute paths
|
||||
FindAllReposAbs = \
|
||||
$(strip $(sort $(dir $(filter-out $(TOPDIR)/build/%, $(wildcard \
|
||||
$(addprefix $(TOPDIR)/, .git */.git */*/.git */*/*/.git */*/*/*/.git) \
|
||||
)))))
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as relative paths
|
||||
FindAllReposRel = \
|
||||
$(strip $(subst $(TOPDIR)/,.,$(patsubst $(TOPDIR)/%/, %, $(FindAllReposAbs))))
|
||||
|
||||
USE_SCM := false
|
||||
ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
USE_SCM := true
|
||||
|
||||
@@ -30,6 +30,8 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Modules.gmk
|
||||
|
||||
ALL_MODULES = $(call FindAllModules)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -30,7 +30,7 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Execute.gmk
|
||||
include NativeCompilation.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include ToolsJdk.gmk
|
||||
|
||||
################################################################################
|
||||
@@ -47,14 +47,14 @@ ifeq ($(COMPILE_TYPE), cross)
|
||||
$(error It is not possible to update the x11wrappers when cross-compiling)
|
||||
endif
|
||||
|
||||
BITS := $(OPENJDK_TARGET_CPU_BITS)
|
||||
|
||||
X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers
|
||||
GENERATOR_SOURCE_FILE := $(X11WRAPPERS_OUTPUT)/src/data_generator.c
|
||||
|
||||
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/src/java.desktop/unix/data/x11wrappergen
|
||||
WRAPPER_OUTPUT_FILE := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt
|
||||
|
||||
BITS := $(OPENJDK_TARGET_CPU_BITS)
|
||||
|
||||
# Generate the C code for the program that will output the offset file.
|
||||
$(eval $(call SetupExecute, gensrc_generator, \
|
||||
INFO := Generating X11 wrapper data generator source code, \
|
||||
@@ -76,14 +76,17 @@ DATA_GENERATOR_INCLUDES := \
|
||||
-I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
## Build data_generator
|
||||
################################################################################
|
||||
|
||||
# Compile the generated C code into an executable.
|
||||
$(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
|
||||
PROGRAM := data_generator, \
|
||||
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
|
||||
$(eval $(call SetupJdkExecutable, BUILD_DATA_GENERATOR, \
|
||||
NAME := data_generator, \
|
||||
EXTRA_FILES := $(GENERATOR_SOURCE_FILE), \
|
||||
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE), \
|
||||
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES), \
|
||||
LIBS := $(X_LIBS), \
|
||||
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
|
||||
OBJECT_DIR := $(X11WRAPPERS_OUTPUT)/objs, \
|
||||
))
|
||||
|
||||
@@ -92,6 +95,7 @@ $(eval $(call SetupExecute, run_wrappergen, \
|
||||
INFO := Generating X11 wrapper data files, \
|
||||
DEPS := $(BUILD_DATA_GENERATOR), \
|
||||
OUTPUT_FILE := $(WRAPPER_OUTPUT_FILE), \
|
||||
SUPPORT_DIR := $(X11WRAPPERS_OUTPUT)/run-wrapper, \
|
||||
COMMAND := $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $(WRAPPER_OUTPUT_FILE), \
|
||||
))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,11 +25,11 @@
|
||||
#
|
||||
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2022-09-17'
|
||||
timestamp='2024-01-01'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -72,7 +72,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
usage="\
|
||||
Usage: $0 [OPTION]
|
||||
|
||||
Output the configuration name of the system \`$me' is run on.
|
||||
Output the configuration name of the system '$me' is run on.
|
||||
|
||||
Options:
|
||||
-h, --help print this help, then exit
|
||||
@@ -85,13 +85,13 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
||||
help="
|
||||
Try \`$me --help' for more information."
|
||||
Try '$me --help' for more information."
|
||||
|
||||
# Parse command line
|
||||
while test $# -gt 0 ; do
|
||||
@@ -127,8 +127,8 @@ GUESS=
|
||||
# temporary files to be created and, as you can see below, it is a
|
||||
# headache to deal with in a portable fashion.
|
||||
|
||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||
# use `HOST_CC' if defined, but it is deprecated.
|
||||
# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
|
||||
# use 'HOST_CC' if defined, but it is deprecated.
|
||||
|
||||
# Portable tmp directory creation inspired by the Autoconf team.
|
||||
|
||||
@@ -180,6 +180,9 @@ Linux|GNU|GNU/*)
|
||||
|
||||
set_cc_for_build
|
||||
cat <<-EOF > "$dummy.c"
|
||||
#if defined(__ANDROID__)
|
||||
LIBC=android
|
||||
#else
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
@@ -187,6 +190,8 @@ Linux|GNU|GNU/*)
|
||||
LIBC=dietlibc
|
||||
#elif defined(__GLIBC__)
|
||||
LIBC=gnu
|
||||
#elif defined(__LLVM_LIBC__)
|
||||
LIBC=llvm
|
||||
#else
|
||||
#include <stdarg.h>
|
||||
/* First heuristic to detect musl libc. */
|
||||
@@ -194,6 +199,7 @@ Linux|GNU|GNU/*)
|
||||
LIBC=musl
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
||||
eval "$cc_set_libc"
|
||||
@@ -484,7 +490,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
# Japanese Language versions have a version number like '4.1.3-JL'.
|
||||
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
|
||||
GUESS=sparc-sun-sunos$SUN_REL
|
||||
;;
|
||||
@@ -929,7 +935,7 @@ EOF
|
||||
fi
|
||||
;;
|
||||
*:FreeBSD:*:*)
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
UNAME_PROCESSOR=`uname -p`
|
||||
case $UNAME_PROCESSOR in
|
||||
amd64)
|
||||
UNAME_PROCESSOR=x86_64 ;;
|
||||
@@ -1001,7 +1007,27 @@ EOF
|
||||
GUESS=$UNAME_MACHINE-unknown-minix
|
||||
;;
|
||||
aarch64:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
set_cc_for_build
|
||||
CPU=$UNAME_MACHINE
|
||||
LIBCABI=$LIBC
|
||||
if test "$CC_FOR_BUILD" != no_compiler_found; then
|
||||
ABI=64
|
||||
sed 's/^ //' << EOF > "$dummy.c"
|
||||
#ifdef __ARM_EABI__
|
||||
#ifdef __ARM_PCS_VFP
|
||||
ABI=eabihf
|
||||
#else
|
||||
ABI=eabi
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
|
||||
eval "$cc_set_abi"
|
||||
case $ABI in
|
||||
eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
|
||||
esac
|
||||
fi
|
||||
GUESS=$CPU-unknown-linux-$LIBCABI
|
||||
;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
@@ -1067,6 +1093,15 @@ EOF
|
||||
k1om:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
kvx:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
kvx:cos:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-cos
|
||||
;;
|
||||
kvx:mbr:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-mbr
|
||||
;;
|
||||
loongarch32:Linux:*:* | loongarch64:Linux:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
@@ -1222,7 +1257,7 @@ EOF
|
||||
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
|
||||
;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# If we were able to find 'uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
GUESS=$UNAME_MACHINE-pc-os2-emx
|
||||
;;
|
||||
@@ -1363,7 +1398,7 @@ EOF
|
||||
GUESS=ns32k-sni-sysv
|
||||
fi
|
||||
;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
GUESS=i586-unisys-sysv4
|
||||
;;
|
||||
@@ -1585,6 +1620,9 @@ EOF
|
||||
*:Unleashed:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
||||
;;
|
||||
*:Ironclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad
|
||||
;;
|
||||
esac
|
||||
|
||||
# Do we have a guess based on uname results?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -26,11 +26,11 @@
|
||||
#
|
||||
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2022-09-17'
|
||||
timestamp='2024-01-01'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -102,13 +102,13 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
||||
Copyright 1992-2024 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
||||
help="
|
||||
Try \`$me --help' for more information."
|
||||
Try '$me --help' for more information."
|
||||
|
||||
# Parse command line
|
||||
while test $# -gt 0 ; do
|
||||
@@ -156,7 +156,7 @@ IFS=$saved_IFS
|
||||
# Separate into logical components for further validation
|
||||
case $1 in
|
||||
*-*-*-*-*)
|
||||
echo Invalid configuration \`"$1"\': more than four components >&2
|
||||
echo "Invalid configuration '$1': more than four components" >&2
|
||||
exit 1
|
||||
;;
|
||||
*-*-*-*)
|
||||
@@ -171,7 +171,8 @@ case $1 in
|
||||
nto-qnx* | linux-* | uclinux-uclibc* \
|
||||
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
||||
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
||||
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
|
||||
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
|
||||
| windows-* )
|
||||
basic_machine=$field1
|
||||
basic_os=$maybe_os
|
||||
;;
|
||||
@@ -969,7 +970,7 @@ $basic_machine
|
||||
EOF
|
||||
IFS=$saved_IFS
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# We use 'pc' rather than 'unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i*86 | x86_64)
|
||||
@@ -1101,7 +1102,7 @@ case $cpu-$vendor in
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
cpu=i586
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
|
||||
cpu=i686
|
||||
;;
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
@@ -1206,7 +1207,7 @@ case $cpu-$vendor in
|
||||
case $cpu in
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| aarch64 | aarch64_be | aarch64c | arm64ec \
|
||||
| abacus \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
|
||||
@@ -1225,12 +1226,14 @@ case $cpu-$vendor in
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| e2k | elxsi | epiphany \
|
||||
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
|
||||
| javascript \
|
||||
| h8300 | h8500 \
|
||||
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| kvx \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| loongarch32 | loongarch64 \
|
||||
@@ -1239,36 +1242,13 @@ case $cpu-$vendor in
|
||||
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
||||
| m88110 | m88k | maxq | mb | mcore | mep | metag \
|
||||
| microblaze | microblazeel \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64eb | mips64el \
|
||||
| mips64octeon | mips64octeonel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64r5900 | mips64r5900el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa32r3 | mipsisa32r3el \
|
||||
| mipsisa32r5 | mipsisa32r5el \
|
||||
| mipsisa32r6 | mipsisa32r6el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64r3 | mipsisa64r3el \
|
||||
| mipsisa64r5 | mipsisa64r5el \
|
||||
| mipsisa64r6 | mipsisa64r6el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mips* \
|
||||
| mmix \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nanomips* \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nfp \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
@@ -1300,6 +1280,7 @@ case $cpu-$vendor in
|
||||
| ubicom32 \
|
||||
| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
|
||||
| vax \
|
||||
| vc4 \
|
||||
| visium \
|
||||
| w65 \
|
||||
| wasm32 | wasm64 \
|
||||
@@ -1311,7 +1292,7 @@ case $cpu-$vendor in
|
||||
;;
|
||||
|
||||
*)
|
||||
echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
|
||||
echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1332,11 +1313,12 @@ esac
|
||||
|
||||
# Decode manufacturer-specific aliases for certain operating systems.
|
||||
|
||||
if test x$basic_os != x
|
||||
if test x"$basic_os" != x
|
||||
then
|
||||
|
||||
# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
|
||||
# set os.
|
||||
obj=
|
||||
case $basic_os in
|
||||
gnu/linux*)
|
||||
kernel=linux
|
||||
@@ -1536,10 +1518,16 @@ case $os in
|
||||
os=eabi
|
||||
;;
|
||||
*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
aout* | coff* | elf* | pe*)
|
||||
# These are machine code file formats, not OSes
|
||||
obj=$os
|
||||
os=
|
||||
;;
|
||||
*)
|
||||
# No normalization, but not necessarily accepted, that comes below.
|
||||
;;
|
||||
@@ -1558,12 +1546,15 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
kernel=
|
||||
obj=
|
||||
case $cpu-$vendor in
|
||||
score-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
spu-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=riscix1.2
|
||||
@@ -1573,28 +1564,35 @@ case $cpu-$vendor in
|
||||
os=gnu
|
||||
;;
|
||||
arm*-semi)
|
||||
os=aout
|
||||
os=
|
||||
obj=aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
clipper-intergraph)
|
||||
os=clix
|
||||
;;
|
||||
hexagon-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
tic55x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
tic6x-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
@@ -1616,19 +1614,24 @@ case $cpu-$vendor in
|
||||
os=sunos3
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=aout
|
||||
os=
|
||||
obj=aout
|
||||
;;
|
||||
mep-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
mips*-*)
|
||||
os=elf
|
||||
mips*-*|nanomips*-*)
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
or32-*)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=sysv3
|
||||
@@ -1637,7 +1640,8 @@ case $cpu-$vendor in
|
||||
os=sunos4.1.1
|
||||
;;
|
||||
pru-*)
|
||||
os=elf
|
||||
os=
|
||||
obj=elf
|
||||
;;
|
||||
*-be)
|
||||
os=beos
|
||||
@@ -1718,10 +1722,12 @@ case $cpu-$vendor in
|
||||
os=uxpv
|
||||
;;
|
||||
*-rom68k)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
*-*bug)
|
||||
os=coff
|
||||
os=
|
||||
obj=coff
|
||||
;;
|
||||
*-apple)
|
||||
os=macos
|
||||
@@ -1739,10 +1745,11 @@ esac
|
||||
|
||||
fi
|
||||
|
||||
# Now, validate our (potentially fixed-up) OS.
|
||||
# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
|
||||
|
||||
case $os in
|
||||
# Sometimes we do "kernel-libc", so those need to count as OSes.
|
||||
musl* | newlib* | relibc* | uclibc*)
|
||||
llvm* | musl* | newlib* | relibc* | uclibc*)
|
||||
;;
|
||||
# Likewise for "kernel-abi"
|
||||
eabi* | gnueabi*)
|
||||
@@ -1750,6 +1757,9 @@ case $os in
|
||||
# VxWorks passes extra cpu info in the 4th filed.
|
||||
simlinux | simwindows | spe)
|
||||
;;
|
||||
# See `case $cpu-$os` validation below
|
||||
ghcjs)
|
||||
;;
|
||||
# Now accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST end in a * to match a version number.
|
||||
@@ -1758,7 +1768,7 @@ case $os in
|
||||
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
||||
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
||||
| hiux* | abug | nacl* | netware* | windows* \
|
||||
| os9* | macos* | osx* | ios* \
|
||||
| os9* | macos* | osx* | ios* | tvos* | watchos* \
|
||||
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
||||
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
||||
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
||||
@@ -1767,11 +1777,11 @@ case $os in
|
||||
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
|
||||
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
|
||||
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
|
||||
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
|
||||
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
|
||||
| bosx* | nextstep* | cxux* | oabi* \
|
||||
| ptx* | ecoff* | winnt* | domain* | vsta* \
|
||||
| udi* | lites* | ieee* | go32* | aux* | hcos* \
|
||||
| chorusrdb* | cegcc* | glidix* | serenity* \
|
||||
| cygwin* | msys* | pe* | moss* | proelf* | rtems* \
|
||||
| cygwin* | msys* | moss* | proelf* | rtems* \
|
||||
| midipix* | mingw32* | mingw64* | mint* \
|
||||
| uxpv* | beos* | mpeix* | udk* | moxiebox* \
|
||||
| interix* | uwin* | mks* | rhapsody* | darwin* \
|
||||
@@ -1784,62 +1794,116 @@ case $os in
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||
| fiwix* | mlibc* )
|
||||
| fiwix* | mlibc* | cos* | mbr* | ironclad* )
|
||||
;;
|
||||
# This one is extra strict with allowed versions
|
||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
;;
|
||||
# This refers to builds using the UEFI calling convention
|
||||
# (which depends on the architecture) and PE file format.
|
||||
# Note that this is both a different calling convention and
|
||||
# different file format than that of GNU-EFI
|
||||
# (x86_64-w64-mingw32).
|
||||
uefi)
|
||||
;;
|
||||
none)
|
||||
;;
|
||||
kernel* )
|
||||
kernel* | msvc* )
|
||||
# Restricted further below
|
||||
;;
|
||||
'')
|
||||
if test x"$obj" = x
|
||||
then
|
||||
echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
|
||||
echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case $obj in
|
||||
aout* | coff* | elf* | pe*)
|
||||
;;
|
||||
'')
|
||||
# empty is fine
|
||||
;;
|
||||
*)
|
||||
echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Here we handle the constraint that a (synthetic) cpu and os are
|
||||
# valid only in combination with each other and nowhere else.
|
||||
case $cpu-$os in
|
||||
# The "javascript-unknown-ghcjs" triple is used by GHC; we
|
||||
# accept it here in order to tolerate that, but reject any
|
||||
# variations.
|
||||
javascript-ghcjs)
|
||||
;;
|
||||
javascript-* | *-ghcjs)
|
||||
echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# As a final step for OS-related things, validate the OS-kernel combination
|
||||
# (given a valid OS), if there is a kernel.
|
||||
case $kernel-$os in
|
||||
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
||||
| linux-musl* | linux-relibc* | linux-uclibc* )
|
||||
case $kernel-$os-$obj in
|
||||
linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
|
||||
| linux-mlibc*- | linux-musl*- | linux-newlib*- \
|
||||
| linux-relibc*- | linux-uclibc*- )
|
||||
;;
|
||||
uclinux-uclibc* )
|
||||
uclinux-uclibc*- )
|
||||
;;
|
||||
managarm-mlibc* | managarm-kernel* )
|
||||
managarm-mlibc*- | managarm-kernel*- )
|
||||
;;
|
||||
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
|
||||
windows*-msvc*-)
|
||||
;;
|
||||
-dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \
|
||||
| -uclibc*- )
|
||||
# These are just libc implementations, not actual OSes, and thus
|
||||
# require a kernel.
|
||||
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
|
||||
echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
-kernel* )
|
||||
echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
|
||||
-kernel*- )
|
||||
echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*-kernel* )
|
||||
echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
|
||||
*-kernel*- )
|
||||
echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
||||
*-msvc*- )
|
||||
echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
|
||||
kfreebsd*-gnu*- | kopensolaris*-gnu*-)
|
||||
;;
|
||||
nto-qnx*)
|
||||
vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
|
||||
;;
|
||||
os2-emx)
|
||||
nto-qnx*-)
|
||||
;;
|
||||
*-eabi* | *-gnueabi*)
|
||||
os2-emx-)
|
||||
;;
|
||||
-*)
|
||||
*-eabi*- | *-gnueabi*-)
|
||||
;;
|
||||
none--*)
|
||||
# None (no kernel, i.e. freestanding / bare metal),
|
||||
# can be paired with an machine code file format
|
||||
;;
|
||||
-*-)
|
||||
# Blank kernel with real OS is always fine.
|
||||
;;
|
||||
*-*)
|
||||
echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
|
||||
--*)
|
||||
# Blank kernel and OS with real machine code file format is always fine.
|
||||
;;
|
||||
*-*-*)
|
||||
echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1922,7 +1986,7 @@ case $vendor in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$cpu-$vendor-${kernel:+$kernel-}$os"
|
||||
echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
|
||||
exit
|
||||
|
||||
# Local variables:
|
||||
|
||||
@@ -459,7 +459,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
CFLAGS_OS_DEF_JVM="-DAIX -D_LARGE_FILES"
|
||||
CFLAGS_OS_DEF_JVM="-DAIX -Dalloca'(size)'=__builtin_alloca'(size)' -D_LARGE_FILES"
|
||||
CFLAGS_OS_DEF_JDK="-D_LARGE_FILES"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
|
||||
@@ -476,15 +476,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Always enable optional macros for VM.
|
||||
ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
|
||||
|
||||
# Setup some hard coded includes
|
||||
ALWAYS_CFLAGS_JDK=" \
|
||||
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
|
||||
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
|
||||
-I${TOPDIR}/src/java.base/share/native/libjava \
|
||||
-I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \
|
||||
-I${TOPDIR}/src/hotspot/share/include \
|
||||
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include"
|
||||
|
||||
###############################################################################
|
||||
|
||||
# Adjust flags according to debug level.
|
||||
@@ -577,8 +568,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
|
||||
# compilation of all source files regardless of the active code page on Windows.
|
||||
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -utf-8 -Zc:wchar_t-"
|
||||
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -Zc:wchar_t-"
|
||||
fi
|
||||
|
||||
# CFLAGS C language level for JDK sources (hotspot only uses C++)
|
||||
@@ -871,7 +862,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \
|
||||
$REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
|
||||
|
||||
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
|
||||
CFLAGS_JDK_COMMON="$ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
|
||||
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
|
||||
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
|
||||
$FILE_MACRO_CFLAGS $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
|
||||
|
||||
@@ -31,22 +31,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
|
||||
FLAGS_SETUP_LDFLAGS_HELPER
|
||||
|
||||
# Setup the target toolchain
|
||||
|
||||
# The target dir matches the name of VM variant
|
||||
TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
|
||||
|
||||
# On some platforms (mac) the linker warns about non existing -L dirs.
|
||||
FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET])
|
||||
|
||||
# Setup the build toolchain
|
||||
|
||||
# When building a buildjdk, it's always only the server variant
|
||||
BUILD_JVM_VARIANT_PATH=server
|
||||
|
||||
FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
|
||||
|
||||
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
|
||||
AC_SUBST(LDFLAGS_TESTEXE)
|
||||
AC_SUBST(ADLC_LDFLAGS)
|
||||
])
|
||||
|
||||
@@ -155,7 +144,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
fi
|
||||
|
||||
# Export some intermediate variables for compatibility
|
||||
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY"
|
||||
LDFLAGS_CXX_JDK="$DEBUGLEVEL_LDFLAGS_JDK_ONLY"
|
||||
AC_SUBST(LDFLAGS_CXX_JDK)
|
||||
AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING)
|
||||
])
|
||||
@@ -197,20 +186,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
fi
|
||||
fi
|
||||
|
||||
# JVM_VARIANT_PATH depends on if this is build or target...
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
$1_LDFLAGS_JDK_LIBPATH="-libpath:\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
|
||||
else
|
||||
$1_LDFLAGS_JDK_LIBPATH="-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
|
||||
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/${$1_JVM_VARIANT_PATH}"
|
||||
fi
|
||||
|
||||
# Export variables according to old definitions, prefix with $2 if present.
|
||||
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
|
||||
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
|
||||
${$1_LDFLAGS_JDK_LIBPATH} $SHARED_LIBRARY_FLAGS \
|
||||
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
$SHARED_LIBRARY_FLAGS $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
|
||||
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -849,7 +849,7 @@ AC_DEFUN([JDKOPT_CHECK_CODESIGN_DEBUG],
|
||||
|
||||
AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
[
|
||||
ENABLE_CODESIGN=false
|
||||
MACOSX_CODESIGN_MODE=disabled
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$CODESIGN" != "x"; then
|
||||
|
||||
UTIL_ARG_WITH(NAME: macosx-codesign, TYPE: literal, OPTIONAL: true,
|
||||
@@ -859,7 +859,6 @@ AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
DESC: [set the macosx code signing mode (hardened, debug, auto)]
|
||||
)
|
||||
|
||||
MACOSX_CODESIGN_MODE=disabled
|
||||
if test "x$MACOSX_CODESIGN_ENABLED" = "xtrue"; then
|
||||
|
||||
# Check for user provided code signing identity.
|
||||
@@ -902,9 +901,9 @@ AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
AC_MSG_ERROR([unknown value for --with-macosx-codesign: $MACOSX_CODESIGN])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
AC_SUBST(MACOSX_CODESIGN_MODE)
|
||||
fi
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
AC_SUBST(MACOSX_CODESIGN_MODE)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -69,11 +69,13 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBJPEG],
|
||||
[ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
LIBJPEG_LIBS="-ljpeg"
|
||||
else
|
||||
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBJPEG)
|
||||
AC_SUBST(LIBJPEG_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -102,11 +104,13 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
|
||||
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
|
||||
|
||||
USE_EXTERNAL_LIBGIF=true
|
||||
GIFLIB_LIBS=-lgif
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBGIF)
|
||||
AC_SUBST(GIFLIB_LIBS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -129,12 +129,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
|
||||
LIB_TESTS_SETUP_GTEST
|
||||
|
||||
BASIC_JDKLIB_LIBS=""
|
||||
BASIC_JDKLIB_LIBS_TARGET=""
|
||||
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
|
||||
BASIC_JDKLIB_LIBS="-ljava -ljvm"
|
||||
fi
|
||||
|
||||
# Math library
|
||||
BASIC_JVM_LIBS="$LIBM"
|
||||
|
||||
@@ -170,14 +164,10 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
LIB_SETUP_JVM_LIBS(BUILD)
|
||||
LIB_SETUP_JVM_LIBS(TARGET)
|
||||
|
||||
JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
|
||||
JDKEXE_LIBS=""
|
||||
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
|
||||
OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
|
||||
OPENJDK_BUILD_JDKLIB_LIBS=""
|
||||
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
|
||||
|
||||
AC_SUBST(JDKLIB_LIBS)
|
||||
AC_SUBST(JDKEXE_LIBS)
|
||||
AC_SUBST(JVM_LIBS)
|
||||
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
|
||||
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
|
||||
|
||||
@@ -555,11 +555,9 @@ SYSROOT := @SYSROOT@
|
||||
|
||||
# LDFLAGS used to link the jdk native libraries (C-code)
|
||||
LDFLAGS_JDKLIB := @LDFLAGS_JDKLIB@
|
||||
JDKLIB_LIBS := @JDKLIB_LIBS@
|
||||
|
||||
# LDFLAGS used to link the jdk native launchers (C-code)
|
||||
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
|
||||
JDKEXE_LIBS := @JDKEXE_LIBS@
|
||||
|
||||
# LDFLAGS specific to C++ linking.
|
||||
LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
|
||||
@@ -572,9 +570,6 @@ LDCXX := @LDCXX@
|
||||
# The flags for linking libstdc++ linker.
|
||||
LIBCXX := @LIBCXX@
|
||||
|
||||
# Compiler and linker flags used when building native tests
|
||||
LDFLAGS_TESTEXE := @LDFLAGS_TESTEXE@
|
||||
|
||||
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
|
||||
# build platform.
|
||||
BUILD_CC := @BUILD_ICECC@ @BUILD_CC@
|
||||
@@ -630,13 +625,6 @@ SHARED_LIBRARY_FLAGS := @SHARED_LIBRARY_FLAGS@
|
||||
SET_SHARED_LIBRARY_ORIGIN = @SET_SHARED_LIBRARY_ORIGIN@
|
||||
SET_EXECUTABLE_ORIGIN = @SET_EXECUTABLE_ORIGIN@
|
||||
|
||||
# Different OS:es have different ways of naming shared libraries.
|
||||
# The SHARED_LIBRARY and STATIC_LIBRARY macros takes "verify" as and argument and returns:
|
||||
# "libverify.so" or "libverify.dylib" or "verify.dll" depending on platform.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SHARED_LIBRARY = @SHARED_LIBRARY@
|
||||
STATIC_LIBRARY = @STATIC_LIBRARY@
|
||||
|
||||
LIBRARY_PREFIX := @LIBRARY_PREFIX@
|
||||
SHARED_LIBRARY_SUFFIX := @SHARED_LIBRARY_SUFFIX@
|
||||
STATIC_LIBRARY_SUFFIX := @STATIC_LIBRARY_SUFFIX@
|
||||
@@ -682,6 +670,10 @@ BUILD_JAR = @FIXPATH@ $(BUILD_JDK)/bin/jar
|
||||
|
||||
DOCS_REFERENCE_JAVADOC := @DOCS_REFERENCE_JAVADOC@
|
||||
|
||||
# A file containing a way to uniquely identify the source code revision that
|
||||
# the build was created from
|
||||
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker
|
||||
|
||||
# Interim langtools modules and arguments
|
||||
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
|
||||
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
|
||||
@@ -796,7 +788,9 @@ TAR_SUPPORTS_TRANSFORM := @TAR_SUPPORTS_TRANSFORM@
|
||||
|
||||
# Build setup
|
||||
USE_EXTERNAL_LIBJPEG := @USE_EXTERNAL_LIBJPEG@
|
||||
LIBJPEG_LIBS := @LIBJPEG_LIBS@
|
||||
USE_EXTERNAL_LIBGIF := @USE_EXTERNAL_LIBGIF@
|
||||
GIFLIB_LIBS := @GIFLIB_LIBS@
|
||||
USE_EXTERNAL_LIBZ := @USE_EXTERNAL_LIBZ@
|
||||
LIBZ_CFLAGS := @LIBZ_CFLAGS@
|
||||
LIBZ_LIBS := @LIBZ_LIBS@
|
||||
|
||||
@@ -174,30 +174,24 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
|
||||
LIBRARY_PREFIX=
|
||||
SHARED_LIBRARY_SUFFIX='.dll'
|
||||
STATIC_LIBRARY_SUFFIX='.lib'
|
||||
SHARED_LIBRARY='[$]1.dll'
|
||||
STATIC_LIBRARY='[$]1.lib'
|
||||
OBJ_SUFFIX='.obj'
|
||||
EXECUTABLE_SUFFIX='.exe'
|
||||
else
|
||||
LIBRARY_PREFIX=lib
|
||||
SHARED_LIBRARY_SUFFIX='.so'
|
||||
STATIC_LIBRARY_SUFFIX='.a'
|
||||
SHARED_LIBRARY='lib[$]1.so'
|
||||
STATIC_LIBRARY='lib[$]1.a'
|
||||
OBJ_SUFFIX='.o'
|
||||
EXECUTABLE_SUFFIX=''
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# For full static builds, we're overloading the SHARED_LIBRARY
|
||||
# variables in order to limit the amount of changes required.
|
||||
# For full static builds, we're overloading the shared library suffix
|
||||
# in order to limit the amount of changes required.
|
||||
# It would be better to remove SHARED and just use LIBRARY and
|
||||
# LIBRARY_SUFFIX for libraries that can be built either
|
||||
# shared or static and use STATIC_* for libraries that are
|
||||
# always built statically.
|
||||
if test "x$STATIC_BUILD" = xtrue; then
|
||||
SHARED_LIBRARY='lib[$]1.a'
|
||||
SHARED_LIBRARY_SUFFIX='.a'
|
||||
else
|
||||
SHARED_LIBRARY='lib[$]1.dylib'
|
||||
SHARED_LIBRARY_SUFFIX='.dylib'
|
||||
fi
|
||||
fi
|
||||
@@ -206,8 +200,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
|
||||
AC_SUBST(LIBRARY_PREFIX)
|
||||
AC_SUBST(SHARED_LIBRARY_SUFFIX)
|
||||
AC_SUBST(STATIC_LIBRARY_SUFFIX)
|
||||
AC_SUBST(SHARED_LIBRARY)
|
||||
AC_SUBST(STATIC_LIBRARY)
|
||||
AC_SUBST(OBJ_SUFFIX)
|
||||
AC_SUBST(EXECUTABLE_SUFFIX)
|
||||
])
|
||||
@@ -953,11 +945,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
# Setup hotspot lecagy names for toolchains
|
||||
HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
HOTSPOT_TOOLCHAIN_TYPE=xlc
|
||||
else
|
||||
HOTSPOT_TOOLCHAIN_TYPE=gcc
|
||||
fi
|
||||
HOTSPOT_TOOLCHAIN_TYPE=gcc
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
HOTSPOT_TOOLCHAIN_TYPE=visCPP
|
||||
fi
|
||||
|
||||
303
make/common/FileUtils.gmk
Normal file
303
make/common/FileUtils.gmk
Normal file
@@ -0,0 +1,303 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including FileUtils.gmk)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Common file utility functions
|
||||
#
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# Replace question marks with space in string. This macro needs to be called on
|
||||
# files from FindFiles in case any of them contains space in their file name,
|
||||
# since FindFiles replaces space with ?.
|
||||
# Param 1 - String to replace in
|
||||
DecodeSpace = \
|
||||
$(subst ?,$(SPACE),$(strip $1))
|
||||
|
||||
EncodeSpace = \
|
||||
$(subst $(SPACE),?,$(strip $1))
|
||||
|
||||
################################################################################
|
||||
# Take two paths and return the path of the last common directory.
|
||||
# Ex: /foo/bar/baz, /foo/bar/banan -> /foo/bar
|
||||
# foo/bar/baz, /foo/bar -> <empty>
|
||||
#
|
||||
# The x prefix is used to preserve the presence of the initial slash
|
||||
# On Windows paths are treated as case-insensitive
|
||||
#
|
||||
# $1 - Path to compare
|
||||
# $2 - Other path to compare
|
||||
FindCommonPathPrefix = \
|
||||
$(call DecodeSpace,$(patsubst x%,%,$(subst $(SPACE),/,$(strip \
|
||||
$(call FindCommonPathPrefixHelper1, \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $1))), \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $2)))) \
|
||||
))))
|
||||
|
||||
FindCommonPathPrefixHelper1 = \
|
||||
$(if $(filter $(OPENJDK_TARGET_OS), windows), \
|
||||
$(call FindCommonPathPrefixHelper2,$(call uppercase,$1),$(call uppercase,$2),$1), \
|
||||
$(call FindCommonPathPrefixHelper2,$1,$2,$1))
|
||||
|
||||
FindCommonPathPrefixHelper2 = \
|
||||
$(if $(call equals, $(firstword $1), $(firstword $2)), \
|
||||
$(if $(call equals, $(firstword $1),),, \
|
||||
$(firstword $3) \
|
||||
$(call FindCommonPathPrefixHelper2, \
|
||||
$(wordlist 2, $(words $1), $1), \
|
||||
$(wordlist 2, $(words $2), $2), \
|
||||
$(wordlist 2, $(words $3), $3) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Computes the relative path from a directory to a file
|
||||
# $1 - File to compute the relative path to
|
||||
# $2 - Directory to compute the relative path from
|
||||
RelativePath = \
|
||||
$(call DecodeSpace,$(strip $(call RelativePathHelper,$(call EncodeSpace \
|
||||
,$(strip $1)),$(call EncodeSpace \
|
||||
,$(strip $2)),$(call EncodeSpace \
|
||||
,$(call FindCommonPathPrefix,$1,$2)))))
|
||||
|
||||
RelativePathHelper = \
|
||||
$(eval $3_prefix_length := $(words $(subst /,$(SPACE),$3))) \
|
||||
$(eval $1_words := $(subst /,$(SPACE),$1)) \
|
||||
$(eval $2_words := $(subst /,$(SPACE),$2)) \
|
||||
$(if $(call equals,$($3_prefix_length),0),, \
|
||||
$(eval $1_words := $(wordlist 2,$(words $($1_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($1_words)),$($1_words)))) \
|
||||
$(eval $2_words := $(wordlist 2,$(words $($2_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($2_words)),$($2_words)))) \
|
||||
) \
|
||||
$(eval $1_suffix := $(subst $(SPACE),/,$($1_words))) \
|
||||
$(eval $2_dotdots := $(subst $(SPACE),/,$(foreach d,$($2_words),..))) \
|
||||
$(if $($1_suffix), \
|
||||
$(if $($2_dotdots), $($2_dotdots)/$($1_suffix), $($1_suffix)), \
|
||||
$(if $($2_dotdots), $($2_dotdots), .))
|
||||
|
||||
# Make directory for target file. Should handle spaces in filenames. Just
|
||||
# calling $(call MakeDir $(@D)) will not work if the directory contains a space
|
||||
# and the target file already exists. In that case, the target file will have
|
||||
# its wildcard ? resolved and the $(@D) will evaluate each space separated dir
|
||||
# part on its own.
|
||||
MakeTargetDir = \
|
||||
$(call MakeDir, $(dir $(call EncodeSpace, $@)))
|
||||
|
||||
################################################################################
|
||||
# All install-file and related macros automatically call DecodeSpace when needed.
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# On mac, extended attributes sometimes creep into the source files, which may later
|
||||
# cause the creation of ._* files which confuses testing. Clear these with xattr if
|
||||
# set. Some files get their write permissions removed after being copied to the
|
||||
# output dir. When these are copied again to images, xattr would fail. By only clearing
|
||||
# attributes when they are present, failing on this is avoided.
|
||||
#
|
||||
# If copying a soft link to a directory, need to delete the target first to avoid
|
||||
# weird errors.
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
# Work around a weirdness with cp on Macosx. When copying a symlink, if
|
||||
# the target of the link is write protected (e.g. 444), cp will add
|
||||
# write permission for the user on the target file (644). Avoid this by
|
||||
# using ln to create a new link instead.
|
||||
if [ -h '$(call DecodeSpace, $<)' ]; then \
|
||||
$(LN) -s "`$(READLINK) '$(call DecodeSpace, $<)'`" '$(call DecodeSpace, $@)'; \
|
||||
else \
|
||||
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
|
||||
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
endef
|
||||
else
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -fP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
# Variant of install file that does not preserve symlinks
|
||||
define install-file-nolink
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# link-file-* works similarly to install-file but creates a symlink instead.
|
||||
# There are two versions, either creating a relative or an absolute link. Be
|
||||
# careful when using this on Windows since the symlink created is only valid in
|
||||
# the unix emulation environment.
|
||||
# In msys2 we use mklink /J because its ln would perform a deep copy of the target.
|
||||
# This inhibits performance and can lead to issues with long paths. With mklink /J
|
||||
# relative linking does not work, so we handle the link as absolute path.
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
# Recursive wildcard function. Walks down directories recursively and matches
|
||||
# files with the search patterns. Patterns use standard file wildcards (* and
|
||||
# ?).
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
# $2 - Search patterns
|
||||
rwildcard = \
|
||||
$(strip \
|
||||
$(foreach d, \
|
||||
$(patsubst %/,%,$(sort $(dir $(wildcard $(addsuffix /*/*, $(strip $1)))))), \
|
||||
$(call rwildcard,$d,$2) \
|
||||
) \
|
||||
$(call DoubleDollar, $(wildcard $(foreach p, $2, $(addsuffix /$(strip $p), $(strip $1))))) \
|
||||
)
|
||||
|
||||
# Find non directories using recursive wildcard function. This function may
|
||||
# be used directly when a small amount of directories is expected to be
|
||||
# searched and caching is not expected to be of use.
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
WildcardFindFiles = \
|
||||
$(sort $(strip \
|
||||
$(eval WildcardFindFiles_result := $(call rwildcard,$(patsubst %/,%,$1),$(if $(strip $2),$2,*))) \
|
||||
$(filter-out $(patsubst %/,%,$(sort $(dir $(WildcardFindFiles_result)))), \
|
||||
$(WildcardFindFiles_result) \
|
||||
) \
|
||||
))
|
||||
|
||||
# Find non directories using the find utility in the shell. Safe to call for
|
||||
# non existing directories, or directories containing wildcards.
|
||||
#
|
||||
# Files containing space will get spaces replaced with ? because GNU Make
|
||||
# cannot handle lists of files with space in them. By using ?, make will match
|
||||
# the wildcard to space in many situations so we don't need to replace back
|
||||
# to space on every use. While not a complete solution it does allow some uses
|
||||
# of FindFiles to function with spaces in file names, including for
|
||||
# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so
|
||||
# if files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
# $3 - Optional options to find.
|
||||
ShellFindFiles = \
|
||||
$(if $(wildcard $1), \
|
||||
$(sort \
|
||||
$(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \
|
||||
$(if $(strip $2), -a \( -name "$(firstword $2)" \
|
||||
$(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \
|
||||
| $(TR) ' ' '?' \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Find non directories using the method most likely to work best for the
|
||||
# current build host
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
ifeq ($(OPENJDK_BUILD_OS)-$(RWILDCARD_WORKS), windows-true)
|
||||
DirectFindFiles = $(WildcardFindFiles)
|
||||
else
|
||||
DirectFindFiles = $(ShellFindFiles)
|
||||
endif
|
||||
|
||||
# Finds files using a cache that is populated by FillFindCache below. If any of
|
||||
# the directories given have not been cached, DirectFindFiles is used for
|
||||
# everything. Caching is especially useful in Cygwin, where file finds are very
|
||||
# costly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns. If used, no caching is done.
|
||||
CacheFindFiles_CACHED_DIRS :=
|
||||
CacheFindFiles_CACHED_FILES :=
|
||||
CacheFindFiles = \
|
||||
$(if $2, \
|
||||
$(call DirectFindFiles, $1, $2) \
|
||||
, \
|
||||
$(if $(filter-out $(addsuffix /%, $(CacheFindFiles_CACHED_DIRS)) \
|
||||
$(CacheFindFiles_CACHED_DIRS), $1), \
|
||||
$(call DirectFindFiles, $1) \
|
||||
, \
|
||||
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(CacheFindFiles_CACHED_FILES)) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Explicitly adds files to the find cache used by CacheFindFiles.
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
FillFindCache = \
|
||||
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
|
||||
$$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
|
||||
$(if $(CacheFindFiles_NEW_DIRS), \
|
||||
$(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \
|
||||
$(eval CacheFindFiles_CACHED_FILES := $$(sort $$(CacheFindFiles_CACHED_FILES) \
|
||||
$$(call DirectFindFiles, $$(CacheFindFiles_NEW_DIRS)))) \
|
||||
)
|
||||
|
||||
# Findfiles is the default macro that should be used to find files in the file
|
||||
# system. This function does not always support files with spaces in the names.
|
||||
# If files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
ifeq ($(DISABLE_CACHE_FIND), true)
|
||||
FindFiles = $(DirectFindFiles)
|
||||
else
|
||||
FindFiles = $(CacheFindFiles)
|
||||
endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -30,6 +30,8 @@ ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including JarArchive.gmk)
|
||||
endif
|
||||
|
||||
include MakeIO.gmk
|
||||
|
||||
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
|
||||
|
||||
# Setup make rules for creating a jar archive.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -30,6 +30,8 @@ ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
|
||||
endif
|
||||
|
||||
include MakeIO.gmk
|
||||
|
||||
# Java compilation needs SetupJarArchive and/or SetupZipArchive, if we're
|
||||
# generating a jar file or a source zip.
|
||||
include JarArchive.gmk
|
||||
|
||||
@@ -35,12 +35,6 @@ include NativeCompilation.gmk
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk))
|
||||
|
||||
FindSrcDirsForLib += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
|
||||
$(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
|
||||
|
||||
FindSrcDirsForComponent += \
|
||||
$(call uniq, $(wildcard \
|
||||
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
|
||||
@@ -82,18 +76,163 @@ endif
|
||||
GetJavaHeaderDir = \
|
||||
$(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
|
||||
|
||||
# Process a dir description such as "java.base:headers" into a set of proper absolute paths.
|
||||
ProcessDir = \
|
||||
HOTSPOT_INCLUDE_DIR := $(TOPDIR)/src/hotspot/share/include \
|
||||
$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include
|
||||
|
||||
# Preprocess a source dir destination. Pass on absolute paths unchanged. Expand
|
||||
# description such as "java.base:headers" into a set of proper absolute paths,
|
||||
# by looking in $MODULE/[shared|$OS|$OSTYPE]/native.
|
||||
# Treat *:libjvm as a special case, and replace it with the proper hotspot
|
||||
# include directories.
|
||||
ProcessSrcDir = \
|
||||
$(if $(findstring :, $1), \
|
||||
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), $(lastword $(subst :, , $1))) \
|
||||
$(if $(filter %:libjvm, $1), \
|
||||
$(HOTSPOT_INCLUDE_DIR) \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), \
|
||||
$(lastword $(subst :, , $1))) \
|
||||
) \
|
||||
, \
|
||||
$(if $(filter /%, $1), \
|
||||
$1 \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(MODULE), $1) \
|
||||
$(if $(filter libjvm, $1), \
|
||||
$(HOTSPOT_INCLUDE_DIR) \
|
||||
, \
|
||||
$(call FindSrcDirsForComponent, $(MODULE), $1) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Create a proper LIBPATH for the given library. Sets result in $1_$2_LIBPATH.
|
||||
# $1: The name of the rule (namespace)
|
||||
# $2: The safe namespace of the library
|
||||
define ResolveLibPath
|
||||
# Determine proper LIBPATH. This is quite messy due to historical reasons,
|
||||
# and because we need to have special treatment for "gtest:" and ":jvm".
|
||||
ifneq ($$($1_$2_MODULE), gtest)
|
||||
ifneq ($$($1_$2_NAME), jvm)
|
||||
# This is the common case
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)/lib$$($1_$2_NAME)
|
||||
else
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)/lib$$($1_$2_NAME)/static
|
||||
else ifeq ($$($1_$2_STATIC_LIBRARY), true)
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)
|
||||
else
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
# Special treatment for hotspot
|
||||
ifeq ($(CREATING_BUILDJDK), true)
|
||||
# When building a buildjdk, it's always only the server variant
|
||||
$1_$2_JVM_VARIANT_PATH := server
|
||||
else
|
||||
$1_$2_JVM_VARIANT_PATH := $(JVM_VARIANT_MAIN)
|
||||
endif
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(HOTSPOT_OUTPUTDIR)/variant-$$($1_$2_JVM_VARIANT_PATH)/libjvm/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)
|
||||
endif
|
||||
else
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(HOTSPOT_OUTPUTDIR)/variant-$$($1_$2_JVM_VARIANT_PATH)/libjvm/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)/$$($1_$2_JVM_VARIANT_PATH)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
# Special treatment for virtual module "gtest"
|
||||
ifeq ($$($1_$2_NAME), jvm)
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs
|
||||
endif
|
||||
else
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest
|
||||
endif
|
||||
endif
|
||||
else ifeq ($$($1_$2_NAME), gtest)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest
|
||||
ifeq ($(STATIC_LIBS), true)
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest/objs/static
|
||||
else
|
||||
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# Process a JDK library designation such as "java.desktop:jawt" into the needed
|
||||
# additions to EXTRA_LINK_DEPS, LDFLAGS, LIBS and EXTRA_HEADER_DIRS.
|
||||
# $1: The name of the rule (namespace)
|
||||
# $2: The safe namespace of the library
|
||||
# $3: The actual string given to represent the library
|
||||
define AddJdkLibrary
|
||||
$1_$2_NAME := $$(strip $$(lastword $$(subst :, , $3)))
|
||||
$1_$2_MODULE := $$(strip $$(patsubst %$$($1_$2_NAME), %, $3))
|
||||
|
||||
ifeq ($$(filter lib%, $$($1_$2_NAME)),)
|
||||
$$(error Library name $$($1_$2_NAME) missing lib prefix in $1)
|
||||
endif
|
||||
$1_$2_NAME := $$(strip $$(patsubst lib%, %, $$($1_$2_NAME)))
|
||||
|
||||
ifeq ($$($1_$2_MODULE),)
|
||||
$1_$2_MODULE := $$(MODULE)
|
||||
else
|
||||
$1_$2_MODULE := $$(strip $$(patsubst %:, %, $$($1_$2_MODULE)))
|
||||
endif
|
||||
|
||||
# Determine if the library in question is static.
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$1_$2_STATIC_LIBRARY := true
|
||||
endif
|
||||
# Ideally, we should not hardcode these
|
||||
ifeq ($(call isTargetOs, aix)+$$($1_$2_MODULE):$$($1_$2_NAME), true+java.base:jli)
|
||||
$1_$2_STATIC_LIBRARY := true
|
||||
endif
|
||||
ifeq ($$($1_$2_MODULE):$$($1_$2_NAME), gtest:gtest)
|
||||
$1_$2_STATIC_LIBRARY := true
|
||||
endif
|
||||
|
||||
# Setup $1_$2_LIBPATH.
|
||||
$$(eval $$(call ResolveLibPath,$1,$2))
|
||||
|
||||
$1_EXTRA_HEADER_DIRS += $$($1_$2_MODULE):lib$$($1_$2_NAME)
|
||||
|
||||
ifneq ($(STATIC_LIBS), true)
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
ifeq ($$(filter -libpath:$$($1_$2_LIBPATH), $$($1_LDFLAGS)), )
|
||||
$1_LDFLAGS += -libpath:$$($1_$2_LIBPATH)
|
||||
endif
|
||||
$1_LIBS += $$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
|
||||
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
|
||||
else
|
||||
ifeq ($$(filter -L$$($1_$2_LIBPATH), $$($1_LDFLAGS)), )
|
||||
$1_LDFLAGS += -L$$($1_$2_LIBPATH)
|
||||
endif
|
||||
$1_LIBS += -l$$($1_$2_NAME)
|
||||
ifeq ($$($1_$2_STATIC_LIBRARY), true)
|
||||
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
|
||||
else
|
||||
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(SHARED_LIBRARY_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
$1_EXTRA_LINK_DEPS += $$($1_$2_LIBPATH)/$$($1_$2_LIBFILE)
|
||||
endif
|
||||
endef
|
||||
|
||||
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
|
||||
|
||||
JDK_RCFLAGS=$(RCFLAGS) \
|
||||
@@ -104,29 +243,76 @@ JDK_RCFLAGS=$(RCFLAGS) \
|
||||
-D"JDK_NAME=$(JDK_RC_NAME) $(VERSION_SHORT)" \
|
||||
-D"JDK_FVER=$(subst .,$(COMMA),$(VERSION_NUMBER_FOUR_POSITIONS))"
|
||||
|
||||
# Setup make rules for creating a native shared library with suitable defaults
|
||||
# for the OpenJDK project.
|
||||
# Setup make rules for creating a native binary with suitable defaults
|
||||
# for the OpenJDK project. This macro is mostly considered to be an internal
|
||||
# support version. Please use SetupJdkLibrary or SetupJdkExecutable instead.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
# EXTRA_HEADER_DIRS -- additional directories to look for headers in
|
||||
# EXTRA_SRC -- additional directories to look for source in
|
||||
# SetupNativeCompilation. This macro also adds the following additional
|
||||
# arguments:
|
||||
#
|
||||
# SRC -- this is passed on after preprocessing. The preprocessing will pass on
|
||||
# absolute paths unchanged, but relative paths will be expanded to include
|
||||
# all directories with this name in $MODULE/[shared|$OS|$OSTYPE]/native.
|
||||
# EXTRA_SRC -- additional directories to look for source in. This is processed
|
||||
# like SRC.
|
||||
# EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from
|
||||
# appearing in SRC.
|
||||
# EXTRA_HEADER_DIRS -- additional directories to look for headers in. This can
|
||||
# be specified either as an absolute path, or relative directory names which
|
||||
# are preprocessed like SRC, or in the format <module>:<directory>, which
|
||||
# will be processed like SRC but for the given module. The names
|
||||
# "java.base:libjvm" and "gtest:libjvm" symbolise virtual libraries that
|
||||
# will be replaced with proper values for hotspot.
|
||||
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
|
||||
# header include dirs. (Defaults to true.)
|
||||
# SRC -- this is passed on, but preprocessed to accept source dir designations
|
||||
# JDK_LIBS -- libraries generated by the JDK build system to link against.
|
||||
# These take the form <module>:<basename>. For the current module, the
|
||||
# module name and colon can be omitted. The basename should be specified
|
||||
# as the source directory, e.g. "libjava". The gtest module is a virtual
|
||||
# module that will be replaced with correct values for gtest. When
|
||||
# specifying JDK_LIBS, suitable values for EXTRA_LINK_DEPS, LDFLAGS, LIBS
|
||||
# and EXTRA_HEADER_DIRS will be added.
|
||||
# JDK_LIBS_<os> or JDK_LIBS_<osType> -- additional JDK_LIBS for the given OS
|
||||
# or OS type only
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
# RC_FILEDESC -- override the default FILEDESC for Windows version.rc
|
||||
# such as "java.base:headers".
|
||||
SetupJdkLibrary = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkLibraryBody
|
||||
# DEFAULT_LIBCXX -- if false, do not add LIBCXX to LIBS for C++ compilations
|
||||
# DEFAULT_CFLAGS -- if false, do not add default CFLAGS and CXXFLAGS
|
||||
# DEFAULT_LDFLAGS -- if false, do not add default LDFLAGS
|
||||
# CFLAGS_FILTER_OUT -- flags to filter out from default CFLAGS
|
||||
# CXXFLAGS_FILTER_OUT -- flags to filter out from default CXXFLAGS
|
||||
# LDFLAGS_FILTER_OUT -- flags to filter out from default LDFLAGS
|
||||
# LD_SET_ORIGIN -- if false, do not add SET_*_ORIGIN flags to LDFLAGS
|
||||
# APPEND_LDFLAGS -- a quirk to have additional LDFLAGS that will be set after
|
||||
# the origin flags
|
||||
# DEFAULT_VERSIONINFO_RESOURCE -- if false, do not set the default
|
||||
# VERSIONINFO_RESOURCE
|
||||
#
|
||||
SetupJdkNativeCompilation = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkNativeCompilationBody
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
$1_NATIVE_DIR_PREFIX :=
|
||||
$1_MODULES_PATH := modules_cmds
|
||||
$1_RC_EXT := exe
|
||||
$1_RC_FTYPE := 0x1L
|
||||
else
|
||||
$1_NATIVE_DIR_PREFIX := lib
|
||||
$1_MODULES_PATH := modules_libs
|
||||
$1_RC_EXT := dll
|
||||
$1_RC_FTYPE := 0x2L
|
||||
endif
|
||||
|
||||
ifeq ($$($1_OUTPUT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
|
||||
ifeq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
$1_OUTPUT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)
|
||||
else
|
||||
$1_OUTPUT_DIR := $$(SUPPORT_OUTPUTDIR)/$$($1_MODULES_PATH)/$$(strip $$(MODULE))
|
||||
endif
|
||||
else
|
||||
$$(error Must specify OUTPUT_DIR in a MODULE free context)
|
||||
endif
|
||||
@@ -134,27 +320,31 @@ define SetupJdkLibraryBody
|
||||
|
||||
ifeq ($$($1_OBJECT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NATIVE_DIR_PREFIX)$$($1_NAME)
|
||||
else
|
||||
$$(error Must specify OBJECT_DIR in a MODULE free context)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_LINK_TYPE), C++)
|
||||
$1_LIBS += $(LIBCXX)
|
||||
ifneq ($$($1_DEFAULT_LIBCXX), false)
|
||||
ifeq ($$($1_LINK_TYPE), C++)
|
||||
$1_LIBS += $(LIBCXX)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_SRC), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
|
||||
$1_SRC := $$(call FindSrcDirsForComponent, $$(MODULE), $$($1_NATIVE_DIR_PREFIX)$$($1_NAME))
|
||||
else
|
||||
$$(error Must specify SRC in a MODULE free context)
|
||||
ifeq ($$($1_EXTRA_FILES), )
|
||||
$$(error Must specify SRC or EXTRA_FILES in a MODULE free context)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
|
||||
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessSrcDir, $$(dir)))
|
||||
endif
|
||||
ifneq ($$($1_EXTRA_SRC), )
|
||||
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir)))
|
||||
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessSrcDir, $$(dir)))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
|
||||
@@ -164,19 +354,20 @@ define SetupJdkLibraryBody
|
||||
$1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
ifneq ($$($1_DEFAULT_VERSIONINFO_RESOURCE), false)
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_RC_FILEDESC), )
|
||||
$1_RC_FILEDESC := $(JDK_RC_NAME) binary
|
||||
endif
|
||||
|
||||
$1_RCFLAGS := $(JDK_RCFLAGS) \
|
||||
-D"JDK_FILEDESC=$$(strip $$($1_RC_FILEDESC))" \
|
||||
-D"JDK_FNAME=$$($1_NAME).dll" \
|
||||
-D"JDK_FILEDESC=$$($1_RC_FILEDESC)" \
|
||||
-D"JDK_FNAME=$$($1_NAME).$$($1_RC_EXT)" \
|
||||
-D"JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D"JDK_FTYPE=0x2L" \
|
||||
-D"JDK_FTYPE=$$($1_RC_FTYPE)" \
|
||||
-I$(TOPDIR)/src/java.base/windows/native/common \
|
||||
$$($1_EXTRA_RCFLAGS)
|
||||
|
||||
@@ -185,20 +376,40 @@ define SetupJdkLibraryBody
|
||||
endif
|
||||
|
||||
# Add the module specific java header dir
|
||||
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
|
||||
|
||||
ifneq ($$($1_EXTRA_HEADER_DIRS), )
|
||||
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
|
||||
$$(call ProcessDir, $$(dir)))
|
||||
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
|
||||
ifneq ($$(MODULE), )
|
||||
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_DEFAULT_CFLAGS), false)
|
||||
# Set the default flags first to be able to override
|
||||
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKLIB)) $$($1_CFLAGS)
|
||||
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
|
||||
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
|
||||
$$(foreach lib, $$($1_JDK_LIBS), \
|
||||
$$(eval $$(call AddJdkLibrary,$1,$$(subst :,_,$$(lib)),$$(lib))) \
|
||||
)
|
||||
|
||||
# Set the default flags first to be able to override
|
||||
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKLIB)) $$($1_CXXFLAGS)
|
||||
# Add the include path for jni.h to all native compilations
|
||||
$1_EXTRA_HEADER_DIRS += \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
|
||||
java.base:include \
|
||||
#
|
||||
|
||||
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
|
||||
$$(call ProcessSrcDir, $$(dir)))
|
||||
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
|
||||
|
||||
ifneq ($$($1_DEFAULT_CFLAGS), false)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
# Set the default flags first to be able to override
|
||||
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKEXE)) $$($1_CFLAGS)
|
||||
|
||||
# Set the default flags first to be able to override
|
||||
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKEXE)) $$($1_CXXFLAGS)
|
||||
else
|
||||
# Set the default flags first to be able to override
|
||||
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKLIB)) $$($1_CFLAGS)
|
||||
|
||||
# Set the default flags first to be able to override
|
||||
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKLIB)) $$($1_CXXFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$($1_CFLAGS), )
|
||||
@@ -212,12 +423,21 @@ define SetupJdkLibraryBody
|
||||
endif
|
||||
|
||||
ifneq ($$($1_DEFAULT_LDFLAGS), false)
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKLIB)) $$($1_LDFLAGS)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKEXE)) $$($1_LDFLAGS)
|
||||
else
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKLIB)) $$($1_LDFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$($1_LD_SET_ORIGIN), false)
|
||||
$1_LDFLAGS += $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
ifeq ($$($1_TYPE), EXECUTABLE)
|
||||
$1_LDFLAGS += $$(call SET_EXECUTABLE_ORIGIN)
|
||||
else
|
||||
$1_LDFLAGS += $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
endif
|
||||
endif
|
||||
# APPEND_LDFLAGS, if it exists, must be set after the origin flags
|
||||
# This is a workaround to keep existing behavior
|
||||
@@ -225,74 +445,45 @@ define SetupJdkLibraryBody
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupNativeCompilation, $1, ))
|
||||
$$(eval $$(call SetupNativeCompilation, $1))
|
||||
endef
|
||||
|
||||
# Setup make rules for creating a native executable with suitable defaults for
|
||||
# the OpenJDK project.
|
||||
# Setup make rules for creating a native library with suitable defaults
|
||||
# for the OpenJDK project. The default is to create a shared library,
|
||||
# but by passing TYPE := STATIC_LIBARY, a static library can be created.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupNativeCompilation, except for
|
||||
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
|
||||
SetupJdkExecutable = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkExecutableBody
|
||||
$1_TYPE := EXECUTABLE
|
||||
|
||||
ifeq ($$($1_OUTPUT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
|
||||
else
|
||||
$$(error Must specify OUTPUT_DIR in a MODULE free context)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_OBJECT_DIR), )
|
||||
ifneq ($$(MODULE), )
|
||||
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
|
||||
else
|
||||
$$(error Must specify OBJECT_DIR in a MODULE free context)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_LINK_TYPE), C++)
|
||||
$1_LIBS += $(LIBCXX)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_VERSIONINFO_RESOURCE), )
|
||||
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
|
||||
endif
|
||||
|
||||
$1_RCFLAGS := $(JDK_RCFLAGS) \
|
||||
-D"JDK_FILEDESC=$(JDK_RC_NAME) binary" \
|
||||
-D"JDK_FNAME=$$($1_NAME).exe" \
|
||||
-D"JDK_INTERNAL_NAME=$$($1_NAME)" \
|
||||
-D"JDK_FTYPE=0x1L" \
|
||||
-I$(TOPDIR)/src/java.base/windows/native/common \
|
||||
$$($1_EXTRA_RCFLAGS)
|
||||
|
||||
ifneq ($$($1_DEFAULT_CFLAGS), false)
|
||||
# Set the default flags first to be able to override
|
||||
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKEXE)) $$($1_CFLAGS)
|
||||
|
||||
# Set the default flags first to be able to override
|
||||
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKEXE)) $$($1_CXXFLAGS)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_DEFAULT_LDFLAGS), false)
|
||||
# Set the default flags first to be able to override
|
||||
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKEXE)) $$($1_LDFLAGS)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_LD_SET_ORIGIN), false)
|
||||
$1_LDFLAGS += $$(call SET_EXECUTABLE_ORIGIN)
|
||||
# SetupJdkNativeCompilation. Please see that macro for details.
|
||||
SetupJdkLibrary = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkLibraryBody
|
||||
# If type is unspecified, default to LIBRARY
|
||||
ifeq ($$($1_TYPE), )
|
||||
$1_TYPE := LIBRARY
|
||||
endif
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupNativeCompilation, $1))
|
||||
$$(eval $$(call SetupJdkNativeCompilation, $1))
|
||||
endef
|
||||
|
||||
# Setup make rules for creating a native executable with suitable defaults
|
||||
# for the OpenJDK project.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These are all passed on to
|
||||
# SetupJdkNativeCompilation. Please see that macro for details.
|
||||
SetupJdkExecutable = $(NamedParamsMacroTemplate)
|
||||
define SetupJdkExecutableBody
|
||||
$1_TYPE := EXECUTABLE
|
||||
|
||||
# Since we reuse the rule name ($1), all our arguments will pass through.
|
||||
# We lose in transparency, but gain in brevity in this call...
|
||||
$$(eval $$(call SetupJdkNativeCompilation, $1))
|
||||
endef
|
||||
|
||||
endif # _JDK_NATIVE_COMPILATION_GMK
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
#
|
||||
|
||||
################################################################
|
||||
#
|
||||
# Setup common utility functions.
|
||||
#
|
||||
# MakeBase provides the core functionality needed and used by all makefiles. It
|
||||
# should be included by all makefiles. MakeBase provides essential
|
||||
# functionality for named parameter functions, variable dependency, tool
|
||||
# execution, logging and fixpath functionality.
|
||||
################################################################
|
||||
|
||||
ifndef _MAKEBASE_GMK
|
||||
@@ -64,9 +65,6 @@ define NEWLINE
|
||||
|
||||
endef
|
||||
|
||||
# Make sure we have a value (could be overridden on command line by caller)
|
||||
CREATING_BUILDJDK ?= false
|
||||
|
||||
# Certain features only work in newer version of GNU Make. The build will still
|
||||
# function in 3.81, but will be less performant.
|
||||
ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
|
||||
@@ -75,67 +73,16 @@ ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
|
||||
RWILDCARD_WORKS := true
|
||||
endif
|
||||
|
||||
|
||||
# For convenience, MakeBase.gmk continues to include these separate files, at
|
||||
# least for now.
|
||||
|
||||
# Utils.gmk must be included before FileUtils.gmk, since it uses some of the
|
||||
# basic utility functions there.
|
||||
include $(TOPDIR)/make/common/Utils.gmk
|
||||
include $(TOPDIR)/make/common/MakeIO.gmk
|
||||
include $(TOPDIR)/make/common/CopyFiles.gmk
|
||||
include $(TOPDIR)/make/common/FileUtils.gmk
|
||||
|
||||
################################################################################
|
||||
# Functions for timers
|
||||
################################################################################
|
||||
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
|
||||
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
|
||||
endef
|
||||
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
|
||||
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
|
||||
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
|
||||
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
|
||||
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
|
||||
endef
|
||||
|
||||
# Hook to be called when starting to execute a top-level target
|
||||
define TargetEnter
|
||||
$(PRINTF) "## Starting $(patsubst %-only,%,$@)\n"
|
||||
$(call RecordStartTime,$(patsubst %-only,%,$@))
|
||||
endef
|
||||
|
||||
# Hook to be called when finish executing a top-level target
|
||||
define TargetExit
|
||||
$(call RecordEndTime,$(patsubst %-only,%,$@))
|
||||
$(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`"
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
# A file containing a way to uniquely identify the source code revision that
|
||||
# the build was created from
|
||||
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as absolute paths
|
||||
FindAllReposAbs = \
|
||||
$(strip $(sort $(dir $(filter-out $(TOPDIR)/build/%, $(wildcard \
|
||||
$(addprefix $(TOPDIR)/, .git */.git */*/.git */*/*/.git */*/*/*/.git) \
|
||||
)))))
|
||||
|
||||
# Locate all sourcecode repositories included in the forest, as relative paths
|
||||
FindAllReposRel = \
|
||||
$(strip $(subst $(TOPDIR)/,.,$(patsubst $(TOPDIR)/%/, %, $(FindAllReposAbs))))
|
||||
# Make sure we have a value (could be overridden on command line by caller)
|
||||
CREATING_BUILDJDK ?= false
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -237,224 +184,6 @@ define NamedParamsMacroTemplate
|
||||
$(call $(0)Body,$(strip $1))
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Make directory without forking mkdir if not needed.
|
||||
#
|
||||
# If a directory with an encoded space is provided, the wildcard function
|
||||
# sometimes returns false answers (typically if the dir existed when the
|
||||
# makefile was parsed, but was deleted by a previous rule). In that case, always
|
||||
# call mkdir regardless of what wildcard says.
|
||||
#
|
||||
# 1: List of directories to create
|
||||
MakeDir = \
|
||||
$(strip \
|
||||
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, \
|
||||
$(if $(findstring ?, $d), '$(call DecodeSpace, $d)', \
|
||||
$(if $(wildcard $d), , $d) \
|
||||
) \
|
||||
))) \
|
||||
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
|
||||
)
|
||||
|
||||
# Make directory for target file. Should handle spaces in filenames. Just
|
||||
# calling $(call MakeDir $(@D)) will not work if the directory contains a space
|
||||
# and the target file already exists. In that case, the target file will have
|
||||
# its wildcard ? resolved and the $(@D) will evaluate each space separated dir
|
||||
# part on its own.
|
||||
MakeTargetDir = \
|
||||
$(call MakeDir, $(dir $(call EncodeSpace, $@)))
|
||||
|
||||
################################################################################
|
||||
# All install-file and related macros automatically call DecodeSpace when needed.
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# On mac, extended attributes sometimes creep into the source files, which may later
|
||||
# cause the creation of ._* files which confuses testing. Clear these with xattr if
|
||||
# set. Some files get their write permissions removed after being copied to the
|
||||
# output dir. When these are copied again to images, xattr would fail. By only clearing
|
||||
# attributes when they are present, failing on this is avoided.
|
||||
#
|
||||
# If copying a soft link to a directory, need to delete the target first to avoid
|
||||
# weird errors.
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
# Work around a weirdness with cp on Macosx. When copying a symlink, if
|
||||
# the target of the link is write protected (e.g. 444), cp will add
|
||||
# write permission for the user on the target file (644). Avoid this by
|
||||
# using ln to create a new link instead.
|
||||
if [ -h '$(call DecodeSpace, $<)' ]; then \
|
||||
$(LN) -s "`$(READLINK) '$(call DecodeSpace, $<)'`" '$(call DecodeSpace, $@)'; \
|
||||
else \
|
||||
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
|
||||
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
|
||||
fi
|
||||
endef
|
||||
else
|
||||
define install-file
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -fP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
# Variant of install file that does not preserve symlinks
|
||||
define install-file-nolink
|
||||
$(call MakeTargetDir)
|
||||
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# link-file-* works similarly to install-file but creates a symlink instead.
|
||||
# There are two versions, either creating a relative or an absolute link. Be
|
||||
# careful when using this on Windows since the symlink created is only valid in
|
||||
# the unix emulation environment.
|
||||
# In msys2 we use mklink /J because its ln would perform a deep copy of the target.
|
||||
# This inhibits performance and can lead to issues with long paths. With mklink /J
|
||||
# relative linking does not work, so we handle the link as absolute path.
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-relative
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||
endef
|
||||
else
|
||||
define link-file-absolute
|
||||
$(call MakeTargetDir)
|
||||
$(RM) '$(call DecodeSpace, $@)'
|
||||
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||
endef
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
# Recursive wildcard function. Walks down directories recursively and matches
|
||||
# files with the search patterns. Patterns use standard file wildcards (* and
|
||||
# ?).
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
# $2 - Search patterns
|
||||
rwildcard = \
|
||||
$(strip \
|
||||
$(foreach d, \
|
||||
$(patsubst %/,%,$(sort $(dir $(wildcard $(addsuffix /*/*, $(strip $1)))))), \
|
||||
$(call rwildcard,$d,$2) \
|
||||
) \
|
||||
$(call DoubleDollar, $(wildcard $(foreach p, $2, $(addsuffix /$(strip $p), $(strip $1))))) \
|
||||
)
|
||||
|
||||
# Find non directories using recursive wildcard function. This function may
|
||||
# be used directly when a small amount of directories is expected to be
|
||||
# searched and caching is not expected to be of use.
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
WildcardFindFiles = \
|
||||
$(sort $(strip \
|
||||
$(eval WildcardFindFiles_result := $(call rwildcard,$(patsubst %/,%,$1),$(if $(strip $2),$2,*))) \
|
||||
$(filter-out $(patsubst %/,%,$(sort $(dir $(WildcardFindFiles_result)))), \
|
||||
$(WildcardFindFiles_result) \
|
||||
) \
|
||||
))
|
||||
|
||||
# Find non directories using the find utility in the shell. Safe to call for
|
||||
# non existing directories, or directories containing wildcards.
|
||||
#
|
||||
# Files containing space will get spaces replaced with ? because GNU Make
|
||||
# cannot handle lists of files with space in them. By using ?, make will match
|
||||
# the wildcard to space in many situations so we don't need to replace back
|
||||
# to space on every use. While not a complete solution it does allow some uses
|
||||
# of FindFiles to function with spaces in file names, including for
|
||||
# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so
|
||||
# if files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
# $3 - Optional options to find.
|
||||
ShellFindFiles = \
|
||||
$(if $(wildcard $1), \
|
||||
$(sort \
|
||||
$(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \
|
||||
$(if $(strip $2), -a \( -name "$(firstword $2)" \
|
||||
$(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \
|
||||
| $(TR) ' ' '?' \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Find non directories using the method most likely to work best for the
|
||||
# current build host
|
||||
#
|
||||
# $1 - Directory to start search in
|
||||
# $2 - Optional search patterns, defaults to '*'.
|
||||
ifeq ($(OPENJDK_BUILD_OS)-$(RWILDCARD_WORKS), windows-true)
|
||||
DirectFindFiles = $(WildcardFindFiles)
|
||||
else
|
||||
DirectFindFiles = $(ShellFindFiles)
|
||||
endif
|
||||
|
||||
# Finds files using a cache that is populated by FillFindCache below. If any of
|
||||
# the directories given have not been cached, DirectFindFiles is used for
|
||||
# everything. Caching is especially useful in Cygwin, where file finds are very
|
||||
# costly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns. If used, no caching is done.
|
||||
CacheFindFiles_CACHED_DIRS :=
|
||||
CacheFindFiles_CACHED_FILES :=
|
||||
CacheFindFiles = \
|
||||
$(if $2, \
|
||||
$(call DirectFindFiles, $1, $2) \
|
||||
, \
|
||||
$(if $(filter-out $(addsuffix /%, $(CacheFindFiles_CACHED_DIRS)) \
|
||||
$(CacheFindFiles_CACHED_DIRS), $1), \
|
||||
$(call DirectFindFiles, $1) \
|
||||
, \
|
||||
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(CacheFindFiles_CACHED_FILES)) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Explicitly adds files to the find cache used by CacheFindFiles.
|
||||
#
|
||||
# $1 - Directories to start search in
|
||||
FillFindCache = \
|
||||
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
|
||||
$$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
|
||||
$(if $(CacheFindFiles_NEW_DIRS), \
|
||||
$(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \
|
||||
$(eval CacheFindFiles_CACHED_FILES := $$(sort $$(CacheFindFiles_CACHED_FILES) \
|
||||
$$(call DirectFindFiles, $$(CacheFindFiles_NEW_DIRS)))) \
|
||||
)
|
||||
|
||||
# Findfiles is the default macro that should be used to find files in the file
|
||||
# system. This function does not always support files with spaces in the names.
|
||||
# If files with spaces are anticipated, use ShellFindFiles directly.
|
||||
#
|
||||
# $1 - Directories to start search in.
|
||||
# $2 - Optional search patterns, empty means find everything. Patterns use
|
||||
# standard file wildcards (* and ?) and should not be quoted.
|
||||
ifeq ($(DISABLE_CACHE_FIND), true)
|
||||
FindFiles = $(DirectFindFiles)
|
||||
else
|
||||
FindFiles = $(CacheFindFiles)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# FixPath
|
||||
#
|
||||
|
||||
@@ -241,32 +241,3 @@ else # HAS_FILE_FUNCTION = false
|
||||
$$(call ListPathsSafely_IfPrintf,$1,$2,29751,30000)
|
||||
endef
|
||||
endif # HAS_FILE_FUNCTION
|
||||
|
||||
################################################################################
|
||||
# Write to and read from file
|
||||
|
||||
# Param 1 - File to read
|
||||
ReadFile = \
|
||||
$(shell $(CAT) $1)
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
WriteFile = \
|
||||
$(file >$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
WriteFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) > $2)
|
||||
endif
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
AppendFile = \
|
||||
$(file >>$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
AppendFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) >> $2)
|
||||
endif
|
||||
|
||||
@@ -36,6 +36,7 @@ ifeq ($(_MAKEBASE_GMK), )
|
||||
$(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
|
||||
endif
|
||||
|
||||
include MakeIO.gmk
|
||||
include native/CompileFile.gmk
|
||||
include native/DebugSymbols.gmk
|
||||
include native/Flags.gmk
|
||||
@@ -73,8 +74,6 @@ include native/Paths.gmk
|
||||
# used both for C and C++.
|
||||
# LIBS_<toolchain>_<OS> the libraries to link to for the specified target
|
||||
# OS and toolchain, used both for C and C++.
|
||||
# ARFLAGS the archiver flags to be used on unix platforms
|
||||
# LIBFLAGS the flags for the lib tool used on windows
|
||||
# OBJECT_DIR the directory where we store the object files
|
||||
# OUTPUT_DIR the directory where the resulting binary is put
|
||||
# SYMBOLS_DIR the directory where the debug symbols are put, defaults to OUTPUT_DIR
|
||||
@@ -86,6 +85,7 @@ include native/Paths.gmk
|
||||
# EXTRA_FILES List of extra files not in any of the SRC dirs
|
||||
# EXTRA_OBJECT_FILES List of extra object files to include when linking
|
||||
# EXTRA_DEPS List of extra dependencies to be added to each compiled file
|
||||
# EXTRA_LINK_DEPS List of extra dependencies to be added to the link stage
|
||||
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
|
||||
# RCFLAGS flags for RC.
|
||||
# EMBED_MANIFEST if true, embed manifest on Windows.
|
||||
@@ -229,6 +229,9 @@ endef
|
||||
################################################################################
|
||||
# Verify that user passed arguments are valid
|
||||
define VerifyArguments
|
||||
ifeq ($$($1_NAME), )
|
||||
$$(error NAME must not be empty in $1)
|
||||
endif
|
||||
ifneq ($$($1_NAME), $(basename $$($1_NAME)))
|
||||
$$(error NAME must not contain any directory path in $1)
|
||||
endif
|
||||
|
||||
@@ -31,7 +31,7 @@ ifeq (,$(_MAKEBASE_GMK))
|
||||
endif
|
||||
|
||||
|
||||
include NativeCompilation.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
|
||||
# Setup make rules for creating a set of native test files (libraries or
|
||||
# executables). This will locate native files matching a certain pattern,
|
||||
@@ -56,27 +56,19 @@ define SetupTestFilesCompilationBody
|
||||
$$(error There are duplicate test file names for $1: $$($1_DUPLICATED_NAMES))
|
||||
endif
|
||||
|
||||
# Always include common test functionality
|
||||
TEST_CFLAGS := -I$(TOPDIR)/test/lib/native
|
||||
|
||||
# The list to depend on starts out empty
|
||||
$1 :=
|
||||
ifeq ($$($1_TYPE), LIBRARY)
|
||||
$1_PREFIX = lib
|
||||
$1_OUTPUT_SUBDIR := lib
|
||||
$1_BASE_CFLAGS := $(CFLAGS_JDKLIB) $$(TEST_CFLAGS)
|
||||
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB) $$(TEST_CFLAGS)
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
|
||||
$1_COMPILATION_TYPE := LIBRARY
|
||||
$1_LOG_TYPE := library
|
||||
else ifeq ($$($1_TYPE), PROGRAM)
|
||||
$1_PREFIX = exe
|
||||
$1_OUTPUT_SUBDIR := bin
|
||||
$1_BASE_CFLAGS := $(CFLAGS_JDKEXE) $$(TEST_CFLAGS)
|
||||
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKEXE) $$(TEST_CFLAGS)
|
||||
$1_LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_TESTEXE)
|
||||
$1_COMPILATION_TYPE := EXECUTABLE
|
||||
$1_LOG_TYPE := executable
|
||||
$1_LD_SET_ORIGIN := false
|
||||
else
|
||||
$$(error Unknown type: $$($1_TYPE))
|
||||
endif
|
||||
@@ -99,24 +91,34 @@ define SetupTestFilesCompilationBody
|
||||
$1_COPY_DEBUG_SYMBOLS := true
|
||||
endif
|
||||
|
||||
# Always include common test functionality
|
||||
TEST_CFLAGS := -I$(TOPDIR)/test/lib/native
|
||||
|
||||
# Setup a compilation for each and every one of them
|
||||
$$(foreach file, $$($1_FILTERED_FILE_LIST),\
|
||||
$$(eval name := $$(strip $$(basename $$(notdir $$(file))))) \
|
||||
$$(eval unprefixed_name := $$(patsubst $$($1_PREFIX)%, %, $$(name))) \
|
||||
$$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
|
||||
$$(eval $$(call SetupJdkNativeCompilation, BUILD_TEST_$$(name), \
|
||||
NAME := $$(unprefixed_name), \
|
||||
TYPE := $$($1_COMPILATION_TYPE), \
|
||||
LINK_TYPE := $(if $$(filter %.cpp, $$(file)), C++, C), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
java.base:libjava \
|
||||
java.base:libjvm, \
|
||||
EXTRA_FILES := $$(file) $$($1_EXTRA_FILES), \
|
||||
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
|
||||
CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
CXXFLAGS := $$($1_BASE_CXXFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \
|
||||
CFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
|
||||
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
|
||||
LDFLAGS := $$($1_LDFLAGS_$$(name)), \
|
||||
DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
|
||||
DISABLED_WARNINGS_clang := undef format-nonliteral \
|
||||
missing-field-initializers sometimes-uninitialized, \
|
||||
DEFAULT_LIBCXX := false, \
|
||||
JDK_LIBS := $$($1_JDK_LIBS_$$(name)), \
|
||||
LIBS := $$($1_LIBS_$$(name)), \
|
||||
DEFAULT_VERSIONINFO_RESOURCE := false, \
|
||||
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
|
||||
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \
|
||||
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \
|
||||
@@ -129,7 +131,7 @@ define SetupTestFilesCompilationBody
|
||||
|
||||
# Setup rule for printing a summary of all the tests being compiled. On Warn
|
||||
# log level, this replaces the individual build info logging done by
|
||||
# SetupNativeCompilation.
|
||||
# SetupJdkNativeCompilation.
|
||||
$$($1_BUILD_INFO): $$($1_BUILD_INFO_DEPS)
|
||||
$$(call LogWarn, $$(strip Creating $$(words $$(filter-out %.vardeps, $$?)) \
|
||||
test $$($1_LOG_TYPE) file(s) for $1))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -29,29 +29,34 @@ endif
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Common utility functions
|
||||
# Basic utility functions available to MakeBase.gmk itself
|
||||
#
|
||||
################################################################################
|
||||
|
||||
### Debug functions
|
||||
# String equals
|
||||
equals = \
|
||||
$(if $(strip $1)$(strip $2),$(strip \
|
||||
$(and $(findstring $(strip $1),$(strip $2)),\
|
||||
$(findstring $(strip $2),$(strip $1)))), \
|
||||
true \
|
||||
)
|
||||
|
||||
# Prints the name and value of a variable
|
||||
PrintVar = \
|
||||
$(info $(strip $1) >$($(strip $1))<)
|
||||
# Convert the string given to upper case, without any $(shell)
|
||||
# Inspired by http://lists.gnu.org/archive/html/help-make/2013-09/msg00009.html
|
||||
uppercase_table := a,A b,B c,C d,D e,E f,F g,G h,H i,I j,J k,K l,L m,M n,N o,O \
|
||||
p,P q,Q r,R s,S t,T u,U v,V w,W x,X y,Y z,Z
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into \$ to protect the $ from expansion in the shell.
|
||||
# To make this macro resilient against already escaped strings, first remove
|
||||
# any present escapes before escaping so that no double escapes are added.
|
||||
EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))
|
||||
uppercase_internal = \
|
||||
$(if $(strip $1), $$(subst $(firstword $1), $(call uppercase_internal, \
|
||||
$(wordlist 2, $(words $1), $1), $2)), $2)
|
||||
|
||||
################################################################################
|
||||
# This macro works just like EscapeDollar above, but for #.
|
||||
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into $$ to protect the string from make itself.
|
||||
DoubleDollar = $(subst $$,$$$$,$(strip $1))
|
||||
# Convert a string to upper case. Works only on a-z.
|
||||
# $1 - The string to convert
|
||||
uppercase = \
|
||||
$(strip \
|
||||
$(eval uppercase_result := $(call uppercase_internal, $(uppercase_table), $1)) \
|
||||
$(uppercase_result) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Creates a sequence of increasing numbers (inclusive).
|
||||
@@ -68,23 +73,142 @@ _sequence-do = \
|
||||
$(words $(SEQUENCE_COUNT)) \
|
||||
$(call _sequence-do,$1))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into \$ to protect the $ from expansion in the shell.
|
||||
# To make this macro resilient against already escaped strings, first remove
|
||||
# any present escapes before escaping so that no double escapes are added.
|
||||
EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro works just like EscapeDollar above, but for #.
|
||||
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into $$ to protect the string from make itself.
|
||||
DoubleDollar = $(subst $$,$$$$,$(strip $1))
|
||||
|
||||
################################################################################
|
||||
# ShellQuote
|
||||
#
|
||||
# Quotes a string with single quotes and replaces single quotes with '\'' so
|
||||
# that the contents survives being given to the shell.
|
||||
ShellQuote = \
|
||||
$(SQUOTE)$(subst $(SQUOTE),$(SQUOTE)\$(SQUOTE)$(SQUOTE),$(strip $1))$(SQUOTE)
|
||||
|
||||
################################################################################
|
||||
# Write to and read from file
|
||||
|
||||
# Param 1 - File to read
|
||||
ReadFile = \
|
||||
$(shell $(CAT) $1)
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
WriteFile = \
|
||||
$(file >$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
WriteFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) > $2)
|
||||
endif
|
||||
|
||||
# Param 1 - Text to write
|
||||
# Param 2 - File to write to
|
||||
ifeq ($(HAS_FILE_FUNCTION), true)
|
||||
AppendFile = \
|
||||
$(file >>$2,$(strip $1))
|
||||
else
|
||||
# Use printf to get consistent behavior on all platforms.
|
||||
AppendFile = \
|
||||
$(shell $(PRINTF) "%s\n" $(strip $(call ShellQuote, $1)) >> $2)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Make directory without forking mkdir if not needed.
|
||||
#
|
||||
# If a directory with an encoded space is provided, the wildcard function
|
||||
# sometimes returns false answers (typically if the dir existed when the
|
||||
# makefile was parsed, but was deleted by a previous rule). In that case, always
|
||||
# call mkdir regardless of what wildcard says.
|
||||
#
|
||||
# 1: List of directories to create
|
||||
MakeDir = \
|
||||
$(strip \
|
||||
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, \
|
||||
$(if $(findstring ?, $d), '$(call DecodeSpace, $d)', \
|
||||
$(if $(wildcard $d), , $d) \
|
||||
) \
|
||||
))) \
|
||||
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Check if our build or target conforms to certain restrictions. This set of
|
||||
# functions all work in similar ways, testing the property that the name
|
||||
# implies, so e.g. isTargetCpu test the CPU of the target system.
|
||||
#
|
||||
# $1 - A property, or a space separated list of properties to test for.
|
||||
#
|
||||
# Returns true if the actual property matches one of the properties in the list,
|
||||
# and false otherwise.
|
||||
#
|
||||
# Examples: $(call isTargetOs, linux windows) will return true when executed
|
||||
# on either linux or windows, and false otherwise.
|
||||
# $(call isBuildCpuArch, x86) will return true iff the build CPU Arch is x86.
|
||||
|
||||
isTargetOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS), $1), true, false))
|
||||
|
||||
isTargetOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS_TYPE), $1), true, false))
|
||||
|
||||
isTargetCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU), $1), true, false))
|
||||
|
||||
isTargetCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_ARCH), $1), true, false))
|
||||
|
||||
isTargetCpuBits = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_BITS), $1), true, false))
|
||||
|
||||
isBuildOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS), $1), true, false))
|
||||
|
||||
isBuildOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_TYPE), $1), true, false))
|
||||
|
||||
isBuildOsEnv = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_ENV), $1), true, false))
|
||||
|
||||
isBuildCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU), $1), true, false))
|
||||
|
||||
isBuildCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU_ARCH), $1), true, false))
|
||||
|
||||
isCompiler = \
|
||||
$(strip $(if $(filter $(TOOLCHAIN_TYPE), $1), true, false))
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Common utility functions
|
||||
#
|
||||
################################################################################
|
||||
|
||||
### Debug functions
|
||||
|
||||
# Prints the name and value of a variable
|
||||
PrintVar = \
|
||||
$(info $(strip $1) >$($(strip $1))<)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Strip both arguments. Append the first argument to the second argument. If the
|
||||
# first argument is empty, return the empty string.
|
||||
IfAppend = \
|
||||
$(if $(strip $1),$(strip $1)$(strip $2),)
|
||||
|
||||
################################################################################
|
||||
# Replace question marks with space in string. This macro needs to be called on
|
||||
# files from FindFiles in case any of them contains space in their file name,
|
||||
# since FindFiles replaces space with ?.
|
||||
# Param 1 - String to replace in
|
||||
DecodeSpace = \
|
||||
$(subst ?,$(SPACE),$(strip $1))
|
||||
|
||||
EncodeSpace = \
|
||||
$(subst $(SPACE),?,$(strip $1))
|
||||
|
||||
################################################################################
|
||||
# Assign a variable only if it is empty
|
||||
# Param 1 - Variable to assign
|
||||
@@ -92,65 +216,6 @@ EncodeSpace = \
|
||||
SetIfEmpty = \
|
||||
$(if $($(strip $1)),,$(eval $(strip $1) := $2))
|
||||
|
||||
################################################################################
|
||||
# Take two paths and return the path of the last common directory.
|
||||
# Ex: /foo/bar/baz, /foo/bar/banan -> /foo/bar
|
||||
# foo/bar/baz, /foo/bar -> <empty>
|
||||
#
|
||||
# The x prefix is used to preserve the presence of the initial slash
|
||||
# On Windows paths are treated as case-insensitive
|
||||
#
|
||||
# $1 - Path to compare
|
||||
# $2 - Other path to compare
|
||||
FindCommonPathPrefix = \
|
||||
$(call DecodeSpace,$(patsubst x%,%,$(subst $(SPACE),/,$(strip \
|
||||
$(call FindCommonPathPrefixHelper1, \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $1))), \
|
||||
$(subst /,$(SPACE),x$(call EncodeSpace,$(strip $2)))) \
|
||||
))))
|
||||
|
||||
FindCommonPathPrefixHelper1 = \
|
||||
$(if $(filter $(OPENJDK_TARGET_OS), windows), \
|
||||
$(call FindCommonPathPrefixHelper2,$(call uppercase,$1),$(call uppercase,$2),$1), \
|
||||
$(call FindCommonPathPrefixHelper2,$1,$2,$1))
|
||||
|
||||
FindCommonPathPrefixHelper2 = \
|
||||
$(if $(call equals, $(firstword $1), $(firstword $2)), \
|
||||
$(if $(call equals, $(firstword $1),),, \
|
||||
$(firstword $3) \
|
||||
$(call FindCommonPathPrefixHelper2, \
|
||||
$(wordlist 2, $(words $1), $1), \
|
||||
$(wordlist 2, $(words $2), $2), \
|
||||
$(wordlist 2, $(words $3), $3) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Computes the relative path from a directory to a file
|
||||
# $1 - File to compute the relative path to
|
||||
# $2 - Directory to compute the relative path from
|
||||
RelativePath = \
|
||||
$(call DecodeSpace,$(strip $(call RelativePathHelper,$(call EncodeSpace \
|
||||
,$(strip $1)),$(call EncodeSpace \
|
||||
,$(strip $2)),$(call EncodeSpace \
|
||||
,$(call FindCommonPathPrefix,$1,$2)))))
|
||||
|
||||
RelativePathHelper = \
|
||||
$(eval $3_prefix_length := $(words $(subst /,$(SPACE),$3))) \
|
||||
$(eval $1_words := $(subst /,$(SPACE),$1)) \
|
||||
$(eval $2_words := $(subst /,$(SPACE),$2)) \
|
||||
$(if $(call equals,$($3_prefix_length),0),, \
|
||||
$(eval $1_words := $(wordlist 2,$(words $($1_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($1_words)),$($1_words)))) \
|
||||
$(eval $2_words := $(wordlist 2,$(words $($2_words)),$(wordlist \
|
||||
$($3_prefix_length),$(words $($2_words)),$($2_words)))) \
|
||||
) \
|
||||
$(eval $1_suffix := $(subst $(SPACE),/,$($1_words))) \
|
||||
$(eval $2_dotdots := $(subst $(SPACE),/,$(foreach d,$($2_words),..))) \
|
||||
$(if $($1_suffix), \
|
||||
$(if $($2_dotdots), $($2_dotdots)/$($1_suffix), $($1_suffix)), \
|
||||
$(if $($2_dotdots), $($2_dotdots), .))
|
||||
|
||||
################################################################################
|
||||
# Filter out duplicate sub strings while preserving order. Keeps the first occurrence.
|
||||
uniq = \
|
||||
@@ -173,14 +238,6 @@ dups = \
|
||||
$(strip $(foreach v, $(sort $1), $(if $(filter-out 1, \
|
||||
$(words $(filter $v, $1))), $v)))
|
||||
|
||||
# String equals
|
||||
equals = \
|
||||
$(if $(strip $1)$(strip $2),$(strip \
|
||||
$(and $(findstring $(strip $1),$(strip $2)),\
|
||||
$(findstring $(strip $2),$(strip $1)))), \
|
||||
true \
|
||||
)
|
||||
|
||||
# Remove a whole list of prefixes
|
||||
# $1 - List of prefixes
|
||||
# $2 - List of elements to process
|
||||
@@ -188,23 +245,6 @@ remove-prefixes = \
|
||||
$(strip $(if $1,$(patsubst $(firstword $1)%,%,\
|
||||
$(call remove-prefixes,$(filter-out $(firstword $1),$1),$2)),$2))
|
||||
|
||||
# Convert the string given to upper case, without any $(shell)
|
||||
# Inspired by http://lists.gnu.org/archive/html/help-make/2013-09/msg00009.html
|
||||
uppercase_table := a,A b,B c,C d,D e,E f,F g,G h,H i,I j,J k,K l,L m,M n,N o,O \
|
||||
p,P q,Q r,R s,S t,T u,U v,V w,W x,X y,Y z,Z
|
||||
|
||||
uppercase_internal = \
|
||||
$(if $(strip $1), $$(subst $(firstword $1), $(call uppercase_internal, \
|
||||
$(wordlist 2, $(words $1), $1), $2)), $2)
|
||||
|
||||
# Convert a string to upper case. Works only on a-z.
|
||||
# $1 - The string to convert
|
||||
uppercase = \
|
||||
$(strip \
|
||||
$(eval uppercase_result := $(call uppercase_internal, $(uppercase_table), $1)) \
|
||||
$(uppercase_result) \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Boolean operators.
|
||||
|
||||
@@ -290,14 +330,6 @@ define ParseKeywordVariableBody
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# ShellQuote
|
||||
#
|
||||
# Quotes a string with single quotes and replaces single quotes with '\'' so
|
||||
# that the contents survives being given to the shell.
|
||||
ShellQuote = \
|
||||
$(SQUOTE)$(subst $(SQUOTE),$(SQUOTE)\$(SQUOTE)$(SQUOTE),$(strip $1))$(SQUOTE)
|
||||
|
||||
################################################################################
|
||||
# Find lib dir for module
|
||||
# Param 1 - module name
|
||||
@@ -329,53 +361,6 @@ check-jvm-variant = \
|
||||
$(error Internal error: Invalid variant tested: $1)) \
|
||||
$(if $(filter $1, $(JVM_VARIANTS)), true, false))
|
||||
|
||||
################################################################################
|
||||
# Check if our build or target conforms to certain restrictions. This set of
|
||||
# functions all work in similar ways, testing the property that the name
|
||||
# implies, so e.g. isTargetCpu test the CPU of the target system.
|
||||
#
|
||||
# $1 - A property, or a space separated list of properties to test for.
|
||||
#
|
||||
# Returns true if the actual property matches one of the properties in the list,
|
||||
# and false otherwise.
|
||||
#
|
||||
# Examples: $(call isTargetOs, linux windows) will return true when executed
|
||||
# on either linux or windows, and false otherwise.
|
||||
# $(call isBuildCpuArch, x86) will return true iff the build CPU Arch is x86.
|
||||
|
||||
isTargetOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS), $1), true, false))
|
||||
|
||||
isTargetOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_OS_TYPE), $1), true, false))
|
||||
|
||||
isTargetCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU), $1), true, false))
|
||||
|
||||
isTargetCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_ARCH), $1), true, false))
|
||||
|
||||
isTargetCpuBits = \
|
||||
$(strip $(if $(filter $(OPENJDK_TARGET_CPU_BITS), $1), true, false))
|
||||
|
||||
isBuildOs = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS), $1), true, false))
|
||||
|
||||
isBuildOsType = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_TYPE), $1), true, false))
|
||||
|
||||
isBuildOsEnv = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_OS_ENV), $1), true, false))
|
||||
|
||||
isBuildCpu = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU), $1), true, false))
|
||||
|
||||
isBuildCpuArch = \
|
||||
$(strip $(if $(filter $(OPENJDK_BUILD_CPU_ARCH), $1), true, false))
|
||||
|
||||
isCompiler = \
|
||||
$(strip $(if $(filter $(TOOLCHAIN_TYPE), $1), true, false))
|
||||
|
||||
################################################################################
|
||||
# Converts a space separated list to a comma separated list.
|
||||
#
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
LIB_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
|
||||
CONF_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)
|
||||
LEGAL_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_legal/$(MODULE)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include Modules.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
@@ -122,12 +123,6 @@ define SetupBuildLauncherBody
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
$1_LIBS += -lz
|
||||
endif
|
||||
|
||||
$1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
|
||||
|
||||
$1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c
|
||||
|
||||
ifeq ($(ASAN_ENABLED), true)
|
||||
@@ -138,6 +133,10 @@ define SetupBuildLauncherBody
|
||||
$1_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.c
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
## Build launcher "$1"
|
||||
##############################################################################
|
||||
|
||||
$$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
|
||||
NAME := $1, \
|
||||
EXTRA_FILES := $$($1_EXTRA_FILES), \
|
||||
@@ -148,20 +147,20 @@ define SetupBuildLauncherBody
|
||||
-DPROGNAME='"$1"' \
|
||||
$$($1_CFLAGS), \
|
||||
CFLAGS_windows := $$($1_CFLAGS_windows), \
|
||||
EXTRA_HEADER_DIRS := java.base:libjvm, \
|
||||
DISABLED_WARNINGS_gcc := unused-function, \
|
||||
LDFLAGS := $$($1_LDFLAGS), \
|
||||
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
|
||||
-L$(call FindLibDirForModule, java.base), \
|
||||
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
|
||||
-L$(call FindLibDirForModule, java.base), \
|
||||
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
|
||||
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|
||||
LIBS_linux := -ljli -lpthread $(LIBDL), \
|
||||
LIBS_macosx := -ljli -framework Cocoa -framework Security \
|
||||
-framework ApplicationServices, \
|
||||
LIBS_aix := -ljli_static, \
|
||||
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
|
||||
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
|
||||
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
|
||||
JDK_LIBS := java.base:libjli, \
|
||||
JDK_LIBS_windows := java.base:libjava, \
|
||||
LIBS := $$($1_LIBS), \
|
||||
LIBS_unix := $(LIBZ_LIBS), \
|
||||
LIBS_linux := $(LIBDL) -lpthread, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework Security, \
|
||||
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
|
||||
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \
|
||||
@@ -174,15 +173,6 @@ define SetupBuildLauncherBody
|
||||
|
||||
$$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
|
||||
$$($1_WINDOWS_JLI_LIB)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
|
||||
endif
|
||||
|
||||
@@ -24,14 +24,3 @@
|
||||
#
|
||||
|
||||
include JdkNativeCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
# Absolute paths to lib files on windows for use in LIBS. Should figure out a more
|
||||
# elegant solution to this.
|
||||
WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
|
||||
|
||||
# Put the libraries here.
|
||||
INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -36,47 +36,35 @@ define CreateDebugSymbols
|
||||
$1_ZIP_EXTERNAL_DEBUG_SYMBOLS := $(ZIP_EXTERNAL_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
$1_CREATE_DEBUGINFO := false
|
||||
ifeq ($$($1_COPY_DEBUG_SYMBOLS), true)
|
||||
ifneq ($$($1_DEBUG_SYMBOLS), false)
|
||||
$$(call SetIfEmpty, $1_SYMBOLS_DIR, $$($1_OUTPUT_DIR))
|
||||
# Only copy debug symbols for dynamic libraries and programs.
|
||||
ifneq ($$($1_TYPE), STATIC_LIBRARY)
|
||||
# Generate debuginfo files.
|
||||
$1_CREATE_DEBUGINFO := true
|
||||
|
||||
# Setup where the platform specific debuginfo files end up
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).diz
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
$1_DEBUGINFO_FILES := \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME)
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).diz
|
||||
else ifeq ($(call isTargetOsType, unix), true)
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).diz
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb" \
|
||||
"-map:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map"
|
||||
ifeq ($(SHIP_DEBUG_SYMBOLS), public)
|
||||
$1_EXTRA_LDFLAGS += "-pdbstripped:$$($1_SYMBOLS_DIR)/$$($1_BASENAME).stripped.pdb"
|
||||
endif
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).pdb \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).map
|
||||
|
||||
else ifeq ($(call isTargetOs, linux), true)
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
# Setup the command line creating debuginfo files, to be run after linking.
|
||||
# It cannot be run separately since it updates the original target file
|
||||
# Creating the debuglink is done in another command rather than all at once
|
||||
# so we can run it after strip is called, since strip can sometimes mangle the
|
||||
# embedded debuglink, which we want to avoid.
|
||||
$1_CREATE_DEBUGINFO_CMDS := \
|
||||
$$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) && \
|
||||
$$(CHMOD) -x $$($1_DEBUGINFO_FILES)
|
||||
$1_CREATE_DEBUGLINK_CMDS := $(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# AIX does not provide the equivalent of OBJCOPY to extract debug symbols,
|
||||
# so we copy the compiled object with symbols to the .debuginfo file, which
|
||||
# happens prior to the STRIP_CMD on the original target object file.
|
||||
$1_DEBUGINFO_FILES := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
$1_CREATE_DEBUGINFO_CMDS := $(CP) $$($1_TARGET) $$($1_DEBUGINFO_FILES)
|
||||
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
$1_DEBUGINFO_FILES := \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \
|
||||
$$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME)
|
||||
$1_CREATE_DEBUGINFO_CMDS := \
|
||||
$(DSYMUTIL) --out $$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET)
|
||||
endif
|
||||
|
||||
# Since the link rule creates more than one file that we want to track,
|
||||
@@ -98,19 +86,13 @@ define CreateDebugSymbols
|
||||
$1 += $$($1_DEBUGINFO_FILES)
|
||||
|
||||
ifeq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_BASENAME).diz
|
||||
else
|
||||
$1_DEBUGINFO_ZIP := $$($1_SYMBOLS_DIR)/$$($1_NOSUFFIX).diz
|
||||
endif
|
||||
$1 += $$($1_DEBUGINFO_ZIP)
|
||||
|
||||
# The dependency on TARGET is needed for debuginfo files
|
||||
# to be rebuilt properly.
|
||||
$$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
$(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$(ZIPEXE) -q -r $$@ $$(subst $$($1_SYMBOLS_DIR)/,, $$($1_DEBUGINFO_FILES))
|
||||
|
||||
$1 += $$($1_DEBUGINFO_ZIP)
|
||||
endif
|
||||
endif # !STATIC_LIBRARY
|
||||
endif # $1_DEBUG_SYMBOLS != false
|
||||
|
||||
@@ -52,12 +52,9 @@ define SetupLinking
|
||||
# being copied.
|
||||
$$(call SetIfEmpty, $1_STRIP_SYMBOLS, $$($1_COPY_DEBUG_SYMBOLS))
|
||||
|
||||
ifneq ($$($1_STRIP_SYMBOLS), false)
|
||||
# Default to using the global STRIPFLAGS. Allow for overriding with an
|
||||
# empty value
|
||||
$1_STRIPFLAGS ?= $(STRIPFLAGS)
|
||||
$1_STRIP_CMD := $$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET)
|
||||
endif
|
||||
# Default to using the global STRIPFLAGS. Allow for overriding with an
|
||||
# empty value
|
||||
$1_STRIPFLAGS ?= $(STRIPFLAGS)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
@@ -78,7 +75,7 @@ define CreateStaticLibrary
|
||||
endif
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) $$($1_LIBS) \
|
||||
$1_VARDEPS := $$($1_AR) $$(ARFLAGS) $$($1_LIBS) \
|
||||
$$($1_EXTRA_LIBS)
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$1_VARDEPS += $$($1_LD) $$($1_SYSROOT_LDFLAGS)
|
||||
@@ -86,7 +83,7 @@ define CreateStaticLibrary
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG)
|
||||
# With clang on linux, partial linking is enabled and 'AR' takes the output
|
||||
@@ -109,14 +106,13 @@ define CreateStaticLibrary
|
||||
# Do partial linking.
|
||||
ifeq ($$($1_ENABLE_PARTIAL_LINKING), true)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_partial_link, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
|
||||
-o $$($1_TARGET_RELOCATABLE) \
|
||||
$$($1_LD_OBJ_ARG))
|
||||
-o $$($1_TARGET_RELOCATABLE) $$($1_LD_OBJ_ARG))
|
||||
endif
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) -r -cs $$($1_TARGET) \
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ar, \
|
||||
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_AR) $$(ARFLAGS) -r -cs $$($1_TARGET) \
|
||||
$$($1_AR_OBJ_ARG) $$($1_RES))
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
$(RM) $$(@D)/$$(basename $$(@F)).symbols; \
|
||||
@@ -135,13 +131,20 @@ define CreateDynamicLibraryOrExecutable
|
||||
$1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
|
||||
endif
|
||||
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
|
||||
$1_CODESIGN_OPTS := "$(MACOSX_CODESIGN_IDENTITY)" --timestamp \
|
||||
--options runtime
|
||||
else ifeq ($(MACOSX_CODESIGN_MODE), debug)
|
||||
$1_CODESIGN_OPTS := -
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
|
||||
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) \
|
||||
$$($1_CREATE_DEBUGINFO_CMDS) $$($1_STRIP_CMD) $$($1_CREATE_DEBUGLINK_CMDS)
|
||||
$$($1_DEBUGINFO_FILES) $$($1_STRIPFLAGS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
@@ -153,25 +156,48 @@ define CreateDynamicLibraryOrExecutable
|
||||
endif
|
||||
$$(call LogInfo, Linking $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ld, \
|
||||
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||
$$($1_SYSROOT_LDFLAGS) -o $$($1_TARGET) $$($1_LD_OBJ_ARG) \
|
||||
$$($1_LIBS) $$($1_EXTRA_LIBS))
|
||||
$$($1_CREATE_DEBUGINFO_CMDS)
|
||||
$$($1_STRIP_CMD)
|
||||
$$($1_CREATE_DEBUGLINK_CMDS)
|
||||
# On macosx, optionally run codesign on every binary.
|
||||
# Remove signature explicitly first to avoid warnings if the linker
|
||||
# added a default adhoc signature.
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
|
||||
$(CODESIGN) --remove-signature $$@
|
||||
$(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp \
|
||||
--options runtime --entitlements \
|
||||
$$(call GetEntitlementsFile, $$@) $$@
|
||||
else ifeq ($(MACOSX_CODESIGN_MODE), debug)
|
||||
$(CODESIGN) --remove-signature $$@
|
||||
$(CODESIGN) -f -s - --entitlements \
|
||||
$$(call GetEntitlementsFile, $$@) $$@
|
||||
ifeq ($$($1_CREATE_DEBUGINFO), true)
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# This cannot be run separately since it updates the original target
|
||||
# file.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_create_debuginfo, \
|
||||
$$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES))
|
||||
$$(CHMOD) -x $$($1_DEBUGINFO_FILES)
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# AIX does not provide the equivalent of objcopy to extract debug
|
||||
# symbols, so we copy unstripped library instead.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_create_debuginfo, \
|
||||
$(CP) $$($1_TARGET) $$($1_DEBUGINFO_FILES))
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_create_debuginfo, \
|
||||
$(DSYMUTIL) --out $$($1_SYMBOLS_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET))
|
||||
endif
|
||||
endif
|
||||
ifneq ($$($1_STRIP_SYMBOLS), false)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_strip, \
|
||||
$$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET))
|
||||
endif
|
||||
ifeq ($$($1_CREATE_DEBUGINFO), true)
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# Run this after strip is called, since strip can sometimes mangle
|
||||
# the embedded debuglink, which we want to avoid.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_add_debuginfo_link, \
|
||||
$(CD) $$($1_SYMBOLS_DIR) && \
|
||||
$$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET))
|
||||
endif
|
||||
endif
|
||||
ifneq ($(MACOSX_CODESIGN_MODE), disabled)
|
||||
# Remove signature explicitly first to avoid warnings if the linker
|
||||
# added a default adhoc signature.
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_codesign_clear, \
|
||||
$(CODESIGN) --remove-signature $$@)
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_codesign_add, \
|
||||
$(CODESIGN) -f -s $$($1_CODESIGN_OPTS) --entitlements \
|
||||
$$(call GetEntitlementsFile, $$@) $$@)
|
||||
endif
|
||||
endef
|
||||
|
||||
@@ -38,19 +38,22 @@ endef
|
||||
|
||||
################################################################################
|
||||
define CreateStaticLibraryMicrosoft
|
||||
$1_VARDEPS := $$($1_LIB) $$(LIBFLAGS) $$($1_LIBFLAGS) $$($1_LIBS) \
|
||||
$1_VARDEPS := $$($1_LIB) $$(LIBFLAGS) $$($1_LIBS) \
|
||||
$$($1_EXTRA_LIBS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_EXTRA_LINK_DEPS) \
|
||||
$$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
|
||||
endif
|
||||
$$(call LogInfo, Building static library $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$$($1_LIB) -nologo $$(LIBFLAGS) $$($1_LIBFLAGS) -out:$$($1_TARGET) \
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_lib, \
|
||||
$$($1_LIB) -nologo $$(LIBFLAGS) -out:$$($1_TARGET) \
|
||||
$$($1_LD_OBJ_ARG) $$($1_RES))
|
||||
endef
|
||||
|
||||
@@ -87,7 +90,7 @@ define CreateDynamicLibraryOrExecutableMicrosoft
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
|
||||
$$($1_VARDEPS_FILE)
|
||||
$$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
|
||||
|
||||
$$($1_TARGET): $$($1_TARGET_DEPS)
|
||||
ifneq ($$($1_OBJ_FILE_LIST), )
|
||||
@@ -95,7 +98,7 @@ define CreateDynamicLibraryOrExecutableMicrosoft
|
||||
endif
|
||||
$$(call LogInfo, Linking $$($1_BASENAME))
|
||||
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
|
||||
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ld, \
|
||||
$$($1_LD) -nologo $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||
$$($1_SYSROOT_LDFLAGS) -out:$$($1_TARGET) $$($1_LD_OBJ_ARG) \
|
||||
$$($1_RES) $$($1_LIBS) $$($1_EXTRA_LIBS)) \
|
||||
|
||||
@@ -29,17 +29,17 @@ GTEST_VERSION=1.14.0
|
||||
JTREG_VERSION=7.3.1+1
|
||||
|
||||
LINUX_X64_BOOT_JDK_EXT=tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=a30c454a9bef8f46d5f1bf3122830014a8fbe7ac03b5f8729bc3add4b92a1d0a
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=4d65cc6ed28711768fd72c2043a7925f7c83f5f51bb64970bd9d52f7791fc6ac
|
||||
|
||||
MACOS_X64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=af32e84c11009f72f783fdcdc9917efc277893988f097e198e2576875d1e88c1
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=ae31fe10916429e3fe284266095067a5ce9fecbdc03ff1a079d20459f731ca36
|
||||
|
||||
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_macos-aarch64_bin.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=f12e1e0a2dffc847951598f597c8ee60fb0913932f24b2b09c62cfd2f0f4dfb9
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_macos-aarch64_bin.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=d10f82429d01047968c52c7975c326388cb5d212791e14c1de21c987463a4b53
|
||||
|
||||
WINDOWS_X64_BOOT_JDK_EXT=zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk21/fd2272bbf8e04c3dbaee13770090416c/35/GPL/openjdk-21_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=5434faaf029e66e7ce6e75770ca384de476750984a7d2881ef7686894c4b4944
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=8f5138fecb53c08c20abd4fa6812f9400051f3852582a2142ffda0dff73a5824
|
||||
|
||||
@@ -390,8 +390,8 @@ var getJibProfilesCommon = function (input, data) {
|
||||
};
|
||||
};
|
||||
|
||||
common.boot_jdk_version = "21";
|
||||
common.boot_jdk_build_number = "35";
|
||||
common.boot_jdk_version = "22";
|
||||
common.boot_jdk_build_number = "36";
|
||||
common.boot_jdk_home = input.get("boot_jdk", "install_path") + "/jdk-"
|
||||
+ common.boot_jdk_version
|
||||
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -37,6 +37,6 @@ DEFAULT_VERSION_DATE=2024-09-17
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_VERSION_DOCS_API_SINCE=11
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22 23"
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
# Copy all built libraries into exploded jdk
|
||||
LIB_TARGETS := $(filter $(LIB_OUTPUTDIR)/%, $(TARGETS))
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -29,7 +29,7 @@ include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Execute.gmk
|
||||
include JavaCompilation.gmk
|
||||
include NativeCompilation.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
include HotspotCommon.gmk
|
||||
|
||||
@@ -68,16 +68,22 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
ADLC_LDFLAGS += $(UBSAN_LDFLAGS)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
|
||||
##############################################################################
|
||||
## Build adlc
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_ADLC, \
|
||||
NAME := adlc, \
|
||||
TYPE := EXECUTABLE, \
|
||||
TARGET_TYPE := BUILD, \
|
||||
LINK_TYPE := C++, \
|
||||
SRC := $(TOPDIR)/src/hotspot/share/adlc, \
|
||||
EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \
|
||||
DEFAULT_LDFLAGS := false, \
|
||||
LDFLAGS := $(ADLC_LDFLAGS), \
|
||||
LIBS := $(ADLC_LIBS), \
|
||||
DEFAULT_VERSIONINFO_RESOURCE := false, \
|
||||
OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
|
||||
OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
|
||||
DEBUG_SYMBOLS := false, \
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -26,14 +26,13 @@
|
||||
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileGtest.gmk))
|
||||
|
||||
GTEST_TEST_SRC += $(TOPDIR)/test/hotspot/gtest
|
||||
GTEST_LAUNCHER_SRC := $(TOPDIR)/test/hotspot/gtest/gtestLauncher.cpp
|
||||
|
||||
ifeq ($(ASAN_ENABLED), true)
|
||||
GTEST_LAUNCHER_SRC += $(TOPDIR)/make/data/asan/asan_default_options.cpp
|
||||
GTEST_LAUNCHER_EXTRA_FILES += $(TOPDIR)/make/data/asan/asan_default_options.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(LSAN_ENABLED), true)
|
||||
GTEST_LAUNCHER_SRC += $(TOPDIR)/make/data/lsan/lsan_default_options.cpp
|
||||
GTEST_LAUNCHER_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.cpp
|
||||
endif
|
||||
|
||||
# On Windows, there are no internal debug symbols so must set copying to true
|
||||
@@ -45,7 +44,8 @@ else
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
## Build libgtest
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
NAME := gtest, \
|
||||
@@ -76,8 +76,10 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
TARGETS += $(BUILD_GTEST_LIBGTEST)
|
||||
|
||||
################################################################################
|
||||
# Additional disabled warnings are due to code in the test source.
|
||||
## Build libjvm (for gtest)
|
||||
################################################################################
|
||||
|
||||
# Additional disabled warnings are due to code in the test source.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
NAME := jvm, \
|
||||
LINK_TYPE := C++, \
|
||||
@@ -108,10 +110,8 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
LD_SET_ORIGIN := false, \
|
||||
DEFAULT_LDFLAGS := false, \
|
||||
LDFLAGS := $(JVM_LDFLAGS), \
|
||||
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \
|
||||
JDK_LIBS := gtest:libgtest, \
|
||||
LIBS := $(JVM_LIBS), \
|
||||
LIBS_unix := -lgtest, \
|
||||
LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
|
||||
OPTIMIZATION := $(JVM_OPTIMIZATION), \
|
||||
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
|
||||
@@ -129,6 +129,8 @@ endif
|
||||
|
||||
TARGETS += $(BUILD_GTEST_LIBJVM)
|
||||
|
||||
################################################################################
|
||||
## Build gtestLauncher
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
|
||||
@@ -136,7 +138,9 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
|
||||
TYPE := EXECUTABLE, \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
|
||||
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
|
||||
SRC := $(TOPDIR)/test/hotspot/gtest, \
|
||||
INCLUDE_FILES := gtestLauncher.cpp, \
|
||||
EXTRA_FILES := $(GTEST_LAUNCHER_EXTRA_FILES), \
|
||||
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(JVM_CFLAGS) \
|
||||
@@ -145,15 +149,12 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googlemock \
|
||||
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \
|
||||
LD_SET_ORIGIN := false, \
|
||||
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := -ljvm, \
|
||||
LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
|
||||
LDFLAGS_unix := $(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
JDK_LIBS := gtest:libjvm, \
|
||||
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
|
||||
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
|
||||
))
|
||||
|
||||
$(BUILD_GTEST_LAUNCHER): $(BUILD_GTEST_LIBJVM)
|
||||
|
||||
TARGETS += $(BUILD_GTEST_LAUNCHER)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
# Include support files that will setup compiler flags due to the selected
|
||||
# jvm feature set, specific file overrides, and general flags.
|
||||
include lib/JvmFeatures.gmk
|
||||
@@ -128,7 +130,7 @@ endif
|
||||
JVM_OPTIMIZATION ?= HIGHEST_JVM
|
||||
|
||||
# Need to set JVM_STRIPFLAGS to the default value from SPEC since the STRIPFLAGS
|
||||
# parameter to SetupNativeCompilation allows an empty value to override the
|
||||
# parameter to SetupJdkLibrary allows an empty value to override the
|
||||
# default.
|
||||
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
|
||||
|
||||
@@ -159,7 +161,8 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Now set up the actual compilation of the main hotspot native library
|
||||
## Build libjvm
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
NAME := jvm, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -214,7 +214,6 @@ ifeq ($(call check-jvm-feature, opt-size), true)
|
||||
frame_x86.cpp \
|
||||
genCollectedHeap.cpp \
|
||||
generation.cpp \
|
||||
genMarkSweep.cpp \
|
||||
growableArray.cpp \
|
||||
handles.cpp \
|
||||
hashtable.cpp \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -73,7 +73,7 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
NONPIC_SRC := $(filter $(NONPIC_FILTER), $(ALL_SRC)) globals.cpp location.cpp
|
||||
# Declare variables for each source file that needs the pic flag like this:
|
||||
# BUILD_JVM_<srcfile>_CXXFLAGS := -fno-PIC
|
||||
# This will get implicitly picked up by SetupNativeCompilation below.
|
||||
# This will get implicitly picked up by SetupJdkLibrary below.
|
||||
$(foreach s, $(NONPIC_SRC), $(eval BUILD_LIBJVM_$(notdir $s)_CXXFLAGS := -fno-PIC))
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -28,11 +28,13 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call SetupCopyFiles, COPY_GTEST_$v, \
|
||||
SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/gtest, \
|
||||
DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
|
||||
FILES := $(call SHARED_LIBRARY,jvm) gtestLauncher$(EXECUTABLE_SUFFIX), \
|
||||
FILES := $(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) gtestLauncher$(EXECUTABLE_SUFFIX), \
|
||||
)) \
|
||||
$(eval TARGETS += $$(COPY_GTEST_$v)) \
|
||||
)
|
||||
|
||||
@@ -97,7 +97,7 @@ public class CLDRConverter {
|
||||
private static final String DST = "dst";
|
||||
private static final String NO_SUBST = "-";
|
||||
|
||||
private static SupplementDataParseHandler handlerSuppl;
|
||||
private static SupplementalDataParseHandler handlerSuppl;
|
||||
private static LikelySubtagsParseHandler handlerLikelySubtags;
|
||||
private static WinZonesParseHandler handlerWinZones;
|
||||
static PluralsParseHandler handlerPlurals;
|
||||
@@ -471,7 +471,7 @@ public class CLDRConverter {
|
||||
// SupplementalData file also provides the "parent" locales which
|
||||
// are othrwise not to be fallen back. Process them here as well.
|
||||
//
|
||||
handlerSuppl = new SupplementDataParseHandler();
|
||||
handlerSuppl = new SupplementalDataParseHandler();
|
||||
parseLDMLFile(new File(SPPL_SOURCE_FILE), handlerSuppl);
|
||||
Map<String, Object> parentData = handlerSuppl.getData("root");
|
||||
parentData.keySet().stream()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -38,11 +38,11 @@ import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Handles parsing of files in Locale Data Markup Language for SupplementData.xml
|
||||
* Handles parsing of files in Locale Data Markup Language for supplementalData.xml
|
||||
* and produces a map that uses the keys and values of JRE locale data.
|
||||
*/
|
||||
|
||||
class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
class SupplementalDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
//UNM49 region and composition code used in supplementalData.xml
|
||||
private static final String WORLD = "001";
|
||||
|
||||
@@ -73,7 +73,7 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
// "component" specific to this parent locale chain
|
||||
private String currentParentLocaleComponent;
|
||||
|
||||
SupplementDataParseHandler() {
|
||||
SupplementalDataParseHandler() {
|
||||
firstDayMap = new HashMap<>();
|
||||
minDaysMap = new HashMap<>();
|
||||
parentLocalesMap = new HashMap<>();
|
||||
@@ -132,32 +132,15 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
switch (qName) {
|
||||
case "firstDay":
|
||||
if (!isIgnored(attributes)) {
|
||||
String fd;
|
||||
|
||||
switch (attributes.getValue("day")) {
|
||||
case "sun":
|
||||
fd = "1";
|
||||
break;
|
||||
default:
|
||||
case "mon":
|
||||
fd = "2";
|
||||
break;
|
||||
case "tue":
|
||||
fd = "3";
|
||||
break;
|
||||
case "wed":
|
||||
fd = "4";
|
||||
break;
|
||||
case "thu":
|
||||
fd = "5";
|
||||
break;
|
||||
case "fri":
|
||||
fd = "6";
|
||||
break;
|
||||
case "sat":
|
||||
fd = "7";
|
||||
break;
|
||||
}
|
||||
String fd = switch (attributes.getValue("day")) {
|
||||
case "sun" -> "1";
|
||||
case "tue" -> "3";
|
||||
case "wed" -> "4";
|
||||
case "thu" -> "5";
|
||||
case "fri" -> "6";
|
||||
case "sat" -> "7";
|
||||
default -> "2"; // Mon
|
||||
};
|
||||
firstDayMap.put(attributes.getValue("territories"), fd);
|
||||
}
|
||||
break;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -36,7 +36,7 @@ import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Handles parsing of files in Locale Data Markup Language for
|
||||
* SupplementalMetadata.xml
|
||||
* supplementalMetadata.xml
|
||||
*/
|
||||
|
||||
class SupplementalMetadataParseHandler extends AbstractLDMLHandler<Object> {
|
||||
|
||||
@@ -43,14 +43,8 @@ public class CompilerThreadPool {
|
||||
this.pool = Executors.newFixedThreadPool(POOLSIZE);
|
||||
}
|
||||
|
||||
public int dispatchCompilation(String[] args) {
|
||||
Log log = Log.get();
|
||||
try {
|
||||
return pool.submit(() -> Server.runCompiler(log, args)).get();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("Error during compile", e);
|
||||
}
|
||||
public void execute(Runnable runnable) {
|
||||
this.pool.execute(runnable);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
|
||||
@@ -168,10 +168,8 @@ public class Server {
|
||||
do {
|
||||
try {
|
||||
Socket socket = serverSocket.accept();
|
||||
// Handle each incoming request in a separate thread. This is just for socket communication,
|
||||
// the actual compilation will be done by the threadpool.
|
||||
Thread requestHandler = new Thread(() -> handleRequest(socket));
|
||||
requestHandler.start();
|
||||
// Handle each incoming request in a threapool thread
|
||||
compilerThreadPool.execute(() -> handleRequest(socket));
|
||||
} catch (SocketException se) {
|
||||
// Caused by serverSocket.close() and indicates shutdown
|
||||
}
|
||||
@@ -206,9 +204,9 @@ public class Server {
|
||||
// If there has been any internal errors, notify client
|
||||
checkInternalErrorLog();
|
||||
|
||||
// Perform compilation. This will call runCompiler() on a
|
||||
// thread in the thread pool
|
||||
int exitCode = compilerThreadPool.dispatchCompilation(args);
|
||||
// Perform compilation
|
||||
int exitCode = runCompiler(args);
|
||||
|
||||
Protocol.sendExitCode(out, exitCode);
|
||||
|
||||
// Check for internal errors again.
|
||||
@@ -220,15 +218,14 @@ public class Server {
|
||||
// Not much to be done at this point. The client side request
|
||||
// code will most likely throw an IOException and the
|
||||
// compilation will fail.
|
||||
ex.printStackTrace();
|
||||
Log.error(ex);
|
||||
} finally {
|
||||
Log.setLogForCurrentThread(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static int runCompiler(Log log, String[] args) {
|
||||
Log.setLogForCurrentThread(log);
|
||||
|
||||
public static int runCompiler(String[] args) {
|
||||
// Direct logging to our byte array stream.
|
||||
StringWriter strWriter = new StringWriter();
|
||||
PrintWriter printWriter = new PrintWriter(strWriter);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -50,17 +50,16 @@ public class PortFile {
|
||||
// Followed by a 4 byte int, with the port nr.
|
||||
// Followed by a 8 byte long, with cookie nr.
|
||||
|
||||
private String filename;
|
||||
private File file;
|
||||
private File stopFile;
|
||||
private final String filename;
|
||||
private final File file;
|
||||
private final File stopFile;
|
||||
private RandomAccessFile rwfile;
|
||||
private FileChannel channel;
|
||||
|
||||
// FileLock used to solve inter JVM synchronization, lockSem used to avoid
|
||||
// JVM internal OverlappingFileLockExceptions.
|
||||
// Class invariant: lock.isValid() <-> lockSem.availablePermits() == 0
|
||||
private FileLock lock;
|
||||
private Semaphore lockSem = new Semaphore(1);
|
||||
private final Semaphore lockSem = new Semaphore(1);
|
||||
|
||||
private boolean containsPortInfo;
|
||||
private int serverPort;
|
||||
@@ -89,17 +88,18 @@ public class PortFile {
|
||||
}
|
||||
// The rwfile should only be readable by the owner of the process
|
||||
// and no other! How do we do that on a RandomAccessFile?
|
||||
channel = rwfile.getChannel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock the port file.
|
||||
*/
|
||||
public void lock() throws IOException, InterruptedException {
|
||||
if (channel == null) {
|
||||
initializeChannel();
|
||||
}
|
||||
lockSem.acquire();
|
||||
if (rwfile != null) {
|
||||
throw new IllegalStateException("rwfile not null");
|
||||
}
|
||||
initializeChannel();
|
||||
FileChannel channel = rwfile.getChannel();
|
||||
lock = channel.lock();
|
||||
}
|
||||
|
||||
@@ -110,8 +110,7 @@ public class PortFile {
|
||||
public void getValues() {
|
||||
containsPortInfo = false;
|
||||
if (lock == null) {
|
||||
// Not locked, remain ignorant about port file contents.
|
||||
return;
|
||||
throw new IllegalStateException("Must lock before calling getValues");
|
||||
}
|
||||
try {
|
||||
if (rwfile.length()>0) {
|
||||
@@ -156,6 +155,9 @@ public class PortFile {
|
||||
* Store the values into the locked port file.
|
||||
*/
|
||||
public void setValues(int port, long cookie) throws IOException {
|
||||
if (lock == null) {
|
||||
throw new IllegalStateException("Must lock before calling setValues");
|
||||
}
|
||||
rwfile.seek(0);
|
||||
// Write the magic nr that identifies a port file.
|
||||
rwfile.writeInt(magicNr);
|
||||
@@ -169,19 +171,19 @@ public class PortFile {
|
||||
* Delete the port file.
|
||||
*/
|
||||
public void delete() throws IOException, InterruptedException {
|
||||
// Access to file must be closed before deleting.
|
||||
rwfile.close();
|
||||
|
||||
file.delete();
|
||||
|
||||
// Wait until file has been deleted (deletes are asynchronous on Windows!) otherwise we
|
||||
if (!file.exists()) { // file deleted already
|
||||
return;
|
||||
}
|
||||
// Keep trying until file has been deleted, otherwise we
|
||||
// might shutdown the server and prevent another one from starting.
|
||||
for (int i = 0; i < 10 && file.exists(); i++) {
|
||||
for (int i = 0; i < 10 && file.exists() && !file.delete(); i++) {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
if (file.exists()) {
|
||||
throw new IOException("Failed to delete file.");
|
||||
}
|
||||
// allow some time for late clients to connect
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,10 +212,12 @@ public class PortFile {
|
||||
*/
|
||||
public void unlock() throws IOException {
|
||||
if (lock == null) {
|
||||
return;
|
||||
throw new IllegalStateException("Not locked");
|
||||
}
|
||||
lock.release();
|
||||
lock = null;
|
||||
rwfile.close();
|
||||
rwfile = null;
|
||||
lockSem.release();
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +246,18 @@ ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
|
||||
TARGETS += $(COPY_LIBFFI)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Copy tzmappings file for Windows
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \
|
||||
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \
|
||||
DEST := $(call FindLibDirForModule, $(MODULE)), \
|
||||
))
|
||||
|
||||
TARGETS += $(COPY_TZMAPPINGS)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Optionally copy hsdis into the image
|
||||
|
||||
|
||||
@@ -28,10 +28,13 @@ include LauncherCommon.gmk
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, modules/java.base/Launcher.gmk))
|
||||
|
||||
JAVA_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/launcher/java.rc
|
||||
JAVA_VERSION_INFO_RESOURCE := \
|
||||
$(TOPDIR)/src/java.base/windows/native/launcher/java.rc
|
||||
|
||||
JAVA_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
|
||||
################################################################################
|
||||
## Build java
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, java, \
|
||||
@@ -41,6 +44,10 @@ $(eval $(call SetupBuildLauncher, java, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
## Build javaw
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupBuildLauncher, javaw, \
|
||||
CFLAGS := -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
|
||||
@@ -49,19 +56,24 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
))
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build keytool
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, keytool, \
|
||||
MAIN_CLASS := sun.security.tools.keytool.Main, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
##############################################################################
|
||||
## Build jexec
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_JEXEC, \
|
||||
NAME := jexec, \
|
||||
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/launcher, \
|
||||
INCLUDE_FILES := jexec.c, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -I$(TOPDIR)/src/$(MODULE)/share/native/libjli, \
|
||||
EXTRA_HEADER_DIRS := libjli, \
|
||||
CFLAGS_linux := -fPIC, \
|
||||
LD_SET_ORIGIN := false, \
|
||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
|
||||
@@ -70,21 +82,21 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
TARGETS += $(BUILD_JEXEC)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOsType, unix), true)
|
||||
##############################################################################
|
||||
## Build jspawnhelper
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_JSPAWNHELPER, \
|
||||
NAME := jspawnhelper, \
|
||||
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(VERSION_CFLAGS) \
|
||||
-I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
|
||||
EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc$(OBJ_SUFFIX), \
|
||||
CFLAGS := $(VERSION_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := libjava, \
|
||||
EXTRA_OBJECT_FILES := \
|
||||
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc$(OBJ_SUFFIX), \
|
||||
LD_SET_ORIGIN := false, \
|
||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_JSPAWNHELPER)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
include LibCommon.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
@@ -37,7 +38,8 @@ $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))
|
||||
include lib/CoreLibraries.gmk
|
||||
|
||||
################################################################################
|
||||
# Create the network library
|
||||
## Build libnet
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
|
||||
NAME := net, \
|
||||
@@ -45,26 +47,28 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
|
||||
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := \
|
||||
deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_NetworkInterface.c := gnu-pointer-arith, \
|
||||
DISABLED_WARNINGS_microsoft_InetAddress.c := 4244, \
|
||||
DISABLED_WARNINGS_microsoft_ResolverConfigurationImpl.c := 4996, \
|
||||
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll \
|
||||
LDFLAGS_windows := -delayload:iphlpapi.dll -delayload:secur32.dll \
|
||||
-delayload:winhttp.dll, \
|
||||
LIBS_unix := -ljvm -ljava, \
|
||||
JDK_LIBS := libjava libjvm, \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL),\
|
||||
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \
|
||||
delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \
|
||||
LIBS_macosx := -framework CoreFoundation -framework CoreServices, \
|
||||
LIBS_windows := advapi32.lib delayimp.lib iphlpapi.lib secur32.lib \
|
||||
winhttp.lib ws2_32.lib, \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation \
|
||||
-framework CoreServices, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBNET): $(BUILD_LIBJAVA)
|
||||
|
||||
TARGETS += $(BUILD_LIBNET)
|
||||
|
||||
################################################################################
|
||||
# Create the nio library
|
||||
## Build libnio
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
|
||||
NAME := nio, \
|
||||
@@ -72,101 +76,91 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libnio/ch \
|
||||
libnio/fs \
|
||||
libnet, \
|
||||
LIBS_unix := -ljava -lnet, \
|
||||
LIBS_linux := -lpthread $(LIBDL), \
|
||||
libjvm, \
|
||||
JDK_LIBS := libjava libnet, \
|
||||
LIBS_linux := $(LIBDL) -lpthread, \
|
||||
LIBS_aix := $(LIBDL), \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation -framework CoreServices, \
|
||||
LIBS_windows := jvm.lib Mswsock.lib ws2_32.lib $(WIN_JAVA_LIB) \
|
||||
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
|
||||
advapi32.lib, \
|
||||
-framework CoreFoundation \
|
||||
-framework CoreServices, \
|
||||
LIBS_windows := advapi32.lib mswsock.lib ws2_32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBNIO)
|
||||
|
||||
$(BUILD_LIBNIO): $(BUILD_LIBNET)
|
||||
|
||||
################################################################################
|
||||
# Create the macosx security library
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libosxsecurity
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
|
||||
NAME := osxsecurity, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \
|
||||
LDFLAGS := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base,\
|
||||
LIBS := \
|
||||
-lobjc \
|
||||
-framework CoreServices \
|
||||
-framework Security \
|
||||
-framework Foundation \
|
||||
$(JDKLIB_LIBS), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXSECURITY)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
|
||||
NAME := osxsecurity, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \
|
||||
JDK_LIBS := libjava, \
|
||||
LIBS_macosx := -lobjc \
|
||||
-framework CoreServices \
|
||||
-framework Foundation \
|
||||
-framework Security, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXSECURITY)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Create the jsig library
|
||||
ifeq ($(call isTargetOsType, unix)+$(STATIC_BUILD), true+false)
|
||||
##############################################################################
|
||||
## Build libjsig
|
||||
##############################################################################
|
||||
|
||||
ifeq ($(call isTargetOsType, unix), true)
|
||||
ifeq ($(STATIC_BUILD), false)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
|
||||
NAME := jsig, \
|
||||
OPTIMIZATION := LOW, \
|
||||
jsig.c_CFLAGS := -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"', \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL), \
|
||||
))
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
|
||||
NAME := jsig, \
|
||||
OPTIMIZATION := LOW, \
|
||||
jsig.c_CFLAGS := -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"', \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJSIG)
|
||||
TARGETS += $(BUILD_LIBJSIG)
|
||||
|
||||
############################################################################
|
||||
# Create symlinks to libjsig in each JVM variant sub dir
|
||||
ifneq ($(STATIC_LIBS), true)
|
||||
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
|
||||
##############################################################################
|
||||
# Create symlinks to libjsig in each JVM variant sub dir
|
||||
ifneq ($(STATIC_LIBS), true)
|
||||
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
|
||||
LIBJSIG_NAME := $(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
|
||||
|
||||
# $1 variant subdir
|
||||
define CreateSymlinks
|
||||
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
|
||||
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
|
||||
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
|
||||
# $1 variant subdir
|
||||
define CreateSymlinks
|
||||
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
|
||||
$(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME): \
|
||||
$(LIB_OUTPUTDIR)/$(LIBJSIG_NAME)
|
||||
$$(call MakeDir, $$(@D))
|
||||
$(RM) $$@
|
||||
$(LN) -s ../$$(@F) $$@
|
||||
|
||||
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
|
||||
endef
|
||||
|
||||
# The subdir is the same as the variant
|
||||
$(foreach v, $(JVM_VARIANTS), $(eval $(call CreateSymlinks,$v)))
|
||||
endif
|
||||
############################################################################
|
||||
TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME)
|
||||
endef
|
||||
|
||||
# The subdir is the same as the variant
|
||||
$(foreach v, $(JVM_VARIANTS), $(eval $(call CreateSymlinks,$v)))
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Create the symbols file for static builds.
|
||||
|
||||
ifeq ($(STATIC_BUILD), true)
|
||||
STATIC_SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
|
||||
JAVA_BASE_EXPORT_SYMBOLS_SRC := \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jli.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)jli.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)java.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)net.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)nio.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)verify.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)zip.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)jimage.symbols \
|
||||
$(STATIC_SYMBOLS_DIR)/server/$(LIBRARY_PREFIX)jvm.symbols \
|
||||
#
|
||||
|
||||
JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols
|
||||
JAVA_BASE_EXPORT_SYMBOL_FILE := $(STATIC_SYMBOLS_DIR)/java.base.symbols
|
||||
|
||||
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC)
|
||||
$(call LogInfo, Generating java.base.symbols file)
|
||||
@@ -181,56 +175,48 @@ ifeq ($(STATIC_BUILD), true)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Copy tzmappings file for Windows
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \
|
||||
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \
|
||||
DEST := $(call FindLibDirForModule, $(MODULE)), \
|
||||
))
|
||||
TARGETS += $(COPY_TZMAPPINGS)
|
||||
endif
|
||||
|
||||
## Build libsyslookup
|
||||
################################################################################
|
||||
# Create system lookup
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_SYSLOOKUPLIB, \
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSYSLOOKUP, \
|
||||
NAME := syslookup, \
|
||||
LD_SET_ORIGIN := false, \
|
||||
LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \
|
||||
LDFLAGS_aix := -brtl -bexpfull, \
|
||||
LIBS_linux := -lm -ldl, \
|
||||
LIBS_aix := -lm -ldecNumber, \
|
||||
LIBS_linux := $(LIBDL) $(LIBM), \
|
||||
LIBS_aix := -ldecNumber $(LIBM), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_SYSLOOKUPLIB)
|
||||
|
||||
################################################################################
|
||||
# Create fallback linker lib
|
||||
TARGETS += $(BUILD_LIBSYSLOOKUP)
|
||||
|
||||
ifeq ($(ENABLE_FALLBACK_LINKER), true)
|
||||
##############################################################################
|
||||
## Build libfallbackLinker
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFALLBACKLINKER, \
|
||||
NAME := fallbackLinker, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
CFLAGS := $(LIBFFI_CFLAGS), \
|
||||
LIBS := $(LIBFFI_LIBS), \
|
||||
LIBS_windows := $(LIBFFI_LIBS) ws2_32.lib, \
|
||||
LIBS_windows := ws2_32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBFALLBACKLINKER)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)+$(filter $(TOOLCHAIN_TYPE), gcc), true+true+true+gcc)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIB_SIMD_SORT, \
|
||||
##############################################################################
|
||||
## Build libsimdsort
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSIMD_SORT, \
|
||||
NAME := simdsort, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CXXFLAGS := -std=c++17, \
|
||||
LIBS_linux := -lm -ldl, \
|
||||
LIBS_linux := $(LIBDL) $(LIBM), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIB_SIMD_SORT)
|
||||
TARGETS += $(BUILD_LIBSIMD_SORT)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -23,25 +23,27 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
##########################################################################################
|
||||
################################################################################
|
||||
## Build libverify
|
||||
################################################################################
|
||||
|
||||
LIBVERIFY_OPTIMIZATION := HIGH
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
|
||||
LIBVERIFY_OPTIMIZATION := LOW
|
||||
endif
|
||||
ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true)
|
||||
LIBVERIFY_OPTIMIZATION := LOW
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
|
||||
NAME := verify, \
|
||||
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
|
||||
LIBS_unix := -ljvm, \
|
||||
LIBS_windows := jvm.lib, \
|
||||
EXTRA_HEADER_DIRS := libjava, \
|
||||
JDK_LIBS := libjvm, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBVERIFY)
|
||||
|
||||
##########################################################################################
|
||||
################################################################################
|
||||
## Build libjava
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
|
||||
@@ -53,26 +55,24 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
|
||||
ProcessImpl_md.c_CFLAGS := $(VERSION_CFLAGS), \
|
||||
java_props_md.c_CFLAGS := -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"', \
|
||||
java_props_md.c_CFLAGS := \
|
||||
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"', \
|
||||
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
|
||||
LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
|
||||
LIBS_unix := -ljvm, \
|
||||
JDK_LIBS := libjvm, \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL) $(LIBM),\
|
||||
LIBS_macosx := -framework CoreFoundation \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation \
|
||||
-framework Foundation \
|
||||
-framework SystemConfiguration, \
|
||||
LIBS_windows := jvm.lib \
|
||||
shell32.lib ole32.lib \
|
||||
advapi32.lib version.lib, \
|
||||
LIBS_windows := advapi32.lib ole32.lib shell32.lib version.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAVA)
|
||||
|
||||
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
|
||||
|
||||
|
||||
##########################################################################################
|
||||
################################################################################
|
||||
## Build libzip
|
||||
################################################################################
|
||||
|
||||
BUILD_LIBZIP_EXCLUDES :=
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
@@ -92,31 +92,32 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
|
||||
DISABLED_WARNINGS_gcc_zip_util.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
|
||||
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
|
||||
LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \
|
||||
JDK_LIBS := libjava libjvm, \
|
||||
LIBS_unix := $(LIBZ_LIBS), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
|
||||
|
||||
TARGETS += $(BUILD_LIBZIP)
|
||||
|
||||
##########################################################################################
|
||||
################################################################################
|
||||
## Build libjimage
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
|
||||
NAME := jimage, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := libjava, \
|
||||
CFLAGS_unix := -UDEBUG, \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LIBS_unix := -ljvm -ldl, \
|
||||
LIBS_windows := jvm.lib, \
|
||||
JDK_LIBS := libjvm, \
|
||||
LIBS_unix := $(LIBDL), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
|
||||
|
||||
TARGETS += $(BUILD_LIBJIMAGE)
|
||||
|
||||
##########################################################################################
|
||||
################################################################################
|
||||
## Build libjli
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBJLI_EXCLUDE_FILES += java_md.c
|
||||
@@ -135,11 +136,10 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
|
||||
|
||||
ifneq ($(USE_EXTERNAL_LIBZ), true)
|
||||
# Extra files from the zlib.
|
||||
LIBJLI_EXTRA_FILE_LIST := inflate.c inftrees.c inffast.c zadler32.c zcrc32.c zutil.c
|
||||
LIBJLI_EXTRA_FILE_LIST := inflate.c inftrees.c inffast.c zadler32.c \
|
||||
zcrc32.c zutil.c
|
||||
|
||||
LIBJLI_EXTRA_FILES += \
|
||||
$(addprefix $(TOPDIR)/src/java.base/share/native/libzip/zlib/, \
|
||||
@@ -150,46 +150,33 @@ ifneq ($(USE_EXTERNAL_LIBZ), true)
|
||||
# static libraries, we use the --whole-archive linker option.
|
||||
# The duplicate objects in different static libraries cause linking
|
||||
# errors due to duplicate symbols.
|
||||
LIBJLI_STATIC_EXCLUDE_OBJS := $(subst .c,$(OBJ_SUFFIX),$(LIBJLI_EXTRA_FILE_LIST))
|
||||
LIBJLI_STATIC_EXCLUDE_OBJS := \
|
||||
$(subst .c,$(OBJ_SUFFIX),$(LIBJLI_EXTRA_FILE_LIST))
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
# AIX requires a static libjli because the compiler doesn't support '-rpath'
|
||||
BUILD_LIBJLI_TYPE := STATIC_LIBRARY
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
|
||||
NAME := jli, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
TYPE := $(BUILD_LIBJLI_TYPE), \
|
||||
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
||||
EXTRA_HEADER_DIRS := libjvm, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(LIBJLI_CFLAGS), \
|
||||
CFLAGS := $(LIBJLI_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := unused-function, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral deprecated-non-prototype, \
|
||||
LIBS_unix := $(LIBZ_LIBS), \
|
||||
LIBS_linux := $(LIBDL) -lpthread, \
|
||||
LIBS_aix := $(LIBDL),\
|
||||
LIBS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework Security, \
|
||||
LIBS_windows := advapi32.lib comctl32.lib user32.lib, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBJLI_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJLI)
|
||||
|
||||
LIBJLI_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, libjli)
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
# AIX also requires a static libjli because the compiler doesn't support '-rpath'
|
||||
$(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
|
||||
NAME := jli_static, \
|
||||
TYPE := STATIC_LIBRARY, \
|
||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
|
||||
SRC := $(LIBJLI_SRC_DIRS), \
|
||||
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
|
||||
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
|
||||
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
|
||||
DISABLED_WARNINGS_clang_aix := format-nonliteral deprecated-non-prototype, \
|
||||
ARFLAGS := $(ARFLAGS), \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
|
||||
|
||||
TARGETS += $(BUILD_LIBJLI_STATIC)
|
||||
|
||||
endif
|
||||
|
||||
@@ -35,12 +35,13 @@ $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native))
|
||||
################################################################################
|
||||
# Create the AWT/2D libraries
|
||||
|
||||
include lib/Awt2dLibraries.gmk
|
||||
|
||||
################################################################################
|
||||
# Create the libjsound library
|
||||
include lib/AwtLibraries.gmk
|
||||
include lib/ClientLibraries.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, aix), false)
|
||||
##############################################################################
|
||||
# Build libjsound
|
||||
##############################################################################
|
||||
|
||||
LIBJSOUND_CFLAGS := \
|
||||
$(ALSA_CFLAGS) \
|
||||
@@ -60,74 +61,70 @@ ifeq ($(call isTargetOs, aix), false)
|
||||
NAME := jsound, \
|
||||
LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
CFLAGS := $(LIBJSOUND_CFLAGS), \
|
||||
CXXFLAGS := $(LIBJSOUND_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := undef, \
|
||||
DISABLED_WARNINGS_clang := undef, \
|
||||
LIBS_unix := -ljava -ljvm, \
|
||||
LIBS_linux := $(ALSA_LIBS), \
|
||||
LIBS_macosx := -framework CoreAudio -framework CoreFoundation \
|
||||
-framework CoreServices -framework AudioUnit \
|
||||
-framework CoreMIDI -framework AudioToolbox, \
|
||||
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib dsound.lib winmm.lib user32.lib ole32.lib, \
|
||||
LIBS_macosx := \
|
||||
-framework AudioToolbox \
|
||||
-framework AudioUnit \
|
||||
-framework CoreAudio \
|
||||
-framework CoreFoundation \
|
||||
-framework CoreMIDI \
|
||||
-framework CoreServices, \
|
||||
LIBS_windows := advapi32.lib dsound.lib ole32.lib user32.lib winmm.lib, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBJSOUND): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBJSOUND)
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Create the macosx specific osxapp and osx libraries
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
# Build libosxapp
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXAPP, \
|
||||
NAME := osxapp, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_NSApplicationAWT.m := deprecated-declarations format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := objc-method-access, \
|
||||
LIBS := \
|
||||
-ljava \
|
||||
DISABLED_WARNINGS_clang_NSApplicationAWT.m := deprecated-declarations \
|
||||
format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := \
|
||||
objc-method-access, \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS_macosx := \
|
||||
-framework Accelerate \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework Security \
|
||||
-framework ExceptionHandling \
|
||||
-framework IOSurface \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework OpenGL \
|
||||
-framework IOSurface \
|
||||
-framework QuartzCore, \
|
||||
-framework QuartzCore \
|
||||
-framework Security, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBOSXAPP): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXAPP)
|
||||
|
||||
##############################################################################
|
||||
# Build libosx
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \
|
||||
NAME := osx, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := libosxapp, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
DISABLED_WARNINGS_clang_CFileManager.m := deprecated-declarations, \
|
||||
LDFLAGS := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.desktop, \
|
||||
LIBS := \
|
||||
-losxapp \
|
||||
-framework Cocoa \
|
||||
JDK_LIBS := libosxapp, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework SystemConfiguration \
|
||||
$(JDKLIB_LIBS), \
|
||||
-framework SystemConfiguration, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSX)
|
||||
|
||||
$(BUILD_LIBOSX): $(call FindLib, java.desktop, osxapp)
|
||||
|
||||
$(BUILD_LIBOSX): $(call FindLib, java.base, java)
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,946 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
|
||||
|
||||
LIBAWT_DEFAULT_HEADER_DIRS := \
|
||||
common/awt/utility \
|
||||
libawt/awt/image \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/loops \
|
||||
libawt/java2d/pipe \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
|
||||
NAME := mlib_image, \
|
||||
EXTRA_SRC := common/awt/medialib, \
|
||||
EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
|
||||
EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(BUILD_LIBMLIB_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := unused-function, \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
LIBS_unix := $(LIBM) $(LIBDL), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBMLIB_IMAGE)
|
||||
|
||||
################################################################################
|
||||
|
||||
LIBAWT_EXTRA_SRC := \
|
||||
common/awt/debug \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_EXTRA_SRC += \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux macosx aix), true)
|
||||
LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_EXFILES += \
|
||||
java2d/d3d/D3DShaderGen.c \
|
||||
awt/image/cvutils/img_colors.c \
|
||||
#
|
||||
endif
|
||||
|
||||
LIBAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
$(call GetJavaHeaderDir, java.base) \
|
||||
libawt/awt/medialib \
|
||||
libawt/java2d/d3d \
|
||||
libawt/java2d/opengl \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
common/awt/medialib \
|
||||
libmlib_image \
|
||||
include \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
|
||||
|
||||
LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
LIBAWT_CFLAGS += -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
|
||||
endif
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
# This option improves performance of MaskFill in Java2D by 20% for some gcc
|
||||
LIBAWT_CFLAGS += -fgcse-after-reload
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
NAME := awt, \
|
||||
EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
|
||||
EXCLUDES := $(LIBAWT_EXCLUDES), \
|
||||
EXCLUDE_FILES := $(LIBAWT_EXFILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(LIBAWT_CFLAGS), \
|
||||
CXXFLAGS := $(LIBAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_awt_LoadLibrary.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_debug_mem.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_ProcessPath.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_Region.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_SurfaceData.c := unused-value, \
|
||||
DISABLED_WARNINGS_gcc_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_awt_ImagingLib.c := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_debug_trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_Trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_microsoft := 4244 4996, \
|
||||
DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \
|
||||
LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
|
||||
-delayload:shell32.dll -delayload:winmm.dll \
|
||||
-delayload:winspool.drv -delayload:imm32.dll \
|
||||
-delayload:ole32.dll -delayload:comdlg32.dll \
|
||||
-delayload:comctl32.dll -delayload:shlwapi.dll, \
|
||||
LIBS_unix := -ljvm -ljava $(LIBM), \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL),\
|
||||
LIBS_macosx := -lmlib_image \
|
||||
-framework Cocoa \
|
||||
-framework OpenGL \
|
||||
-framework Metal \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox, \
|
||||
LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
|
||||
imm32.lib ole32.lib uuid.lib shell32.lib \
|
||||
comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
|
||||
delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib, \
|
||||
VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBAWT): $(call FindLib, java.base, java)
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
|
||||
endif
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBAWT_XAWT_EXTRA_SRC := \
|
||||
common/awt \
|
||||
common/java2d \
|
||||
common/font \
|
||||
#
|
||||
|
||||
LIBAWT_XAWT_EXCLUDES := medialib debug
|
||||
|
||||
LIBPIPEWIRE_HEADER_DIRS := \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/libpipewire/include
|
||||
|
||||
LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_xawt/awt \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/awt/systemscale \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
common/java2d/x11 \
|
||||
$(LIBPIPEWIRE_HEADER_DIRS)
|
||||
|
||||
LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
|
||||
$(FONTCONFIG_CFLAGS) \
|
||||
$(CUPS_CFLAGS)
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifeq ($(DISABLE_XRENDER), true)
|
||||
LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
LIBAWT_XAWT_LIBS += -lpthread
|
||||
endif
|
||||
|
||||
# These are the object files provided by the awt native
|
||||
# library. Do not include these external (non-awt_xawt library)
|
||||
# objects in the static library. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_XAWT_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
|
||||
NAME := awt_xawt, \
|
||||
EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBAWT_XAWT_CFLAGS) $(X_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := int-to-pointer-cast, \
|
||||
DISABLED_WARNINGS_gcc_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_gcc_GLXSurfaceData.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_gtk2_interface.c := parentheses type-limits, \
|
||||
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits unused-function, \
|
||||
DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \
|
||||
DISABLED_WARNINGS_gcc_screencast_portal.c := undef, \
|
||||
DISABLED_WARNINGS_gcc_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_gcc_X11SurfaceData.c := implicit-fallthrough pointer-to-int-cast, \
|
||||
DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \
|
||||
DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk2_interface.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk3_interface.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_screencast_pipewire.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_gtk2_interface.c := parentheses logical-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_gtk3_interface.c := parentheses logical-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := sign-compare, \
|
||||
LDFLAGS := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS := $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_XAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
|
||||
|
||||
$(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_XAWT)
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
# The fast floor code loses precision.
|
||||
LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR -DCMS_NO_HALF_SUPPORT
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LCMS), true)
|
||||
# If we're using an external library, we'll just need the wrapper part.
|
||||
# By including it explicitly, all other files will be excluded.
|
||||
BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBLCMS_HEADERS_FROM_SRC := false
|
||||
else
|
||||
BUILD_LIBLCMS_INCLUDE_FILES :=
|
||||
endif
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
ifeq ($(TOOLCHAIN_VERSION), 10.1)
|
||||
# Work around an optimizer bug seen with Xcode 10.1, but fixed by 10.3
|
||||
BUILD_LIBLCMS_cmsopt.c_CFLAGS := -O0
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
|
||||
NAME := lcms, \
|
||||
INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(LCMS_CFLAGS), \
|
||||
CFLAGS_windows := -DCMS_IS_WINDOWS_, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
common/awt/debug \
|
||||
libawt/java2d, \
|
||||
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc := format-nonliteral type-limits stringop-truncation, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral, \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS) $(LIBM), \
|
||||
LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBLCMS)
|
||||
|
||||
$(BUILD_LIBLCMS): $(BUILD_LIBAWT)
|
||||
|
||||
################################################################################
|
||||
|
||||
# "DISABLED_WARNINGS_gcc := clobbered" rationale:
|
||||
# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
|
||||
# or 'vfork'": this warning indicates that some variable is placed to
|
||||
# a register by optimized compiler and it's value might be lost on longjmp().
|
||||
# Recommended way to avoid such warning is to declare the variable as
|
||||
# volatile to prevent the optimization. However, this approach does not
|
||||
# work because we have to declare all variables as volatile in result.
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
LIBJPEG_LIBS := -ljpeg
|
||||
BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
|
||||
imageioJPEG.c \
|
||||
jpegdecoder.c
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBJPEG_HEADERS_FROM_SRC := false
|
||||
else
|
||||
LIBJPEG_LIBS :=
|
||||
BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
|
||||
NAME := javajpeg, \
|
||||
INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc_imageioJPEG.c := clobbered array-bounds, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
|
||||
LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBJAVAJPEG)
|
||||
|
||||
################################################################################
|
||||
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_SRC := \
|
||||
common/font \
|
||||
common/java2d \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXCLUDES := medialib
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
|
||||
-DHEADLESS=true
|
||||
|
||||
# These are the object files provided by the awt native
|
||||
# library. Do not include these external (non-awt_headless library)
|
||||
# objects in the static library. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBAWT_HEADLESS_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_X11SurfaceData.c := unused-function, \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS_unix := -lawt -ljvm -ljava, \
|
||||
LIBS_linux := $(LIBM) $(LIBDL), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_HEADLESS)
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), system)
|
||||
# For use by libfontmanager:
|
||||
LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
|
||||
LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
|
||||
else
|
||||
BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
|
||||
BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY
|
||||
|
||||
# For use by libfontmanager:
|
||||
LIBFREETYPE_CFLAGS := -I$(BUILD_LIBFREETYPE_HEADER_DIRS)
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
|
||||
# freetype now requires you to manually define this (see ftconfig.h)
|
||||
BUILD_LIBFREETYPE_CFLAGS += -DDLL_EXPORT
|
||||
else
|
||||
LIBFREETYPE_LIBS := -lfreetype
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
|
||||
NAME := freetype, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(BUILD_LIBFREETYPE_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_microsoft := 4267 4244 4996, \
|
||||
DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBFREETYPE)
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
|
||||
|
||||
ifeq ($(USE_EXTERNAL_HARFBUZZ), true)
|
||||
LIBFONTMANAGER_EXTRA_SRC =
|
||||
BUILD_LIBFONTMANAGER_FONTLIB += $(HARFBUZZ_LIBS)
|
||||
else
|
||||
LIBFONTMANAGER_EXTRA_SRC = libharfbuzz
|
||||
|
||||
ifeq ($(call isTargetOs, windows), false)
|
||||
HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
|
||||
-DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H \
|
||||
-DHB_NO_PRAGMA_GCC_DIAGNOSTIC
|
||||
endif
|
||||
ifeq ($(call isTargetOs, linux macosx), true)
|
||||
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES -DHB_NO_VISIBILITY
|
||||
endif
|
||||
|
||||
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
|
||||
# hb-subset and hb-style APIs are not needed, excluded to cut on compilation time.
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += hb-ft.cc hb-subset-cff-common.cc \
|
||||
hb-subset-cff1.cc hb-subset-cff2.cc hb-subset-input.cc hb-subset-plan.cc \
|
||||
hb-subset.cc hb-subset-instancer-solver.cc gsubgpos-context.cc hb-style.cc
|
||||
|
||||
# list of disabled warnings and the compilers for which it was specifically added.
|
||||
# array-bounds -> GCC 12 on Alpine Linux
|
||||
# parentheses -> GCC 6
|
||||
# range-loop-analysis -> clang on Xcode12
|
||||
|
||||
HARFBUZZ_DISABLED_WARNINGS_gcc := missing-field-initializers strict-aliasing \
|
||||
unused-result array-bounds parentheses
|
||||
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
|
||||
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
|
||||
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
|
||||
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
|
||||
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type \
|
||||
expansion-to-defined dangling-reference maybe-uninitialized \
|
||||
calloc-transposed-args
|
||||
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers range-loop-analysis
|
||||
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
|
||||
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
|
||||
libharfbuzz \
|
||||
common/awt \
|
||||
common/awt/utility \
|
||||
common/font \
|
||||
libawt/java2d \
|
||||
libawt/java2d/pipe \
|
||||
libawt/java2d/loops \
|
||||
#
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
|
||||
BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
|
||||
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
|
||||
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
# gcc (and to an extent clang) is particularly bad at optimizing these files,
|
||||
# causing a massive spike in compile time. We don't care about these
|
||||
# particular files anyway, so lower optimization level.
|
||||
BUILD_LIBFONTMANAGER_hb-subset.cc_OPTIMIZATION := SIZE
|
||||
BUILD_LIBFONTMANAGER_hb-subset-plan.cc_OPTIMIZATION := SIZE
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
|
||||
X11TextRenderer.c \
|
||||
fontpath.c \
|
||||
lcdglyph.c
|
||||
else
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
|
||||
lcdglyph.c
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
|
||||
# LDFLAGS clarification:
|
||||
# Filter relevant linker flags disallowing unresolved symbols as we cannot
|
||||
# build-time decide to which library to link against (libawt_headless or
|
||||
# libawt_xawt). See JDK-8196516 for details.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
NAME := fontmanager, \
|
||||
LINK_TYPE := C++, \
|
||||
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
|
||||
AccelGlyphCache.c, \
|
||||
CFLAGS := $(LIBFONTMANAGER_CFLAGS), \
|
||||
CXXFLAGS := $(LIBFONTMANAGER_CFLAGS), \
|
||||
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
|
||||
EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \
|
||||
DISABLED_WARNINGS_gcc := $(HARFBUZZ_DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_CXX_gcc := $(HARFBUZZ_DISABLED_WARNINGS_CXX_gcc), \
|
||||
DISABLED_WARNINGS_clang := $(HARFBUZZ_DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LDFLAGS_FILTER_OUT :=-Wl$(COMMA)-z$(COMMA)defs, \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_aix := -Wl$(COMMA)-berok, \
|
||||
LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
|
||||
LIBS_unix := -lawt -ljava -ljvm $(LIBM), \
|
||||
LIBS_macosx := -lawt_lwawt -framework CoreText -framework CoreFoundation -framework CoreGraphics, \
|
||||
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
|
||||
$(WIN_AWT_LIB), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
|
||||
endif
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), bundled)
|
||||
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBFREETYPE)
|
||||
endif
|
||||
|
||||
TARGETS += $(BUILD_LIBFONTMANAGER)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
LIBJAWT_CFLAGS := -EHsc -DUNICODE -D_UNICODE
|
||||
|
||||
LIBJAWT_EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/awt/utility \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetCpu, x86), true)
|
||||
KERNEL32_LIB := kernel32.lib
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
|
||||
NAME := jawt, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBJAWT_CFLAGS), \
|
||||
CXXFLAGS := $(LIBJAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
|
||||
))
|
||||
|
||||
$(BUILD_LIBJAWT): $(BUILD_LIBAWT)
|
||||
|
||||
$(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
|
||||
FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
|
||||
))
|
||||
|
||||
$(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
|
||||
|
||||
TARGETS += $(COPY_JAWT_LIB)
|
||||
|
||||
else # not windows
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# libjawt on macosx do not use the unix code
|
||||
LIBJAWT_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
JAWT_LIBS := -lawt_lwawt
|
||||
else
|
||||
JAWT_LIBS := -lawt
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
JAWT_LIBS += -lawt_xawt
|
||||
else
|
||||
JAWT_LIBS += -lawt_headless
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
JAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
|
||||
NAME := jawt, \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
|
||||
INCLUDE_FILES := $(JAWT_FILES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(JAWT_CFLAGS), \
|
||||
DISABLED_WARNINGS_clang_jawt.m := sign-compare, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
common/awt, \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
|
||||
LIBS_macosx := -framework Cocoa, \
|
||||
))
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
$(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
|
||||
else
|
||||
$(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_headless)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_lwawt)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
TARGETS += $(BUILD_LIBJAWT)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBSPLASHSCREEN_EXTRA_SRC := \
|
||||
common/awt/systemscale \
|
||||
#
|
||||
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += common/awt/utility
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES := giflib
|
||||
GIFLIB_LIBS := -lgif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), false)
|
||||
# While the following ought to work, it will currently pull in the closed
|
||||
# additions to this library, and this was not done previously in the build.
|
||||
# LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
|
||||
else
|
||||
LIBJPEG_LIBS := -ljpeg
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES += libpng
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# libsplashscreen on macosx do not use the unix code
|
||||
LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
|
||||
-DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifeq ($(call isTargetCpuArch, ppc), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
endif
|
||||
endif
|
||||
|
||||
# The external libpng submitted in the jdk is a reduced version
|
||||
# which does not contain .png_init_filter_functions_vsx.
|
||||
# Therefore we need to disable PNG_POWERPC_VSX_OPT explicitly by setting
|
||||
# it to 0. If this define is not set, it would be automatically set to 2,
|
||||
# because
|
||||
# "#if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)"
|
||||
# expands to true. This would results in the fact that
|
||||
# .png_init_filter_functions_vsx is needed in libpng.
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
ifeq ($(TOOLCHAIN_TYPE), clang)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
|
||||
|
||||
BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
|
||||
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
|
||||
else
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_LIBS :=
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBSPLASHSCREEN_LIBS += \
|
||||
$(LIBM) -lpthread -liconv -losxapp \
|
||||
-framework ApplicationServices \
|
||||
-framework Foundation \
|
||||
-framework Security \
|
||||
-framework Cocoa \
|
||||
-framework Metal
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
|
||||
else
|
||||
LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += \
|
||||
libosxapp \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
|
||||
NAME := splashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
|
||||
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
|
||||
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
CXXFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_pngerror.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_gfx_impl.c := implicit-fallthrough maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_impl.c := implicit-fallthrough sign-compare unused-function, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits unused-result, \
|
||||
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_png.c := incompatible-pointer-types, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_sys.m := deprecated-declarations, \
|
||||
DISABLED_WARNINGS_microsoft_dgif_lib.c := 4018 4267, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
|
||||
LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_windows := -delayload:user32.dll, \
|
||||
LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
|
||||
$(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
|
||||
LIBS_aix := -liconv, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSPLASHSCREEN)
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
|
||||
LIBAWT_LWAWT_EXTRA_SRC := \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_lwawt/awt \
|
||||
libawt_lwawt/font \
|
||||
libawt_lwawt/java2d/opengl \
|
||||
libawt_lwawt/java2d/metal \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/java2d/opengl \
|
||||
libosxapp \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
|
||||
|
||||
LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
|
||||
NAME := awt_lwawt, \
|
||||
EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
|
||||
INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
|
||||
EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
|
||||
EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBAWT_LWAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_clang := incomplete-implementation deprecated-declarations \
|
||||
objc-method-access incompatible-pointer-types extra-tokens sign-compare undef, \
|
||||
DISABLED_WARNINGS_clang_AWTWindow.m := bitwise-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_CFileDialog.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_CGGlyphImages.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_CGLLayer.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_ImageSurfaceData.m := enum-conversion parentheses-equality, \
|
||||
DISABLED_WARNINGS_clang_MTLBlitLoops.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_MTLPipelineStatesStorage.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_MTLRenderer.m := gnu-folding-constant, \
|
||||
DISABLED_WARNINGS_clang_MTLVertexCache.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \
|
||||
LDFLAGS := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
|
||||
-framework Accelerate \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework Metal \
|
||||
-framework Security \
|
||||
-framework ExceptionHandling \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore -ljava, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_LWAWT)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
|
||||
|
||||
$(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
SHADERS_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal
|
||||
SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui
|
||||
SHADERS_AIR := $(SHADERS_SUPPORT_DIR)/shaders.air
|
||||
SHADERS_LIB := $(INSTALL_LIBRARIES_HERE)/shaders.metallib
|
||||
|
||||
$(eval $(call SetupExecute, metal_shaders, \
|
||||
INFO := Running metal on $(notdir $(SHADERS_SRC)) (for libosxui.dylib), \
|
||||
DEPS := $(SHADERS_SRC), \
|
||||
OUTPUT_FILE := $(SHADERS_AIR), \
|
||||
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
|
||||
COMMAND := $(METAL) -c -std=osx-metal2.0 \
|
||||
-mmacosx-version-min=$(MACOSX_VERSION_MIN) \
|
||||
-o $(SHADERS_AIR) $(SHADERS_SRC), \
|
||||
))
|
||||
|
||||
$(eval $(call SetupExecute, metallib_shaders, \
|
||||
INFO := Running metallib on $(notdir $(SHADERS_AIR)) (for libosxui.dylib), \
|
||||
DEPS := $(SHADERS_AIR), \
|
||||
OUTPUT_FILE := $(SHADERS_LIB), \
|
||||
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
|
||||
COMMAND := $(METALLIB) -o $(SHADERS_LIB) $(SHADERS_AIR), \
|
||||
))
|
||||
|
||||
TARGETS += $(SHADERS_LIB)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
|
||||
NAME := osxui, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libawt_lwawt/awt \
|
||||
libosxapp, \
|
||||
DISABLED_WARNINGS_clang_AquaFileView.m := deprecated-declarations sign-compare, \
|
||||
DISABLED_WARNINGS_clang_ScreenMenu.m := deprecated-declarations, \
|
||||
APPEND_LDFLAGS := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
LDFLAGS := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS := -lawt -losxapp -lawt_lwawt \
|
||||
-framework Cocoa \
|
||||
-framework Metal \
|
||||
-framework Carbon \
|
||||
-framework ApplicationServices \
|
||||
-framework JavaRuntimeSupport \
|
||||
-ljava -ljvm, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXUI)
|
||||
$(BUILD_LIBOSXUI): $(SHADERS_LIB)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
|
||||
|
||||
endif
|
||||
426
make/modules/java.desktop/lib/AwtLibraries.gmk
Normal file
426
make/modules/java.desktop/lib/AwtLibraries.gmk
Normal file
@@ -0,0 +1,426 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
################################################################################
|
||||
# This file will build all AWT/2D native libraries with "awt" in the name.
|
||||
# Note that this does not imply that the code they bring in belong to AWT.
|
||||
# This split is purely made to keep the size of the Makefiles reasonable.
|
||||
|
||||
LIBAWT_DEFAULT_HEADER_DIRS := \
|
||||
common/awt/utility \
|
||||
libawt/awt/image \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/loops \
|
||||
libawt/java2d/pipe \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
## Build libawt
|
||||
################################################################################
|
||||
|
||||
LIBAWT_EXTRA_SRC := \
|
||||
common/awt/debug \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_EXTRA_SRC += \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux macosx aix), true)
|
||||
LIBAWT_EXCLUDE_FILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBAWT_EXCLUDE_FILES += initIDs.c img_colors.c
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_EXCLUDE_FILES += D3DShaderGen.c img_colors.c
|
||||
endif
|
||||
|
||||
LIBAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
$(call GetJavaHeaderDir, java.base) \
|
||||
libawt/awt/medialib \
|
||||
libawt/java2d/d3d \
|
||||
libawt/java2d/opengl \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
common/awt/medialib \
|
||||
libmlib_image \
|
||||
include \
|
||||
#
|
||||
|
||||
LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
LIBAWT_CFLAGS += -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
LIBAWT_VERSIONINFO_RESOURCE := \
|
||||
$(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
|
||||
endif
|
||||
|
||||
# -fgcse-after-reload improves performance of MaskFill in Java2D by 20% for
|
||||
# some gcc
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
NAME := awt, \
|
||||
EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
|
||||
EXCLUDE_FILES := $(LIBAWT_EXCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
|
||||
CXXFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
|
||||
CFLAGS_gcc := -fgcse-after-reload, \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_awt_LoadLibrary.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_debug_mem.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_ProcessPath.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_Region.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_SurfaceData.c := unused-value, \
|
||||
DISABLED_WARNINGS_gcc_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_awt_ImagingLib.c := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_debug_trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_Trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_microsoft := 4244 4996, \
|
||||
DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \
|
||||
LDFLAGS_windows := -delayload:comctl32.dll -delayload:comdlg32.dll \
|
||||
-delayload:gdi32.dll -delayload:imm32.dll -delayload:ole32.dll \
|
||||
-delayload:shell32.dll -delayload:shlwapi.dll -delayload:user32.dll \
|
||||
-delayload:winmm.dll -delayload:winspool.drv, \
|
||||
JDK_LIBS := java.base:libjava java.base:libjvm, \
|
||||
LIBS_unix := $(LIBM), \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL),\
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Cocoa \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal \
|
||||
-framework OpenGL, \
|
||||
LIBS_windows := advapi32.lib comctl32.lib comdlg32.lib delayimp.lib \
|
||||
gdi32.lib imm32.lib kernel32.lib ole32.lib shell32.lib shlwapi.lib \
|
||||
user32.lib uuid.lib winmm.lib winspool.lib, \
|
||||
VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT)
|
||||
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
##############################################################################
|
||||
## Build libawt_headless
|
||||
##############################################################################
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_SRC := \
|
||||
common/font \
|
||||
common/java2d \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
# These are the object files provided by the awt native
|
||||
# library. Do not include these external (non-awt_headless library)
|
||||
# objects in the static library. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := medialib, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \
|
||||
$(X_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_X11SurfaceData.c := unused-function, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_linux := $(LIBDL) $(LIBM), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_HEADLESS)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
##############################################################################
|
||||
## Build libawt_xawt
|
||||
##############################################################################
|
||||
|
||||
LIBAWT_XAWT_EXTRA_SRC := \
|
||||
common/awt \
|
||||
common/java2d \
|
||||
common/font \
|
||||
#
|
||||
|
||||
LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_xawt/awt \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/awt/systemscale \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
common/java2d/x11 \
|
||||
libpipewire/include \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifeq ($(DISABLE_XRENDER), true)
|
||||
LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
|
||||
endif
|
||||
endif
|
||||
|
||||
# These are the object files provided by the awt native
|
||||
# library. Do not include these external (non-awt_xawt library)
|
||||
# objects in the static library. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_XAWT_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
|
||||
NAME := awt_xawt, \
|
||||
EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := medialib debug, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DXAWT -DXAWT_HACK $(LIBAWT_XAWT_CFLAGS) \
|
||||
$(FONTCONFIG_CFLAGS) $(CUPS_CFLAGS) $(X_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := int-to-pointer-cast, \
|
||||
DISABLED_WARNINGS_gcc_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_gcc_GLXSurfaceData.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_gtk2_interface.c := parentheses type-limits, \
|
||||
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits \
|
||||
unused-function, \
|
||||
DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \
|
||||
DISABLED_WARNINGS_gcc_screencast_portal.c := undef, \
|
||||
DISABLED_WARNINGS_gcc_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_gcc_X11SurfaceData.c := implicit-fallthrough \
|
||||
pointer-to-int-cast, \
|
||||
DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \
|
||||
DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk2_interface.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk3_interface.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_screencast_pipewire.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_gtk2_interface.c := parentheses \
|
||||
logical-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_gtk3_interface.c := parentheses \
|
||||
logical-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := \
|
||||
parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := sign-compare, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_unix := $(LIBDL) $(LIBM) $(X_LIBS) -lX11 -lXext -lXi -lXrender \
|
||||
-lXtst, \
|
||||
LIBS_linux := -lpthread, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_XAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_XAWT)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libawt_lwawt
|
||||
##############################################################################
|
||||
|
||||
LIBAWT_LWAWT_EXTRA_SRC := \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_lwawt/awt \
|
||||
libawt_lwawt/font \
|
||||
libawt_lwawt/java2d/opengl \
|
||||
libawt_lwawt/java2d/metal \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/java2d/opengl \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_EXCLUDE_FILES := fontpath.c awt_Font.c X11Color.c
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
|
||||
NAME := awt_lwawt, \
|
||||
EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
|
||||
EXCLUDE_FILES := $(LIBAWT_LWAWT_EXCLUDE_FILES), \
|
||||
EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_clang := incomplete-implementation \
|
||||
deprecated-declarations objc-method-access \
|
||||
incompatible-pointer-types extra-tokens sign-compare undef, \
|
||||
DISABLED_WARNINGS_clang_AWTWindow.m := bitwise-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_CFileDialog.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_CGGlyphImages.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_CGLLayer.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_ImageSurfaceData.m := enum-conversion \
|
||||
parentheses-equality, \
|
||||
DISABLED_WARNINGS_clang_MTLBlitLoops.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_MTLPipelineStatesStorage.m := \
|
||||
semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_MTLRenderer.m := gnu-folding-constant, \
|
||||
DISABLED_WARNINGS_clang_MTLVertexCache.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \
|
||||
JDK_LIBS := libawt java.base:libjava libosxapp, \
|
||||
LIBS_macosx := $(LIBM) \
|
||||
-framework Accelerate \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework ExceptionHandling \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal \
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore \
|
||||
-framework Security, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_LWAWT)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libjawt
|
||||
################################################################################
|
||||
|
||||
LIBJAWT_EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBJAWT_EXTRA_HEADER_DIRS += \
|
||||
common/awt/debug \
|
||||
common/awt/utility \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
java.base:libjvm \
|
||||
#
|
||||
else
|
||||
LIBJAWT_EXTRA_HEADER_DIRS += \
|
||||
common/awt \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# libjawt on macosx does not use the unix code
|
||||
LIBJAWT_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(ENABLE_HEADLESS_ONLY), true+true)
|
||||
LIBJAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows)+$(call isTargetCpu, x86), true+true)
|
||||
LIBJAWT_LIBS_windows := kernel32.lib
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOsType, unix)+$(call isTargetOs, macosx), true+false)
|
||||
LIBJAWT_JDK_LIBS_unix := libawt
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LIBJAWT_JDK_LIBS_unix += libawt_xawt
|
||||
else
|
||||
LIBJAWT_JDK_LIBS_unix += libawt_headless
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
|
||||
NAME := jawt, \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBJAWT_CFLAGS), \
|
||||
CFLAGS_windows := -EHsc -DUNICODE -D_UNICODE, \
|
||||
CXXFLAGS_windows := -EHsc -DUNICODE -D_UNICODE, \
|
||||
DISABLED_WARNINGS_clang_jawt.m := sign-compare, \
|
||||
EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
|
||||
LDFLAGS_windows := $(LDFLAGS_CXX_JDK), \
|
||||
LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
JDK_LIBS_unix := $(LIBJAWT_JDK_LIBS_unix), \
|
||||
JDK_LIBS_windows := libawt, \
|
||||
JDK_LIBS_macosx := libawt_lwawt, \
|
||||
LIBS_macosx := -framework Cocoa, \
|
||||
LIBS_windows := advapi32.lib $(LIBJAWT_LIBS_windows), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAWT)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
|
||||
FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
|
||||
))
|
||||
|
||||
$(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
|
||||
|
||||
TARGETS += $(COPY_JAWT_LIB)
|
||||
endif
|
||||
453
make/modules/java.desktop/lib/ClientLibraries.gmk
Normal file
453
make/modules/java.desktop/lib/ClientLibraries.gmk
Normal file
@@ -0,0 +1,453 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file will build all AWT/2D native libraries that does not have "awt" in
|
||||
# the name. Note that this does not imply anything about the logical ownership
|
||||
# of the code they compile.
|
||||
# This split is purely made to keep the size of the Makefiles reasonable.
|
||||
|
||||
################################################################################
|
||||
## Build libmlib_image
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
LIBMLIB_IMAGE_CFLAGS := -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
|
||||
NAME := mlib_image, \
|
||||
EXTRA_SRC := common/awt/medialib, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH \
|
||||
$(LIBMLIB_IMAGE_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := unused-function, \
|
||||
LIBS_unix := $(LIBDL) $(LIBM), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBMLIB_IMAGE)
|
||||
|
||||
################################################################################
|
||||
## Build liblcms
|
||||
################################################################################
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LCMS), true)
|
||||
# If we're using an external library, we'll just need the wrapper part.
|
||||
# By including it explicitly, all other files will be excluded.
|
||||
LIBLCMS_INCLUDE_FILES := LCMS.c
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBLCMS_HEADERS_FROM_SRC := false
|
||||
# FIXME: Keep old behavior and reset LCMS_CFLAGS. This is likely a bug.
|
||||
LCMS_CFLAGS :=
|
||||
endif
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE)+$(TOOLCHAIN_VERSION), clang+10.1)
|
||||
# Work around an optimizer bug seen with Xcode 10.1, but fixed by 10.3
|
||||
BUILD_LIBLCMS_cmsopt.c_CFLAGS := -O0
|
||||
endif
|
||||
|
||||
# We use CMS_DONT_USE_FAST_FLOOR and CMS_NO_HALF_SUPPORT since the fast floor
|
||||
# code loses precision.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
|
||||
NAME := lcms, \
|
||||
INCLUDE_FILES := $(LIBLCMS_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -DCMS_DONT_USE_FAST_FLOOR -DCMS_NO_HALF_SUPPORT $(LCMS_CFLAGS), \
|
||||
CFLAGS_windows := -DCMS_IS_WINDOWS_, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
common/awt/debug \
|
||||
libawt/java2d \
|
||||
java.base:libjvm, \
|
||||
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc := format-nonliteral type-limits \
|
||||
stringop-truncation, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_unix := $(LCMS_LIBS) $(LIBM), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBLCMS)
|
||||
|
||||
################################################################################
|
||||
## Build libjavajpeg
|
||||
################################################################################
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
LIBJAVAJPEG_INCLUDE_FILES := \
|
||||
imageioJPEG.c \
|
||||
jpegdecoder.c
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBJAVAJPEG_HEADERS_FROM_SRC := false
|
||||
endif
|
||||
|
||||
# "DISABLED_WARNINGS_gcc := clobbered" rationale:
|
||||
# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
|
||||
# or 'vfork'": this warning indicates that some variable is placed to
|
||||
# a register by optimized compiler and it's value might be lost on longjmp().
|
||||
# Recommended way to avoid such warning is to declare the variable as
|
||||
# volatile to prevent the optimization. However, this approach does not
|
||||
# work because we have to declare all variables as volatile in result.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
|
||||
NAME := javajpeg, \
|
||||
INCLUDE_FILES := $(LIBJAVAJPEG_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
HEADERS_FROM_SRC := $(LIBJAVAJPEG_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc_imageioJPEG.c := clobbered array-bounds, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS := $(LIBJPEG_LIBS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAVAJPEG)
|
||||
|
||||
################################################################################
|
||||
## Build libsplashscreen
|
||||
################################################################################
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC := \
|
||||
common/awt/systemscale \
|
||||
#
|
||||
|
||||
LIBSPLASHSCREEN_HEADER_DIRS := \
|
||||
common/awt/utility \
|
||||
libosxapp \
|
||||
java.base:libjava \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES += giflib
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES += libpng
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
|
||||
-DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(call isTargetCpuArch, ppc), true+true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
endif
|
||||
|
||||
# The external libpng submitted in the jdk is a reduced version
|
||||
# which does not contain .png_init_filter_functions_vsx.
|
||||
# Therefore we need to disable PNG_POWERPC_VSX_OPT explicitly by setting
|
||||
# it to 0. If this define is not set, it would be automatically set to 2,
|
||||
# because
|
||||
# "#if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)"
|
||||
# expands to true. This would results in the fact that
|
||||
# .png_init_filter_functions_vsx is needed in libpng.
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# libsplashscreen on macosx does not use the unix code
|
||||
LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
|
||||
BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
|
||||
else
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
|
||||
NAME := splashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
|
||||
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
|
||||
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
CXXFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_pngerror.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_gfx_impl.c := implicit-fallthrough \
|
||||
maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_impl.c := implicit-fallthrough \
|
||||
sign-compare unused-function, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits unused-result, \
|
||||
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_png.c := \
|
||||
incompatible-pointer-types, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_sys.m := deprecated-declarations, \
|
||||
DISABLED_WARNINGS_microsoft_dgif_lib.c := 4018 4267, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
|
||||
LDFLAGS_windows := -delayload:user32.dll, \
|
||||
JDK_LIBS_windows := java.base:libjava, \
|
||||
JDK_LIBS_macosx := libosxapp, \
|
||||
LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS), \
|
||||
LIBS_unix := $(LIBM) -lpthread, \
|
||||
LIBS_linux := $(LIBDL) $(X_LIBS) -lX11 -lXext, \
|
||||
LIBS_macosx := -liconv \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework Foundation \
|
||||
-framework Metal \
|
||||
-framework Security, \
|
||||
LIBS_aix := $(LIBDL) -liconv $(X_LIBS) -lX11 -lXext, \
|
||||
LIBS_windows := delayimp.lib gdi32.lib kernel32.lib user32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSPLASHSCREEN)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libfreetype
|
||||
################################################################################
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), bundled)
|
||||
# freetype requires you to manually define DLL_EXPORT for windows (see ftconfig.h)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
|
||||
NAME := freetype, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -DFT2_BUILD_LIBRARY, \
|
||||
CFLAGS_windows := -DDLL_EXPORT, \
|
||||
EXTRA_HEADER_DIRS := libfreetype/include, \
|
||||
DISABLED_WARNINGS_microsoft := 4267 4244 4996, \
|
||||
DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBFREETYPE)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libfontmanager
|
||||
################################################################################
|
||||
|
||||
ifeq ($(USE_EXTERNAL_HARFBUZZ), true)
|
||||
LIBFONTMANAGER_EXTRA_SRC =
|
||||
LIBFONTMANAGER_LIBS += $(HARFBUZZ_LIBS)
|
||||
else
|
||||
LIBFONTMANAGER_EXTRA_SRC = libharfbuzz
|
||||
|
||||
ifeq ($(call isTargetOs, windows), false)
|
||||
HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
|
||||
-DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H \
|
||||
-DHB_NO_PRAGMA_GCC_DIAGNOSTIC
|
||||
endif
|
||||
ifeq ($(call isTargetOs, linux macosx), true)
|
||||
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES -DHB_NO_VISIBILITY
|
||||
endif
|
||||
|
||||
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
|
||||
# hb-subset and hb-style APIs are not needed, excluded to cut on compilation
|
||||
# time.
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += gsubgpos-context.cc hb-ft.cc hb-style.cc \
|
||||
hb-subset-cff-common.cc hb-subset-cff1.cc hb-subset-cff2.cc \
|
||||
hb-subset-input.cc hb-subset-instancer-solver.cc hb-subset-plan.cc \
|
||||
hb-subset.cc
|
||||
|
||||
# list of disabled warnings and the compilers for which it was specifically
|
||||
# added.
|
||||
# array-bounds -> GCC 12 on Alpine Linux
|
||||
# parentheses -> GCC 6
|
||||
# range-loop-analysis -> clang on Xcode12
|
||||
|
||||
HARFBUZZ_DISABLED_WARNINGS_gcc := missing-field-initializers \
|
||||
strict-aliasing unused-result array-bounds parentheses
|
||||
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
|
||||
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
|
||||
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
|
||||
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in
|
||||
# Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
|
||||
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type \
|
||||
expansion-to-defined dangling-reference maybe-uninitialized \
|
||||
calloc-transposed-args
|
||||
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers \
|
||||
range-loop-analysis
|
||||
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
|
||||
common/awt \
|
||||
common/awt/utility \
|
||||
common/font \
|
||||
libawt/java2d \
|
||||
libawt/java2d/pipe \
|
||||
libawt/java2d/loops \
|
||||
#
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), system)
|
||||
LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS)
|
||||
LIBFONTMANAGER_LIBS += $(FREETYPE_LIBS)
|
||||
else
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS += libfreetype/include
|
||||
LIBFONTMANAGER_JDK_LIBS += libfreetype
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
|
||||
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
# gcc (and to an extent clang) is particularly bad at optimizing these files,
|
||||
# causing a massive spike in compile time. We don't care about these
|
||||
# particular files anyway, so lower optimization level.
|
||||
BUILD_LIBFONTMANAGER_hb-subset.cc_OPTIMIZATION := SIZE
|
||||
BUILD_LIBFONTMANAGER_hb-subset-plan.cc_OPTIMIZATION := SIZE
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c
|
||||
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c \
|
||||
fontpath.c lcdglyph.c
|
||||
else
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c lcdglyph.c
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
|
||||
# LDFLAGS clarification:
|
||||
# Filter relevant linker flags disallowing unresolved symbols as we cannot
|
||||
# build-time decide to which library to link against (libawt_headless or
|
||||
# libawt_xawt). See JDK-8196516 for details.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
NAME := fontmanager, \
|
||||
LINK_TYPE := C++, \
|
||||
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
|
||||
AccelGlyphCache.c, \
|
||||
CFLAGS := $(LIBFONTMANAGER_CFLAGS), \
|
||||
CXXFLAGS := $(LIBFONTMANAGER_CFLAGS), \
|
||||
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
|
||||
EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \
|
||||
DISABLED_WARNINGS_gcc := $(HARFBUZZ_DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_CXX_gcc := $(HARFBUZZ_DISABLED_WARNINGS_CXX_gcc), \
|
||||
DISABLED_WARNINGS_clang := $(HARFBUZZ_DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LDFLAGS_FILTER_OUT :=-Wl$(COMMA)-z$(COMMA)defs, \
|
||||
LDFLAGS_aix := -Wl$(COMMA)-berok, \
|
||||
JDK_LIBS := libawt java.base:libjava $(LIBFONTMANAGER_JDK_LIBS), \
|
||||
JDK_LIBS_macosx := libawt_lwawt, \
|
||||
LIBS := $(LIBFONTMANAGER_LIBS), \
|
||||
LIBS_unix := $(LIBM), \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation \
|
||||
-framework CoreGraphics \
|
||||
-framework CoreText, \
|
||||
LIBS_windows := advapi32.lib gdi32.lib user32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBFONTMANAGER)
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libosxui
|
||||
##############################################################################
|
||||
|
||||
SHADERS_SRC := \
|
||||
$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal
|
||||
SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui
|
||||
SHADERS_AIR := $(SHADERS_SUPPORT_DIR)/shaders.air
|
||||
SHADERS_LIB := $(call FindLibDirForModule, $(MODULE))/shaders.metallib
|
||||
|
||||
$(eval $(call SetupExecute, metal_shaders, \
|
||||
INFO := Running metal on $(notdir $(SHADERS_SRC)) (for libosxui.dylib), \
|
||||
DEPS := $(SHADERS_SRC), \
|
||||
OUTPUT_FILE := $(SHADERS_AIR), \
|
||||
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
|
||||
COMMAND := $(METAL) -c -std=osx-metal2.0 \
|
||||
-mmacosx-version-min=$(MACOSX_VERSION_MIN) \
|
||||
-o $(SHADERS_AIR) $(SHADERS_SRC), \
|
||||
))
|
||||
|
||||
$(eval $(call SetupExecute, metallib_shaders, \
|
||||
INFO := Running metallib on $(notdir $(SHADERS_AIR)) (for libosxui.dylib), \
|
||||
DEPS := $(SHADERS_AIR), \
|
||||
OUTPUT_FILE := $(SHADERS_LIB), \
|
||||
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
|
||||
COMMAND := $(METALLIB) -o $(SHADERS_LIB) $(SHADERS_AIR), \
|
||||
))
|
||||
|
||||
TARGETS += $(SHADERS_LIB)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
|
||||
NAME := osxui, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libawt_lwawt/awt, \
|
||||
DISABLED_WARNINGS_clang_AquaFileView.m := deprecated-declarations \
|
||||
sign-compare, \
|
||||
DISABLED_WARNINGS_clang_ScreenMenu.m := deprecated-declarations, \
|
||||
APPEND_LDFLAGS := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
JDK_LIBS := java.base:libjava libosxapp, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXUI)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(SHADERS_LIB)
|
||||
endif
|
||||
@@ -25,41 +25,26 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libinstrument
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
# equivalent of strcasecmp is stricmp on Windows
|
||||
LIBINSTRUMENT_CFLAGS := -Dstrcasecmp=stricmp
|
||||
WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
|
||||
endif
|
||||
|
||||
# equivalent of strcasecmp is stricmp on Windows
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
|
||||
NAME := instrument, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBINSTRUMENT_CFLAGS), \
|
||||
CFLAGS_windows := -Dstrcasecmp=stricmp, \
|
||||
CFLAGS_debug := -DJPLIS_LOGGING, \
|
||||
CFLAGS_release := -DNO_JPLIS_LOGGING, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjli, \
|
||||
LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
|
||||
LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
|
||||
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
JDK_LIBS := java.base:libjava java.base:libjli java.base:libjvm, \
|
||||
LIBS_unix := $(LIBZ_LIBS), \
|
||||
LIBS_linux := -ljli $(LIBDL), \
|
||||
LIBS_aix := -liconv -ljli_static $(LIBDL), \
|
||||
LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \
|
||||
-framework ApplicationServices, \
|
||||
LIBS_windows := jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
|
||||
$(WINDOWS_JLI_LIB), \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL) -liconv, \
|
||||
LIBS_macosx := -liconv \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework Security, \
|
||||
LIBS_windows := advapi32.lib, \
|
||||
))
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
$(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
|
||||
else
|
||||
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
|
||||
endif
|
||||
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBINSTRUMENT)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -25,23 +25,21 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libmanagement
|
||||
################################################################################
|
||||
|
||||
LIBMANAGEMENT_OPTIMIZATION := HIGH
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
|
||||
LIBMANAGEMENT_OPTIMIZATION := LOW
|
||||
endif
|
||||
ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true)
|
||||
LIBMANAGEMENT_OPTIMIZATION := LOW
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
|
||||
NAME := management, \
|
||||
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
JDK_LIBS := java.base:libjava java.base:libjvm, \
|
||||
LIBS_aix := -lperfstat,\
|
||||
LIBS_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \
|
||||
LIBS_windows := advapi32.lib psapi.lib, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBMANAGEMENT)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
DISABLED_WARNINGS_java += this-escape
|
||||
@@ -25,26 +25,24 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libprefs
|
||||
################################################################################
|
||||
|
||||
# libprefs on macosx do not use the unix code
|
||||
# libprefs on macosx does not use the unix code
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBPREFS_EXCLUDE_SRC_PATTERNS := unix
|
||||
LIBPREFS_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \
|
||||
NAME := prefs, \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
LIBS_unix := -ljvm, \
|
||||
LIBS_linux := -ljava, \
|
||||
LIBS_aix := -ljava, \
|
||||
LIBS_macosx := -framework CoreFoundation -framework Foundation, \
|
||||
LIBS_windows := advapi32.lib jvm.lib $(WIN_JAVA_LIB), \
|
||||
JDK_LIBS := java.base:libjava java.base:libjvm, \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation \
|
||||
-framework Foundation, \
|
||||
LIBS_windows := advapi32.lib, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBPREFS): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBPREFS)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build rmiregistry
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, rmiregistry, \
|
||||
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
|
||||
JAVA_ARGS := -Djava.security.manager=allow, \
|
||||
|
||||
@@ -25,17 +25,15 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build librmi
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \
|
||||
NAME := rmi, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
OPTIMIZATION := LOW, \
|
||||
LIBS_unix := -ljvm, \
|
||||
LIBS_windows := jvm.lib, \
|
||||
JDK_LIBS := java.base:libjvm, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBRMI): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBRMI)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build jrunscript
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jrunscript, \
|
||||
MAIN_CLASS := com.sun.tools.script.shell.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -26,14 +26,26 @@
|
||||
include LauncherCommon.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
##############################################################################
|
||||
## Build kinit
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, kinit, \
|
||||
MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \
|
||||
))
|
||||
|
||||
##############################################################################
|
||||
## Build klist
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, klist, \
|
||||
MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \
|
||||
))
|
||||
|
||||
##############################################################################
|
||||
## Build ktab
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, ktab, \
|
||||
MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \
|
||||
))
|
||||
|
||||
@@ -25,57 +25,72 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libj2gss
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
|
||||
NAME := j2gss, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
DISABLED_WARNINGS_gcc := undef, \
|
||||
DISABLED_WARNINGS_clang_aix := undef, \
|
||||
DISABLED_WARNINGS_clang := undef, \
|
||||
LIBS := $(LIBDL), \
|
||||
LIBS_unix := $(LIBDL), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJ2GSS)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
##############################################################################
|
||||
## Build libsspi_bridge
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSSPI_BRIDGE, \
|
||||
NAME := sspi_bridge, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := libj2gss, \
|
||||
LIBS := Secur32.lib, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libj2gss \
|
||||
java.base:libjava, \
|
||||
LIBS_windows := secur32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSSPI_BRIDGE)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
ifneq ($(BUILD_CRYPTO), false)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
############################################################################
|
||||
## Build libw2k_lsa_auth
|
||||
############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBW2K_LSA_AUTH, \
|
||||
NAME := w2k_lsa_auth, \
|
||||
OPTIMIZATION := LOW, \
|
||||
LIBS := advapi32.lib Secur32.lib kernel32.lib ws2_32.lib, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
LIBS_windows := advapi32.lib kernel32.lib secur32.lib ws2_32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBW2K_LSA_AUTH)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
############################################################################
|
||||
## Build libosxkrb5
|
||||
############################################################################
|
||||
|
||||
# libosxkrb5 needs to call deprecated krb5 APIs so that java
|
||||
# can use the native credentials cache.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXKRB5, \
|
||||
NAME := osxkrb5, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
DISABLED_WARNINGS_clang_nativeccache.c := deprecated-declarations, \
|
||||
LIBS := -framework Cocoa -framework SystemConfiguration \
|
||||
-framework Kerberos, \
|
||||
LIBS_macosx := \
|
||||
-framework Cocoa \
|
||||
-framework Kerberos \
|
||||
-framework SystemConfiguration, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXKRB5)
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -25,17 +25,19 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libj2pcsc
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \
|
||||
NAME := j2pcsc, \
|
||||
CFLAGS_unix := -D__sun_jdk, \
|
||||
EXTRA_HEADER_DIRS := libj2pcsc/MUSCLE, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libj2pcsc/MUSCLE \
|
||||
java.base:libjava, \
|
||||
OPTIMIZATION := LOW, \
|
||||
LIBS_unix := $(LIBDL), \
|
||||
LIBS_windows := winscard.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJ2PCSC)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
DISABLED_WARNINGS_java += this-escape
|
||||
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
CLEAN_FILES += $(wildcard \
|
||||
|
||||
@@ -26,29 +26,21 @@
|
||||
include LauncherCommon.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
ACCESSIBILITY_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
|
||||
TOOLS_CFLAGS := $(addprefix -I, \
|
||||
$(ACCESSIBILITY_SRCDIR)/include/bridge \
|
||||
$(ACCESSIBILITY_SRCDIR)/common \
|
||||
$(ACCESSIBILITY_SRCDIR)/toolscommon)
|
||||
|
||||
##############################################################################
|
||||
# jabswitch
|
||||
# Build jabswitch
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkExecutable, BUILD_JABSWITCH, \
|
||||
NAME := jabswitch, \
|
||||
SRC := $(ACCESSIBILITY_SRCDIR)/jabswitch, \
|
||||
INCLUDE_FILES := jabswitch.cpp, \
|
||||
CFLAGS_FILTER_OUT := -Zc:wchar_t-, \
|
||||
CXXFLAGS_FILTER_OUT := -Zc:wchar_t-, \
|
||||
CFLAGS := -Zc:wchar_t -analyze- -Od -Gd -D_WINDOWS -D_UNICODE \
|
||||
-DUNICODE -RTC1 -EHsc, \
|
||||
CXXFLAGS := -Zc:wchar_t -analyze- -Od -Gd -D_WINDOWS -D_UNICODE \
|
||||
-DUNICODE -RTC1 -EHsc, \
|
||||
DISABLED_WARNINGS_microsoft_jabswitch.cpp := 4267 4996, \
|
||||
LIBS := advapi32.lib version.lib user32.lib, \
|
||||
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
LIBS_windows := advapi32.lib user32.lib version.lib, \
|
||||
VERSIONINFO_RESOURCE := \
|
||||
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
MANIFEST := $(ACCESSIBILITY_SRCDIR)/jabswitch/jabswitch.manifest, \
|
||||
MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
|
||||
))
|
||||
@@ -56,47 +48,54 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
TARGETS += $(BUILD_JABSWITCH)
|
||||
|
||||
##############################################################################
|
||||
# jaccessinspector
|
||||
|
||||
define SetupInspector
|
||||
# Setup rules to create 32/64 bit version of jaccessinspector
|
||||
#
|
||||
# Parameter 1 File name suffix
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
|
||||
|
||||
##############################################################################
|
||||
define SetupInspector
|
||||
$$(eval $$(call SetupJdkExecutable, BUILD_JACCESSINSPECTOR$1, \
|
||||
NAME := jaccessinspector$1, \
|
||||
SRC := $(ACCESSIBILITY_SRCDIR)/jaccessinspector $(ACCESSIBILITY_SRCDIR)/common \
|
||||
$(ACCESSIBILITY_SRCDIR)/toolscommon $(ACCESSIBILITY_SRCDIR)/bridge, \
|
||||
CFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
CXXFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
LDFLAGS := -stack:655360, \
|
||||
LIBS := advapi32.lib user32.lib, \
|
||||
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
|
||||
NAME := jaccessinspector$1, \
|
||||
SRC := jaccessinspector, \
|
||||
EXTRA_SRC := \
|
||||
bridge \
|
||||
common \
|
||||
toolscommon, \
|
||||
EXTRA_HEADER_DIRS := include/bridge, \
|
||||
CFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
CXXFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
LDFLAGS_windows := -stack:655360, \
|
||||
LIBS_windows := advapi32.lib user32.lib, \
|
||||
VERSIONINFO_RESOURCE := \
|
||||
$(ACCESSIBILITY_SRCDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
|
||||
))
|
||||
|
||||
TARGETS += $$(BUILD_JACCESSINSPECTOR$1)
|
||||
|
||||
endef
|
||||
|
||||
##############################################################################
|
||||
# jaccesswalker
|
||||
|
||||
define SetupWalker
|
||||
# Setup rules to create 32/64 bit version of jaccesswalker
|
||||
# Parameter 1 File name suffix
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
|
||||
|
||||
##############################################################################
|
||||
define SetupWalker
|
||||
$$(eval $$(call SetupJdkExecutable, BUILD_JACCESSWALKER$1, \
|
||||
NAME := jaccesswalker$1, \
|
||||
SRC := $(ACCESSIBILITY_SRCDIR)/jaccesswalker $(ACCESSIBILITY_SRCDIR)/common \
|
||||
$(ACCESSIBILITY_SRCDIR)/toolscommon $(ACCESSIBILITY_SRCDIR)/bridge, \
|
||||
CFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
CXXFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
LDFLAGS := -stack:655360, \
|
||||
LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
|
||||
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
|
||||
NAME := jaccesswalker$1, \
|
||||
SRC := jaccesswalker, \
|
||||
EXTRA_SRC := \
|
||||
bridge \
|
||||
common \
|
||||
toolscommon, \
|
||||
EXTRA_HEADER_DIRS := include/bridge, \
|
||||
CFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
CXXFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
LDFLAGS_windows := -stack:655360, \
|
||||
LIBS_windows := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
|
||||
VERSIONINFO_RESOURCE := \
|
||||
$(ACCESSIBILITY_SRCDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
|
||||
))
|
||||
|
||||
TARGETS += $$(BUILD_JACCESSWALKER$1)
|
||||
|
||||
endef
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 32), true)
|
||||
@@ -108,7 +107,4 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupInspector,,64))
|
||||
$(eval $(call SetupWalker,,64))
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -28,77 +28,81 @@ include LibCommon.gmk
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
ACCESSIBILITY_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
|
||||
|
||||
##############################################################################
|
||||
# Setup rules to create 32/64 bit version of javaaccessbridge
|
||||
#
|
||||
# Parameter 1 Suffix
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
|
||||
##############################################################################
|
||||
define SetupJavaDLL
|
||||
# Parameter 1 Suffix
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
|
||||
|
||||
$(call SetupJdkLibrary, BUILD_JAVAACCESSBRIDGE$1, \
|
||||
$(call SetupJdkLibrary, BUILD_LIBJAVAACCESSBRIDGE$1, \
|
||||
NAME := javaaccessbridge$1, \
|
||||
SRC := libjavaaccessbridge, \
|
||||
EXTRA_SRC := common, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
|
||||
CFLAGS_FILTER_OUT := -MD, \
|
||||
CXXFLAGS_FILTER_OUT := -MD, \
|
||||
CFLAGS := -MT -DACCESSBRIDGE_ARCH_$2, \
|
||||
CXXFLAGS := -MT -DACCESSBRIDGE_ARCH_$2, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include/bridge \
|
||||
java.desktop:include, \
|
||||
LIBS := kernel32.lib user32.lib gdi32.lib \
|
||||
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib \
|
||||
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib, \
|
||||
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
JDK_LIBS := java.desktop:libjawt, \
|
||||
LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \
|
||||
odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib \
|
||||
user32.lib uuid.lib winspool.lib, \
|
||||
VERSIONINFO_RESOURCE := \
|
||||
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
)
|
||||
|
||||
$$(BUILD_JAVAACCESSBRIDGE$1): $(call FindStaticLib, java.desktop, jawt, /libjawt)
|
||||
|
||||
TARGETS += $$(BUILD_JAVAACCESSBRIDGE$1)
|
||||
TARGETS += $$(BUILD_LIBJAVAACCESSBRIDGE$1)
|
||||
endef
|
||||
|
||||
##############################################################################
|
||||
# Setup rules to create 32/64 bit version of windowsaccessbridge
|
||||
#
|
||||
# Parameter 1 Suffix
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
|
||||
##############################################################################
|
||||
define SetupWinDLL
|
||||
# Parameter 1 Suffix
|
||||
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
|
||||
$(call SetupJdkLibrary, BUILD_WINDOWSACCESSBRIDGE$1, \
|
||||
$(call SetupJdkLibrary, BUILD_LIBWINDOWSACCESSBRIDGE$1, \
|
||||
NAME := windowsaccessbridge$1, \
|
||||
SRC := libwindowsaccessbridge, \
|
||||
EXTRA_SRC := common, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_microsoft_WinAccessBridge.cpp := 4302 4311, \
|
||||
CFLAGS := -DACCESSBRIDGE_ARCH_$2, \
|
||||
CXXFLAGS := -DACCESSBRIDGE_ARCH_$2, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include/bridge, \
|
||||
LDFLAGS := \
|
||||
-def:$(ACCESSIBILITY_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
|
||||
LIBS := kernel32.lib user32.lib gdi32.lib \
|
||||
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
|
||||
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib, \
|
||||
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \
|
||||
odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib \
|
||||
user32.lib uuid.lib winspool.lib, \
|
||||
VERSIONINFO_RESOURCE := \
|
||||
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
)
|
||||
|
||||
TARGETS += $$(BUILD_WINDOWSACCESSBRIDGE$1)
|
||||
|
||||
endef
|
||||
|
||||
define SetupAccessBridgeSysInfo
|
||||
|
||||
$(call SetupJdkLibrary, BUILD_ACCESSBRIDGESYSINFO, \
|
||||
NAME := jabsysinfo, \
|
||||
OPTIMIZATION := LOW, \
|
||||
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
)
|
||||
|
||||
TARGETS += $$(BUILD_ACCESSBRIDGESYSINFO)
|
||||
|
||||
TARGETS += $$(BUILD_LIBWINDOWSACCESSBRIDGE$1)
|
||||
endef
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 32), true)
|
||||
$(eval $(call SetupAccessBridgeSysInfo))
|
||||
############################################################################
|
||||
# Build libjabsysinfo
|
||||
############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJABSYSINFO, \
|
||||
NAME := jabsysinfo, \
|
||||
OPTIMIZATION := LOW, \
|
||||
VERSIONINFO_RESOURCE := \
|
||||
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
|
||||
)
|
||||
|
||||
TARGETS += $(BUILD_LIBJABSYSINFO)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 32), true)
|
||||
$(eval $(call SetupJavaDLL,-32,32))
|
||||
$(eval $(call SetupJavaDLL,,LEGACY))
|
||||
$(eval $(call SetupWinDLL,-32,32))
|
||||
@@ -107,7 +111,4 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupJavaDLL,,64))
|
||||
$(eval $(call SetupWinDLL,-64,64))
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libattach
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
@@ -38,13 +40,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBATTACH, \
|
||||
NAME := attach, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBATTACH_CFLAGS), \
|
||||
CFLAGS_windows := /Gy, \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \
|
||||
CFLAGS_windows := -Gy, \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS_windows := advapi32.lib psapi.lib, \
|
||||
))
|
||||
|
||||
$(BUILD_LIBATTACH): $(call FindLib, java.base, java)
|
||||
|
||||
TARGETS += $(BUILD_LIBATTACH)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -23,6 +23,4 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
DISABLED_WARNINGS_java += this-escape
|
||||
|
||||
COPY += .dat
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JarArchive.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
@@ -65,7 +66,7 @@ $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
|
||||
SRC := $(TOPDIR)/make/langtools/src/classes, \
|
||||
INCLUDES := build/tools/symbolgenerator com/sun/tools/classfile, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javac, \
|
||||
DISABLED_WARNINGS := options this-escape, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
JAVAC_FLAGS := \
|
||||
$(COMPILECREATESYMBOLS_ADD_EXPORTS), \
|
||||
))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,12 +25,20 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build javac
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, javac, \
|
||||
MAIN_CLASS := com.sun.tools.javac.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
MAIN_CLASS := com.sun.tools.javac.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
## Build serialver
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, serialver, \
|
||||
MAIN_CLASS := sun.tools.serialver.SerialVer, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
|
||||
@@ -25,15 +25,16 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libj2pkcs11
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
|
||||
NAME := j2pkcs11, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
DISABLED_WARNINGS_clang_p11_util.c := format-nonliteral, \
|
||||
LIBS_unix := $(LIBDL), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJ2PKCS11)
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
DISABLED_WARNINGS_java += this-escape
|
||||
@@ -25,18 +25,18 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
##############################################################################
|
||||
## Build libsunmscapi
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSUNMSCAPI, \
|
||||
NAME := sunmscapi, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LIBS := crypt32.lib advapi32.lib ncrypt.lib, \
|
||||
LIBS_windows := advapi32.lib crypt32.lib ncrypt.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSUNMSCAPI)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build jhsdb
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jhsdb, \
|
||||
MAIN_CLASS := sun.jvm.hotspot.SALauncher, \
|
||||
MACOSX_PRIVILEGED := true, \
|
||||
|
||||
@@ -25,53 +25,56 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libsaproc
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
SA_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
|
||||
LIBSAPROC_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
|
||||
-mstack-alignment=16 -fPIC
|
||||
LIBSA_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
|
||||
LIBSAPROC_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
SA_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -EHsc
|
||||
LIBSAPROC_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -EHsc
|
||||
ifeq ($(call isTargetCpu, x86_64), true)
|
||||
SA_CXXFLAGS := -DWIN64
|
||||
LIBSAPROC_CXXFLAGS := -DWIN64
|
||||
else
|
||||
# Only add /RTC1 flag for debug builds as it's
|
||||
# incompatible with release type builds. See
|
||||
# https://msdn.microsoft.com/en-us/library/8wtf2dfz.aspx
|
||||
ifeq ($(DEBUG_LEVEL),slowdebug)
|
||||
SA_CXXFLAGS := -RTC1
|
||||
ifeq ($(DEBUG_LEVEL), slowdebug)
|
||||
LIBSAPROC_CXXFLAGS := -RTC1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
SA_LINK_TYPE := C
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
SA_LINK_TYPE := C++
|
||||
LIBSAPROC_LINK_TYPE := C++
|
||||
else
|
||||
LIBSAPROC_LINK_TYPE := C
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
|
||||
NAME := saproc, \
|
||||
LINK_TYPE := $(SA_LINK_TYPE), \
|
||||
LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjvm, \
|
||||
DISABLED_WARNINGS_gcc := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sadis.c := format-nonliteral, \
|
||||
CFLAGS := $(SA_CFLAGS), \
|
||||
CXXFLAGS := $(SA_CFLAGS) $(SA_CXXFLAGS), \
|
||||
EXTRA_SRC := $(LIBSA_EXTRA_SRC), \
|
||||
LIBS_unix := -ljava, \
|
||||
CFLAGS := $(LIBSAPROC_CFLAGS), \
|
||||
CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \
|
||||
EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_macosx := -framework Foundation \
|
||||
-framework JavaRuntimeSupport -framework Security -framework CoreFoundation, \
|
||||
LIBS_windows := dbgeng.lib $(WIN_JAVA_LIB), \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation \
|
||||
-framework Foundation \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Security, \
|
||||
LIBS_windows := dbgeng.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSA)
|
||||
|
||||
################################################################################
|
||||
TARGETS += $(BUILD_LIBSAPROC)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build jwebserver
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jwebserver, \
|
||||
MAIN_CLASS := sun.net.httpserver.simpleserver.JWebServer, \
|
||||
))
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
include LibCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build libjsvml
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, linux windows)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2), true+true+true)
|
||||
@@ -35,5 +37,3 @@ ifeq ($(call isTargetOs, linux windows)+$(call isTargetCpu, x86_64)+$(INCLUDE_CO
|
||||
|
||||
TARGETS += $(BUILD_LIBJSVML)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user