This commit is contained in:
Henry Jen 2019-03-26 10:55:17 -07:00
commit 52da980fa2
4374 changed files with 112127 additions and 138806 deletions

16
.hgtags
View file

@ -536,4 +536,18 @@ de9fd809bb475401aad188eab2264226788aad81 jdk-12+26
f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27 f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
a47b8125b7cc9ef59619745c163975fe935b57ed jdk-13+4 a47b8125b7cc9ef59619745c163975fe935b57ed jdk-13+4
659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28 659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28
e3ed960609927b5fdfd0a797159835cd83a81a31 jdk-13+5
44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29
b5f05fe4a6f8b3996a000c20078b356d991ca8ec jdk-13+6
6c377af36a5c4203f16aed8a5e4c2ecc08fcd8bd jdk-12+30
021917019cda1c0c5853255322274f37693a2431 jdk-13+7
b5f7bb57de2f797be34f6c75d45c3245ad37ab97 jdk-12+31
a535ba736cabc6886acdff36de3a096c46e5ddc5 jdk-13+8
4ce47bc1fb92cf94c6e3d1f49d582f02dcb851ab jdk-12+32
c081f3ea6b9300265a4a34e38f970b1e3ddaae9f jdk-13+9
b67884871b5fff79c5ef3eb8ac74dd48d71ea9b1 jdk-12+33
8e069f7b4fabfe05d9f500783e6d56cb0196d25c jdk-13+10
21ea4076a275a0f498afa517e9ee1b94a9cf0255 jdk-13+11
1d7aec80147a6d92b101a76aef92f3ddc88bedf4 jdk-13+12
b67884871b5fff79c5ef3eb8ac74dd48d71ea9b1 jdk-12-ga
83cace4142c8563b6a921787db02388e1bc48d01 jdk-13+13

View file

@ -237,7 +237,7 @@
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p> <p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
<pre><code>sudo yum groupinstall &quot;Development Tools&quot;</code></pre> <pre><code>sudo yum groupinstall &quot;Development Tools&quot;</code></pre>
<h3 id="aix">AIX</h3> <h3 id="aix">AIX</h3>
<p>The regular builds by SAP is using AIX version 7.1, but AIX 5.3 is also supported. See the <a href="http://cr.openjdk.java.net/~simonis/ppc-aix-port">OpenJDK PowerPC Port Status Page</a> for details.</p> <p>Please consult the AIX section of the <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a> OpenJDK Build Wiki page for details about which versions of AIX are supported.</p>
<h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requirements</h2> <h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requirements</h2>
<p>Large portions of the JDK consists of native code, that needs to be compiled to be able to run on the target platform. In theory, toolchain and operating system should be independent factors, but in practice there's more or less a one-to-one correlation between target operating system and toolchain.</p> <p>Large portions of the JDK consists of native code, that needs to be compiled to be able to run on the target platform. In theory, toolchain and operating system should be independent factors, but in practice there's more or less a one-to-one correlation between target operating system and toolchain.</p>
<table> <table>
@ -373,8 +373,7 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p> <p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p>
<p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p> <p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p>
<h3 id="ibm-xl-cc">IBM XL C/C++</h3> <h3 id="ibm-xl-cc">IBM XL C/C++</h3>
<p>The regular builds by SAP is using version 12.1, described as <code>IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0017</code>.</p> <p>Please consult the AIX section of the <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a> OpenJDK Build Wiki page for details about which versions of XLC are supported.</p>
<p>See the <a href="http://cr.openjdk.java.net/~simonis/ppc-aix-port">OpenJDK PowerPC Port Status Page</a> for details.</p>
<h2 id="boot-jdk-requirements">Boot JDK Requirements</h2> <h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
<p>Paradoxically, building the JDK requires a pre-existing JDK. This is called the &quot;boot JDK&quot;. The boot JDK does not, however, have to be a JDK built directly from the source code available in the OpenJDK Community. If you are porting the JDK to a new platform, chances are that there already exists another JDK for that platform that is usable as boot JDK.</p> <p>Paradoxically, building the JDK requires a pre-existing JDK. This is called the &quot;boot JDK&quot;. The boot JDK does not, however, have to be a JDK built directly from the source code available in the OpenJDK Community. If you are porting the JDK to a new platform, chances are that there already exists another JDK for that platform that is usable as boot JDK.</p>
<p>The rule of thumb is that the boot JDK for building JDK major version <em>N</em> should be a JDK of major version <em>N-1</em>, so for building JDK 9 a JDK 8 would be suitable as boot JDK. However, the JDK should be able to &quot;build itself&quot;, so an up-to-date build of the current JDK source is an acceptable alternative. If you are following the <em>N-1</em> rule, make sure you've got the latest update version, since JDK 8 GA might not be able to build JDK 9 on all platforms.</p> <p>The rule of thumb is that the boot JDK for building JDK major version <em>N</em> should be a JDK of major version <em>N-1</em>, so for building JDK 9 a JDK 8 would be suitable as boot JDK. However, the JDK should be able to &quot;build itself&quot;, so an up-to-date build of the current JDK source is an acceptable alternative. If you are following the <em>N-1</em> rule, make sure you've got the latest update version, since JDK 8 GA might not be able to build JDK 9 on all platforms.</p>

View file

@ -295,9 +295,9 @@ sudo yum groupinstall "Development Tools"
### AIX ### AIX
The regular builds by SAP is using AIX version 7.1, but AIX 5.3 is also Please consult the AIX section of the [Supported Build Platforms](
supported. See the [OpenJDK PowerPC Port Status Page]( https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms) OpenJDK
http://cr.openjdk.java.net/~simonis/ppc-aix-port) for details. Build Wiki page for details about which versions of AIX are supported.
## Native Compiler (Toolchain) Requirements ## Native Compiler (Toolchain) Requirements
@ -419,11 +419,10 @@ https://stackoverflow.com/questions/10888391) for other suggestions.
### IBM XL C/C++ ### IBM XL C/C++
The regular builds by SAP is using version 12.1, described as `IBM XL C/C++ for Please consult the AIX section of the [Supported Build Platforms](
AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0017`. https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms) OpenJDK
Build Wiki page for details about which versions of XLC are supported.
See the [OpenJDK PowerPC Port Status Page](
http://cr.openjdk.java.net/~simonis/ppc-aix-port) for details.
## Boot JDK Requirements ## Boot JDK Requirements

View file

@ -1,24 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta name="generator" content="pandoc" /> <meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Testing the JDK</title> <title>Testing the JDK</title>
<style type="text/css"> <style type="text/css">code{white-space: pre;}</style>
code{white-space: pre-wrap;} <link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css">
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]--> <![endif]-->
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style> <style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
</head> </head>
<body> <body>
<header id="title-block-header"> <header>
<h1 class="title">Testing the JDK</h1> <h1 class="title">Testing the JDK</h1>
</header> </header>
<nav id="TOC"> <nav id="TOC">
@ -34,6 +29,7 @@
</ul></li> </ul></li>
<li><a href="#test-results-and-summary">Test results and summary</a></li> <li><a href="#test-results-and-summary">Test results and summary</a></li>
<li><a href="#test-suite-control">Test suite control</a><ul> <li><a href="#test-suite-control">Test suite control</a><ul>
<li><a href="#general-keywords-test_opts">General keywords (TEST_OPTS)</a></li>
<li><a href="#jtreg-keywords">JTReg keywords</a></li> <li><a href="#jtreg-keywords">JTReg keywords</a></li>
<li><a href="#gtest-keywords">Gtest keywords</a></li> <li><a href="#gtest-keywords">Gtest keywords</a></li>
<li><a href="#microbenchmark-keywords">Microbenchmark keywords</a></li> <li><a href="#microbenchmark-keywords">Microbenchmark keywords</a></li>
@ -102,11 +98,29 @@ TEST FAILURE</code></pre>
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p> <p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p>
<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p> <p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
<p>As far as possible, the names of the keywords have been standardized between test suites.</p> <p>As far as possible, the names of the keywords have been standardized between test suites.</p>
<h3 id="jtreg-keywords">JTReg keywords</h3> <h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
<p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
<p>There are also some keywords that applies globally to the test runner system, not to any specific test suites. These are also available as TEST_OPTS keywords.</p>
<h4 id="jobs">JOBS</h4> <h4 id="jobs">JOBS</h4>
<p>Currently only applies to JTReg.</p>
<h4 id="timeout_factor">TIMEOUT_FACTOR</h4>
<p>Currently only applies to JTReg.</p>
<h4 id="vm_options">VM_OPTIONS</h4>
<p>Applies to JTReg, GTest and Micro.</p>
<h4 id="java_options">JAVA_OPTIONS</h4>
<p>Applies to JTReg, GTest and Micro.</p>
<h4 id="aot_modules">AOT_MODULES</h4>
<p>Applies to JTReg and GTest.</p>
<h4 id="jcov">JCOV</h4>
<p>This keywords applies globally to the test runner system. If set to <code>true</code>, it enables JCov coverage reporting for all tests run. To be useful, the JDK under test must be run with a JDK built with JCov instrumentation (<code>configure --with-jcov=&lt;path to directory containing lib/jcov.jar&gt;</code>, <code>make jcov-image</code>).</p>
<p>The simplest way to run tests with JCov coverage report is to use the special target <code>jcov-test</code> instead of <code>test</code>, e.g. <code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov image is built, and that JCov reporting is enabled.</p>
<p>The JCov report is stored in <code>build/$BUILD/test-results/jcov-output</code>.</p>
<p>Please note that running with JCov reporting can be very memory intensive.</p>
<h3 id="jtreg-keywords">JTReg keywords</h3>
<h4 id="jobs-1">JOBS</h4>
<p>The test concurrency (<code>-concurrency</code>).</p> <p>The test concurrency (<code>-concurrency</code>).</p>
<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em>, but never more than 12.</p> <p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em> (for sparc, if more than 16 cpus, then <em>number of CPU cores/5</em>, otherwise <em>number of CPU cores/4</em>), but never more than <em>memory size in GB/2</em>.</p>
<h4 id="timeout">TIMEOUT</h4> <h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
<p>The timeout factor (<code>-timeoutFactor</code>).</p> <p>The timeout factor (<code>-timeoutFactor</code>).</p>
<p>Defaults to 4.</p> <p>Defaults to 4.</p>
<h4 id="test_mode">TEST_MODE</h4> <h4 id="test_mode">TEST_MODE</h4>
@ -125,13 +139,21 @@ TEST FAILURE</code></pre>
<p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p> <p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
<p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p> <p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p>
<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p> <p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
<h4 id="keywords">KEYWORDS</h4>
<p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
<h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
<p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
<p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
<p>The file names should be either absolute, or relative to the JTReg test root of the tests to be run.</p>
<h4 id="options">OPTIONS</h4> <h4 id="options">OPTIONS</h4>
<p>Additional options to the JTReg test framework.</p> <p>Additional options to the JTReg test framework.</p>
<p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTReg options.</p> <p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTReg options.</p>
<h4 id="java_options">JAVA_OPTIONS</h4> <h4 id="java_options-1">JAVA_OPTIONS</h4>
<p>Additional Java options to JTReg (<code>-javaoption</code>).</p> <p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
<h4 id="vm_options">VM_OPTIONS</h4> <h4 id="vm_options-1">VM_OPTIONS</h4>
<p>Additional VM options to JTReg (<code>-vmoption</code>).</p> <p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
<h4 id="aot_modules-1">AOT_MODULES</h4>
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
<h3 id="gtest-keywords">Gtest keywords</h3> <h3 id="gtest-keywords">Gtest keywords</h3>
<h4 id="repeat">REPEAT</h4> <h4 id="repeat">REPEAT</h4>
<p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p> <p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
@ -139,6 +161,8 @@ TEST FAILURE</code></pre>
<h4 id="options-1">OPTIONS</h4> <h4 id="options-1">OPTIONS</h4>
<p>Additional options to the Gtest test framework.</p> <p>Additional options to the Gtest test framework.</p>
<p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p> <p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p>
<h4 id="aot_modules-2">AOT_MODULES</h4>
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
<h3 id="microbenchmark-keywords">Microbenchmark keywords</h3> <h3 id="microbenchmark-keywords">Microbenchmark keywords</h3>
<h4 id="fork">FORK</h4> <h4 id="fork">FORK</h4>
<p>Override the number of benchmark forks to spawn. Same as specifying <code>-f &lt;num&gt;</code>.</p> <p>Override the number of benchmark forks to spawn. Same as specifying <code>-f &lt;num&gt;</code>.</p>
@ -152,7 +176,7 @@ TEST FAILURE</code></pre>
<p>Amount of time to spend in each warmup iteration. Same as specifying <code>-w &lt;num&gt;</code>.</p> <p>Amount of time to spend in each warmup iteration. Same as specifying <code>-w &lt;num&gt;</code>.</p>
<h4 id="results_format">RESULTS_FORMAT</h4> <h4 id="results_format">RESULTS_FORMAT</h4>
<p>Specify to have the test run save a log of the values. Accepts the same values as <code>-rff</code>, i.e., <code>text</code>, <code>csv</code>, <code>scsv</code>, <code>json</code>, or <code>latex</code>.</p> <p>Specify to have the test run save a log of the values. Accepts the same values as <code>-rff</code>, i.e., <code>text</code>, <code>csv</code>, <code>scsv</code>, <code>json</code>, or <code>latex</code>.</p>
<h4 id="vm_options-1">VM_OPTIONS</h4> <h4 id="vm_options-2">VM_OPTIONS</h4>
<p>Additional VM arguments to provide to forked off VMs. Same as <code>-jvmArgs &lt;args&gt;</code></p> <p>Additional VM arguments to provide to forked off VMs. Same as <code>-jvmArgs &lt;args&gt;</code></p>
<h4 id="options-2">OPTIONS</h4> <h4 id="options-2">OPTIONS</h4>
<p>Additional arguments to send to JMH.</p> <p>Additional arguments to send to JMH.</p>

View file

@ -202,16 +202,61 @@ proper quoting of command line arguments through.)
As far as possible, the names of the keywords have been standardized between As far as possible, the names of the keywords have been standardized between
test suites. test suites.
### General keywords (TEST_OPTS)
Some keywords are valid across different test suites. If you want to run
tests from multiple test suites, or just don't want to care which test suite specific
control variable to use, then you can use the general TEST_OPTS control variable.
There are also some keywords that applies globally to the test runner system,
not to any specific test suites. These are also available as TEST_OPTS keywords.
#### JOBS
Currently only applies to JTReg.
#### TIMEOUT_FACTOR
Currently only applies to JTReg.
#### VM_OPTIONS
Applies to JTReg, GTest and Micro.
#### JAVA_OPTIONS
Applies to JTReg, GTest and Micro.
#### AOT_MODULES
Applies to JTReg and GTest.
#### JCOV
This keywords applies globally to the test runner system. If set to `true`, it
enables JCov coverage reporting for all tests run. To be useful, the JDK under
test must be run with a JDK built with JCov instrumentation (`configure
--with-jcov=<path to directory containing lib/jcov.jar>`, `make jcov-image`).
The simplest way to run tests with JCov coverage report is to use the special
target `jcov-test` instead of `test`, e.g. `make jcov-test TEST=jdk_lang`. This
will make sure the JCov image is built, and that JCov reporting is enabled.
The JCov report is stored in `build/$BUILD/test-results/jcov-output`.
Please note that running with JCov reporting can be very memory intensive.
### JTReg keywords ### JTReg keywords
#### JOBS #### JOBS
The test concurrency (`-concurrency`). The test concurrency (`-concurrency`).
Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to
JOBS, except for Hotspot, where the default is *number of CPU cores/2*, but JOBS, except for Hotspot, where the default is *number of CPU cores/2* (for
never more than 12. sparc, if more than 16 cpus, then *number of CPU cores/5*, otherwise *number of
CPU cores/4*), but never more than *memory size in GB/2*.
#### TIMEOUT #### TIMEOUT_FACTOR
The timeout factor (`-timeoutFactor`). The timeout factor (`-timeoutFactor`).
Defaults to 4. Defaults to 4.
@ -245,6 +290,24 @@ to disable the limits.
Defaults to 512m, except for hotspot, where it defaults to 0 (no limit). Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
#### KEYWORDS
JTReg kewords sent to JTReg using `-k`. Please be careful in making sure that
spaces and special characters (like `!`) are properly quoted. To avoid some
issues, the special value `%20` can be used instead of space.
#### EXTRA_PROBLEM_LISTS
Use additional problem lists file or files, in addition to the default
ProblemList.txt located at the JTReg test roots.
If multiple file names are specified, they should be separated by space (or, to
help avoid quoting issues, the special value `%20`).
The file names should be either absolute, or relative to the JTReg test root of
the tests to be run.
#### OPTIONS #### OPTIONS
Additional options to the JTReg test framework. Additional options to the JTReg test framework.
@ -256,6 +319,12 @@ Additional Java options to JTReg (`-javaoption`).
#### VM_OPTIONS #### VM_OPTIONS
Additional VM options to JTReg (`-vmoption`). Additional VM options to JTReg (`-vmoption`).
#### AOT_MODULES
Generate AOT modules before testing for the specified module, or set of
modules. If multiple modules are specified, they should be separated by space
(or, to help avoid quoting issues, the special value `%20`).
### Gtest keywords ### Gtest keywords
#### REPEAT #### REPEAT
@ -270,6 +339,12 @@ Additional options to the Gtest test framework.
Use `GTEST="OPTIONS=--help"` to see all available Gtest options. Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
#### AOT_MODULES
Generate AOT modules before testing for the specified module, or set of
modules. If multiple modules are specified, they should be separated by space
(or, to help avoid quoting issues, the special value `%20`).
### Microbenchmark keywords ### Microbenchmark keywords
#### FORK #### FORK

View file

@ -35,7 +35,7 @@ DOCS_TARGETS :=
# On Windows tar frequently complains that "file changed as we read it" for # On Windows tar frequently complains that "file changed as we read it" for
# some random source files. This seems to be cause by anti virus scanners and # some random source files. This seems to be cause by anti virus scanners and
# is most likely safe to ignore. When it happens, tar returns '1'. # is most likely safe to ignore. When it happens, tar returns '1'.
ifeq ($(OPENJDK_BUILD_OS), windows) ifeq ($(call isBuildOs, windows), true)
TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1" TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
endif endif
@ -144,7 +144,7 @@ endef
# On Macosx, we bundle up the macosx specific images which already have the # On Macosx, we bundle up the macosx specific images which already have the
# correct base directories. # correct base directories.
ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release) ifeq ($(call isTargetOs, macosx)+$(DEBUG_LEVEL), true+release)
JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR) JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
JDK_BUNDLE_SUBDIR := JDK_BUNDLE_SUBDIR :=
@ -167,7 +167,7 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
# Create special filter rules when dealing with unzipped .dSYM directories on # Create special filter rules when dealing with unzipped .dSYM directories on
# macosx # macosx
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false) ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \ JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
$(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, $(ALL_JDK_FILES)))) $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, $(ALL_JDK_FILES))))

View file

@ -234,7 +234,7 @@ $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
$(call install-file) $(call install-file)
$(CHMOD) -f ug+w $@ $(CHMOD) -f ug+w $@
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(call isTargetOs, solaris), true)
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \ TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \ $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)) $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,7 @@ $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
################################################################################ ################################################################################
# Module specific build settings # Module specific build settings
java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
java.base_COPY += .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties java.base_COPY += .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
java.base_CLEAN += intrinsic.properties java.base_CLEAN += intrinsic.properties
@ -51,21 +51,18 @@ java.base_EXCLUDES += java/lang/doc-files
# data files and shouldn't go in the product # data files and shouldn't go in the product
java.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java java.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java
ifneq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(call isTargetOs, solaris), false)
java.base_EXCLUDE_FILES += \ java.base_EXCLUDE_FILES += \
SolarisLoginModule.java \ SolarisLoginModule.java \
SolarisSystem.java \ SolarisSystem.java \
# #
endif endif
ifeq ($(filter $(OPENJDK_TARGET_OS), solaris macosx aix), ) ifeq ($(call isTargetOs, solaris macosx aix), false)
#
# only solaris, macosx and aix
#
java.base_EXCLUDE_FILES += sun/nio/fs/PollingWatchService.java java.base_EXCLUDE_FILES += sun/nio/fs/PollingWatchService.java
endif endif
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
java.base_EXCLUDE_FILES += \ java.base_EXCLUDE_FILES += \
sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \ sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
# #
@ -82,7 +79,7 @@ java.datatransfer_COPY += flavormap.properties
################################################################################ ################################################################################
java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \ java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility \
'-Xdoclint/package:java.*,javax.*' -Xlint:exports \ '-Xdoclint/package:java.*,javax.*' -Xlint:exports \
--doclint-format html4 --doclint-format html4
java.desktop_COPY += .gif .png .wav .txt .xml .css .pf java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
@ -124,7 +121,7 @@ java.desktop_EXCLUDE_FILES += \
.template \ .template \
# #
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
# exclude all X11 on Mac. # exclude all X11 on Mac.
java.desktop_EXCLUDES += \ java.desktop_EXCLUDES += \
sun/awt/X11 \ sun/awt/X11 \
@ -186,7 +183,7 @@ else
sun/awt/X11/XwcTextItem.java sun/awt/X11/XwcTextItem.java
endif endif
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
java.desktop_EXCLUDES += com/sun/java/swing/plaf/gtk java.desktop_EXCLUDES += com/sun/java/swing/plaf/gtk
endif endif
@ -194,8 +191,7 @@ ifdef BUILD_HEADLESS_ONLY
java.desktop_EXCLUDES += sun/applet java.desktop_EXCLUDES += sun/applet
endif endif
# Used on windows and macosx ifeq ($(call isTargetOs, windows macosx), false)
ifeq ($(filter $(OPENJDK_TARGET_OS), windows macosx), )
java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java
endif endif
@ -224,15 +220,15 @@ java.scripting_CLEAN += .properties
################################################################################ ################################################################################
java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################ ################################################################################
java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################ ################################################################################
java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################ ################################################################################
@ -253,7 +249,7 @@ java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
################################################################################ ################################################################################
java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
java.sql.rowset_CLEAN_FILES += $(wildcard \ java.sql.rowset_CLEAN_FILES += $(wildcard \
$(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \ $(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \
$(TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties) $(TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
@ -267,14 +263,14 @@ java.rmi_CLEAN_FILES += $(wildcard \
################################################################################ ################################################################################
java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected \ java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility \
'-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \ '-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
javax.xml.transform javax.xml.validation javax.xml.xpath)' javax.xml.transform javax.xml.validation javax.xml.xpath)'
java.xml_CLEAN += .properties java.xml_CLEAN += .properties
################################################################################ ################################################################################
java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -Xlint:-exports java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' -Xlint:-exports
java.naming_CLEAN += jndiprovider.properties java.naming_CLEAN += jndiprovider.properties
################################################################################ ################################################################################
@ -283,7 +279,7 @@ java.security.jgss_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package
################################################################################ ################################################################################
java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
################################################################################ ################################################################################
@ -374,11 +370,11 @@ SCTP_IMPL_CLASSES = \
$(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SendFailed.java \ $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SendFailed.java \
$(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/Shutdown.java $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/Shutdown.java
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES) jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES)
endif endif
ifeq ($(OPENJDK_TARGET_OS),aix) ifeq ($(call isTargetOs, aix), true)
jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES) jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES)
endif endif
@ -465,6 +461,7 @@ jdk.internal.vm.compiler_EXCLUDES += \
org.graalvm.compiler.debug.test \ org.graalvm.compiler.debug.test \
org.graalvm.compiler.graph.test \ org.graalvm.compiler.graph.test \
org.graalvm.compiler.hotspot.amd64.test \ org.graalvm.compiler.hotspot.amd64.test \
org.graalvm.compiler.hotspot.jdk9.test \
org.graalvm.compiler.hotspot.lir.test \ org.graalvm.compiler.hotspot.lir.test \
org.graalvm.compiler.hotspot.sparc.test \ org.graalvm.compiler.hotspot.sparc.test \
org.graalvm.compiler.hotspot.test \ org.graalvm.compiler.hotspot.test \
@ -542,9 +539,14 @@ jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline -Xlint:-exports
################################################################################ ################################################################################
# If this is an imported module that has prebuilt classes, only compile # If this is an imported module that has prebuilt classes, only compile
# module-info.java. # module-info.java.
ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), ) ifneq ($(IMPORT_MODULES_CLASSES), )
IMPORT_MODULE_DIR := $(IMPORT_MODULES_CLASSES)/$(MODULE)
ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
$(MODULE)_INCLUDE_FILES := module-info.java $(MODULE)_INCLUDE_FILES := module-info.java
endif endif
else
IMPORT_MODULE_DIR :=
endif
################################################################################ ################################################################################
# Setup the compilation for the module # Setup the compilation for the module
@ -649,13 +651,13 @@ endif
# If this is an imported module, copy the pre built classes and resources into # If this is an imported module, copy the pre built classes and resources into
# the modules output dir # the modules output dir
ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), ) ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
$(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \ $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
$(call CacheFind, $(IMPORT_MODULES_CLASSES)/$(MODULE)) $(call CacheFind, $(IMPORT_MODULE_DIR))
$(call MakeDir, $(@D)) $(call MakeDir, $(@D))
# Do not delete marker and build meta data files # Do not delete marker and build meta data files
$(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*)) $(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
$(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE)/* $(@D)/ $(CP) -R $(IMPORT_MODULE_DIR)/* $(@D)/
$(TOUCH) $@ $(TOUCH) $@
TARGETS += $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker TARGETS += $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker

View file

@ -90,7 +90,7 @@ TARGETS += $(COMPILE_DEPEND) $(DEPEND_SERVICE_PROVIDER)
# To be able to call the javascript filter when generating man pages using # To be able to call the javascript filter when generating man pages using
# pandoc, we need to create this executable wrapper script. # pandoc, we need to create this executable wrapper script.
ifneq ($(PANDOC), ) ifeq ($(ENABLE_PANDOC), true)
# PANDOC_TROFF_MANPAGE_FILTER is duplicated for export in ToolsJdk.gmk. # PANDOC_TROFF_MANPAGE_FILTER is duplicated for export in ToolsJdk.gmk.
PANDOC_TROFF_MANPAGE_FILTER := \ PANDOC_TROFF_MANPAGE_FILTER := \
$(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-troff-manpage-filter $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-troff-manpage-filter

View file

@ -38,7 +38,7 @@ CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
$(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))) $(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR)))
ifneq ($(LIBS_DIR), ) ifneq ($(LIBS_DIR), )
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
$(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \ $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \

View file

@ -1,4 +1,4 @@
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include Modules.gmk include Modules.gmk
ifeq ($(MODULE), ) ifeq ($(MODULE), )
@ -37,7 +38,8 @@ $(eval $(call IncludeCustomExtension, CreateJmods.gmk))
################################################################################ ################################################################################
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
JMODS_TEMPDIR := $(SUPPORT_OUTPUTDIR)/jmods JMODS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jmods
JMOD_FILE := $(MODULE).jmod
LIBS_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \ LIBS_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS)))) $(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS))))
@ -118,7 +120,7 @@ ifeq ($(MODULE), java.base)
endif endif
endif endif
else # not java.base else # not java.base
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
# Only java.base needs to include the MSVC*_DLLs. Make sure no other module # Only java.base needs to include the MSVC*_DLLs. Make sure no other module
# tries to include them (typically imported ones). # tries to include them (typically imported ones).
ifneq ($(MSVCR_DLL), ) ifneq ($(MSVCR_DLL), )
@ -152,26 +154,27 @@ endif
# to avoid false incremental rebuilds. # to avoid false incremental rebuilds.
ifeq ($(INTERIM_JMOD), true) ifeq ($(INTERIM_JMOD), true)
DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS)) DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS))
INTERIM_MSG := interim$(SPACE)
endif endif
JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}'
# Create jmods in a temp dir and then move them into place to keep the # Create jmods in the support dir and then move them into place to keep the
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
$(JMODS_DIR)/$(MODULE).jmod: $(DEPS) $(eval $(call SetupExecute, create_$(JMOD_FILE), \
$(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@)) WARN := Creating $(INTERIM_MSG)$(JMOD_FILE), \
$(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR)) DEPS := $(DEPS), \
$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@) OUTPUT_FILE := $(JMODS_DIR)/$(JMOD_FILE), \
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/jmods/$(MODULE).jmod, \ SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
$(JMOD) create \ PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
--module-version $(VERSION_SHORT) \ COMMAND := $(JMOD) create --module-version $(VERSION_SHORT) \
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \ --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
--module-path $(JMODS_DIR) \ --module-path $(JMODS_DIR) $(JMOD_FLAGS) \
$(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) \ $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
) POST_COMMAND := $(MV) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE) $(JMODS_DIR)/$(JMOD_FILE), \
$(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@ ))
TARGETS += $(JMODS_DIR)/$(MODULE).jmod TARGETS += $(create_$(JMOD_FILE))
################################################################################ ################################################################################

View file

@ -1,4 +1,4 @@
# Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include Modules.gmk include Modules.gmk
include ModuleTools.gmk include ModuleTools.gmk
include ProcessMarkdown.gmk include ProcessMarkdown.gmk
@ -195,10 +196,13 @@ define setup_gengraph_dot_to_png
# For each module needing a graph, create a png file from the dot file # For each module needing a graph, create a png file from the dot file
# generated by the GenGraphs tool and store it in the target dir. # generated by the GenGraphs tool and store it in the target dir.
$$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER) $$(eval $$(call SetupExecute, gengraphs_png_$1_$2, \
$$(call MakeDir, $$(@D)) INFO := Running dot for module graphs for $2, \
$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \ DEPS := $$(gengraphs_$1_TARGET), \
$$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC)) OUTPUT_FILE := $$($1_$2_PNG_TARGET), \
SUPPORT_DIR := $$($1_GENGRAPHS_DIR), \
COMMAND := $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC), \
))
$1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET) $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
endef endef
@ -336,18 +340,18 @@ define SetupApiDocsGenerationBody
$1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \ $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
$$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module))))) $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
# Javadoc creates a lot of files but use index.html as a marker $$(eval $$(call SetupExecute, javadoc_$1, \
$$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \ WARN := Generating $1 javadoc for $$(words $$($1_ALL_MODULES)) modules, \
$$($1_SOURCE_DEPS) $$($1_OVERVIEW) INFO := Javadoc modules: $$($1_ALL_MODULES), \
$$(call LogWarn, Generating $1 javadoc for \ DEPS := $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_SOURCE_DEPS) \
$$(words $$($1_ALL_MODULES)) modules) $$($1_OVERVIEW), \
$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES)) OUTPUT_DIR := $$($1_TARGET_DIR), \
$$(call MakeDir, $$($1_TARGET_DIR)) SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/docs, \
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \ COMMAND := $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) $$($1_OPTIONS) \
$$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) \ $$($1_LOG_OPTION), \
$$($1_OPTIONS) $$($1_LOG_OPTION)) ))
$1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html $1_JAVADOC_TARGETS := $$(javadoc_$1_TARGET)
ifeq ($$(ENABLE_FULL_DOCS), true) ifeq ($$(ENABLE_FULL_DOCS), true)
# We have asked ModuleGraph to generate links to png files. Now we must # We have asked ModuleGraph to generate links to png files. Now we must
@ -367,19 +371,18 @@ define SetupApiDocsGenerationBody
$$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties $$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties
$1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
$1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
$$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS) $$(eval $$(call SetupExecute, gengraphs_$1, \
$$(call LogInfo, Running gengraphs for $1 documentation) INFO := Running gengraphs for $1 documentation, \
$$(call MakeDir, $$($1_GENGRAPHS_DIR)) DEPS := $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS), \
$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \ OUTPUT_DIR := $$($1_GENGRAPHS_DIR), \
$$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \ COMMAND := $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
--dot-attributes $$(GENGRAPHS_PROPS) && \ --dot-attributes $$(GENGRAPHS_PROPS), \
$$(TOUCH) $$($1_GENGRAPHS_MARKER)) ))
# For each module needing a graph, create a png file from the dot file # For each module needing a graph, create a png file from the dot file
# generated by the GenGraphs tool and store it in the target dir. # generated by the GenGraphs tool and store it in the target dir.
# They will depend on $1_GENGRAPHS_MARKER, and will be added to $1. # They will depend on gengraphs_$1_TARGET, and will be added to $1.
$$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \ $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
$$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \ $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
) )

View file

@ -29,19 +29,21 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include $(TOPDIR)/make/ModuleTools.gmk include $(TOPDIR)/make/ModuleTools.gmk
################################################################################ ################################################################################
PACKAGES_ATTRIBUTE_TARGET := $(JDK_OUTPUTDIR)/_packages_attribute.done
ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class) ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class)
$(PACKAGES_ATTRIBUTE_TARGET): $(ALL_MODULEINFO_CLASSES) $(BUILD_JIGSAW_CLASSES) $(eval $(call SetupExecute, optimize_image, \
$(call LogInfo, Optimizing the exploded image) INFO := Optimizing the exploded image, \
$(call ExecuteWithLog, $@, $(TOOL_ADD_PACKAGES_ATTRIBUTE) $(JDK_OUTPUTDIR)) DEPS := $(ALL_MODULEINFO_CLASSES) $(BUILD_JIGSAW_CLASSES), \
$(TOUCH) $@ OUTPUT_DIR := $(JDK_OUTPUTDIR), \
COMMAND := $(TOOL_ADD_PACKAGES_ATTRIBUTE) $(JDK_OUTPUTDIR), \
))
TARGETS := $(PACKAGES_ATTRIBUTE_TARGET) TARGETS := $(optimize_image_TARGET)
################################################################################ ################################################################################

View file

@ -59,6 +59,8 @@ ifeq ($(EXTERNAL_BUILDJDK), true)
INTERIM_IMAGE_DIR := $(BUILD_JDK) INTERIM_IMAGE_DIR := $(BUILD_JDK)
endif endif
# Save the stderr output of the command and print it along with stdout in case
# something goes wrong.
$(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR) $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
$(call MakeDir, $(LINK_OPT_DIR)) $(call MakeDir, $(LINK_OPT_DIR))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@)) $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
@ -67,7 +69,14 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \ -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.HelloClasslist \ build.tools.classlist.HelloClasslist \
$(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE) 2> $(LINK_OPT_DIR)/stderr > $(JLI_TRACE_FILE) \
|| ( \
exitcode=$$? ; \
$(ECHO) "ERROR: Failed to generate link optimization data." \
"This is likely a problem with the newly built JVM/JDK." ; \
$(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
exit $$exitcode \
)
$(GREP) -v HelloClasslist $@.raw > $@ $(GREP) -v HelloClasslist $@.raw > $@
# The jli trace is created by the same recipe as classlist. By declaring these # The jli trace is created by the same recipe as classlist. By declaring these

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -27,9 +27,9 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include Modules.gmk include Modules.gmk
TOOL_TARGETS :=
JDK_TARGETS := JDK_TARGETS :=
JRE_TARGETS := JRE_TARGETS :=
@ -56,9 +56,6 @@ BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod) JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod)
# Use this file inside the image as target for make rule
JIMAGE_TARGET_FILE := release
JLINK_ORDER_RESOURCES := **module-info.class JLINK_ORDER_RESOURCES := **module-info.class
JLINK_JLI_CLASSES := JLINK_JLI_CLASSES :=
ifeq ($(ENABLE_GENERATE_CLASSLIST), true) ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
@ -88,40 +85,61 @@ ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
endif endif
$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ $(eval $(call SetupExecute, jlink_jdk, \
$(call DependOnVariable, JDK_MODULES_LIST) $(BASE_RELEASE_FILE) WARN := Creating jdk image, \
$(call LogWarn, Creating jdk image) DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
$(RM) -r $(JDK_IMAGE_DIR) $(call DependOnVariable, JDK_MODULES_LIST), \
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jdk, \ OUTPUT_DIR := $(JDK_IMAGE_DIR), \
$(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \ SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
$(JLINK_JDK_EXTRA_OPTS) \ PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \
--output $(JDK_IMAGE_DIR) \ COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
) $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR), \
ifeq ($(BUILD_CDS_ARCHIVE), true) ))
$(call LogWarn, Creating CDS archive for jdk image)
$(FIXPATH) $(JDK_IMAGE_DIR)/bin/java \
-Xshare:dump -Xmx128M -Xms128M $(LOG_INFO)
endif
$(TOUCH) $@
$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ JLINK_JDK_TARGETS := $(jlink_jdk)
$(call DependOnVariable, JRE_MODULES_LIST) $(BASE_RELEASE_FILE)
$(call LogWarn, Creating legacy jre image)
$(RM) -r $(JRE_IMAGE_DIR)
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jre, \
$(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
$(JLINK_JRE_EXTRA_OPTS) \
--output $(JRE_IMAGE_DIR) \
)
ifeq ($(BUILD_CDS_ARCHIVE), true)
$(call LogWarn, Creating CDS archive for jre image)
$(FIXPATH) $(JRE_IMAGE_DIR)/bin/java \
-Xshare:dump -Xmx128M -Xms128M $(LOG_INFO)
endif
$(TOUCH) $@
TOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE) $(eval $(call SetupExecute, jlink_jre, \
TOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE) WARN := Creating legacy jre image, \
DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
$(call DependOnVariable, JDK_MODULES_LIST), \
OUTPUT_DIR := $(JDK_IMAGE_DIR), \
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
PRE_COMMAND := $(RM) -r $(JRE_IMAGE_DIR), \
COMMAND := $(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
$(JLINK_JRE_EXTRA_OPTS) --output $(JRE_IMAGE_DIR), \
))
JLINK_JRE_TARGETS := $(jlink_jre)
ifeq ($(BUILD_CDS_ARCHIVE), true)
ifeq ($(OPENJDK_TARGET_OS), windows)
CDS_ARCHIVE := bin/server/classes.jsa
else
CDS_ARCHIVE := lib/server/classes.jsa
endif
$(eval $(call SetupExecute, gen_cds_archive_jdk, \
WARN := Creating CDS archive for jdk image, \
DEPS := $(jlink_jdk), \
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_ARCHIVE), \
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
-Xmx128M -Xms128M $(LOG_INFO), \
))
JDK_TARGETS += $(gen_cds_archive_jdk)
$(eval $(call SetupExecute, gen_cds_archive_jre, \
WARN := Creating CDS archive for jre image, \
DEPS := $(jlink_jre), \
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_ARCHIVE), \
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
-Xmx128M -Xms128M $(LOG_INFO), \
))
JDK_TARGETS += $(gen_cds_archive_jdk)
endif
################################################################################ ################################################################################
# src.zip # src.zip
@ -144,7 +162,7 @@ ifneq ($(filter jdk, $(MAKECMDGOALS)), )
) )
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true) ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
DEMO_FILES := $(call not-containing, .dSYM, $(DEMO_FILES)) DEMO_FILES := $(call not-containing, .dSYM, $(DEMO_FILES))
else else
DEMO_FILES := $(filter-out %.debuginfo %.pdb %.map, $(DEMO_FILES)) DEMO_FILES := $(filter-out %.debuginfo %.pdb %.map, $(DEMO_FILES))
@ -192,7 +210,7 @@ ALL_JDK_MODULES := $(JDK_MODULES)
ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \ ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \
$(call FindTransitiveDepsForModule, $m))) $(call FindTransitiveDepsForModule, $m)))
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
LIBS_TARGET_SUBDIR := bin LIBS_TARGET_SUBDIR := bin
else else
LIBS_TARGET_SUBDIR := lib LIBS_TARGET_SUBDIR := lib
@ -211,7 +229,7 @@ else
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM # On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
# dirs. # dirs.
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
$(eval $(call FillCacheFind, \ $(eval $(call FillCacheFind, \
$(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs)) $(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs))
FindDebuginfoFiles = \ FindDebuginfoFiles = \
@ -244,11 +262,11 @@ $(eval $(call IncludeCustomExtension, Images-post.gmk))
################################################################################ ################################################################################
$(JRE_TARGETS): $(TOOL_JRE_TARGETS) $(JRE_TARGETS): $(JLINK_JRE_TARGETS)
$(JDK_TARGETS): $(TOOL_JDK_TARGETS) $(JDK_TARGETS): $(JLINK_JDK_TARGETS)
jdk: $(TOOL_JDK_TARGETS) $(JDK_TARGETS) jdk: $(JLINK_JDK_TARGETS) $(JDK_TARGETS)
jre: $(TOOL_JRE_TARGETS) $(JRE_TARGETS) jre: $(JLINK_JRE_TARGETS) $(JRE_TARGETS)
symbols: $(SYMBOLS_TARGETS) symbols: $(SYMBOLS_TARGETS)
all: jdk jre symbols all: jdk jre symbols

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -277,7 +277,7 @@ else # HAS_SPEC=true
else else
$(ECHO) "Re-running configure using default settings" $(ECHO) "Re-running configure using default settings"
endif endif
( cd $(OUTPUTDIR) && PATH="$(ORIGINAL_PATH)" \ ( cd $(OUTPUTDIR) && PATH="$(ORIGINAL_PATH)" AUTOCONF="$(AUTOCONF)" \
CUSTOM_ROOT="$(CUSTOM_ROOT)" \ CUSTOM_ROOT="$(CUSTOM_ROOT)" \
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \ CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
$(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )

View file

@ -483,7 +483,7 @@ else # $(HAS_SPEC)=true
$(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
endef endef
ifeq ($(OPENJDK_BUILD_OS), windows) ifeq ($(call isBuildOs, windows), true)
# On windows we need to synchronize with the javac server to be able to # On windows we need to synchronize with the javac server to be able to
# move or remove the build output directory. Since we have no proper # move or remove the build output directory. Since we have no proper
# synchronization process, wait for a while and hope it helps. This is only # synchronization process, wait for a while and hope it helps. This is only

View file

@ -30,7 +30,7 @@ include TextFileProcessing.gmk
default: bundles default: bundles
# Only macosx has bundles defined. # Only macosx has bundles defined.
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
bundles: jre-bundle jdk-bundle bundles: jre-bundle jdk-bundle

View file

@ -456,7 +456,7 @@ define DeclareInterimJmodRecipe
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \ +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
MODULE=$1 \ MODULE=$1 \
JMODS_DIR=$(INTERIM_JMODS_DIR) \ JMODS_DIR=$(INTERIM_JMODS_DIR) \
JMODS_TEMPDIR=$(INTERIM_JMODS_DIR)/temp \ JMODS_SUPPORT_DIR=$(INTERIM_JMODS_DIR)/support \
INTERIM_JMOD=true \ INTERIM_JMOD=true \
) )
endef endef
@ -479,10 +479,11 @@ ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
define DeclareRunTestRecipe define DeclareRunTestRecipe
test-$1: test-$1:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1") +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
TEST="$1")
exploded-test-$1: exploded-test-$1:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
endef endef
@ -490,21 +491,11 @@ endef
$(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t))) $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS)) ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS))
define DeclareRunJCovTestRecipe
jcov-test-$1:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
TEST="$1" TEST_OPTS_JCOV=true)
endef
# jcov-test only makes sense for some of the tests
$(foreach t, $(JCOV_NAMED_TESTS), $(eval $(call DeclareRunJCovTestRecipe,$t)))
ALL_JCOV_TEST_TARGETS := $(addprefix jcov-test-, $(JCOV_NAMED_TESTS))
# We only support the "exploded-test-gtest" shortcut # We only support the "exploded-test-gtest" shortcut
ALL_EXPLODED_TESTS := gtest ALL_EXPLODED_TESTS := gtest
ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS)) ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS))
ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS) $(ALL_JCOV_TEST_TARGETS) ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS)
################################################################################ ################################################################################
# Build tests and microbenchmarks # Build tests and microbenchmarks
@ -571,10 +562,11 @@ ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
# Run tests # Run tests
test: test:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)") +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
TEST="$(TEST)")
exploded-test: exploded-test:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
jcov-test: jcov-test:
@ -774,6 +766,8 @@ else
$(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc)) $(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
$(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java)) $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))
$(COMPILE_COMMANDS_TARGETS_HOTSPOT): clean-compile-commands
$(COMPILE_COMMANDS_TARGETS_JDK): clean-compile-commands
compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK) compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
@ -891,7 +885,6 @@ else
# Declare dependency for all generated test targets # Declare dependency for all generated test targets
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image)) $(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image))
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image)) $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
$(ALL_JCOV_TEST_TARGETS): jcov-image test-image
create-buildjdk-copy: jdk.jlink-java java.base-gendata \ create-buildjdk-copy: jdk.jlink-java java.base-gendata \
$(addsuffix -java, $(INTERIM_IMAGE_MODULES)) $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
@ -1041,7 +1034,7 @@ ifneq ($(CREATE_BUILDJDK), true)
endif endif
endif endif
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(call isTargetOs, macosx), true)
product-images: mac-jdk-bundle product-images: mac-jdk-bundle
endif endif
@ -1127,7 +1120,8 @@ ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
# file. # file.
CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \ CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
images make-support test-make bundles buildjdk test-results test-support images make-support test-make bundles buildjdk test-results test-support \
support/images
CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS)) CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
CLEAN_SUPPORT_DIRS += demos CLEAN_SUPPORT_DIRS += demos
CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS)) CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
@ -1148,6 +1142,9 @@ clean: $(CLEAN_DIR_TARGETS)
clean-docs: clean-docs:
$(call CleanDocs) $(call CleanDocs)
clean-compile-commands:
$(call CleanMakeSupportDir,compile-commands)
$(CLEAN_DIR_TARGETS): $(CLEAN_DIR_TARGETS):
$(call CleanDir,$(patsubst clean-%, %, $@)) $(call CleanDir,$(patsubst clean-%, %, $@))
@ -1174,6 +1171,9 @@ clean-support: clean-jdk
clean-test: clean-test-results clean-test-support clean-test: clean-test-results clean-test-support
# When cleaning images, also clean the support/images directory.
clean-images: clean-support/images
# Remove everything, including configure configuration. If the output # Remove everything, including configure configuration. If the output
# directory was created by configure and now becomes empty, remove it as well. # directory was created by configure and now becomes empty, remove it as well.
dist-clean: clean dist-clean: clean
@ -1190,9 +1190,9 @@ dist-clean: clean
) )
$(ECHO) Cleaned everything, you will have to re-run configure. $(ECHO) Cleaned everything, you will have to re-run configure.
ALL_TARGETS += clean clean-docs dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_SUPPORT_DIR_TARGETS) \ ALL_TARGETS += clean clean-docs clean-compile-commands dist-clean $(CLEAN_DIR_TARGETS) \
$(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) \ $(CLEAN_SUPPORT_DIR_TARGETS) $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) \
$(CLEAN_MODULE_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
################################################################################ ################################################################################
# Declare *-only targets for each normal target # Declare *-only targets for each normal target

View file

@ -54,6 +54,13 @@ define CleanSupportDir
@$(PRINTF) " done\n" @$(PRINTF) " done\n"
endef endef
define CleanMakeSupportDir
@$(PRINTF) "Cleaning $(strip $1) make support artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1)
@$(PRINTF) " done\n"
endef
define CleanTest define CleanTest
@$(PRINTF) "Cleaning test $(strip $1) ..." @$(PRINTF) "Cleaning test $(strip $1) ..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(PRINTF) "\n" $(LOG_DEBUG)

View file

@ -42,7 +42,7 @@ TARGETS :=
include $(MAKEFILE_PREFIX)-$(MODULE).gmk include $(MAKEFILE_PREFIX)-$(MODULE).gmk
# Setup copy rules from the modules directories to the jdk image directory. # Setup copy rules from the modules directories to the jdk image directory.
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
$(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \ $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \

View file

@ -45,8 +45,8 @@ ifneq ($(TEST_VM_OPTS), )
endif endif
$(eval $(call ParseKeywordVariable, TEST_OPTS, \ $(eval $(call ParseKeywordVariable, TEST_OPTS, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR AOT_MODULES JCOV, \ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV, \
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \ STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
)) ))
# Helper function to propagate TEST_OPTS values. # Helper function to propagate TEST_OPTS values.
@ -61,7 +61,7 @@ define SetTestOpt
endef endef
# Setup _NT_SYMBOL_PATH on Windows # Setup _NT_SYMBOL_PATH on Windows
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
ifndef _NT_SYMBOL_PATH ifndef _NT_SYMBOL_PATH
# Can't use PathList here as it adds quotes around the value. # Can't use PathList here as it adds quotes around the value.
_NT_SYMBOL_PATH := \ _NT_SYMBOL_PATH := \
@ -72,7 +72,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
) \ ) \
)) ))
export _NT_SYMBOL_PATH export _NT_SYMBOL_PATH
$(info _NT_SYMBOL_PATH=$(_NT_SYMBOL_PATH)) $(call LogDebug, Rewriting _NT_SYMBOL_PATH to $(_NT_SYMBOL_PATH))
endif endif
endif endif
@ -81,6 +81,9 @@ endif
$(eval $(call IncludeCustomExtension, RunTests.gmk)) $(eval $(call IncludeCustomExtension, RunTests.gmk))
################################################################################ ################################################################################
# This is the JDK that we will test
JDK_UNDER_TEST := $(JDK_IMAGE_DIR)
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
TEST_SUMMARY := $(TEST_RESULTS_DIR)/test-summary.txt TEST_SUMMARY := $(TEST_RESULTS_DIR)/test-summary.txt
@ -104,8 +107,35 @@ ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
-timeoutHandlerTimeout:0 -timeoutHandlerTimeout:0
endif endif
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher)) GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS))) $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
$(GTEST_LAUNCHER_DIRS)))
COV_ENVIRONMENT :=
JTREG_COV_OPTIONS :=
ifeq ($(TEST_OPTS_JCOV), true)
JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
JCOV_RESULT_FILE := $(JCOV_OUTPUT_DIR)/result.xml
JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
JCOV_MEM_OPTIONS := -Xms64m -Xmx4g
# Replace our normal test JDK with the JCov image.
JDK_UNDER_TEST := $(JCOV_IMAGE_DIR)
COV_ENVIRONMENT += JAVA_TOOL_OPTIONS="$(JCOV_MEM_OPTIONS)" \
_JAVA_OPTIONS="$(JCOV_MEM_OPTIONS)"
JTREG_COV_OPTIONS += -e:JAVA_TOOL_OPTIONS='$(JCOV_MEM_OPTIONS)' \
-e:_JAVA_OPTIONS='$(JCOV_MEM_OPTIONS)'
endif
ifeq ($(GCOV_ENABLED), true)
GCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/gcov-output
COV_ENVIRONMENT += GCOV_PREFIX="$(GCOV_OUTPUT_DIR)"
JTREG_COV_OPTIONS += -e:GCOV_PREFIX="$(GCOV_OUTPUT_DIR)"
endif
################################################################################ ################################################################################
# Optionally create AOT libraries for specified modules before running tests. # Optionally create AOT libraries for specified modules before running tests.
@ -129,37 +159,35 @@ define SetupAotModuleBody
$1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE)) $1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE))
$1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt) $1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt)
ifeq ($(OPENJDK_TARGET_OS), windows)
$1_LD := $$(addsuffix $$(EXE_SUFFIX), $$(filter-out $$(FIXPATH), $$(LD)))
else
$1_LD := $$(LD)
endif
# Create jaotc flags. # Create jaotc flags.
# VM flags which don't affect AOT code generation are filtered out: -Xcomp, -XX:+-TieredCompilation # VM flags which don't affect AOT code generation are filtered out:
# -Xcomp, -XX:+-TieredCompilation
$1_JAOTC_OPTS := \ $1_JAOTC_OPTS := \
-J-Xmx4g --info \ -J-Xmx4g --info \
$$(addprefix -J, $$(filter-out -Xcomp %TieredCompilation, $$($1_VM_OPTIONS))) \ $$(addprefix -J, $$(filter-out -Xcomp %TieredCompilation, $$($1_VM_OPTIONS))) \
$$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \ $$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \
--linker-path $$($1_LD) \ --linker-path $$(LD_JAOTC) \
# #
ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), ) ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), )
$1_JAOTC_OPTS += --compile-with-assertions $1_JAOTC_OPTS += --compile-with-assertions
endif endif
$$($1_AOT_LIB): $$(JDK_IMAGE_DIR)/release \ $$($1_AOT_LIB): $$(JDK_UNDER_TEST)/release \
$$(call DependOnVariable, $1_JAOTC_OPTS) \ $$(call DependOnVariable, $1_JAOTC_OPTS) \
$$(call DependOnVariable, JDK_IMAGE_DIR) $$(call DependOnVariable, JDK_UNDER_TEST)
$$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@)) $$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@))
$$(call MakeTargetDir) $$(call MakeTargetDir)
$$(call ExecuteWithLog, $$@, \ $$(call ExecuteWithLog, $$@, \
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \ $((COV_ENVIRONMENT) \
$$(FIXPATH) $$(JDK_UNDER_TEST)/bin/jaotc \
$$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \ $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
) )
$$(call ExecuteWithLog, $$@.check, \ $$(call ExecuteWithLog, $$@.check, \
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \ $$(FIXPATH) $$(JDK_UNDER_TEST)/bin/java \
$$($1_VM_OPTIONS) -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary=$$@ -version \ $$($1_VM_OPTIONS) -XX:+UnlockDiagnosticVMOptions \
-XX:+PrintAOT -XX:+UseAOTStrictLoading \
-XX:AOTLibrary=$$@ -version \
> $$@.verify-aot \ > $$@.verify-aot \
) )
@ -206,7 +234,7 @@ TEST_JOBS_FACTOR_MACHINE ?= 1
ifeq ($(TEST_JOBS), 0) ifeq ($(TEST_JOBS), 0)
CORES_DIVIDER := 2 CORES_DIVIDER := 2
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) ifeq ($(call isTargetCpuArch, sparc), true)
# For smaller SPARC machines we see reasonable scaling of throughput up to # For smaller SPARC machines we see reasonable scaling of throughput up to
# cpus/4 without affecting test reliability. On the bigger machines, cpus/4 # cpus/4 without affecting test reliability. On the bigger machines, cpus/4
# causes intermittent timeouts. # causes intermittent timeouts.
@ -249,9 +277,10 @@ $(eval $(call SetTestOpt,JOBS,JTREG))
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG)) $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
$(eval $(call ParseKeywordVariable, JTREG, \ $(eval $(call ParseKeywordVariable, JTREG, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN \
EXTRA_PROBLEM_LISTS KEYWORDS AOT_MODULES, \ MAX_MEM, \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \ STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
EXTRA_PROBLEM_LISTS AOT_MODULES, \
)) ))
ifneq ($(JTREG), ) ifneq ($(JTREG), )
@ -266,8 +295,8 @@ $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
$(eval $(call SetTestOpt,AOT_MODULES,GTEST)) $(eval $(call SetTestOpt,AOT_MODULES,GTEST))
$(eval $(call ParseKeywordVariable, GTEST, \ $(eval $(call ParseKeywordVariable, GTEST, \
SINGLE_KEYWORDS := REPEAT AOT_MODULES, \ SINGLE_KEYWORDS := REPEAT, \
STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \ STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
)) ))
ifneq ($(GTEST), ) ifneq ($(GTEST), )
@ -282,7 +311,8 @@ $(eval $(call SetTestOpt,JAVA_OPTIONS,MICRO))
$(eval $(call ParseKeywordVariable, MICRO, \ $(eval $(call ParseKeywordVariable, MICRO, \
SINGLE_KEYWORDS := ITER FORK TIME WARMUP_ITER WARMUP_TIME, \ SINGLE_KEYWORDS := ITER FORK TIME WARMUP_ITER WARMUP_TIME, \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS RESULTS_FORMAT TEST_JDK BENCHMARKS_JAR, \ STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS RESULTS_FORMAT TEST_JDK \
BENCHMARKS_JAR, \
)) ))
ifneq ($(MICRO), ) ifneq ($(MICRO), )
@ -348,8 +378,8 @@ endef
# Helper function to determine if a test specification is a microbenchmark test # Helper function to determine if a test specification is a microbenchmark test
# #
# It is a microbenchmark test if it is either "micro", or "micro:" followed by an optional # It is a microbenchmark test if it is either "micro", or "micro:" followed by
# test filter string. # an optional test filter string.
define ParseMicroTestSelection define ParseMicroTestSelection
$(if $(filter micro%, $1), \ $(if $(filter micro%, $1), \
$(if $(filter micro, $1), \ $(if $(filter micro, $1), \
@ -439,8 +469,8 @@ endef
# Helper function to determine if a test specification is a special test # Helper function to determine if a test specification is a special test
# #
# It is a special test if it is "special:" followed by a test name, # It is a special test if it is "special:" followed by a test name,
# if it is "make:" or "make-" followed by a make test, or any of the special test names # if it is "make:" or "make-" followed by a make test, or any of the special
# as a single word. # test names as a single word.
define ParseSpecialTestSelection define ParseSpecialTestSelection
$(if $(filter special:%, $1), \ $(if $(filter special:%, $1), \
$1 \ $1 \
@ -555,13 +585,13 @@ define SetupRunGtestTestBody
)) ))
endif endif
run-test-$1: $$($1_AOT_TARGETS) run-test-$1: pre-run-test $$($1_AOT_TARGETS)
$$(call LogWarn) $$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)') $$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \ $$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \ $$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
-jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \ -jdk $(JDK_UNDER_TEST) $$($1_GTEST_FILTER) \
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \ --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
$$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \ $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
$$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \ $$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \
@ -595,7 +625,11 @@ define SetupRunGtestTestBody
$$(eval $1_TOTAL := 1) \ $$(eval $1_TOTAL := 1) \
) )
TARGETS += run-test-$1 parse-test-$1 $1: run-test-$1 parse-test-$1
TARGETS += $1 run-test-$1 parse-test-$1
TEST_TARGETS += parse-test-$1
endef endef
################################################################################ ################################################################################
@ -629,15 +663,18 @@ define SetupRunMicroTestBody
$1_TEST_NAME := $$(strip $$(patsubst micro:%, %, $$($1_TEST))) $1_TEST_NAME := $$(strip $$(patsubst micro:%, %, $$($1_TEST)))
$$(eval $$(call SetMicroValue,$1,MICRO_BENCHMARKS_JAR,$$(TEST_IMAGE_DIR)/micro/benchmarks.jar)) $$(eval $$(call SetMicroValue,$1,MICRO_BENCHMARKS_JAR,$$(TEST_IMAGE_DIR)/micro/benchmarks.jar))
$$(eval $$(call SetMicroValue,$1,MICRO_TEST_JDK,$$(JDK_IMAGE_DIR))) $$(eval $$(call SetMicroValue,$1,MICRO_TEST_JDK,$$(JDK_UNDER_TEST)))
$$(eval $$(call SetMicroValue,$1,MICRO_JAVA_OPTIONS)) $$(eval $$(call SetMicroValue,$1,MICRO_JAVA_OPTIONS))
# Current tests needs to open java.io # Current tests needs to open java.io
$1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED $1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED
# Set library path for native dependencies
$1_MICRO_JAVA_OPTIONS += -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native
# Save output as JSON or CSV file # Save output as JSON or CSV file
ifneq ($$(MICRO_RESULTS_FORMAT), ) ifneq ($$(MICRO_RESULTS_FORMAT), )
$1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT) -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT) $1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT)
$1_MICRO_BASIC_OPTIONS += -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
endif endif
ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), ) ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
@ -660,12 +697,13 @@ define SetupRunMicroTestBody
$1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME) $1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)
endif endif
run-test-$1: run-test-$1: pre-run-test
$$(call LogWarn) $$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)') $$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, \ $$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, \
$$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) -jar $$($1_MICRO_BENCHMARKS_JAR) \ $$(FIXPATH) $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) \
-jar $$($1_MICRO_BENCHMARKS_JAR) \
$$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \ $$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
$$($1_MICRO_WARMUP_ITER) $$($1_MICRO_WARMUP_TIME) \ $$($1_MICRO_WARMUP_ITER) $$($1_MICRO_WARMUP_TIME) \
$$($1_MICRO_VM_OPTIONS) $$($1_MICRO_BASIC_OPTIONS) $$(MICRO_OPTIONS) \ $$($1_MICRO_VM_OPTIONS) $$($1_MICRO_BASIC_OPTIONS) $$(MICRO_OPTIONS) \
@ -700,7 +738,11 @@ define SetupRunMicroTestBody
$$(eval $1_TOTAL := 1) \ $$(eval $1_TOTAL := 1) \
) )
TARGETS += run-test-$1 parse-test-$1 $1: run-test-$1 parse-test-$1
TARGETS += $1 run-test-$1 parse-test-$1
TEST_TARGETS += parse-test-$1
endef endef
################################################################################ ################################################################################
@ -779,7 +821,7 @@ define SetupRunJtregTestBody
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS)) $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
# SPARC is in general slower per core so need to scale up timeouts a bit. # SPARC is in general slower per core so need to scale up timeouts a bit.
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) ifeq ($(call isTargetCpuArch, sparc), true)
JTREG_TIMEOUT_FACTOR ?= 8 JTREG_TIMEOUT_FACTOR ?= 8
else else
JTREG_TIMEOUT_FACTOR ?= 4 JTREG_TIMEOUT_FACTOR ?= 4
@ -806,7 +848,7 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK) $1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
# If running on Windows, propagate the _NT_SYMBOL_PATH to enable # If running on Windows, propagate the _NT_SYMBOL_PATH to enable
# symbol lookup in hserr files # symbol lookup in hserr files
ifeq ($$(OPENJDK_TARGET_OS), windows) ifeq ($$(call isTargetOs, windows), true)
$1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH $1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
endif endif
@ -870,22 +912,22 @@ define SetupRunJtregTestBody
clean-workdir-$1: clean-workdir-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR) $$(RM) -r $$($1_TEST_SUPPORT_DIR)
run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS) run-test-$1: pre-run-test clean-workdir-$1 $$($1_AOT_TARGETS)
$$(call LogWarn) $$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)') $$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \ $$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
$$(JCOV_ENVIRONMENT) \ $$(COV_ENVIRONMENT) \
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \ -Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
$$($1_JTREG_BASIC_OPTIONS) \ $$($1_JTREG_BASIC_OPTIONS) \
-testjdk:$$(JDK_IMAGE_DIR) \ -testjdk:$$(JDK_UNDER_TEST) \
-dir:$$(JTREG_TOPDIR) \ -dir:$$(JTREG_TOPDIR) \
-reportDir:$$($1_TEST_RESULTS_DIR) \ -reportDir:$$($1_TEST_RESULTS_DIR) \
-workDir:$$($1_TEST_SUPPORT_DIR) \ -workDir:$$($1_TEST_SUPPORT_DIR) \
$$(JTREG_OPTIONS) \ $$(JTREG_OPTIONS) \
$$(JTREG_FAILURE_HANDLER_OPTIONS) \ $$(JTREG_FAILURE_HANDLER_OPTIONS) \
$$(JTREG_JCOV_OPTIONS) \ $$(JTREG_COV_OPTIONS) \
$$($1_TEST_NAME) \ $$($1_TEST_NAME) \
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \ && $$(ECHO) $$$$? > $$($1_EXITCODE) \
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \ || $$(ECHO) $$$$? > $$($1_EXITCODE) \
@ -919,7 +961,11 @@ define SetupRunJtregTestBody
$$(eval $1_TOTAL := 1) \ $$(eval $1_TOTAL := 1) \
) )
TARGETS += run-test-$1 parse-test-$1 $1: run-test-$1 parse-test-$1 clean-workdir-$1
TARGETS += $1 run-test-$1 parse-test-$1 clean-workdir-$1
TEST_TARGETS += parse-test-$1
endef endef
################################################################################ ################################################################################
@ -957,7 +1003,7 @@ define SetupRunSpecialTestBody
$$(error Invalid special test specification: $$($1_TEST_NAME)) $$(error Invalid special test specification: $$($1_TEST_NAME))
endif endif
run-test-$1: $(TEST_PREREQS) run-test-$1: pre-run-test
$$(call LogWarn) $$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)') $$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@ -981,7 +1027,11 @@ define SetupRunSpecialTestBody
$$(eval $1_ERROR := 0) $$(eval $1_ERROR := 0)
$$(eval $1_TOTAL := 0) $$(eval $1_TOTAL := 0)
TARGETS += run-test-$1 parse-test-$1 $1: run-test-$1 parse-test-$1
TARGETS += $1 run-test-$1 parse-test-$1
TEST_TARGETS += parse-test-$1
endef endef
################################################################################ ################################################################################
@ -1043,12 +1093,36 @@ endif
# The main target for RunTests.gmk # The main target for RunTests.gmk
################################################################################ ################################################################################
# The SetupRun*Test functions have populated TARGETS. #
# Provide hooks for adding functionality before and after all tests are run.
#
$(call LogInfo, RunTest setup starting)
# This target depends on all actual test having been run (TEST_TARGETS has beeen
# populated by the SetupRun*Test functions). If you need to provide a teardown
# hook, you must let it depend on this target.
run-all-tests: $(TEST_TARGETS)
$(call LogInfo, RunTest teardown starting)
# This is an abstract target that will be run before any actual tests. Add your
# target as a dependency to thisif you need "setup" type functionality executed
# before all tests.
pre-run-test:
$(call LogInfo, RunTest setup done)
# This is an abstract target that will be run after all actual tests, but before
# the test summary. If you need "teardown" type functionality, add your target
# as a dependency on this, and let the teardown target depend on run-all-tests.
post-run-test: run-all-tests
$(call LogInfo, RunTest teardown done)
#
# Create and print a table of the result of all tests run
#
TEST_FAILURE := false TEST_FAILURE := false
run-test: $(TARGETS) run-test-report: post-run-test
# Create and print a table of the result of all tests run
$(RM) $(TEST_SUMMARY).old 2> /dev/null $(RM) $(TEST_SUMMARY).old 2> /dev/null
$(MV) $(TEST_SUMMARY) $(TEST_SUMMARY).old 2> /dev/null || true $(MV) $(TEST_SUMMARY) $(TEST_SUMMARY).old 2> /dev/null || true
$(RM) $(TEST_LAST_IDS).old 2> /dev/null $(RM) $(TEST_LAST_IDS).old 2> /dev/null
@ -1092,27 +1166,17 @@ run-test: $(TARGETS)
$(CAT) $(TEST_SUMMARY) $(CAT) $(TEST_SUMMARY)
$(ECHO) $(ECHO)
# The main run-test target
run-test: run-test-report
TARGETS += run-all-tests pre-run-test post-run-test run-test-report run-test
################################################################################ ################################################################################
# Setup JCov # Setup JCov
################################################################################ ################################################################################
ifeq ($(TEST_OPTS_JCOV), true) ifeq ($(TEST_OPTS_JCOV), true)
JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
JCOV_RESULT_FILE := $(JCOV_OUTPUT_DIR)/result.xml
JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
JCOV_MEM_OPTIONS := -Xms64m -Xmx4g
ifneq ($(JCOV_IMAGE_DIR), )
JDK_IMAGE_DIR := $(JCOV_IMAGE_DIR)
endif
JCOV_ENVIRONMENT := JAVA_TOOL_OPTIONS="$(JCOV_MEM_OPTIONS)" \
_JAVA_OPTIONS="$(JCOV_MEM_OPTIONS)"
JTREG_JCOV_OPTIONS := -e:JAVA_TOOL_OPTIONS='$(JCOV_MEM_OPTIONS)' \
-e:_JAVA_OPTIONS='$(JCOV_MEM_OPTIONS)'
jcov-do-start-grabber: jcov-do-start-grabber:
$(call MakeDir, $(JCOV_OUTPUT_DIR)) $(call MakeDir, $(JCOV_OUTPUT_DIR))
if $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -status 1>/dev/null 2>&1 ; then \ if $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -status 1>/dev/null 2>&1 ; then \
@ -1130,14 +1194,21 @@ ifeq ($(TEST_OPTS_JCOV), true)
$(call LogWarn, Stopping JCov Grabber...) $(call LogWarn, Stopping JCov Grabber...)
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600 $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600
jcov-gen-report: run-test jcov-stop-grabber jcov-gen-report: jcov-stop-grabber
$(call LogWarn, Generating JCov report ...) $(call LogWarn, Generating JCov report ...)
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \ $(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
`$(ECHO) $(TOPDIR)/src/*/share/classes/ | $(TR) ' ' ':'` -fmt html \ `$(ECHO) $(TOPDIR)/src/*/share/classes/ | $(TR) ' ' ':'` -fmt html \
-o $(JCOV_REPORT) $(JCOV_RESULT_FILE) -o $(JCOV_REPORT) $(JCOV_RESULT_FILE)
$(TARGETS): jcov-start-grabber TARGETS += jcov-do-start-grabber jcov-start-grabber jcov-stop-grabber \
all: jcov-gen-report jcov-gen-report
# Hook this into the framework at appropriate places
pre-run-test: jcov-start-grabber
post-run-test: jcov-gen-report
jcov-gen-report: run-all-tests
endif endif
@ -1145,4 +1216,4 @@ endif
all: run-test all: run-test
.PHONY: default all run-test $(TARGETS) .PHONY: default all $(TARGETS)

View file

@ -95,12 +95,12 @@ endef
# $1: The output file name # $1: The output file name
# $2..$N: The lines to output to the file # $2..$N: The lines to output to the file
define CreateNewSpec define CreateNewSpec
$(if $(strip $(31)), \ $(if $(strip $(33)), \
$(error Internal makefile error: \ $(error Internal makefile error: \
Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \ Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
) \ ) \
$(shell $(RM) $1) \ $(shell $(RM) $1) \
$(foreach i, $(call sequence, 2, 30), \ $(foreach i, $(call sequence, 2, 32), \
$(if $(strip $($i)), \ $(if $(strip $($i)), \
$(call AppendFile, $(strip $($i)), $1) \ $(call AppendFile, $(strip $($i)), $1) \
) \ ) \
@ -254,31 +254,35 @@ endif
# Setup LD for AOT support # Setup LD for AOT support
ifneq ($(DEVKIT_HOME), ) ifneq ($(DEVKIT_HOME), )
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
LD := $(DEVKIT_HOME)/VC/bin/x64/link LD_JAOTC := $(DEVKIT_HOME)/VC/bin/x64/link.exe
LIBRARY_PREFIX := LIBRARY_PREFIX :=
SHARED_LIBRARY_SUFFIX := .dll SHARED_LIBRARY_SUFFIX := .dll
EXE_SUFFIX := .exe
else ifeq ($(OPENJDK_TARGET_OS), linux) else ifeq ($(OPENJDK_TARGET_OS), linux)
LD := $(DEVKIT_HOME)/bin/ld LD_JAOTC := $(DEVKIT_HOME)/bin/ld
LIBRARY_PREFIX := lib LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so SHARED_LIBRARY_SUFFIX := .so
EXE_SUFFIX :=
else ifeq ($(OPENJDK_TARGET_OS), macosx) else ifeq ($(OPENJDK_TARGET_OS), macosx)
LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld LD_JAOTC := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LIBRARY_PREFIX := lib LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .dylib SHARED_LIBRARY_SUFFIX := .dylib
EXE_SUFFIX :=
else ifeq ($(OPENJDK_TARGET_OS), solaris) else ifeq ($(OPENJDK_TARGET_OS), solaris)
# Prefer system linker for AOT on Solaris. # Prefer system linker for AOT on Solaris.
LD := ld LD_JAOTC := ld
LIBRARY_PREFIX := lib LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so SHARED_LIBRARY_SUFFIX := .so
EXE_SUFFIX :=
endif endif
else else
LD := ld LD := ld
endif endif
ifneq ($(wildcard $(JDK_IMAGE_DIR)/template.xml), )
TEST_OPTS_JCOV := true
JCOV_IMAGE_DIR := $(JDK_IMAGE_DIR)
else
TEST_OPTS_JCOV := false
JCOV_IMAGE_DIR :=
endif
################################################################################ ################################################################################
# Generate the ephemeral spec file # Generate the ephemeral spec file
################################################################################ ################################################################################
@ -299,6 +303,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
BOOT_JDK := $(BOOT_JDK), \ BOOT_JDK := $(BOOT_JDK), \
JT_HOME := $(JT_HOME), \ JT_HOME := $(JT_HOME), \
JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \ JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
JCOV_IMAGE_DIR := $(JCOV_IMAGE_DIR), \
TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \ TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \ SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
MAKE := $(MAKE), \ MAKE := $(MAKE), \
@ -315,11 +320,11 @@ $(call CreateNewSpec, $(NEW_SPEC), \
OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \ OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
NUM_CORES := $(NUM_CORES), \ NUM_CORES := $(NUM_CORES), \
MEMORY_SIZE := $(MEMORY_SIZE), \ MEMORY_SIZE := $(MEMORY_SIZE), \
LD := $(LD), \ LD_JAOTC := $(LD_JAOTC), \
LIBRARY_PREFIX := $(LIBRARY_PREFIX), \ LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \ SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
EXE_SUFFIX := $(EXE_SUFFIX), \
include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \ include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
TEST_OPTS_JCOV := $(TEST_OPTS_JCOV), \
$(CUSTOM_NEW_SPEC_LINE), \ $(CUSTOM_NEW_SPEC_LINE), \
) )

View file

@ -30,7 +30,7 @@ include MakeBase.gmk
############################################################################ ############################################################################
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
FIXPATH_COPY := $(TEST_IMAGE_DIR)/bin/fixpath.exe FIXPATH_COPY := $(TEST_IMAGE_DIR)/bin/fixpath.exe
$(FIXPATH_COPY): $(firstword $(FIXPATH)) $(FIXPATH_COPY): $(firstword $(FIXPATH))

View file

@ -34,7 +34,7 @@ include ProcessMarkdown.gmk
# #
################################################################################ ################################################################################
ifeq ($(PANDOC), ) ifeq ($(ENABLE_PANDOC), false)
$(info No pandoc executable was detected by configure) $(info No pandoc executable was detected by configure)
$(error Cannot continue) $(error Cannot continue)
endif endif

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include NativeCompilation.gmk include NativeCompilation.gmk
include ToolsJdk.gmk include ToolsJdk.gmk
@ -47,17 +48,21 @@ ifeq ($(COMPILE_TYPE), cross)
endif endif
X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers
GENERATOR_SOURCE_FILE := $(X11WRAPPERS_OUTPUT)/src/data_generator.c
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen
WRAPPER_OUTPUT_FILE := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt
BITS := $(OPENJDK_TARGET_CPU_BITS) BITS := $(OPENJDK_TARGET_CPU_BITS)
# Generate the C code for the program that will output the offset file. # Generate the C code for the program that will output the offset file.
$(X11WRAPPERS_OUTPUT)/src/data_generator.c: $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK) $(eval $(call SetupExecute, gensrc_generator, \
$(call LogInfo, Generating X11 wrapper data generator source code) INFO := Generating X11 wrapper data generator source code, \
$(call MakeDir, $(@D)) DEPS := $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK), \
$(call ExecuteWithLog, $@, \ OUTPUT_FILE := $(GENERATOR_SOURCE_FILE), \
$(TOOL_WRAPPERGENERATOR) gen_c_source $@ $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS)) COMMAND := $(TOOL_WRAPPERGENERATOR) gen_c_source $(GENERATOR_SOURCE_FILE) \
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS), \
))
DATA_GENERATOR_INCLUDES := \ DATA_GENERATOR_INCLUDES := \
-I$(TOPDIR)/src/hotspot/share/include \ -I$(TOPDIR)/src/hotspot/share/include \
@ -75,7 +80,7 @@ DATA_GENERATOR_INCLUDES := \
$(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \ $(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
PROGRAM := data_generator, \ PROGRAM := data_generator, \
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \ OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
EXTRA_FILES := $(X11WRAPPERS_OUTPUT)/src/data_generator.c, \ EXTRA_FILES := $(GENERATOR_SOURCE_FILE), \
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \ CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS_JDKEXE), \ LDFLAGS := $(LDFLAGS_JDKEXE), \
LIBS := $(X_LIBS), \ LIBS := $(X_LIBS), \
@ -83,16 +88,19 @@ $(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
)) ))
# Run the executable to create the data file. # Run the executable to create the data file.
$(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt: $(BUILD_DATA_GENERATOR_TARGET) $(eval $(call SetupExecute, run_wrappergen, \
$(call LogInfo, Generating X11 wrapper data files) INFO := Generating X11 wrapper data files, \
$(call MakeDir, $(@D)) DEPS := $(BUILD_DATA_GENERATOR), \
$(call ExecuteWithLog, $(X11WRAPPERS_OUTPUT)/generation, \ OUTPUT_FILE := $(WRAPPER_OUTPUT_FILE), \
$(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $@) COMMAND := $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $(WRAPPER_OUTPUT_FILE), \
))
wrapper-information: $(run_wrappergen)
$(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly $(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly
$(ECHO) need to be updated for both 32 and 64 bit platforms. You have now $(ECHO) need to be updated for both 32 and 64 bit platforms. You have now
$(ECHO) updated them for $(BITS) bit platforms only. $(ECHO) updated them for $(BITS) bit platforms only.
TARGETS += $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt TARGETS += $(run_wrappergen) wrapper-information
################################################################################ ################################################################################

View file

@ -70,7 +70,7 @@ TARGETS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
# #
# Windows specific binary security packages. # Windows specific binary security packages.
# #
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
# sec-windows-bin.zip is used by builds where the corresponding sources are not available # sec-windows-bin.zip is used by builds where the corresponding sources are not available
$(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \ $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \ SRC := $(JDK_OUTPUTDIR), \
@ -80,7 +80,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
TARGETS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip TARGETS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
# JGSS files contain the native Kerberos library # JGSS files contain the native Kerberos library
ifeq ($(OPENJDK_TARGET_CPU), x86_64) ifeq ($(call isTargetCpu, x86_64), true)
JGSS_ZIP_NAME = jgss-windows-x64-bin.zip JGSS_ZIP_NAME = jgss-windows-x64-bin.zip
else else
JGSS_ZIP_NAME = jgss-windows-i586-bin.zip JGSS_ZIP_NAME = jgss-windows-i586-bin.zip

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -406,6 +406,8 @@ AC_DEFUN_ONCE([BASIC_INIT],
[ [
# Save the original command line. This is passed to us by the wrapper configure script. # Save the original command line. This is passed to us by the wrapper configure script.
AC_SUBST(CONFIGURE_COMMAND_LINE) AC_SUBST(CONFIGURE_COMMAND_LINE)
# AUTOCONF might be set in the environment by the user. Preserve for "make reconfigure".
AC_SUBST(AUTOCONF)
# Save the path variable before it gets changed # Save the path variable before it gets changed
ORIGINAL_PATH="$PATH" ORIGINAL_PATH="$PATH"
AC_SUBST(ORIGINAL_PATH) AC_SUBST(ORIGINAL_PATH)
@ -616,14 +618,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
BASIC_PATH_PROGS(CPIO, [cpio bsdcpio]) BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
BASIC_PATH_PROGS(NICE, nice) BASIC_PATH_PROGS(NICE, nice)
BASIC_PATH_PROGS(PANDOC, pandoc)
if test -n "$PANDOC"; then
ENABLE_PANDOC="true"
else
ENABLE_PANDOC="false"
fi
AC_SUBST(ENABLE_PANDOC)
BASIC_PATH_PROGS(LSB_RELEASE, lsb_release) BASIC_PATH_PROGS(LSB_RELEASE, lsb_release)
BASIC_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe]) BASIC_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe])
]) ])
@ -1191,6 +1185,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
BASIC_CHECK_FIND_DELETE BASIC_CHECK_FIND_DELETE
BASIC_CHECK_TAR BASIC_CHECK_TAR
BASIC_CHECK_GREP BASIC_CHECK_GREP
BASIC_SETUP_PANDOC
# These tools might not be installed by default, # These tools might not be installed by default,
# need hint on how to install them. # need hint on how to install them.
@ -1375,6 +1370,34 @@ AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
AC_SUBST(BASH_ARGS) AC_SUBST(BASH_ARGS)
]) ])
################################################################################
#
# Setup Pandoc
#
AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
[
BASIC_PATH_PROGS(PANDOC, pandoc)
PANDOC_MARKDOWN_FLAG="markdown"
if test -n "$PANDOC"; then
AC_MSG_CHECKING(if the pandoc smart extension needs to be disabled for markdown)
if $PANDOC --list-extensions | $GREP -q '\+smart'; then
AC_MSG_RESULT([yes])
PANDOC_MARKDOWN_FLAG="markdown-smart"
else
AC_MSG_RESULT([no])
fi
fi
if test -n "$PANDOC"; then
ENABLE_PANDOC="true"
else
ENABLE_PANDOC="false"
fi
AC_SUBST(ENABLE_PANDOC)
AC_SUBST(PANDOC_MARKDOWN_FLAG)
])
################################################################################ ################################################################################
# #
# Default make target # Default make target

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -42,8 +42,11 @@ AC_DEFUN([BPERF_CHECK_CORES],
NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu` NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu`
FOUND_CORES=yes FOUND_CORES=yes
elif test "x$OPENJDK_BUILD_OS" = xaix ; then elif test "x$OPENJDK_BUILD_OS" = xaix ; then
NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print [$]4 }'` NUM_LCPU=`lparstat -m 2> /dev/null | $GREP -o "lcpu=[[0-9]]*" | $CUT -d "=" -f 2`
if test -n "$NUM_LCPU"; then
NUM_CORES=$NUM_LCPU
FOUND_CORES=yes FOUND_CORES=yes
fi
elif test -n "$NUMBER_OF_PROCESSORS"; then elif test -n "$NUMBER_OF_PROCESSORS"; then
# On windows, look in the env # On windows, look in the env
NUM_CORES=$NUMBER_OF_PROCESSORS NUM_CORES=$NUMBER_OF_PROCESSORS

View file

@ -75,6 +75,8 @@ JVM_LDFLAGS := @OPENJDK_BUILD_JVM_LDFLAGS@
JVM_ASFLAGS := @OPENJDK_BUILD_JVM_ASFLAGS@ JVM_ASFLAGS := @OPENJDK_BUILD_JVM_ASFLAGS@
JVM_LIBS := @OPENJDK_BUILD_JVM_LIBS@ JVM_LIBS := @OPENJDK_BUILD_JVM_LIBS@
FDLIBM_CFLAGS := @OPENJDK_BUILD_FDLIBM_CFLAGS@
# The compiler for the build platform is likely not warning compatible with the official # The compiler for the build platform is likely not warning compatible with the official
# compiler. # compiler.
WARNINGS_AS_ERRORS := false WARNINGS_AS_ERRORS := false

View file

@ -76,12 +76,15 @@ export OUTPUTDIR="@OUTPUTDIR@"
if [ "@COMPILE_TYPE@" != "cross" ]; then if [ "@COMPILE_TYPE@" != "cross" ]; then
export JAVAP="@FIXPATH@ $OUTPUTDIR/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@" export JAVAP="@FIXPATH@ $OUTPUTDIR/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ $OUTPUTDIR/jdk/bin/jimage" export JIMAGE="@FIXPATH@ $OUTPUTDIR/jdk/bin/jimage"
export JMOD="@FIXPATH@ $OUTPUTDIR/jdk/bin/jmod"
elif [ "@CREATE_BUILDJDK@" = "true" ]; then elif [ "@CREATE_BUILDJDK@" = "true" ]; then
export JAVAP="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@" export JAVAP="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jimage" export JIMAGE="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jimage"
export JMOD="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jmod"
else else
export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@" export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage" export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage"
export JMOD="@FIXPATH@ @BUILD_JDK@/bin/jmod"
fi fi
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then if [ "$OPENJDK_TARGET_OS" = "windows" ]; then

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -78,9 +78,12 @@ autoconf_missing_help() {
APT_GET="`which apt-get 2> /dev/null | grep -v '^no apt-get in'`" APT_GET="`which apt-get 2> /dev/null | grep -v '^no apt-get in'`"
YUM="`which yum 2> /dev/null | grep -v '^no yum in'`" YUM="`which yum 2> /dev/null | grep -v '^no yum in'`"
BREW="`which brew 2> /dev/null | grep -v '^no brew in'`" BREW="`which brew 2> /dev/null | grep -v '^no brew in'`"
ZYPPER="`which zypper 2> /dev/null | grep -v '^no zypper in'`"
CYGWIN="`which cygpath 2> /dev/null | grep -v '^no cygpath in'`" CYGWIN="`which cygpath 2> /dev/null | grep -v '^no cygpath in'`"
if test "x$APT_GET" != x; then if test "x$ZYPPER" != x; then
PKGHANDLER_COMMAND="sudo zypper install autoconf"
elif test "x$APT_GET" != x; then
PKGHANDLER_COMMAND="sudo apt-get install autoconf" PKGHANDLER_COMMAND="sudo apt-get install autoconf"
elif test "x$YUM" != x; then elif test "x$YUM" != x; then
PKGHANDLER_COMMAND="sudo yum install autoconf" PKGHANDLER_COMMAND="sudo yum install autoconf"

View file

@ -121,7 +121,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
# -g0 enables debug symbols without disabling inlining. # -g0 enables debug symbols without disabling inlining.
CFLAGS_DEBUG_SYMBOLS="-g0 -xs" CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then elif test "x$TOOLCHAIN_TYPE" = xxlc; then
if test "x$XLC_USES_CLANG" = xtrue; then
CFLAGS_DEBUG_SYMBOLS="-g1"
else
CFLAGS_DEBUG_SYMBOLS="-g" CFLAGS_DEBUG_SYMBOLS="-g"
fi
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
CFLAGS_DEBUG_SYMBOLS="-Z7 -d2Zi+" CFLAGS_DEBUG_SYMBOLS="-Z7 -d2Zi+"
fi fi
@ -415,21 +419,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS],
FLAGS_CPU_LEGACY=$OPENJDK_BUILD_CPU_LEGACY FLAGS_CPU_LEGACY=$OPENJDK_BUILD_CPU_LEGACY
FLAGS_CPU_LEGACY_LIB=$OPENJDK_BUILD_CPU_LEGACY_LIB FLAGS_CPU_LEGACY_LIB=$OPENJDK_BUILD_CPU_LEGACY_LIB
FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_], [BUILD_])
COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off"
# Check that the compiler supports -ffp-contract=off flag
# Set FDLIBM_CFLAGS to -ffp-contract=off if it does. Empty
# otherwise.
# These flags are required for GCC-based builds of
# fdlibm with optimization without losing precision.
# Notably, -ffp-contract=off needs to be added for GCC >= 4.6.
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_FP_CONTRACT_OFF_FLAG}],
IF_TRUE: [FDLIBM_CFLAGS=${COMPILER_FP_CONTRACT_OFF_FLAG}],
IF_FALSE: [FDLIBM_CFLAGS=""])
fi
AC_SUBST(FDLIBM_CFLAGS)
]) ])
################################################################################ ################################################################################
@ -529,15 +519,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$TOOLCHAIN_TYPE" = xgcc; then if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector" TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector" TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX (but since this gives *worse* performance, use no-strict-aliasing everywhere!) # technically NOT for CXX (but since this gives *worse* performance, use
# no-strict-aliasing everywhere!)
CXXSTD_CXXFLAG="-std=gnu++98" TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing"
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG -Werror],
IF_FALSE: [CXXSTD_CXXFLAG=""])
TOOLCHAIN_CFLAGS_JDK_CXXONLY="$CXXSTD_CXXFLAG"
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $CXXSTD_CXXFLAG"
ADLC_CXXFLAG="$CXXSTD_CXXFLAG"
elif test "x$TOOLCHAIN_TYPE" = xclang; then elif test "x$TOOLCHAIN_TYPE" = xclang; then
# Restrict the debug information created by Clang to avoid # Restrict the debug information created by Clang to avoid
@ -670,15 +654,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DNEEDS_LIBRT" OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DNEEDS_LIBRT"
fi fi
fi fi
# EXPORT
AC_SUBST(ADLC_CXXFLAG)
]) ])
################################################################################ ################################################################################
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check # $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
# conditionals against. # conditionals against.
# $2 - Optional prefix for each variable defined. # $2 - Optional prefix for each variable defined.
# $3 - Optional prefix for compiler variables (either BUILD_ or nothing).
AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
[ [
#### CPU DEFINES, these should (in theory) be independent on toolchain #### CPU DEFINES, these should (in theory) be independent on toolchain
@ -768,6 +750,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer" $1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
fi fi
$1_CXXSTD_CXXFLAG="-std=gnu++98"
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${$1_CXXSTD_CXXFLAG} -Werror],
PREFIX: $3, IF_FALSE: [$1_CXXSTD_CXXFLAG=""])
$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY="${$1_CXXSTD_CXXFLAG}"
$1_TOOLCHAIN_CFLAGS_JVM="${$1_TOOLCHAIN_CFLAGS_JVM} ${$1_CXXSTD_CXXFLAG}"
$2ADLC_CXXFLAG="${$1_CXXSTD_CXXFLAG}"
elif test "x$TOOLCHAIN_TYPE" = xclang; then elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$FLAGS_OS" = xlinux; then if test "x$FLAGS_OS" = xlinux; then
# ppc test not really needed for clang # ppc test not really needed for clang
@ -804,14 +793,15 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
fi fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($1)) FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}" $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized" $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
fi fi
# EXPORT to API # EXPORT to API
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM $TOOLCHAIN_CFLAGS_JVM \ CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
$OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \ $OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG" $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG"
@ -825,7 +815,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY \ CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY \
$WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}" $WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY $TOOLCHAIN_CFLAGS_JDK_CXXONLY \ CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY \
$TOOLCHAIN_CFLAGS_JDK_CXXONLY \
${$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY} \
$WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}" $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
$1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}" $1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
@ -843,11 +835,28 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
AC_SUBST($2CFLAGS_JDKEXE) AC_SUBST($2CFLAGS_JDKEXE)
AC_SUBST($2CXXFLAGS_JDKLIB) AC_SUBST($2CXXFLAGS_JDKLIB)
AC_SUBST($2CXXFLAGS_JDKEXE) AC_SUBST($2CXXFLAGS_JDKEXE)
AC_SUBST($2ADLC_CXXFLAG)
COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off"
# Check that the compiler supports -ffp-contract=off flag
# Set FDLIBM_CFLAGS to -ffp-contract=off if it does. Empty
# otherwise.
# These flags are required for GCC-based builds of
# fdlibm with optimization without losing precision.
# Notably, -ffp-contract=off needs to be added for GCC >= 4.6.
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_FP_CONTRACT_OFF_FLAG}],
PREFIX: $3,
IF_TRUE: [$2FDLIBM_CFLAGS=${COMPILER_FP_CONTRACT_OFF_FLAG}],
IF_FALSE: [$2FDLIBM_CFLAGS=""])
fi
AC_SUBST($2FDLIBM_CFLAGS)
]) ])
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX]) # FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
# Arguments: # Arguments:
# $1 - Prefix for each variable defined. # $1 - Prefix for each variable defined.
# $2 - Prefix for compiler variables (either BUILD_ or nothing).
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS], AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
[ [
# These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
@ -855,14 +864,11 @@ AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
# Notably, value range propagation now assumes that the this pointer of C++ # Notably, value range propagation now assumes that the this pointer of C++
# member functions is non-null. # member functions is non-null.
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks" NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror], PREFIX: $2, IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
dnl IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror], PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}])
$1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" $1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
]) ])

View file

@ -421,17 +421,20 @@ AC_DEFUN([FLAGS_SETUP_FLAGS],
# ------------------------------------------------------------ # ------------------------------------------------------------
# Check that the C compiler supports an argument # Check that the C compiler supports an argument
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS],
[*ARGUMENT IF_TRUE IF_FALSE], [$@], [*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@],
[ [
AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"]) AC_MSG_CHECKING([if ARG_PREFIX[CC] supports "ARG_ARGUMENT"])
supports=yes supports=yes
saved_cflags="$CFLAGS" saved_cflags="$CFLAGS"
saved_cc="$CC"
CFLAGS="$CFLAGS ARG_ARGUMENT" CFLAGS="$CFLAGS ARG_ARGUMENT"
CC="$ARG_PREFIX[CC]"
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no]) [supports=no])
AC_LANG_POP([C]) AC_LANG_POP([C])
CC="$saved_cc"
CFLAGS="$saved_cflags" CFLAGS="$saved_cflags"
AC_MSG_RESULT([$supports]) AC_MSG_RESULT([$supports])
@ -449,17 +452,20 @@ BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS],
# ------------------------------------------------------------ # ------------------------------------------------------------
# Check that the C++ compiler supports an argument # Check that the C++ compiler supports an argument
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS],
[*ARGUMENT IF_TRUE IF_FALSE], [$@], [*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@],
[ [
AC_MSG_CHECKING([if the C++ compiler supports "ARG_ARGUMENT"]) AC_MSG_CHECKING([if ARG_PREFIX[CXX] supports "ARG_ARGUMENT"])
supports=yes supports=yes
saved_cxxflags="$CXXFLAGS" saved_cxxflags="$CXXFLAGS"
saved_cxx="$CXX"
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" CXXFLAGS="$CXXFLAG ARG_ARGUMENT"
CXX="$ARG_PREFIX[CXX]"
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no]) [supports=no])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
CXX="$saved_cxx"
CXXFLAGS="$saved_cxxflags" CXXFLAGS="$saved_cxxflags"
AC_MSG_RESULT([$supports]) AC_MSG_RESULT([$supports])
@ -477,18 +483,22 @@ BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS],
# ------------------------------------------------------------ # ------------------------------------------------------------
# Check that the C and C++ compilers support an argument # Check that the C and C++ compilers support an argument
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS],
[*ARGUMENT IF_TRUE IF_FALSE], [$@], [*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@],
[ [
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT],
IF_TRUE: [C_COMP_SUPPORTS="yes"], IF_TRUE: [C_COMP_SUPPORTS="yes"],
IF_FALSE: [C_COMP_SUPPORTS="no"]) IF_FALSE: [C_COMP_SUPPORTS="no"],
PREFIX: [ARG_PREFIX])
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT],
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], IF_TRUE: [CXX_COMP_SUPPORTS="yes"],
IF_FALSE: [CXX_COMP_SUPPORTS="no"]) IF_FALSE: [CXX_COMP_SUPPORTS="no"],
PREFIX: [ARG_PREFIX])
AC_MSG_CHECKING([if both compilers support "ARG_ARGUMENT"]) AC_MSG_CHECKING([if both ARG_PREFIX[CC] and ARG_PREFIX[CXX] support "ARG_ARGUMENT"])
supports=no supports=no
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then
supports=yes;
fi
AC_MSG_RESULT([$supports]) AC_MSG_RESULT([$supports])
if test "x$supports" = "xyes" ; then if test "x$supports" = "xyes" ; then

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
[ [
AC_CHECK_PROGS(PKGHANDLER, apt-get yum brew port pkgutil pkgadd) AC_CHECK_PROGS(PKGHANDLER, zypper apt-get yum brew port pkgutil pkgadd)
]) ])
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
@ -54,6 +54,8 @@ AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
pkgutil_help $MISSING_DEPENDENCY ;; pkgutil_help $MISSING_DEPENDENCY ;;
pkgadd) pkgadd)
pkgadd_help $MISSING_DEPENDENCY ;; pkgadd_help $MISSING_DEPENDENCY ;;
zypper)
zypper_help $MISSING_DEPENDENCY ;;
esac esac
if test "x$PKGHANDLER_COMMAND" != x; then if test "x$PKGHANDLER_COMMAND" != x; then
@ -110,6 +112,25 @@ apt_help() {
esac esac
} }
zypper_help() {
case $1 in
devkit)
PKGHANDLER_COMMAND="sudo zypper install gcc gcc-c++" ;;
alsa)
PKGHANDLER_COMMAND="sudo zypper install alsa-devel" ;;
cups)
PKGHANDLER_COMMAND="sudo zypper install cups-devel" ;;
fontconfig)
PKGHANDLER_COMMAND="sudo zypper install fontconfig-devel" ;;
freetype)
PKGHANDLER_COMMAND="sudo zypper install freetype-devel" ;;
x11)
PKGHANDLER_COMMAND="sudo zypper install libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel" ;;
ccache)
PKGHANDLER_COMMAND="sudo zypper install ccache" ;;
esac
}
yum_help() { yum_help() {
case $1 in case $1 in
devkit) devkit)

View file

@ -47,8 +47,8 @@ AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
[ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ]) [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
############################################################################### ###############################################################################
# Check if the specified JVM features are explicitly enabled. To be used in # Check if the specified JVM feature is enabled. To be used in shell if
# shell if constructs, like this: # constructs, like this:
# if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
# #
# Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features. # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
@ -58,6 +58,20 @@ AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE], AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE],
[ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ]) [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
###############################################################################
# Check if the specified JVM feature is explicitly disabled. To be used in
# shell if constructs, like this:
# if HOTSPOT_IS_JVM_FEATURE_DISABLED(jvmci); then
#
# This function is internal to hotspot.m4, and is only used when constructing
# the valid set of enabled JVM features. Users outside of hotspot.m4 should just
# use HOTSPOT_CHECK_JVM_FEATURE to check if a feature is enabled or not.
# Definition kept in one line to allow inlining in if statements.
# Additional [] needed to keep m4 from mangling shell constructs.
AC_DEFUN([HOTSPOT_IS_JVM_FEATURE_DISABLED],
[ [ [[ " $DISABLED_JVM_FEATURES " =~ " $1 " ]] ] ])
############################################################################### ###############################################################################
# Check which variants of the JVM that we want to build. Available variants are: # Check which variants of the JVM that we want to build. Available variants are:
# server: normal interpreter, and a tiered C1/C2 compiler # server: normal interpreter, and a tiered C1/C2 compiler
@ -373,8 +387,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_CHECKING([if jvmci module jdk.internal.vm.ci should be built]) AC_MSG_CHECKING([if jvmci module jdk.internal.vm.ci should be built])
# Check if jvmci is diabled # Check if jvmci is diabled
DISABLE_JVMCI=`$ECHO $DISABLED_JVM_FEATURES | $GREP jvmci` if HOTSPOT_IS_JVM_FEATURE_DISABLED(jvmci); then
if test "x$DISABLE_JVMCI" = "xjvmci"; then
AC_MSG_RESULT([no, forced]) AC_MSG_RESULT([no, forced])
JVM_FEATURES_jvmci="" JVM_FEATURES_jvmci=""
INCLUDE_JVMCI="false" INCLUDE_JVMCI="false"
@ -400,8 +413,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_CHECKING([if graal module jdk.internal.vm.compiler should be built]) AC_MSG_CHECKING([if graal module jdk.internal.vm.compiler should be built])
# Check if graal is diabled # Check if graal is diabled
DISABLE_GRAAL=`$ECHO $DISABLED_JVM_FEATURES | $GREP graal` if HOTSPOT_IS_JVM_FEATURE_DISABLED(graal); then
if test "x$DISABLE_GRAAL" = "xgraal"; then
AC_MSG_RESULT([no, forced]) AC_MSG_RESULT([no, forced])
JVM_FEATURES_graal="" JVM_FEATURES_graal=""
INCLUDE_GRAAL="false" INCLUDE_GRAAL="false"
@ -433,8 +445,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_SUBST(INCLUDE_GRAAL) AC_SUBST(INCLUDE_GRAAL)
# Disable aot with '--with-jvm-features=-aot' # Disable aot with '--with-jvm-features=-aot'
DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if HOTSPOT_IS_JVM_FEATURE_DISABLED(aot); then
if test "x$DISABLE_AOT" = "xaot"; then
ENABLE_AOT="false" ENABLE_AOT="false"
fi fi
@ -458,7 +469,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
JVM_FEATURES_aot="aot" JVM_FEATURES_aot="aot"
fi fi
else else
if test "x$enable_aot" = "xno" || test "x$DISABLE_AOT" = "xaot"; then if test "x$enable_aot" = "xno" || HOTSPOT_IS_JVM_FEATURE_DISABLED(aot); then
AC_MSG_RESULT([no, forced]) AC_MSG_RESULT([no, forced])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -490,8 +501,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
fi fi
# Disable CDS if user requested it with --with-jvm-features=-cds. # Disable CDS if user requested it with --with-jvm-features=-cds.
DISABLE_CDS=`$ECHO $DISABLED_JVM_FEATURES | $GREP cds` if HOTSPOT_IS_JVM_FEATURE_DISABLED(cds); then
if test "x$DISABLE_CDS" = "xcds"; then
ENABLE_CDS="false" ENABLE_CDS="false"
if test "x$enable_cds" = "xyes"; then if test "x$enable_cds" = "xyes"; then
AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.]) AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.])

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -364,7 +364,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
################################################################################ ################################################################################
# #
# Gcov coverage data for hotspot # Native and Java code coverage
# #
AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE], AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
[ [
@ -372,7 +372,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
[enable native compilation with code coverage data@<:@disabled@:>@])]) [enable native compilation with code coverage data@<:@disabled@:>@])])
GCOV_ENABLED="false" GCOV_ENABLED="false"
if test "x$enable_native_coverage" = "xyes"; then if test "x$enable_native_coverage" = "xyes"; then
if test "x$TOOLCHAIN_TYPE" = "xgcc"; then case $TOOLCHAIN_TYPE in
gcc | clang)
AC_MSG_CHECKING([if native coverage is enabled]) AC_MSG_CHECKING([if native coverage is enabled])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline" GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
@ -386,9 +387,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS" LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS" LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
GCOV_ENABLED="true" GCOV_ENABLED="true"
else ;;
AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc]) *)
fi AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc or clang])
;;
esac
elif test "x$enable_native_coverage" = "xno"; then elif test "x$enable_native_coverage" = "xno"; then
AC_MSG_CHECKING([if native coverage is enabled]) AC_MSG_CHECKING([if native coverage is enabled])
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])

View file

@ -92,7 +92,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
# This setup is to verify access to system installed freetype header and libraries. # This setup is to verify access to system installed freetype header and libraries.
# On Windows and MacOS this does not apply and using these options will report an error. # On Windows and MacOS this does not apply and using these options will report an error.
# On other platforms (Linux, Solaris, and perhaps AIX), they will default to using # On other platforms (Linux, Solaris), they will default to using
# the system libraries. If they are found automatically, nothing need be done. # the system libraries. If they are found automatically, nothing need be done.
# If they are not found, the configure "--with-freetype-*" options may be used to fix that. # If they are not found, the configure "--with-freetype-*" options may be used to fix that.
# If the preference is to bundle on these platforms then use --with-freetype=bundled # If the preference is to bundle on these platforms then use --with-freetype=bundled
@ -102,11 +102,12 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
if (test "x$with_freetype_include" = "x" && test "x$with_freetype_lib" != "x") || \ if (test "x$with_freetype_include" = "x" && test "x$with_freetype_lib" != "x") || \
(test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" = "x"); then (test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" = "x"); then
AC_MSG_ERROR(['must specify both or neither of --with_freetype_include and --with_freetype_lib]) AC_MSG_ERROR(['must specify both or neither of --with-freetype-include and --with-freetype-lib])
fi fi
FREETYPE_TO_USE=bundled FREETYPE_TO_USE=bundled
if (test "x$OPENJDK_TARGET_OS" != "xwindows" && test "x$OPENJDK_TARGET_OS" != "xmacosx"); then if (test "x$OPENJDK_TARGET_OS" != "xwindows" && test "x$OPENJDK_TARGET_OS" != "xmacosx" \
&& test "x$OPENJDK_TARGET_OS" != "xaix"); then
FREETYPE_TO_USE=system FREETYPE_TO_USE=system
fi fi
if (test "x$with_freetype" != "x"); then if (test "x$with_freetype" != "x"); then
@ -115,7 +116,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
elif (test "x$with_freetype" = "xbundled"); then elif (test "x$with_freetype" = "xbundled"); then
FREETYPE_TO_USE=bundled FREETYPE_TO_USE=bundled
if (test "x$with_freetype_include" != "x" || test "x$with_freetype_lib" != "x"); then if (test "x$with_freetype_include" != "x" || test "x$with_freetype_lib" != "x"); then
AC_MSG_ERROR(['bundled' cannot be specified with --with_freetype_include and --with_freetype_lib]) AC_MSG_ERROR(['bundled' cannot be specified with --with-freetype-include and --with-freetype-lib])
fi fi
else else
AC_MSG_ERROR(['valid values for --with-freetype are 'system' and 'bundled']) AC_MSG_ERROR(['valid values for --with-freetype are 'system' and 'bundled'])

View file

@ -36,6 +36,9 @@ CONFIGURE_COMMAND_LINE:=@CONFIGURE_COMMAND_LINE@
# A self-referential reference to this file. # A self-referential reference to this file.
SPEC:=@SPEC@ SPEC:=@SPEC@
# Path to autoconf if overriden by the user, to be used by "make reconfigure"
AUTOCONF := @AUTOCONF@
# SPACE and COMMA are defined in MakeBase.gmk, but they are also used in # SPACE and COMMA are defined in MakeBase.gmk, but they are also used in
# some definitions here, and are needed if MakeBase.gmk is not included before # some definitions here, and are needed if MakeBase.gmk is not included before
# this file. # this file.
@ -487,6 +490,9 @@ CPP:=@FIXPATH@ @CPP@
# The linker can be gcc or ld on unix systems, or link.exe on windows systems. # The linker can be gcc or ld on unix systems, or link.exe on windows systems.
LD:=@FIXPATH@ @LD@ LD:=@FIXPATH@ @LD@
# Linker used by the jaotc tool for AOT compilation.
LD_JAOTC:=@LD_JAOTC@
# Xcode SDK path # Xcode SDK path
SDKROOT:=@SDKROOT@ SDKROOT:=@SDKROOT@
@ -768,6 +774,7 @@ MSVCP_DLL:=@MSVCP_DLL@
UCRT_DLL_DIR:=@UCRT_DLL_DIR@ UCRT_DLL_DIR:=@UCRT_DLL_DIR@
STLPORT_LIB:=@STLPORT_LIB@ STLPORT_LIB:=@STLPORT_LIB@
ENABLE_PANDOC:=@ENABLE_PANDOC@ ENABLE_PANDOC:=@ENABLE_PANDOC@
PANDOC_MARKDOWN_FLAG:=@PANDOC_MARKDOWN_FLAG@
#################################################### ####################################################
# #

View file

@ -276,6 +276,20 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
fi fi
AC_SUBST(TOOLCHAIN_TYPE) AC_SUBST(TOOLCHAIN_TYPE)
# on AIX, check for xlclang++ on the PATH and TOOLCHAIN_PATH and use it if it is available
if test "x$OPENJDK_TARGET_OS" = xaix; then
if test "x$TOOLCHAIN_PATH" != x; then
XLC_TEST_PATH=${TOOLCHAIN_PATH}/
fi
XLCLANG_VERSION_OUTPUT=`${XLC_TEST_PATH}xlclang++ -qversion 2>&1 | $HEAD -n 1`
$ECHO "$XLCLANG_VERSION_OUTPUT" | $GREP "IBM XL C/C++ for AIX" > /dev/null
if test $? -eq 0; then
AC_MSG_NOTICE([xlclang++ output: $XLCLANG_VERSION_OUTPUT])
XLC_USES_CLANG=true
fi
fi
TOOLCHAIN_CC_BINARY_clang="clang" TOOLCHAIN_CC_BINARY_clang="clang"
TOOLCHAIN_CC_BINARY_gcc="gcc" TOOLCHAIN_CC_BINARY_gcc="gcc"
TOOLCHAIN_CC_BINARY_microsoft="cl$EXE_SUFFIX" TOOLCHAIN_CC_BINARY_microsoft="cl$EXE_SUFFIX"
@ -288,6 +302,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
TOOLCHAIN_CXX_BINARY_solstudio="CC" TOOLCHAIN_CXX_BINARY_solstudio="CC"
TOOLCHAIN_CXX_BINARY_xlc="xlC_r" TOOLCHAIN_CXX_BINARY_xlc="xlC_r"
if test "x$OPENJDK_TARGET_OS" = xaix; then
if test "x$XLC_USES_CLANG" = xtrue; then
AC_MSG_NOTICE([xlclang++ detected, using it])
TOOLCHAIN_CC_BINARY_xlc="xlclang"
TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
fi
fi
# Use indirect variable referencing # Use indirect variable referencing
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
@ -595,7 +617,7 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION], AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION],
[ [
LINKER=[$]$1 LINKER=[$]$1
LINKER_NAME=$2 LINKER_NAME="$2"
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
# cc -Wl,-V output typically looks like # cc -Wl,-V output typically looks like
@ -621,14 +643,21 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION],
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \ [ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'` ] $SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'` ]
elif test "x$TOOLCHAIN_TYPE" = xgcc; then elif test "x$TOOLCHAIN_TYPE" = xgcc; then
# gcc -Wl,-version output typically looks like # gcc -Wl,-version output typically looks like:
# GNU ld (GNU Binutils for Ubuntu) 2.26.1 # GNU ld (GNU Binutils for Ubuntu) 2.26.1
# Copyright (C) 2015 Free Software Foundation, Inc. # Copyright (C) 2015 Free Software Foundation, Inc.
# This program is free software; [...] # This program is free software; [...]
LINKER_VERSION_STRING=`$LD -Wl,-version 2>&1 | $HEAD -n 1` # If using gold it will look like:
# GNU gold (GNU Binutils 2.30) 1.15
LINKER_VERSION_STRING=`$LD -Wl,--version 2> /dev/null | $HEAD -n 1`
# Extract version number # Extract version number
if [ [[ "$LINKER_VERSION_STRING" == *gold* ]] ]; then
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*) .*/\1/'` ]
else
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \ [ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'` ] $SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'` ]
fi
elif test "x$TOOLCHAIN_TYPE" = xclang; then elif test "x$TOOLCHAIN_TYPE" = xclang; then
# clang -Wl,-v output typically looks like # clang -Wl,-v output typically looks like
# @(#)PROGRAM:ld PROJECT:ld64-305 # @(#)PROGRAM:ld PROJECT:ld64-305
@ -715,12 +744,18 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
LDCXX="$LD" LDCXX="$LD"
# jaotc being a windows program expects the linker to be supplied with exe suffix.
LD_JAOTC="$LD$EXE_SUFFIX"
else else
# All other toolchains use the compiler to link. # All other toolchains use the compiler to link.
LD="$CC" LD="$CC"
LDCXX="$CXX" LDCXX="$CXX"
# jaotc expects 'ld' as the linker rather than the compiler.
BASIC_CHECK_TOOLS([LD_JAOTC], ld)
BASIC_FIXUP_EXECUTABLE(LD_JAOTC)
fi fi
AC_SUBST(LD) AC_SUBST(LD)
AC_SUBST(LD_JAOTC)
# FIXME: it should be CXXLD, according to standard (cf CXXCPP) # FIXME: it should be CXXLD, according to standard (cf CXXCPP)
AC_SUBST(LDCXX) AC_SUBST(LDCXX)

112
make/common/CopyFiles.gmk Normal file
View file

@ -0,0 +1,112 @@
#
# Copyright (c) 2011, 2019, 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 CopyFiles.gmk)
endif
################################################################################
#
# Code for handling the SetupCopyFiles macro.
#
################################################################################
define AddFileToCopy
# Helper macro for SetupCopyFiles
# 1 : Source file
# 2 : Dest file
# 3 : Variable to add targets to
# 4 : Macro to call for copy operation
# 5 : Action text to log
$2: $1
$$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUTDIR)/%,%,$$(call DecodeSpace, $$@)))
$$($$(strip $4))
$3 += $2
$3_SOURCES += $1
endef
# Returns the value of the first argument
identity = \
$(strip $1)
# Setup make rules for copying files, with an option to do more complex
# processing instead of copying.
#
# 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.
#
# The list of all source files is returned in $1_SOURCES.
#
# Remaining parameters are named arguments. These include:
# SRC : Source root dir (defaults to dir of first file)
# DEST : Dest root dir
# FILES : List of files to copy with absolute paths, or path relative to SRC.
# Must be in SRC.
# FLATTEN : Set to flatten the directory structure in the DEST dir.
# MACRO : Optionally override the default macro used for making the copy.
# Default is 'install-file'
# NAME_MACRO : Optionally supply a macro that rewrites the target file name
# based on the source file name
# LOG_ACTION : Optionally specify a different action text for log messages
SetupCopyFiles = $(NamedParamsMacroTemplate)
define SetupCopyFilesBody
ifeq ($$($1_MACRO), )
$1_MACRO := install-file
endif
# Default SRC to the dir of the first file.
ifeq ($$($1_SRC), )
$1_SRC := $$(dir $$(firstword $$($1_FILES)))
endif
ifeq ($$($1_NAME_MACRO), )
$1_NAME_MACRO := identity
endif
ifeq ($$($1_LOG_ACTION), )
$1_LOG_ACTION := Copying
endif
# Remove any trailing slash from SRC and DEST
$1_SRC := $$(patsubst %/,%,$$($1_SRC))
$1_DEST := $$(patsubst %/,%,$$($1_DEST))
# Need to wrap arguments in DoubleDollar because of the eval nested inside an
# eval macro body.
$$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
$$(eval $$(call AddFileToCopy, \
$$(call DoubleDollar, $$($1_SRC)/$$f), \
$$(call DoubleDollar, \
$$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)) \
), \
$1, \
$$($1_MACRO), \
$$($1_LOG_ACTION) \
)) \
)
endef

198
make/common/Execute.gmk Normal file
View file

@ -0,0 +1,198 @@
#
# Copyright (c) 2019, 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 Execute.gmk)
endif
################################################################################
#
# Code for handling the SetupExecute macro.
#
################################################################################
################################################################################
# Setup make rules for executing an arbitrary command.
#
# 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.
#
# You need to specify a COMMAND, the actual command line to execute. You are
# strongly recommended to provide a INFO with the text to display for LOG=info
# on what operation is performed. You can use DEPS to provide additional
# dependencies for your command to run. You can optionally include a PRE_COMMAND
# and a POST_COMMAND, intended for simple pre- and post-processing. The latter
# might be e.g. a mv from a temporary file to the final destination, the former
# e.g. a simple sed replacement on the input file. If the operations are
# unrelated to the main COMMAND, this is not a suitable solution.
#
# If your command outputs a variety of files, or if it's really a single file
# but you don't really care about the output from the perspective, you can just
# supply an OUTPUT_DIR. You are supposed to make sure the command creates files
# in this directory (which will be created for you if it does not exist), but
# this can't be enforced by SetupExecute. Additional support files (like logs
# and markers) are created in this directory. If you want support files in a
# separate directory (e.g. if you're targeting an OUTPUT_DIR in the image
# directly), you can specify a SUPPORT_DIR. If your command outputs only a
# single file, you can get rid of the marker files (but not the log files) by
# specifying OUTPUT_FILE. Note that if you specify an OUTPUT_FILE, support log
# files will be placed in the same directory as the OUTPUT_FILE. If you do not
# want that, use SUPPORT_DIR as well.
#
# After the call to SetupExecute, $1 will contain references to all generated
# files (that make knows about), and $1_TARGET will contain a reference to the
# final target (that is OUTPUT_FILE if it exists, or the $1_exec.marker file
# otherwise).
#
# All the above keep functioning as expected even if PRE_COMMAND and
# POST_COMMAND are given. One special case worth noting is that if OUTPUT_FILE
# and POST_COMMAND is both given, the actual OUTPUT_FILE is considered to be a
# result of running the POST_COMMAND.
#
# Remaining parameters are named arguments. These include:
# COMMAND : The command to execute
# PRE_COMMAND : A helper command to execute before COMMAND
# POST_COMMAND: A helper command to execute after COMMAND
# OUTPUT_DIR : The directory that will contain the result from the command
# OUTPUT_FILE : Use this if the command results in a single output file
# SUPPORT_DIR : Where to store generated support files
# INFO : Message to display at LOG=info level when running command (optional)
# WARN : Message to display at LOG=warn level when running command (optional)
# DEPS : Dependencies for the execution to take place
#
# Setup make rules for copying files, with an option to do more complex
SetupExecute = $(NamedParamsMacroTemplate)
define SetupExecuteBody
ifeq ($$($1_COMMAND), )
$$(error COMMAND is missing in SetupExecute $1)
endif
ifneq ($$($1_OUTPUT_FILE), )
ifneq ($$($1_OUTPUT_DIR), )
$$(error Cannot specify both OUTPUT_DIR and OUTPUT_FILE in SetupExecute $1)
endif
# We need to know output dir since we will make sure it is created.
$1_OUTPUT_DIR := $$(patsubst %/,%, $$(dir $$($1_OUTPUT_FILE)))
ifeq ($$($1_SUPPORT_DIR), )
# If support dir is not given, use base dir of output file.
$1_SUPPORT_DIR := $$($1_OUTPUT_DIR)
endif
else ifneq ($$($1_OUTPUT_DIR), )
ifeq ($$($1_SUPPORT_DIR), )
# If support dir is not given, use output dir.
$1_SUPPORT_DIR := $$($1_OUTPUT_DIR)
endif
else
$$(error OUTPUT_DIR or OUTPUT_FILE is required in SetupExecute $1)
endif
$1_BASE := $$($1_SUPPORT_DIR)/_$1
$1_PRE_MARKER := $$($1_BASE)_pre.marker
$1_EXEC_MARKER := $$($1_BASE)_exec.marker
$1_POST_MARKER := $$($1_BASE)_post.marker
ifeq ($$($1_OUTPUT_FILE), )
# No specified output file, use markers everywhere
$1_EXEC_RESULT := $$($1_EXEC_MARKER)
ifeq ($$($1_POST_COMMAND), )
$1_FINAL_RESULT := $$($1_EXEC_MARKER)
else
$1_FINAL_RESULT := $$($1_POST_MARKER)
endif
else
# If we have a single output file, we don't need a separate marker
ifeq ($$($1_POST_COMMAND), )
$1_EXEC_RESULT := $$($1_OUTPUT_FILE)
$1_FINAL_RESULT := $$($1_EXEC_RESULT)
else
$1_EXEC_RESULT := $$($1_EXEC_MARKER)
$1_FINAL_RESULT := $$($1_OUTPUT_FILE)
endif
endif
ifeq ($$($1_INFO)$$($1_WARN), )
# If neither info nor warn is provided, add basic info text.
$1_INFO := Running commands for $1
endif
ifneq ($$($1_PRE_COMMAND), )
$$($1_PRE_MARKER): $$($1_DEPS)
ifneq ($$($1_WARN), )
$$(call LogWarn, $$($1_WARN))
endif
ifneq ($$($1_INFO), )
$$(call LogInfo, $$($1_INFO))
endif
$$(call MakeDir, $$($1_SUPPORT_DIR) $$($1_OUTPUT_DIR))
$$(call ExecuteWithLog, $$($1_BASE)_pre, \
$$($1_PRE_COMMAND))
$$(TOUCH) $$@
$$($1_EXEC_RESULT): $$($1_PRE_MARKER)
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
$$($1_COMMAND))
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
$$(TOUCH) $$@
endif
$1 := $$($1_PRE_MARKER) $$($1_EXEC_RESULT)
else
$$($1_EXEC_RESULT): $$($1_DEPS)
ifneq ($$($1_WARN), )
$$(call LogWarn, $$($1_WARN))
endif
ifneq ($$($1_INFO), )
$$(call LogInfo, $$($1_INFO))
endif
$$(call MakeDir, $$(call EncodeSpace, $$($1_SUPPORT_DIR)) $$(call EncodeSpace, $$($1_OUTPUT_DIR)))
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
$$($1_COMMAND))
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
$$(TOUCH) $$@
endif
$1 := $$($1_EXEC_RESULT)
endif
ifneq ($$($1_POST_COMMAND), )
$$($1_FINAL_RESULT): $$($1_EXEC_RESULT)
$$(call ExecuteWithLog, $$($1_BASE)_post, \
$$($1_POST_COMMAND))
$$(TOUCH) $$@
$1 += $$($1_FINAL_RESULT)
endif
# Export all our generated targets in $1, and the final target in $1_TARGET.
$1_TARGET := $$($1_FINAL_RESULT)
endef

View file

@ -68,7 +68,6 @@ JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
# Add Jtreg test groups to list of named tests (test groups, test list, etc) # Add Jtreg test groups to list of named tests (test groups, test list, etc)
# ALL_NAMED_TESTS might have been set by a custom extension # ALL_NAMED_TESTS might have been set by a custom extension
ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS) ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
JCOV_NAMED_TESTS += $(JTREG_TEST_GROUPS)
# Add Gtest # Add Gtest
ALL_NAMED_TESTS += gtest ALL_NAMED_TESTS += gtest

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -70,17 +70,17 @@ ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
CORRECT_FUNCTION_IN_RECIPE_EVALUATION := true CORRECT_FUNCTION_IN_RECIPE_EVALUATION := true
endif endif
##############################
# Functions
##############################
### Debug functions # For convenience, MakeBase.gmk continues to include these separate files, at
# least for now.
# Prints the name and value of a variable include $(TOPDIR)/make/common/Utils.gmk
PrintVar = \ include $(TOPDIR)/make/common/MakeIO.gmk
$(info $(strip $1) >$($(strip $1))<) include $(TOPDIR)/make/common/CopyFiles.gmk
### Functions for timers ################################################################################
# Functions for timers
################################################################################
# Store the build times in this directory. # Store the build times in this directory.
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
@ -116,227 +116,6 @@ define TargetExit
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`" "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`"
endef endef
################################################################################
# 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))
################################################################################
# ListPathsSafely can be used to print command parameters to a file. This is
# typically done if the command line lenght risk being too long for the
# OS/shell. In later make versions, the file function can be used for this
# purpose. For earlier versions, a more complex implementation is provided.
#
# The function ListPathsSafely can be called either directly or, more commonly
# from a recipe line. If called from a recipe, it will be executed in the
# evaluation phase of that recipe, which means that it will write to the file
# before any other line in the recipe has been run.
ifeq ($(HAS_FILE_FUNCTION), true)
# Param 1 - Name of variable containing paths/arguments to output
# Param 2 - File to print to
# Param 3 - Set to true to append to file instead of overwriting
define ListPathsSafely
$$(call MakeDir, $$(dir $$(strip $2)))
$$(file $$(if $$(filter true, $$(strip $3)),>>,>) \
$$(strip $2),$$(subst $$(SPACE),$$(NEWLINE),$$(strip $$($$(strip $1)))))
endef
else # HAS_FILE_FUNCTION = false
$(eval compress_paths = \
$(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-pre-compress.incl)))
compress_paths += \
$(subst $(TOPDIR),X97, \
$(subst $(OUTPUTDIR),X98, \
$(subst X,X00, \
$(subst $(SPACE),\n,$(strip $1)))))
$(eval compress_paths += \
$(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-post-compress.incl)))
decompress_paths=$(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \
-e 's|X99|\\n|g' \
-e 's|X98|$(OUTPUTDIR)|g' -e 's|X97|$(TOPDIR)|g' \
-e 's|X00|X|g'
ListPathsSafely_IfPrintf = \
$(if $(word $3,$($(strip $1))), \
$(shell $(PRINTF) -- "$(strip $(call EscapeDollar, \
$(call compress_paths, $(wordlist $3,$4,$($(strip $1))))))\n" \
| $(decompress_paths) >> $2))
# Param 1 - Name of variable containing paths/arguments to output
# Param 2 - File to print to
# Param 3 - Set to true to append to file instead of overwriting
define ListPathsSafely
ifneq (,$$(word 30001,$$($$(strip $1))))
$$(error Cannot list safely more than 30000 paths. $1 has $$(words $$($$(strip $1))) paths!)
endif
$$(call MakeDir, $$(dir $2))
ifneq ($$(strip $3), true)
$$(shell $(RM) $$(strip $2))
endif
$$(call ListPathsSafely_IfPrintf,$1,$2,1,250)
$$(call ListPathsSafely_IfPrintf,$1,$2,251,500)
$$(call ListPathsSafely_IfPrintf,$1,$2,501,750)
$$(call ListPathsSafely_IfPrintf,$1,$2,751,1000)
$$(call ListPathsSafely_IfPrintf,$1,$2,1001,1250)
$$(call ListPathsSafely_IfPrintf,$1,$2,1251,1500)
$$(call ListPathsSafely_IfPrintf,$1,$2,1501,1750)
$$(call ListPathsSafely_IfPrintf,$1,$2,1751,2000)
$$(call ListPathsSafely_IfPrintf,$1,$2,2001,2250)
$$(call ListPathsSafely_IfPrintf,$1,$2,2251,2500)
$$(call ListPathsSafely_IfPrintf,$1,$2,2501,2750)
$$(call ListPathsSafely_IfPrintf,$1,$2,2751,3000)
$$(call ListPathsSafely_IfPrintf,$1,$2,3001,3250)
$$(call ListPathsSafely_IfPrintf,$1,$2,3251,3500)
$$(call ListPathsSafely_IfPrintf,$1,$2,3501,3750)
$$(call ListPathsSafely_IfPrintf,$1,$2,3751,4000)
$$(call ListPathsSafely_IfPrintf,$1,$2,4001,4250)
$$(call ListPathsSafely_IfPrintf,$1,$2,4251,4500)
$$(call ListPathsSafely_IfPrintf,$1,$2,4501,4750)
$$(call ListPathsSafely_IfPrintf,$1,$2,4751,5000)
$$(call ListPathsSafely_IfPrintf,$1,$2,5001,5250)
$$(call ListPathsSafely_IfPrintf,$1,$2,5251,5500)
$$(call ListPathsSafely_IfPrintf,$1,$2,5501,5750)
$$(call ListPathsSafely_IfPrintf,$1,$2,5751,6000)
$$(call ListPathsSafely_IfPrintf,$1,$2,6001,6250)
$$(call ListPathsSafely_IfPrintf,$1,$2,6251,6500)
$$(call ListPathsSafely_IfPrintf,$1,$2,6501,6750)
$$(call ListPathsSafely_IfPrintf,$1,$2,6751,7000)
$$(call ListPathsSafely_IfPrintf,$1,$2,7001,7250)
$$(call ListPathsSafely_IfPrintf,$1,$2,7251,7500)
$$(call ListPathsSafely_IfPrintf,$1,$2,7501,7750)
$$(call ListPathsSafely_IfPrintf,$1,$2,7751,8000)
$$(call ListPathsSafely_IfPrintf,$1,$2,8001,8250)
$$(call ListPathsSafely_IfPrintf,$1,$2,8251,8500)
$$(call ListPathsSafely_IfPrintf,$1,$2,8501,8750)
$$(call ListPathsSafely_IfPrintf,$1,$2,8751,9000)
$$(call ListPathsSafely_IfPrintf,$1,$2,9001,9250)
$$(call ListPathsSafely_IfPrintf,$1,$2,9251,9500)
$$(call ListPathsSafely_IfPrintf,$1,$2,9501,9750)
$$(call ListPathsSafely_IfPrintf,$1,$2,9751,10000)
$$(call ListPathsSafely_IfPrintf,$1,$2,10001,10250)
$$(call ListPathsSafely_IfPrintf,$1,$2,10251,10500)
$$(call ListPathsSafely_IfPrintf,$1,$2,10501,10750)
$$(call ListPathsSafely_IfPrintf,$1,$2,10751,11000)
$$(call ListPathsSafely_IfPrintf,$1,$2,11001,11250)
$$(call ListPathsSafely_IfPrintf,$1,$2,11251,11500)
$$(call ListPathsSafely_IfPrintf,$1,$2,11501,11750)
$$(call ListPathsSafely_IfPrintf,$1,$2,11751,12000)
$$(call ListPathsSafely_IfPrintf,$1,$2,12001,12250)
$$(call ListPathsSafely_IfPrintf,$1,$2,12251,12500)
$$(call ListPathsSafely_IfPrintf,$1,$2,12501,12750)
$$(call ListPathsSafely_IfPrintf,$1,$2,12751,13000)
$$(call ListPathsSafely_IfPrintf,$1,$2,13001,13250)
$$(call ListPathsSafely_IfPrintf,$1,$2,13251,13500)
$$(call ListPathsSafely_IfPrintf,$1,$2,13501,13750)
$$(call ListPathsSafely_IfPrintf,$1,$2,13751,14000)
$$(call ListPathsSafely_IfPrintf,$1,$2,14001,14250)
$$(call ListPathsSafely_IfPrintf,$1,$2,14251,14500)
$$(call ListPathsSafely_IfPrintf,$1,$2,14501,14750)
$$(call ListPathsSafely_IfPrintf,$1,$2,14751,15000)
$$(call ListPathsSafely_IfPrintf,$1,$2,15001,15250)
$$(call ListPathsSafely_IfPrintf,$1,$2,15251,15500)
$$(call ListPathsSafely_IfPrintf,$1,$2,15501,15750)
$$(call ListPathsSafely_IfPrintf,$1,$2,15751,16000)
$$(call ListPathsSafely_IfPrintf,$1,$2,16001,16250)
$$(call ListPathsSafely_IfPrintf,$1,$2,16251,16500)
$$(call ListPathsSafely_IfPrintf,$1,$2,16501,16750)
$$(call ListPathsSafely_IfPrintf,$1,$2,16751,17000)
$$(call ListPathsSafely_IfPrintf,$1,$2,17001,17250)
$$(call ListPathsSafely_IfPrintf,$1,$2,17251,17500)
$$(call ListPathsSafely_IfPrintf,$1,$2,17501,17750)
$$(call ListPathsSafely_IfPrintf,$1,$2,17751,18000)
$$(call ListPathsSafely_IfPrintf,$1,$2,18001,18250)
$$(call ListPathsSafely_IfPrintf,$1,$2,18251,18500)
$$(call ListPathsSafely_IfPrintf,$1,$2,18501,18750)
$$(call ListPathsSafely_IfPrintf,$1,$2,18751,19000)
$$(call ListPathsSafely_IfPrintf,$1,$2,19001,19250)
$$(call ListPathsSafely_IfPrintf,$1,$2,19251,19500)
$$(call ListPathsSafely_IfPrintf,$1,$2,19501,19750)
$$(call ListPathsSafely_IfPrintf,$1,$2,19751,20000)
$$(call ListPathsSafely_IfPrintf,$1,$2,20001,20250)
$$(call ListPathsSafely_IfPrintf,$1,$2,20251,20500)
$$(call ListPathsSafely_IfPrintf,$1,$2,20501,20750)
$$(call ListPathsSafely_IfPrintf,$1,$2,20751,21000)
$$(call ListPathsSafely_IfPrintf,$1,$2,21001,21250)
$$(call ListPathsSafely_IfPrintf,$1,$2,21251,21500)
$$(call ListPathsSafely_IfPrintf,$1,$2,21501,21750)
$$(call ListPathsSafely_IfPrintf,$1,$2,21751,22000)
$$(call ListPathsSafely_IfPrintf,$1,$2,22001,22250)
$$(call ListPathsSafely_IfPrintf,$1,$2,22251,22500)
$$(call ListPathsSafely_IfPrintf,$1,$2,22501,22750)
$$(call ListPathsSafely_IfPrintf,$1,$2,22751,23000)
$$(call ListPathsSafely_IfPrintf,$1,$2,23001,23250)
$$(call ListPathsSafely_IfPrintf,$1,$2,23251,23500)
$$(call ListPathsSafely_IfPrintf,$1,$2,23501,23750)
$$(call ListPathsSafely_IfPrintf,$1,$2,23751,24000)
$$(call ListPathsSafely_IfPrintf,$1,$2,24001,24250)
$$(call ListPathsSafely_IfPrintf,$1,$2,24251,24500)
$$(call ListPathsSafely_IfPrintf,$1,$2,24501,24750)
$$(call ListPathsSafely_IfPrintf,$1,$2,24751,25000)
$$(call ListPathsSafely_IfPrintf,$1,$2,25001,25250)
$$(call ListPathsSafely_IfPrintf,$1,$2,25251,25500)
$$(call ListPathsSafely_IfPrintf,$1,$2,25501,25750)
$$(call ListPathsSafely_IfPrintf,$1,$2,25751,26000)
$$(call ListPathsSafely_IfPrintf,$1,$2,26001,26250)
$$(call ListPathsSafely_IfPrintf,$1,$2,26251,26500)
$$(call ListPathsSafely_IfPrintf,$1,$2,26501,26750)
$$(call ListPathsSafely_IfPrintf,$1,$2,26751,27000)
$$(call ListPathsSafely_IfPrintf,$1,$2,27001,27250)
$$(call ListPathsSafely_IfPrintf,$1,$2,27251,27500)
$$(call ListPathsSafely_IfPrintf,$1,$2,27501,27750)
$$(call ListPathsSafely_IfPrintf,$1,$2,27751,28000)
$$(call ListPathsSafely_IfPrintf,$1,$2,28001,28250)
$$(call ListPathsSafely_IfPrintf,$1,$2,28251,28500)
$$(call ListPathsSafely_IfPrintf,$1,$2,28501,28750)
$$(call ListPathsSafely_IfPrintf,$1,$2,28751,29000)
$$(call ListPathsSafely_IfPrintf,$1,$2,29001,29250)
$$(call ListPathsSafely_IfPrintf,$1,$2,29251,29500)
$$(call ListPathsSafely_IfPrintf,$1,$2,29501,29750)
$$(call ListPathsSafely_IfPrintf,$1,$2,29751,30000)
endef
endif # HAS_FILE_FUNCTION
################################################################################ ################################################################################
# A file containing a way to uniquely identify the source code revision that # A file containing a way to uniquely identify the source code revision that
@ -408,21 +187,6 @@ endef
# Make sure logging is setup for everyone that includes MakeBase.gmk. # Make sure logging is setup for everyone that includes MakeBase.gmk.
$(eval $(call SetupLogging)) $(eval $(call SetupLogging))
################################################################################
# Creates a sequence of increasing numbers (inclusive).
# Param 1 - starting number
# Param 2 - ending number
sequence = \
$(wordlist $1, $2, $(strip \
$(eval SEQUENCE_COUNT :=) \
$(call _sequence-do,$(strip $2))))
_sequence-do = \
$(if $(word $1, $(SEQUENCE_COUNT)),, \
$(eval SEQUENCE_COUNT += .) \
$(words $(SEQUENCE_COUNT)) \
$(call _sequence-do,$1))
################################################################################ ################################################################################
MAX_PARAMS := 36 MAX_PARAMS := 36
@ -464,16 +228,6 @@ define NamedParamsMacroTemplate
$(call $(0)Body,$(strip $1)) $(call $(0)Body,$(strip $1))
endef endef
################################################################################
# Replace question marks with space in string. This macro needs to be called on
# files from CacheFind in case any of them contains space in their file name,
# since CacheFind replaces space with ?.
# Param 1 - String to replace in
DecodeSpace = \
$(subst ?,$(SPACE),$(strip $1))
EncodeSpace = \
$(subst $(SPACE),?,$(strip $1))
################################################################################ ################################################################################
# Make directory without forking mkdir if not needed. # Make directory without forking mkdir if not needed.
# #
@ -501,17 +255,10 @@ MakeDir = \
MakeTargetDir = \ MakeTargetDir = \
$(call MakeDir, $(dir $(call EncodeSpace, $@))) $(call MakeDir, $(dir $(call EncodeSpace, $@)))
################################################################################
# Assign a variable only if it is empty
# Param 1 - Variable to assign
# Param 2 - Value to assign
SetIfEmpty = \
$(if $($(strip $1)),,$(eval $(strip $1) := $2))
################################################################################ ################################################################################
# All install-file and related macros automatically call DecodeSpace when needed. # All install-file and related macros automatically call DecodeSpace when needed.
ifeq ($(OPENJDK_TARGET_OS),solaris) ifeq ($(call isTargetOs, solaris), true)
# On Solaris, if the target is a symlink and exists, cp won't overwrite. # On Solaris, if the target is a symlink and exists, cp won't overwrite.
# Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
# name of the target file differs from the source file, rename after copy. # name of the target file differs from the source file, rename after copy.
@ -537,7 +284,7 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \ $(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
fi fi
endef endef
else ifeq ($(OPENJDK_TARGET_OS),macosx) else ifeq ($(call isTargetOs, macosx), true)
# On mac, extended attributes sometimes creep into the source files, which may later # 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 # 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 # set. Some files get their write permissions removed after being copied to the
@ -575,46 +322,6 @@ define install-file-nolink
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)' $(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef endef
################################################################################
# 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
#
# $1 - Path to compare
# $2 - Other path to compare
FindCommonPathPrefix = \
$(patsubst x%,%,$(subst $(SPACE),/,$(strip \
$(call FindCommonPathPrefixHelper, \
$(subst /,$(SPACE),x$(strip $1)), $(subst /,$(SPACE),x$(strip $2))) \
)))
FindCommonPathPrefixHelper = \
$(if $(call equals, $(firstword $1), $(firstword $2)), \
$(firstword $1) \
$(call FindCommonPathPrefixHelper, \
$(wordlist 2, $(words $1), $1), $(wordlist 2, $(words $2), $2) \
) \
)
# Convert a partial path into as many directory levels of ../, removing
# leading and following /.
# Ex: foo/bar/baz/ -> ../../..
# foo/bar -> ../..
# /foo -> ..
DirToDotDot = \
$(subst $(SPACE),/,$(foreach d, $(subst /,$(SPACE),$1),..))
# 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 = \
$(eval $1_prefix := $(call FindCommonPathPrefix, $1, $2)) \
$(eval $1_dotdots := $(call DirToDotDot, $(patsubst $($(strip $1)_prefix)/%, %, $2))) \
$(eval $1_suffix := $(patsubst $($(strip $1)_prefix)/%, %, $1)) \
$($(strip $1)_dotdots)/$($(strip $1)_suffix)
################################################################################ ################################################################################
# link-file-* works similarly to install-file but creates a symlink instead. # 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 # There are two versions, either creating a relative or an absolute link. Be
@ -632,60 +339,6 @@ define link-file-absolute
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)' $(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef endef
################################################################################
# Filter out duplicate sub strings while preserving order. Keeps the first occurance.
uniq = \
$(strip $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))))
# Returns all whitespace-separated words in $2 where at least one of the
# whitespace-separated words in $1 is a substring.
containing = \
$(strip \
$(foreach v,$(strip $2),\
$(call uniq,$(foreach p,$(strip $1),$(if $(findstring $p,$v),$v)))))
# Returns all whitespace-separated words in $2 where none of the
# whitespace-separated words in $1 is a substring.
not-containing = \
$(strip $(filter-out $(call containing,$1,$2),$2))
# Return a list of all string elements that are duplicated in $1.
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
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) \
)
################################################################################ ################################################################################
ifneq ($(DISABLE_CACHE_FIND), true) ifneq ($(DISABLE_CACHE_FIND), true)
@ -739,9 +392,10 @@ ifneq ($(DISABLE_CACHE_FIND), true)
# #
# Param 1 - Dirs to find in # Param 1 - Dirs to find in
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression. # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
# Param 3 - (optional) options to find.
define CacheFind define CacheFind
$(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \ $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
$(if $(wildcard $1), $(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 \ $(if $(wildcard $1), $(shell $(FIND) $3 $(wildcard $1) \( -type f -o -type l \) $2 \
| $(TR) ' ' '?')), \ | $(TR) ' ' '?')), \
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE))) $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
endef endef
@ -757,144 +411,6 @@ else
endef endef
endif endif
################################################################################
define AddFileToCopy
# Helper macro for SetupCopyFiles
# 1 : Source file
# 2 : Dest file
# 3 : Variable to add targets to
# 4 : Macro to call for copy operation
# 5 : Action text to log
$2: $1
$$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUTDIR)/%,%,$$(call DecodeSpace, $$@)))
$$($$(strip $4))
$3 += $2
$3_SOURCES += $1
endef
# Returns the value of the first argument
identity = \
$(strip $1)
# Setup make rules for copying files, with an option to do more complex
# processing instead of copying.
#
# 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.
#
# The list of all source files is returned in $1_SOURCES.
#
# Remaining parameters are named arguments. These include:
# SRC : Source root dir (defaults to dir of first file)
# DEST : Dest root dir
# FILES : List of files to copy with absolute paths, or path relative to SRC.
# Must be in SRC.
# FLATTEN : Set to flatten the directory structure in the DEST dir.
# MACRO : Optionally override the default macro used for making the copy.
# Default is 'install-file'
# NAME_MACRO : Optionally supply a macro that rewrites the target file name
# based on the source file name
# LOG_ACTION : Optionally specify a different action text for log messages
SetupCopyFiles = $(NamedParamsMacroTemplate)
define SetupCopyFilesBody
ifeq ($$($1_MACRO), )
$1_MACRO := install-file
endif
# Default SRC to the dir of the first file.
ifeq ($$($1_SRC), )
$1_SRC := $$(dir $$(firstword $$($1_FILES)))
endif
ifeq ($$($1_NAME_MACRO), )
$1_NAME_MACRO := identity
endif
ifeq ($$($1_LOG_ACTION), )
$1_LOG_ACTION := Copying
endif
# Remove any trailing slash from SRC and DEST
$1_SRC := $$(patsubst %/,%,$$($1_SRC))
$1_DEST := $$(patsubst %/,%,$$($1_DEST))
# Need to wrap arguments in DoubleDollar because of the eval nested inside an
# eval macro body.
$$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
$$(eval $$(call AddFileToCopy, \
$$(call DoubleDollar, $$($1_SRC)/$$f), \
$$(call DoubleDollar, \
$$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)) \
), \
$1, \
$$($1_MACRO), \
$$($1_LOG_ACTION) \
)) \
)
endef
################################################################################
# Parse a multiple-keyword variable, like FOO="KEYWORD1=val1;KEYWORD2=val2;..."
# These will be converted into a series of variables like FOO_KEYWORD1=val1,
# FOO_KEYWORD2=val2, etc. Unknown keywords will cause an error.
#
# Parameter 1 is the name of the rule, and is also the name of the variable.
#
# Remaining parameters are named arguments. These include:
# SINGLE_KEYWORDS A list of valid keywords with single string values
# STRING_KEYWORDS A list of valid keywords, processed as string. This means
# that '%20' will be replaced by ' ' to allow for multi-word strings.
#
ParseKeywordVariable = $(NamedParamsMacroTemplate)
define ParseKeywordVariableBody
ifneq ($$($1), )
# To preserve spaces, substitute them with a hopefully unique pattern
# before splitting and then re-substitute spaces back.
$1_MANGLED := $$(subst $$(SPACE),||||,$$($1))
$$(foreach mangled_part, $$(subst ;, , $$($1_MANGLED)), \
$$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
$$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
$$(eval $1_NO_MATCH := true) \
$$(foreach keyword, $$($1_SINGLE_KEYWORDS), \
$$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
$$(if $$(filter $$(keyword)=%, $$(part)), \
$$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part)))) \
$$(eval $1_NO_MATCH := ) \
) \
) \
$$(foreach keyword, $$($1_STRING_KEYWORDS), \
$$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
$$(if $$(filter $$(keyword)=%, $$(part)), \
$$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(subst %20, , $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part))))) \
$$(eval $1_NO_MATCH := ) \
) \
) \
$$(if $$($1_NO_MATCH), \
$$(if $$(filter $$(part), $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS)), \
$$(info Keyword $$(part) for $1 needs to be assigned a value.) \
, \
$$(info $$(part) is not a valid keyword for $1.) \
$$(info Valid keywords: $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS).) \
) \
$$(error Cannot continue) \
) \
)
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)
################################################################################ ################################################################################
# FixPath # FixPath
# #
@ -903,7 +419,7 @@ ShellQuote = \
# unchanged. # unchanged.
# This is normally not needed since we use the FIXPATH prefix for command lines, # This is normally not needed since we use the FIXPATH prefix for command lines,
# but might be needed in certain circumstances. # but might be needed in certain circumstances.
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
FixPath = \ FixPath = \
$(shell $(CYGPATH) -m $1) $(shell $(CYGPATH) -m $1)
else else
@ -911,35 +427,6 @@ else
$1 $1
endif endif
################################################################################
# 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" $(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" $(call ShellQuote, $1) >> $2)
endif
################################################################################ ################################################################################
# DependOnVariable # DependOnVariable
# #
@ -1025,75 +512,6 @@ ExecuteWithLog = \
$(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \ $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \
exit $(DOLLAR)exitcode ) ) exit $(DOLLAR)exitcode ) )
################################################################################
# Find lib dir for module
# Param 1 - module name
FindLibDirForModule = \
$(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
################################################################################
# Find executable dir for module
# Param 1 - module name
FindExecutableDirForModule = \
$(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
################################################################################
# Return a string suitable for use after a -classpath or --module-path option. It
# will be correct and safe to use on all platforms. Arguments are given as space
# separate classpath entries. Safe for multiple nested calls.
# param 1 : A space separated list of classpath entries
# The surrounding strip is needed to keep additional whitespace out
PathList = \
"$(subst $(SPACE),$(PATH_SEP),$(strip $(subst $(DQUOTE),,$1)))"
################################################################################
# Check if a specified hotspot variant is being built, or at least one of a
# list of variants. Will return 'true' or 'false'.
# $1 - the variant to test for
check-jvm-variant = \
$(strip \
$(if $(filter-out $(VALID_JVM_VARIANTS), $1), \
$(error Internal error: Invalid variant tested: $1)) \
$(if $(filter $1, $(JVM_VARIANTS)), true, false))
################################################################################
# Converts a space separated list to a comma separated list.
#
# Replacing double-comma with a single comma is to workaround the issue with
# some version of make on windows that doesn't substitute spaces with one comma
# properly.
CommaList = \
$(strip \
$(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \
)
################################################################################
# Converts a space separated list to a colon separated list.
#
# Replacing double-colon with a single colon is to workaround the issue with
# some version of make on windows that doesn't substitute spaces with one colon
# properly.
ColonList = \
$(strip \
$(subst ::,:,$(subst $(SPACE),:,$(strip $1))) \
)
################################################################################
# Given a list of files, filters out locale specific files for translations
# that should be excluded from this build.
# $1 - The list of files to filter
# $2 - The suffix of the files that should be considered (.java or .properties)
FilterExcludedTranslations = \
$(strip $(if $(EXCLUDE_TRANSLATIONS), \
$(filter-out \
$(foreach suffix, $2, \
$(addprefix %_, $(addsuffix $(suffix), $(EXCLUDE_TRANSLATIONS))) \
), \
$1 \
), \
$1 \
))
################################################################################ ################################################################################
# Hook to include the corresponding custom file, if present. # Hook to include the corresponding custom file, if present.

272
make/common/MakeIO.gmk Normal file
View file

@ -0,0 +1,272 @@
#
# Copyright (c) 2011, 2019, 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 MakeIO.gmk)
endif
################################################################################
#
# Functions for dealing with reading and writing from makefiles. Prior to GNU
# Make 4.0, this was tricky business.
#
################################################################################
################################################################################
# ListPathsSafely can be used to print command parameters to a file. This is
# typically done if the command line lenght risk being too long for the
# OS/shell. In later make versions, the file function can be used for this
# purpose. For earlier versions, a more complex implementation is provided.
#
# The function ListPathsSafely can be called either directly or, more commonly
# from a recipe line. If called from a recipe, it will be executed in the
# evaluation phase of that recipe, which means that it will write to the file
# before any other line in the recipe has been run.
ifeq ($(HAS_FILE_FUNCTION), true)
# Param 1 - Name of variable containing paths/arguments to output
# Param 2 - File to print to
# Param 3 - Set to true to append to file instead of overwriting
define ListPathsSafely
$$(call MakeDir, $$(dir $$(strip $2)))
$$(file $$(if $$(filter true, $$(strip $3)),>>,>) \
$$(strip $2),$$(subst $$(SPACE),$$(NEWLINE),$$(strip $$($$(strip $1)))))
endef
else # HAS_FILE_FUNCTION = false
$(eval compress_paths = \
$(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-pre-compress.incl)))
compress_paths += \
$(subst $(TOPDIR),X97, \
$(subst $(OUTPUTDIR),X98, \
$(subst X,X00, \
$(subst $(SPACE),\n,$(strip $1)))))
$(eval compress_paths += \
$(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-post-compress.incl)))
decompress_paths=$(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \
-e 's|X99|\\n|g' \
-e 's|X98|$(OUTPUTDIR)|g' -e 's|X97|$(TOPDIR)|g' \
-e 's|X00|X|g'
ListPathsSafely_IfPrintf = \
$(if $(word $3,$($(strip $1))), \
$(shell $(PRINTF) -- "$(strip $(call EscapeDollar, \
$(call compress_paths, $(wordlist $3,$4,$($(strip $1))))))\n" \
| $(decompress_paths) >> $2))
# Param 1 - Name of variable containing paths/arguments to output
# Param 2 - File to print to
# Param 3 - Set to true to append to file instead of overwriting
define ListPathsSafely
ifneq (,$$(word 30001,$$($$(strip $1))))
$$(error Cannot list safely more than 30000 paths. $1 has $$(words $$($$(strip $1))) paths!)
endif
$$(call MakeDir, $$(dir $2))
ifneq ($$(strip $3), true)
$$(shell $(RM) $$(strip $2))
endif
$$(call ListPathsSafely_IfPrintf,$1,$2,1,250)
$$(call ListPathsSafely_IfPrintf,$1,$2,251,500)
$$(call ListPathsSafely_IfPrintf,$1,$2,501,750)
$$(call ListPathsSafely_IfPrintf,$1,$2,751,1000)
$$(call ListPathsSafely_IfPrintf,$1,$2,1001,1250)
$$(call ListPathsSafely_IfPrintf,$1,$2,1251,1500)
$$(call ListPathsSafely_IfPrintf,$1,$2,1501,1750)
$$(call ListPathsSafely_IfPrintf,$1,$2,1751,2000)
$$(call ListPathsSafely_IfPrintf,$1,$2,2001,2250)
$$(call ListPathsSafely_IfPrintf,$1,$2,2251,2500)
$$(call ListPathsSafely_IfPrintf,$1,$2,2501,2750)
$$(call ListPathsSafely_IfPrintf,$1,$2,2751,3000)
$$(call ListPathsSafely_IfPrintf,$1,$2,3001,3250)
$$(call ListPathsSafely_IfPrintf,$1,$2,3251,3500)
$$(call ListPathsSafely_IfPrintf,$1,$2,3501,3750)
$$(call ListPathsSafely_IfPrintf,$1,$2,3751,4000)
$$(call ListPathsSafely_IfPrintf,$1,$2,4001,4250)
$$(call ListPathsSafely_IfPrintf,$1,$2,4251,4500)
$$(call ListPathsSafely_IfPrintf,$1,$2,4501,4750)
$$(call ListPathsSafely_IfPrintf,$1,$2,4751,5000)
$$(call ListPathsSafely_IfPrintf,$1,$2,5001,5250)
$$(call ListPathsSafely_IfPrintf,$1,$2,5251,5500)
$$(call ListPathsSafely_IfPrintf,$1,$2,5501,5750)
$$(call ListPathsSafely_IfPrintf,$1,$2,5751,6000)
$$(call ListPathsSafely_IfPrintf,$1,$2,6001,6250)
$$(call ListPathsSafely_IfPrintf,$1,$2,6251,6500)
$$(call ListPathsSafely_IfPrintf,$1,$2,6501,6750)
$$(call ListPathsSafely_IfPrintf,$1,$2,6751,7000)
$$(call ListPathsSafely_IfPrintf,$1,$2,7001,7250)
$$(call ListPathsSafely_IfPrintf,$1,$2,7251,7500)
$$(call ListPathsSafely_IfPrintf,$1,$2,7501,7750)
$$(call ListPathsSafely_IfPrintf,$1,$2,7751,8000)
$$(call ListPathsSafely_IfPrintf,$1,$2,8001,8250)
$$(call ListPathsSafely_IfPrintf,$1,$2,8251,8500)
$$(call ListPathsSafely_IfPrintf,$1,$2,8501,8750)
$$(call ListPathsSafely_IfPrintf,$1,$2,8751,9000)
$$(call ListPathsSafely_IfPrintf,$1,$2,9001,9250)
$$(call ListPathsSafely_IfPrintf,$1,$2,9251,9500)
$$(call ListPathsSafely_IfPrintf,$1,$2,9501,9750)
$$(call ListPathsSafely_IfPrintf,$1,$2,9751,10000)
$$(call ListPathsSafely_IfPrintf,$1,$2,10001,10250)
$$(call ListPathsSafely_IfPrintf,$1,$2,10251,10500)
$$(call ListPathsSafely_IfPrintf,$1,$2,10501,10750)
$$(call ListPathsSafely_IfPrintf,$1,$2,10751,11000)
$$(call ListPathsSafely_IfPrintf,$1,$2,11001,11250)
$$(call ListPathsSafely_IfPrintf,$1,$2,11251,11500)
$$(call ListPathsSafely_IfPrintf,$1,$2,11501,11750)
$$(call ListPathsSafely_IfPrintf,$1,$2,11751,12000)
$$(call ListPathsSafely_IfPrintf,$1,$2,12001,12250)
$$(call ListPathsSafely_IfPrintf,$1,$2,12251,12500)
$$(call ListPathsSafely_IfPrintf,$1,$2,12501,12750)
$$(call ListPathsSafely_IfPrintf,$1,$2,12751,13000)
$$(call ListPathsSafely_IfPrintf,$1,$2,13001,13250)
$$(call ListPathsSafely_IfPrintf,$1,$2,13251,13500)
$$(call ListPathsSafely_IfPrintf,$1,$2,13501,13750)
$$(call ListPathsSafely_IfPrintf,$1,$2,13751,14000)
$$(call ListPathsSafely_IfPrintf,$1,$2,14001,14250)
$$(call ListPathsSafely_IfPrintf,$1,$2,14251,14500)
$$(call ListPathsSafely_IfPrintf,$1,$2,14501,14750)
$$(call ListPathsSafely_IfPrintf,$1,$2,14751,15000)
$$(call ListPathsSafely_IfPrintf,$1,$2,15001,15250)
$$(call ListPathsSafely_IfPrintf,$1,$2,15251,15500)
$$(call ListPathsSafely_IfPrintf,$1,$2,15501,15750)
$$(call ListPathsSafely_IfPrintf,$1,$2,15751,16000)
$$(call ListPathsSafely_IfPrintf,$1,$2,16001,16250)
$$(call ListPathsSafely_IfPrintf,$1,$2,16251,16500)
$$(call ListPathsSafely_IfPrintf,$1,$2,16501,16750)
$$(call ListPathsSafely_IfPrintf,$1,$2,16751,17000)
$$(call ListPathsSafely_IfPrintf,$1,$2,17001,17250)
$$(call ListPathsSafely_IfPrintf,$1,$2,17251,17500)
$$(call ListPathsSafely_IfPrintf,$1,$2,17501,17750)
$$(call ListPathsSafely_IfPrintf,$1,$2,17751,18000)
$$(call ListPathsSafely_IfPrintf,$1,$2,18001,18250)
$$(call ListPathsSafely_IfPrintf,$1,$2,18251,18500)
$$(call ListPathsSafely_IfPrintf,$1,$2,18501,18750)
$$(call ListPathsSafely_IfPrintf,$1,$2,18751,19000)
$$(call ListPathsSafely_IfPrintf,$1,$2,19001,19250)
$$(call ListPathsSafely_IfPrintf,$1,$2,19251,19500)
$$(call ListPathsSafely_IfPrintf,$1,$2,19501,19750)
$$(call ListPathsSafely_IfPrintf,$1,$2,19751,20000)
$$(call ListPathsSafely_IfPrintf,$1,$2,20001,20250)
$$(call ListPathsSafely_IfPrintf,$1,$2,20251,20500)
$$(call ListPathsSafely_IfPrintf,$1,$2,20501,20750)
$$(call ListPathsSafely_IfPrintf,$1,$2,20751,21000)
$$(call ListPathsSafely_IfPrintf,$1,$2,21001,21250)
$$(call ListPathsSafely_IfPrintf,$1,$2,21251,21500)
$$(call ListPathsSafely_IfPrintf,$1,$2,21501,21750)
$$(call ListPathsSafely_IfPrintf,$1,$2,21751,22000)
$$(call ListPathsSafely_IfPrintf,$1,$2,22001,22250)
$$(call ListPathsSafely_IfPrintf,$1,$2,22251,22500)
$$(call ListPathsSafely_IfPrintf,$1,$2,22501,22750)
$$(call ListPathsSafely_IfPrintf,$1,$2,22751,23000)
$$(call ListPathsSafely_IfPrintf,$1,$2,23001,23250)
$$(call ListPathsSafely_IfPrintf,$1,$2,23251,23500)
$$(call ListPathsSafely_IfPrintf,$1,$2,23501,23750)
$$(call ListPathsSafely_IfPrintf,$1,$2,23751,24000)
$$(call ListPathsSafely_IfPrintf,$1,$2,24001,24250)
$$(call ListPathsSafely_IfPrintf,$1,$2,24251,24500)
$$(call ListPathsSafely_IfPrintf,$1,$2,24501,24750)
$$(call ListPathsSafely_IfPrintf,$1,$2,24751,25000)
$$(call ListPathsSafely_IfPrintf,$1,$2,25001,25250)
$$(call ListPathsSafely_IfPrintf,$1,$2,25251,25500)
$$(call ListPathsSafely_IfPrintf,$1,$2,25501,25750)
$$(call ListPathsSafely_IfPrintf,$1,$2,25751,26000)
$$(call ListPathsSafely_IfPrintf,$1,$2,26001,26250)
$$(call ListPathsSafely_IfPrintf,$1,$2,26251,26500)
$$(call ListPathsSafely_IfPrintf,$1,$2,26501,26750)
$$(call ListPathsSafely_IfPrintf,$1,$2,26751,27000)
$$(call ListPathsSafely_IfPrintf,$1,$2,27001,27250)
$$(call ListPathsSafely_IfPrintf,$1,$2,27251,27500)
$$(call ListPathsSafely_IfPrintf,$1,$2,27501,27750)
$$(call ListPathsSafely_IfPrintf,$1,$2,27751,28000)
$$(call ListPathsSafely_IfPrintf,$1,$2,28001,28250)
$$(call ListPathsSafely_IfPrintf,$1,$2,28251,28500)
$$(call ListPathsSafely_IfPrintf,$1,$2,28501,28750)
$$(call ListPathsSafely_IfPrintf,$1,$2,28751,29000)
$$(call ListPathsSafely_IfPrintf,$1,$2,29001,29250)
$$(call ListPathsSafely_IfPrintf,$1,$2,29251,29500)
$$(call ListPathsSafely_IfPrintf,$1,$2,29501,29750)
$$(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" $(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" $(call ShellQuote, $1) >> $2)
endif

View file

@ -117,11 +117,11 @@ PLATFORM_MODULES += \
jdk.zipfs \ jdk.zipfs \
# #
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
PLATFORM_MODULES += jdk.crypto.mscapi PLATFORM_MODULES += jdk.crypto.mscapi
endif endif
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(call isTargetOs, solaris), true)
PLATFORM_MODULES += jdk.crypto.ucrypto PLATFORM_MODULES += jdk.crypto.ucrypto
endif endif

View file

@ -175,9 +175,9 @@ $(strip \
) )
endef endef
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin) ifeq ($(call isBuildOsEnv, windows.cygwin), true)
UNIX_PATH_PREFIX := /cygdrive UNIX_PATH_PREFIX := /cygdrive
else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys) else ifeq ($(call isBuildOsEnv, windows.msys), true)
UNIX_PATH_PREFIX := UNIX_PATH_PREFIX :=
endif endif
@ -505,8 +505,9 @@ define SetupNativeCompilationBody
$$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \ $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d))) $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
# Find all files in the source trees. Preserve order. $1_SRCS_RAW = $$(call CacheFind, $$($1_SRC))
$1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind, $$(s))) # Order src files according to the order of the src dirs
$1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW)))
$1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS)) $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
# Extract the C/C++ files. # Extract the C/C++ files.
ifneq ($$($1_EXCLUDE_PATTERNS), ) ifneq ($$($1_EXCLUDE_PATTERNS), )
@ -770,7 +771,7 @@ define SetupNativeCompilationBody
$(TOUCH) $$@ $(TOUCH) $$@
# On windows we need to create a resource file # On windows we need to create a resource file
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
ifneq ($$($1_VERSIONINFO_RESOURCE), ) ifneq ($$($1_VERSIONINFO_RESOURCE), )
$1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res $1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res
$1_RES_DEP := $$($1_RES).d $1_RES_DEP := $$($1_RES).d
@ -808,7 +809,7 @@ define SetupNativeCompilationBody
ifneq ($(DISABLE_MAPFILES), true) ifneq ($(DISABLE_MAPFILES), true)
$1_REAL_MAPFILE := $$($1_MAPFILE) $1_REAL_MAPFILE := $$($1_MAPFILE)
ifneq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), false)
ifneq ($$($1_REORDER), ) ifneq ($$($1_REORDER), )
$1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile
@ -845,13 +846,13 @@ define SetupNativeCompilationBody
# Only copy debug symbols for dynamic libraries and programs. # Only copy debug symbols for dynamic libraries and programs.
ifneq ($$($1_TYPE), STATIC_LIBRARY) ifneq ($$($1_TYPE), STATIC_LIBRARY)
# Generate debuginfo files. # Generate debuginfo files.
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
$1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb" \ $1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb" \
"-map:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map" "-map:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map"
$1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb \ $1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb \
$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map
else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), ) else ifeq ($(call isTargetOs, linux solaris), true)
$1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).debuginfo $1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).debuginfo
# Setup the command line creating debuginfo files, to be run after linking. # Setup the command line creating debuginfo files, to be run after linking.
# It cannot be run separately since it updates the original target file # It cannot be run separately since it updates the original target file
@ -860,13 +861,13 @@ define SetupNativeCompilationBody
$(CD) $$($1_OUTPUT_DIR) && \ $(CD) $$($1_OUTPUT_DIR) && \
$$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) $$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
else ifeq ($(OPENJDK_TARGET_OS), macosx) else ifeq ($(call isTargetOs, macosx), true)
$1_DEBUGINFO_FILES := \ $1_DEBUGINFO_FILES := \
$$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \ $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \
$$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME) $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME)
$1_CREATE_DEBUGINFO_CMDS := \ $1_CREATE_DEBUGINFO_CMDS := \
$(DSYMUTIL) --out $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET) $(DSYMUTIL) --out $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET)
endif # OPENJDK_TARGET_OS endif
# Since the link rule creates more than one file that we want to track, # Since the link rule creates more than one file that we want to track,
# we have to use some tricks to get make to cooperate. To properly # we have to use some tricks to get make to cooperate. To properly
@ -952,7 +953,7 @@ define SetupNativeCompilationBody
endif endif
endif endif
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
ifeq ($$($1_EMBED_MANIFEST), true) ifeq ($$($1_EMBED_MANIFEST), true)
$1_EXTRA_LDFLAGS += -manifest:embed $1_EXTRA_LDFLAGS += -manifest:embed
endif endif
@ -970,10 +971,9 @@ define SetupNativeCompilationBody
$$(shell $(RM) $$($1_TARGET)) $$(shell $(RM) $$($1_TARGET))
endif endif
$$($1_IMPORT_LIBRARY): $$($1_TARGET) $$($1_IMPORT_LIBRARY): $$($1_TARGET)
$$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \
$$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \
)
$(TOUCH) $$@ $(TOUCH) $$@
$1 += $$($1_IMPORT_LIBRARY)
endif endif
endif endif
@ -1032,7 +1032,7 @@ define SetupNativeCompilationBody
# Keep as much as possible on one execution line for best performance # Keep as much as possible on one execution line for best performance
# on Windows # on Windows
$$(call LogInfo, Linking $$($1_BASENAME)) $$(call LogInfo, Linking $$($1_BASENAME))
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \ $$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \ $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \
@ -1050,7 +1050,7 @@ define SetupNativeCompilationBody
$$($1_CREATE_DEBUGINFO_CMDS) $$($1_CREATE_DEBUGINFO_CMDS)
$$($1_STRIP_CMD) $$($1_STRIP_CMD)
endif endif
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
ifneq ($$($1_MANIFEST), ) ifneq ($$($1_MANIFEST), )
$$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1 $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
endif endif

View file

@ -65,10 +65,13 @@ define ProcessMarkdown
endif endif
endif endif
$1_$2_OPTIONS := $$(shell $$(GREP) _pandoc-options_: $3/$2 | $$(CUT) -d : -f 2-) # This does not need to be included in VARDEPS since it's from the actual
# source file. Only run the shell if the recipe gets executed below.
$1_$2_OPTIONS_FROM_SRC = \
$$(shell $$(GREP) _pandoc-options_: $3/$2 | $$(CUT) -d : -f 2-)
ifneq ($$($1_FILTER), ) ifneq ($$($1_FILTER), )
$1_$2_OPTIONS += --filter $$($1_FILTER) $1_$2_OPTIONS := --filter $$($1_FILTER)
endif endif
$1_$2_VARDEPS := $$($1_OPTIONS) $$($1_$2_OPTIONS) $$($1_CSS) \ $1_$2_VARDEPS := $$($1_OPTIONS) $$($1_$2_OPTIONS) $$($1_CSS) \
@ -80,9 +83,10 @@ define ProcessMarkdown
$$(call LogInfo, Converting $2 to $$($1_FORMAT)) $$(call LogInfo, Converting $2 to $$($1_FORMAT))
$$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$(dir $$($1_$2_PANDOC_OUTPUT))) $$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$(dir $$($1_$2_PANDOC_OUTPUT)))
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \ $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
$$(PANDOC) $$($1_OPTIONS) -f markdown-smart -t $$($1_FORMAT) --standalone \ $$(PANDOC) $$($1_OPTIONS) -f $$(PANDOC_MARKDOWN_FLAG) \
$$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$($1_$2_PANDOC_INPUT)' \ -t $$($1_FORMAT) --standalone \
-o '$$($1_$2_PANDOC_OUTPUT)') $$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS_FROM_SRC) $$($1_$2_OPTIONS) \
'$$($1_$2_PANDOC_INPUT)' -o '$$($1_$2_PANDOC_OUTPUT)')
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),) ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \ TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
if [ "x$$$$TOO_LONG_LINES" != x ]; then \ if [ "x$$$$TOO_LONG_LINES" != x ]; then \

View file

@ -90,8 +90,7 @@ define SetupTestFilesCompilationBody
$$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \ $$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
NAME := $$(unprefixed_name), \ NAME := $$(unprefixed_name), \
TYPE := $$($1_COMPILATION_TYPE), \ TYPE := $$($1_COMPILATION_TYPE), \
SRC := $$(patsubst %/,%,$$(dir $$(file))), \ EXTRA_FILES := $$(file), \
INCLUDE_FILES := $$(notdir $$(file)), \
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \ OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \
OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \ OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \

368
make/common/Utils.gmk Normal file
View file

@ -0,0 +1,368 @@
#
# Copyright (c) 2011, 2019, 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 Utils.gmk)
endif
################################################################################
#
# Common utility functions
#
################################################################################
### Debug functions
# Prints the name and value of a variable
PrintVar = \
$(info $(strip $1) >$($(strip $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))
################################################################################
# Creates a sequence of increasing numbers (inclusive).
# Param 1 - starting number
# Param 2 - ending number
sequence = \
$(wordlist $1, $2, $(strip \
$(eval SEQUENCE_COUNT :=) \
$(call _sequence-do,$(strip $2))))
_sequence-do = \
$(if $(word $1, $(SEQUENCE_COUNT)),, \
$(eval SEQUENCE_COUNT += .) \
$(words $(SEQUENCE_COUNT)) \
$(call _sequence-do,$1))
################################################################################
# Replace question marks with space in string. This macro needs to be called on
# files from CacheFind in case any of them contains space in their file name,
# since CacheFind 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
# Param 2 - Value to assign
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
#
# $1 - Path to compare
# $2 - Other path to compare
FindCommonPathPrefix = \
$(patsubst x%,%,$(subst $(SPACE),/,$(strip \
$(call FindCommonPathPrefixHelper, \
$(subst /,$(SPACE),x$(strip $1)), $(subst /,$(SPACE),x$(strip $2))) \
)))
FindCommonPathPrefixHelper = \
$(if $(call equals, $(firstword $1), $(firstword $2)), \
$(firstword $1) \
$(call FindCommonPathPrefixHelper, \
$(wordlist 2, $(words $1), $1), $(wordlist 2, $(words $2), $2) \
) \
)
# Convert a partial path into as many directory levels of ../, removing
# leading and following /.
# Ex: foo/bar/baz/ -> ../../..
# foo/bar -> ../..
# /foo -> ..
DirToDotDot = \
$(subst $(SPACE),/,$(foreach d, $(subst /,$(SPACE),$1),..))
# 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 = \
$(eval $1_prefix := $(call FindCommonPathPrefix, $1, $2)) \
$(eval $1_dotdots := $(call DirToDotDot, $(patsubst $($(strip $1)_prefix)/%, %, $2))) \
$(eval $1_suffix := $(patsubst $($(strip $1)_prefix)/%, %, $1)) \
$($(strip $1)_dotdots)/$($(strip $1)_suffix)
################################################################################
# Filter out duplicate sub strings while preserving order. Keeps the first occurance.
uniq = \
$(strip $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))))
# Returns all whitespace-separated words in $2 where at least one of the
# whitespace-separated words in $1 is a substring.
containing = \
$(strip \
$(foreach v,$(strip $2),\
$(call uniq,$(foreach p,$(strip $1),$(if $(findstring $p,$v),$v)))))
# Returns all whitespace-separated words in $2 where none of the
# whitespace-separated words in $1 is a substring.
not-containing = \
$(strip $(filter-out $(call containing,$1,$2),$2))
# Return a list of all string elements that are duplicated in $1.
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
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.
# Return the word "true" if all the boolean words given as argument is "true",
# and returns "false" otherwise. Boolean words must be "true" or "false". It is
# an error to supply a non-boolean word. An empty string is considered "true".
And = \
$(strip $(if $(filter-out true false, $1), $(error Non-boolean values: $1)) \
$(if $(strip $(filter-out true, $1)), false, true))
# Return the word "false" if all the boolean words given as argument is "false",
# and returns "true" otherwise. Boolean words must be "true" or "false". It is
# an error to supply a non-boolean word. An empty string is considered "false".
Or = \
$(strip $(if $(filter-out true false, $1), $(error Non-boolean values: $1)) \
$(if $(strip $(filter-out false, $1)), true, false))
################################################################################
# Parse a multiple-keyword variable, like FOO="KEYWORD1=val1;KEYWORD2=val2;..."
# These will be converted into a series of variables like FOO_KEYWORD1=val1,
# FOO_KEYWORD2=val2, etc. Unknown keywords will cause an error.
#
# Parameter 1 is the name of the rule, and is also the name of the variable.
#
# Remaining parameters are named arguments. These include:
# SINGLE_KEYWORDS A list of valid keywords with single string values
# STRING_KEYWORDS A list of valid keywords, processed as string. This means
# that '%20' will be replaced by ' ' to allow for multi-word strings.
#
ParseKeywordVariable = $(NamedParamsMacroTemplate)
define ParseKeywordVariableBody
ifneq ($$($1), )
# To preserve spaces, substitute them with a hopefully unique pattern
# before splitting and then re-substitute spaces back.
$1_MANGLED := $$(subst $$(SPACE),||||,$$($1))
$$(foreach mangled_part, $$(subst ;, , $$($1_MANGLED)), \
$$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
$$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
$$(eval $1_NO_MATCH := true) \
$$(foreach keyword, $$($1_SINGLE_KEYWORDS), \
$$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
$$(if $$(filter $$(keyword)=%, $$(part)), \
$$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part)))) \
$$(eval $1_NO_MATCH := ) \
) \
) \
$$(foreach keyword, $$($1_STRING_KEYWORDS), \
$$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
$$(if $$(filter $$(keyword)=%, $$(part)), \
$$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(subst %20, , $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part))))) \
$$(eval $1_NO_MATCH := ) \
) \
) \
$$(if $$($1_NO_MATCH), \
$$(if $$(filter $$(part), $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS)), \
$$(info Keyword $$(part) for $1 needs to be assigned a value.) \
, \
$$(info $$(part) is not a valid keyword for $1.) \
$$(info Valid keywords: $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS).) \
) \
$$(error Cannot continue) \
) \
)
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
FindLibDirForModule = \
$(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
################################################################################
# Find executable dir for module
# Param 1 - module name
FindExecutableDirForModule = \
$(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
################################################################################
# Return a string suitable for use after a -classpath or --module-path option. It
# will be correct and safe to use on all platforms. Arguments are given as space
# separate classpath entries. Safe for multiple nested calls.
# param 1 : A space separated list of classpath entries
# The surrounding strip is needed to keep additional whitespace out
PathList = \
"$(subst $(SPACE),$(PATH_SEP),$(strip $(subst $(DQUOTE),,$1)))"
################################################################################
# Check if a specified hotspot variant is being built, or at least one of a
# list of variants. Will return 'true' or 'false'.
# $1 - the variant to test for
check-jvm-variant = \
$(strip \
$(if $(filter-out $(VALID_JVM_VARIANTS), $1), \
$(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 solaris) will return true when executed
# on either linux or solaris, 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))
################################################################################
# Converts a space separated list to a comma separated list.
#
# Replacing double-comma with a single comma is to workaround the issue with
# some version of make on windows that doesn't substitute spaces with one comma
# properly.
CommaList = \
$(strip \
$(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \
)
################################################################################
# Converts a space separated list to a colon separated list.
#
# Replacing double-colon with a single colon is to workaround the issue with
# some version of make on windows that doesn't substitute spaces with one colon
# properly.
ColonList = \
$(strip \
$(subst ::,:,$(subst $(SPACE),:,$(strip $1))) \
)
################################################################################
# Given a list of files, filters out locale specific files for translations
# that should be excluded from this build.
# $1 - The list of files to filter
# $2 - The suffix of the files that should be considered (.java or .properties)
FilterExcludedTranslations = \
$(strip $(if $(EXCLUDE_TRANSLATIONS), \
$(filter-out \
$(foreach suffix, $2, \
$(addprefix %_, $(addsuffix $(suffix), $(EXCLUDE_TRANSLATIONS))) \
), \
$1 \
), \
$1 \
))

View file

@ -62,8 +62,9 @@ define SetupZipArchiveBody
$1_FIND_LIST := $$($1_SRC) $1_FIND_LIST := $$($1_SRC)
endif endif
# Find all files in the source tree. # Find all files in the source tree. Follow symlinks in this find since that is
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST))) # what zip does.
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST), , -L))
# Filter on suffixes if set # Filter on suffixes if set
ifneq ($$($1_SUFFIXES),) ifneq ($$($1_SUFFIXES),)
@ -126,10 +127,14 @@ define SetupZipArchiveBody
$$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
$$(call LogWarn, Updating $$($1_NAME)) $$(call LogWarn, Updating $$($1_NAME))
$$(call MakeTargetDir) $$(call MakeTargetDir)
$$(foreach s,$$($1_SRC),(cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \ $$(foreach s,$$($1_SRC), $$(call ExecuteWithLog, \
$$(SUPPORT_OUTPUTDIR)/zip/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \
(cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
$$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \ $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \
$$($1_ZIP_EXCLUDES_$$s) \ $$($1_ZIP_EXCLUDES_$$s) \
|| test "$$$$?" = "12" )$$(NEWLINE)) true || test "$$$$?" = "12" \
))$$(NEWLINE) \
) true \
$(TOUCH) $$@ $(TOUCH) $$@
# Add zip to target list # Add zip to target list

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,6 +76,7 @@
* install_path * install_path
* download_path * download_path
* download_dir * download_dir
* home_path
* *
* *
* The output data generated by this configuration file has the following * The output data generated by this configuration file has the following
@ -185,7 +186,9 @@ var getJibProfiles = function (input) {
// Identifies the version of this format to the tool reading it. // Identifies the version of this format to the tool reading it.
// 1.1 signifies that the publish, publish-src and get-src features are usable. // 1.1 signifies that the publish, publish-src and get-src features are usable.
// 1.2 signifies that artifact uploads should fail on missing artifacts by default. // 1.2 signifies that artifact uploads should fail on missing artifacts by default.
data.format_version = "1.2"; // 1.3 input.get(<dep>, "home_path") automatically goes down into a single top
// dir just like default configure_args and environment_path variables.
data.format_version = "1.3";
// Organization, product and version are used when uploading/publishing build results // Organization, product and version are used when uploading/publishing build results
data.organization = ""; data.organization = "";
@ -238,7 +241,7 @@ var getJibProfilesCommon = function (input, data) {
common.main_profile_names = [ common.main_profile_names = [
"linux-x64", "linux-x86", "macosx-x64", "solaris-x64", "linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
"solaris-sparcv9", "windows-x64", "windows-x86", "solaris-sparcv9", "windows-x64", "windows-x86",
"linux-aarch64", "linux-arm32" "linux-aarch64", "linux-arm32", "linux-ppc64le", "linux-s390x"
]; ];
// These are the base setttings for all the main build profiles. // These are the base setttings for all the main build profiles.
@ -363,7 +366,7 @@ var getJibProfilesCommon = function (input, data) {
}; };
common.boot_jdk_version = "11"; common.boot_jdk_version = "11";
common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk-" common.boot_jdk_home = input.get("boot_jdk", "install_path") + "/jdk-"
+ common.boot_jdk_version + common.boot_jdk_version
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : ""); + (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
@ -461,6 +464,28 @@ var getJibProfilesProfiles = function (input, common, data) {
"--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors" "--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
], ],
}, },
"linux-ppc64le": {
target_os: "linux",
target_cpu: "ppc64le",
build_cpu: "x64",
dependencies: ["devkit", "build_devkit", "cups"],
configure_args: [
"--openjdk-target=ppc64le-linux-gnu", "--with-freetype=bundled",
"--disable-warnings-as-errors"
],
},
"linux-s390x": {
target_os: "linux",
target_cpu: "s390x",
build_cpu: "x64",
dependencies: ["devkit", "build_devkit", "cups"],
configure_args: [
"--openjdk-target=s390x-linux-gnu", "--with-freetype=bundled",
"--disable-warnings-as-errors"
],
},
}; };
// Add the base settings to all the main profiles // Add the base settings to all the main profiles
@ -486,7 +511,7 @@ var getJibProfilesProfiles = function (input, common, data) {
var testmakeBase = { var testmakeBase = {
dependencies: [ "ant" ], dependencies: [ "ant" ],
environment: { environment: {
"ANT_HOME": input.get("ant", "install_path") + "/apache-ant-1.7.1" "ANT_HOME": input.get("ant", "home_path")
} }
}; };
[ "linux-x64", "macosx-x64", "solaris-sparcv9", "solaris-x64", "windows-x64"] [ "linux-x64", "macosx-x64", "solaris-sparcv9", "solaris-x64", "windows-x64"]
@ -496,6 +521,15 @@ var getJibProfilesProfiles = function (input, common, data) {
profiles[maketestName].default_make_targets = [ "test-make" ]; profiles[maketestName].default_make_targets = [ "test-make" ];
}); });
// Generate -gcov profiles
[ "linux-x64", "macosx-x64" ].forEach(function (name) {
var gcovName = name + "-gcov";
profiles[gcovName] = clone(profiles[name]);
profiles[gcovName].default_make_targets = ["product-bundles", "test-bundles"];
profiles[gcovName].configure_args = concat(profiles[gcovName].configure_args,
["--enable-native-coverage", "--disable-warnings-as-errors"]);
});
// Profiles for building the zero jvm variant. These are used for verification. // Profiles for building the zero jvm variant. These are used for verification.
var zeroProfiles = { var zeroProfiles = {
"linux-x64-zero": { "linux-x64-zero": {
@ -574,6 +608,20 @@ var getJibProfilesProfiles = function (input, common, data) {
profiles[bootcyclePrebuiltName].default_make_targets = [ "product-images" ]; profiles[bootcyclePrebuiltName].default_make_targets = [ "product-images" ];
}); });
// JCov profiles build JCov-instrumented JDK image based on images provided through dependencies.
[ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
.forEach(function (name) {
var jcovName = name + "-jcov";
profiles[jcovName] = clone(common.main_profile_base);
profiles[jcovName].target_os = profiles[name].target_os
profiles[jcovName].target_cpu = profiles[name].target_cpu
profiles[jcovName].default_make_targets = [ "jcov-bundles" ];
profiles[jcovName].dependencies = concat(profiles[jcovName].dependencies,
[ name + ".jdk", "devkit" ]);
profiles[jcovName].configure_args = concat(profiles[jcovName].configure_args,
["--with-jcov-input-jdk=" + input.get(name + ".jdk", "home_path")]);
});
// //
// Define artifacts for profiles // Define artifacts for profiles
// //
@ -609,6 +657,12 @@ var getJibProfilesProfiles = function (input, common, data) {
}, },
"linux-arm32": { "linux-arm32": {
platform: "linux-arm32", platform: "linux-arm32",
},
"linux-ppc64le": {
platform: "linux-ppc64le",
},
"linux-s390x": {
platform: "linux-s390x",
} }
} }
// Generate common artifacts for all main profiles // Generate common artifacts for all main profiles
@ -707,6 +761,60 @@ var getJibProfilesProfiles = function (input, common, data) {
}); });
}); });
// Artifacts of JCov profiles
[ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
.forEach(function (name) {
var o = artifactData[name]
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
var pf = o.platform
var jcovName = name + "-jcov";
profiles[jcovName].artifacts = {
jdk: {
local: "bundles/\\(jdk-jcov.*bin." + jdk_suffix + "\\)",
remote: [
"bundles/" + pf + "/jdk-jcov-" + data.version + "_" + pf + "_bin." + jdk_suffix
],
subdir: jdk_subdir,
exploded: "images/jdk-jcov"
}
};
});
// Artifacts of gcov (native-code-coverage) profiles
[ "linux-x64", "macosx-x64" ].forEach(function (name) {
var o = artifactData[name]
var pf = o.platform
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
var gcovName = name + "-gcov";
profiles[gcovName].artifacts = {
jdk: {
local: "bundles/\\(jdk.*bin." + jdk_suffix + "\\)",
remote: [
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov." + jdk_suffix,
],
subdir: jdk_subdir,
exploded: "images/jdk",
},
test: {
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
remote: [
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov-tests.tar.gz",
],
exploded: "images/test"
},
jdk_symbols: {
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
remote: [
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov-symbols.tar.gz",
],
subdir: jdk_subdir,
exploded: "images/jdk"
},
};
});
// Profiles used to run tests. // Profiles used to run tests.
var testOnlyProfiles = { var testOnlyProfiles = {
"run-test": { "run-test": {
@ -726,20 +834,31 @@ var getJibProfilesProfiles = function (input, common, data) {
if (testedProfile == null) { if (testedProfile == null) {
testedProfile = input.build_os + "-" + input.build_cpu; testedProfile = input.build_os + "-" + input.build_cpu;
} }
var testedProfileJDK = testedProfile + ".jdk";
var testedProfileTest = ""
if (testedProfile.endsWith("-jcov")) {
testedProfileTest = testedProfile.substring(0, testedProfile.length - "-jcov".length) + ".test";
} else {
testedProfileTest = testedProfile + ".test";
}
var testOnlyMake = [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ];
if (testedProfile.endsWith("-gcov")) {
testOnlyMake = concat(testOnlyMake, "GCOV_ENABLED=true")
}
var testOnlyProfilesPrebuilt = { var testOnlyProfilesPrebuilt = {
"run-test-prebuilt": { "run-test-prebuilt": {
target_os: input.build_os, target_os: input.build_os,
target_cpu: input.build_cpu, target_cpu: input.build_cpu,
dependencies: [ dependencies: [
"jtreg", "gnumake", "boot_jdk", "devkit", "jib", testedProfile + ".jdk", "jtreg", "gnumake", "boot_jdk", "devkit", "jib", "jcov", testedProfileJDK,
testedProfile + ".test" testedProfileTest
], ],
src: "src.conf", src: "src.conf",
make_args: [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ], make_args: testOnlyMake,
environment: { environment: {
"BOOT_JDK": common.boot_jdk_home, "BOOT_JDK": common.boot_jdk_home,
"JDK_IMAGE_DIR": input.get(testedProfile + ".jdk", "home_path"), "JDK_IMAGE_DIR": input.get(testedProfileJDK, "home_path"),
"TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path") "TEST_IMAGE_DIR": input.get(testedProfileTest, "home_path")
}, },
labels: "test" labels: "test"
} }
@ -820,19 +939,27 @@ var getJibProfilesProfiles = function (input, common, data) {
var getJibProfilesDependencies = function (input, common) { var getJibProfilesDependencies = function (input, common) {
var devkit_platform_revisions = { var devkit_platform_revisions = {
linux_x64: "gcc7.3.0-OEL6.4+1.1", linux_x64: "gcc8.2.0-OL6.4+1.0",
macosx_x64: "Xcode9.4-MacOSX10.13+1.0", macosx_x64: "Xcode10.1-MacOSX10.14+1.0",
solaris_x64: "SS12u4-Solaris11u1+1.0", solaris_x64: "SS12u4-Solaris11u1+1.0",
solaris_sparcv9: "SS12u6-Solaris11u3+1.0", solaris_sparcv9: "SS12u6-Solaris11u3+1.0",
windows_x64: "VS2017-15.5.5+1.0", windows_x64: "VS2017-15.9.6+1.0",
linux_aarch64: "gcc7.3.0-Fedora27+1.1", linux_aarch64: "gcc8.2.0-Fedora27+1.0",
linux_arm: "gcc7.3.0-Fedora27+1.1" linux_arm: "gcc8.2.0-Fedora27+1.0",
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
linux_s390x: "gcc8.2.0-Fedora27+1.0"
}; };
var devkit_platform = (input.target_cpu == "x86" var devkit_platform = (input.target_cpu == "x86"
? input.target_os + "_x64" ? input.target_os + "_x64"
: input.target_platform); : input.target_platform);
var devkit_cross_prefix = "";
if (input.build_platform != input.target_platform
&& input.build_platform != devkit_platform) {
devkit_cross_prefix = input.build_platform + "-to-";
}
var boot_jdk_platform = (input.build_os == "macosx" ? "osx" : input.build_os) var boot_jdk_platform = (input.build_os == "macosx" ? "osx" : input.build_os)
+ "-" + input.build_cpu; + "-" + input.build_cpu;
var boot_jdk_ext = (input.build_os == "windows" ? ".zip" : ".tar.gz") var boot_jdk_ext = (input.build_os == "windows" ? ".zip" : ".tar.gz")
@ -863,7 +990,7 @@ var getJibProfilesDependencies = function (input, common) {
devkit: { devkit: {
organization: common.organization, organization: common.organization,
ext: "tar.gz", ext: "tar.gz",
module: "devkit-" + devkit_platform, module: "devkit-" + devkit_cross_prefix + devkit_platform,
revision: devkit_platform_revisions[devkit_platform], revision: devkit_platform_revisions[devkit_platform],
environment: { environment: {
"DEVKIT_HOME": input.get("devkit", "home_path"), "DEVKIT_HOME": input.get("devkit", "home_path"),
@ -886,7 +1013,7 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: { jtreg: {
server: "javare", server: "javare",
revision: "4.2", revision: "4.2",
build_number: "b13", build_number: "b14",
checksum_file: "MD5_VALUES", checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.2.zip", file: "jtreg_bin-4.2.zip",
environment_name: "JT_HOME", environment_name: "JT_HOME",
@ -900,11 +1027,18 @@ var getJibProfilesDependencies = function (input, common) {
}, },
jcov: { jcov: {
server: "jpg", // Until an official build of JCov is available, use custom
product: "jcov", // build to support classfile version 57.
version: "3.0", // See CODETOOLS-7902358 for more info.
build_number: "b07", // server: "jpg",
file: "bundles/jcov-3_0.zip", // product: "jcov",
// version: "3.0",
// build_number: "b07",
// file: "bundles/jcov-3_0.zip",
organization: common.organization,
revision: "3.0-57-support+1.0",
ext: "zip",
environment_name: "JCOV_HOME",
}, },
gnumake: { gnumake: {
@ -961,8 +1095,7 @@ var getJibProfilesDependencies = function (input, common) {
classifier: "distribution", classifier: "distribution",
revision: "3.0-SNAPSHOT", revision: "3.0-SNAPSHOT",
environment_name: "JIB_HOME", environment_name: "JIB_HOME",
environment_value: input.get("jib", "install_path") environment_value: input.get("jib", "home_path")
+ "/jib-3.0-SNAPSHOT-distribution"
}, },
ant: { ant: {

View file

@ -31,7 +31,7 @@ $(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk))
################################################################################ ################################################################################
ifeq ($(OPENJDK_TARGET_OS), aix) ifeq ($(call isTargetOs, aix), true)
TZMAPPINGS_SRC := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf TZMAPPINGS_SRC := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf
@ -44,7 +44,7 @@ endif
################################################################################ ################################################################################
# Copy the microsoft runtime libraries on windows # Copy the microsoft runtime libraries on windows
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(call isTargetOs, windows), true)
# Chmod to avoid permission issues if bundles are unpacked on unix platforms. # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
define copy-and-chmod define copy-and-chmod
@ -81,7 +81,7 @@ endif
################################################################################ ################################################################################
# In jvm.cfg, the first listed KNOWN variant is the default. On most build # In jvm.cfg, the first listed KNOWN variant is the default. On most build
# configurations, that is the server variant. # configurations, that is the server variant.
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), windows-x86) ifeq ($(call And, $(call isTargetOs, windows) $(call isTargetCpu, x86)), true)
DEFAULT_CFG_VARIANT ?= client DEFAULT_CFG_VARIANT ?= client
endif endif
DEFAULT_CFG_VARIANT ?= server DEFAULT_CFG_VARIANT ?= server
@ -143,7 +143,7 @@ DEF_POLICY_DST := $(LIB_DST_DIR)/security/default.policy
DEF_POLICY_SRC_LIST := $(DEF_POLICY_SRC) DEF_POLICY_SRC_LIST := $(DEF_POLICY_SRC)
DEF_POLICY_SRC_LIST += $(CUSTOM_POLICY_SRC_LIST) DEF_POLICY_SRC_LIST += $(CUSTOM_POLICY_SRC_LIST)
ifneq ($(filter $(OPENJDK_TARGET_OS), windows solaris), ) ifeq ($(call isTargetOs, windows solaris), true)
DEF_POLICY_SRC_LIST += $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/lib/security/default.policy DEF_POLICY_SRC_LIST += $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/lib/security/default.policy
endif endif
@ -183,7 +183,7 @@ $(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \
TARGETS += $(COPY_NET_PROPERTIES) TARGETS += $(COPY_NET_PROPERTIES)
ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux), ) ifeq ($(call isTargetOs, solaris linux), true)
$(eval $(call SetupCopyFiles, COPY_SDP_CONF, \ $(eval $(call SetupCopyFiles, COPY_SDP_CONF, \
FILES := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \ FILES := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \
DEST := $(CONF_DST_DIR)/sdp, \ DEST := $(CONF_DST_DIR)/sdp, \

View file

@ -27,7 +27,7 @@ include CopyCommon.gmk
################################################################################ ################################################################################
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(call isTargetOs, solaris), true)
SUNPKCS11_CFG_SRC := \ SUNPKCS11_CFG_SRC := \
$(TOPDIR)/src/jdk.crypto.cryptoki/solaris/conf/security/sunpkcs11-solaris.cfg $(TOPDIR)/src/jdk.crypto.cryptoki/solaris/conf/security/sunpkcs11-solaris.cfg

View file

@ -27,7 +27,7 @@ include CopyCommon.gmk
################################################################################ ################################################################################
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(call isTargetOs, solaris), true)
UCRYPTO_CFG_SRC := $(TOPDIR)/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg UCRYPTO_CFG_SRC := $(TOPDIR)/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg
UCRYPTO_CFG_DST := $(CONF_DST_DIR)/security/ucrypto-solaris.cfg UCRYPTO_CFG_DST := $(CONF_DST_DIR)/security/ucrypto-solaris.cfg

View file

@ -66,6 +66,8 @@ endif
# Setup make rules for copying legal files. This is only needed if the files # Setup make rules for copying legal files. This is only needed if the files
# need to be filtered due to optional components being enabled/disabled. # need to be filtered due to optional components being enabled/disabled.
# Otherwise CreateJmods.gmk will find the legal files in the original src dirs. # Otherwise CreateJmods.gmk will find the legal files in the original src dirs.
# If multiple license files with the same name are found, only the first one
# found will get copied.
# #
# Parameter 1 is the name of the rule. # Parameter 1 is the name of the rule.
# #
@ -75,10 +77,12 @@ SetupCopyLegalFiles = $(NamedParamsMacroTemplate)
define SetupCopyLegalFilesBody define SetupCopyLegalFilesBody
$$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \ $$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \
$$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \ $$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \
$$(if $$(filter $$($1_$$(notdir $$f)), $$($1)), , \
$$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \ $$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \
DEST := $$(LEGAL_DST_DIR), \ DEST := $$(LEGAL_DST_DIR), \
FILES := $$f, \ FILES := $$f, \
)) \ )) \
$$(eval $1 += $$($1_$$(notdir $$f))) \ $$(eval $1 += $$($1_$$(notdir $$f))) \
) \
) )
endef endef

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -440,6 +440,8 @@ charset IBM00858 IBM858
alias cp00858 alias cp00858
alias 858 alias 858
alias PC-Multilingual-850+euro alias PC-Multilingual-850+euro
alias ibm858
alias ibm-858
charset IBM862 IBM862 charset IBM862 IBM862
package sun.nio.cs package sun.nio.cs
@ -1389,6 +1391,7 @@ charset x-IBM833 IBM833
alias cp833 alias cp833
alias ibm833 alias ibm833
alias ibm-833 alias ibm-833
alias 833
charset x-IBM834 IBM834 # EBCDIC DBCS-only Korean charset x-IBM834 IBM834 # EBCDIC DBCS-only Korean
@ -1561,6 +1564,15 @@ charset x-IBM964 IBM964
alias ibm-euctw alias ibm-euctw
alias 964 alias 964
charset x-IBM29626C IBM29626C
package sun.nio.cs.ext
type template
alias cp29626c # JDK historical
alias ibm29626c
alias ibm-29626c
alias 29626c
alias ibm-eucjp
charset x-IBM33722 IBM33722 charset x-IBM33722 IBM33722
package sun.nio.cs.ext package sun.nio.cs.ext
type source type source
@ -1581,6 +1593,8 @@ charset IBM01140 IBM1140
alias cp01140 alias cp01140
alias 1140 alias 1140
alias ebcdic-us-037+euro alias ebcdic-us-037+euro
alias ibm1140
alias ibm-1140
charset IBM01141 IBM1141 charset IBM01141 IBM1141
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1592,6 +1606,8 @@ charset IBM01141 IBM1141
alias cp01141 alias cp01141
alias 1141 alias 1141
alias ebcdic-de-273+euro alias ebcdic-de-273+euro
alias ibm1141
alias ibm-1141
charset IBM01142 IBM1142 charset IBM01142 IBM1142
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1604,6 +1620,8 @@ charset IBM01142 IBM1142
alias 1142 alias 1142
alias ebcdic-no-277+euro alias ebcdic-no-277+euro
alias ebcdic-dk-277+euro alias ebcdic-dk-277+euro
alias ibm1142
alias ibm-1142
charset IBM01143 IBM1143 charset IBM01143 IBM1143
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1616,6 +1634,8 @@ charset IBM01143 IBM1143
alias 1143 alias 1143
alias ebcdic-fi-278+euro alias ebcdic-fi-278+euro
alias ebcdic-se-278+euro alias ebcdic-se-278+euro
alias ibm1143
alias ibm-1143
charset IBM01144 IBM1144 charset IBM01144 IBM1144
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1627,6 +1647,8 @@ charset IBM01144 IBM1144
alias cp01144 alias cp01144
alias 1144 alias 1144
alias ebcdic-it-280+euro alias ebcdic-it-280+euro
alias ibm1144
alias ibm-1144
charset IBM01145 IBM1145 charset IBM01145 IBM1145
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1638,6 +1660,8 @@ charset IBM01145 IBM1145
alias cp01145 alias cp01145
alias 1145 alias 1145
alias ebcdic-es-284+euro alias ebcdic-es-284+euro
alias ibm1145
alias ibm-1145
charset IBM01146 IBM1146 charset IBM01146 IBM1146
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1649,6 +1673,8 @@ charset IBM01146 IBM1146
alias cp01146 alias cp01146
alias 1146 alias 1146
alias ebcdic-gb-285+euro alias ebcdic-gb-285+euro
alias ibm1146
alias ibm-1146
charset IBM01147 IBM1147 charset IBM01147 IBM1147
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1660,6 +1686,8 @@ charset IBM01147 IBM1147
alias cp01147 alias cp01147
alias 1147 alias 1147
alias ebcdic-fr-277+euro alias ebcdic-fr-277+euro
alias ibm1147
alias ibm-1147
charset IBM01148 IBM1148 charset IBM01148 IBM1148
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1671,6 +1699,8 @@ charset IBM01148 IBM1148
alias cp01148 alias cp01148
alias 1148 alias 1148
alias ebcdic-international-500+euro alias ebcdic-international-500+euro
alias ibm1148
alias ibm-1148
charset IBM01149 IBM1149 charset IBM01149 IBM1149
package sun.nio.cs.ext package sun.nio.cs.ext
@ -1682,6 +1712,8 @@ charset IBM01149 IBM1149
alias cp01149 alias cp01149
alias 1149 alias 1149
alias ebcdic-s-871+euro alias ebcdic-s-871+euro
alias ibm1149
alias ibm-1149
charset IBM290 IBM290 charset IBM290 IBM290
package sun.nio.cs.ext package sun.nio.cs.ext

View file

@ -22,8 +22,12 @@ IBM1046
IBM1124 IBM1124
IBM1129 IBM1129
IBM1383 IBM1383
IBM29626C
ISO_8859_6 ISO_8859_6
ISO_8859_8 ISO_8859_8
JIS_X_0201
JIS_X_0208
JIS_X_0212
MS1252 MS1252
TIS_620 TIS_620
SimpleEUCEncoder SimpleEUCEncoder

4
make/data/cldr/README Normal file
View file

@ -0,0 +1,4 @@
CLDR - Unicode Common Locale Data Repository
http://cldr.unicode.org
CLDR version installed: 33

Some files were not shown because too many files have changed in this diff Show more