128 If you are new to Mercurial, please see the
129 <a href="http://mercurial.selenic.com/wiki/BeginnersGuides">
130 Beginner Guides</a>
131 or refer to the <a href="http://hgbook.red-bean.com/">
132 Mercurial Book</a>.
133 The first few chapters of the book provide an excellent overview of
134 Mercurial, what it is and how it works.
135 <br>
136 For using Mercurial with the OpenJDK refer to the
137 <a href="http://openjdk.java.net/guide/repositories.html#installConfig">
138 Developer Guide: Installing and Configuring Mercurial</a>
139 section for more information.
140
141 <h3><a name="get_source">Getting the Source</a></h3>
142 <blockquote>
143 To get the entire set of OpenJDK Mercurial repositories
144 use the script <code>get_source.sh</code> located in the
145 root repository:
146 <blockquote>
147 <code>
148 hg clone http://hg.openjdk.java.net/jdk8/jdk8
149 <i>YourOpenJDK</i>
150 <br>
151 cd <i>YourOpenJDK</i>
152 <br>
153 bash ./get_source.sh
154 </code>
155 </blockquote>
156 Once you have all the repositories, keep in mind that each
157 repository is its own independent repository.
158 You can also re-run <code>./get_source.sh</code> anytime to
159 pull over all the latest changesets in all the repositories.
160 This set of nested repositories has been given the term
161 "forest" and there are various ways to apply the same
162 <code>hg</code> command to each of the repositories.
163 For example, the script <code>make/scripts/hgforest.sh</code>
164 can be used to repeat the same <code>hg</code>
165 command on every repository, e.g.
166 <blockquote>
167 <code>
168 cd <i>YourOpenJDK</i>
356 Before even attempting to use a system to build the OpenJDK
357 there are some very basic system setups needed.
358 For all systems:
359 <ul>
360 <li>
361 Be sure the GNU make utility is version 3.81 or newer,
362 e.g. run "<code>make -version</code>"
363 </li>
364 <li>
365 Install a
366 <a name="bootjdk">Bootstrap JDK</a>.
367 All OpenJDK builds require access to a previously released
368 JDK called the <i>bootstrap JDK</i> or <i>boot JDK.</i>
369 The general rule is that the bootstrap JDK
370 must be an instance of the previous major
371 release of the JDK. In addition, there may be
372 a requirement to use a release at or beyond a
373 particular update level.
374 <br> <br>
375
376 <b><i>Building JDK 8 requires use of a version
377 of JDK 7 that is at Update 7 or newer. JDK 8
378 developers should not use JDK 8 as the boot
379 JDK, to ensure that JDK 8 dependencies are
380 not introduced into the parts of the system
381 that are built with JDK 7.</i></b>
382
383 <br> <br>
384 The JDK 7 binaries can be downloaded from Oracle's
385 <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"
386 target="_blank">JDK 7 download site</a>.
387 For build performance reasons
388 is very important that this bootstrap JDK be made available
389 on the local disk of the machine doing the build.
390 You should add its <code>bin</code> directory
391 to the <code>PATH</code> environment variable.
392 If <code>configure</code> has any issues finding this JDK, you may
393 need to use the <code>configure</code> option
394 <code>--with-boot-jdk</code>.
395 </li>
396 <li>
397 Ensure that GNU make, the Bootstrap JDK,
398 and the compilers are all
399 in your PATH environment variable
400 </li>
401 </ul>
402 And for specific systems:
403 <table border="1">
404 <thead>
405 <tr>
406 <th>Linux</th>
407 <th>Solaris</th>
1437 number of cores in the build system,
1438 e.g. <code>--with-num-cores=8</code>
1439 </li>
1440 <li>
1441 <b><code>--with-memory-size</code></b>
1442 — memory (in MB) available in the build system,
1443 e.g. <code>--with-memory-size=1024</code>
1444 </li>
1445 </ul>
1446
1447 <p>It might also be necessary to specify the JVM arguments passed
1448 to the Bootstrap JDK, using e.g.
1449 <code>--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"</code>.
1450 Doing this will override the default JVM arguments
1451 passed to the Bootstrap JDK.</p>
1452
1453
1454 <p>One of the top goals of the new build system is to improve the
1455 build performance and decrease the time needed to build. This will
1456 soon also apply to the java compilation when the Smart Javac wrapper
1457 is making its way into jdk8. It can be tried in the build-infra
1458 repository already. You are likely to find that the new build system
1459 is faster than the old one even without this feature.</p>
1460
1461 <p>At the end of a successful execution of <code>configure</code>,
1462 you will get a performance summary,
1463 indicating how well the build will perform. Here you will
1464 also get performance hints.
1465 If you want to build fast, pay attention to those!</p>
1466
1467 <h4>Building with ccache</h4>
1468
1469 <p>A simple way to radically speed up compilation of native code
1470 (typically hotspot and native libraries in JDK) is to install
1471 ccache. This will cache and reuse prior compilation results, if the
1472 source code is unchanged. However, ccache versions prior to 3.1.4
1473 does not work correctly with the precompiled headers used in
1474 OpenJDK. So if your platform supports ccache at 3.1.4 or later, we
1475 highly recommend installing it. This is currently only supported on
1476 linux.</p>
1477
1478 <h4>Building on local disk</h4>
1479
|
128 If you are new to Mercurial, please see the
129 <a href="http://mercurial.selenic.com/wiki/BeginnersGuides">
130 Beginner Guides</a>
131 or refer to the <a href="http://hgbook.red-bean.com/">
132 Mercurial Book</a>.
133 The first few chapters of the book provide an excellent overview of
134 Mercurial, what it is and how it works.
135 <br>
136 For using Mercurial with the OpenJDK refer to the
137 <a href="http://openjdk.java.net/guide/repositories.html#installConfig">
138 Developer Guide: Installing and Configuring Mercurial</a>
139 section for more information.
140
141 <h3><a name="get_source">Getting the Source</a></h3>
142 <blockquote>
143 To get the entire set of OpenJDK Mercurial repositories
144 use the script <code>get_source.sh</code> located in the
145 root repository:
146 <blockquote>
147 <code>
148 hg clone http://hg.openjdk.java.net/jdk9/jdk9
149 <i>YourOpenJDK</i>
150 <br>
151 cd <i>YourOpenJDK</i>
152 <br>
153 bash ./get_source.sh
154 </code>
155 </blockquote>
156 Once you have all the repositories, keep in mind that each
157 repository is its own independent repository.
158 You can also re-run <code>./get_source.sh</code> anytime to
159 pull over all the latest changesets in all the repositories.
160 This set of nested repositories has been given the term
161 "forest" and there are various ways to apply the same
162 <code>hg</code> command to each of the repositories.
163 For example, the script <code>make/scripts/hgforest.sh</code>
164 can be used to repeat the same <code>hg</code>
165 command on every repository, e.g.
166 <blockquote>
167 <code>
168 cd <i>YourOpenJDK</i>
356 Before even attempting to use a system to build the OpenJDK
357 there are some very basic system setups needed.
358 For all systems:
359 <ul>
360 <li>
361 Be sure the GNU make utility is version 3.81 or newer,
362 e.g. run "<code>make -version</code>"
363 </li>
364 <li>
365 Install a
366 <a name="bootjdk">Bootstrap JDK</a>.
367 All OpenJDK builds require access to a previously released
368 JDK called the <i>bootstrap JDK</i> or <i>boot JDK.</i>
369 The general rule is that the bootstrap JDK
370 must be an instance of the previous major
371 release of the JDK. In addition, there may be
372 a requirement to use a release at or beyond a
373 particular update level.
374 <br> <br>
375
376 <b><i>Building JDK 9 requires JDK 8. JDK 9
377 developers should not use JDK 9 as the boot
378 JDK, to ensure that JDK 9 dependencies are
379 not introduced into the parts of the system
380 that are built with JDK 8.</i></b>
381
382 <br> <br>
383 The JDK 8 binaries can be downloaded from Oracle's
384 <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"
385 target="_blank">JDK 8 download site</a>.
386 For build performance reasons it
387 is very important that this bootstrap JDK be made available
388 on the local disk of the machine doing the build.
389 You should add its <code>bin</code> directory
390 to the <code>PATH</code> environment variable.
391 If <code>configure</code> has any issues finding this JDK, you may
392 need to use the <code>configure</code> option
393 <code>--with-boot-jdk</code>.
394 </li>
395 <li>
396 Ensure that GNU make, the Bootstrap JDK,
397 and the compilers are all
398 in your PATH environment variable
399 </li>
400 </ul>
401 And for specific systems:
402 <table border="1">
403 <thead>
404 <tr>
405 <th>Linux</th>
406 <th>Solaris</th>
1436 number of cores in the build system,
1437 e.g. <code>--with-num-cores=8</code>
1438 </li>
1439 <li>
1440 <b><code>--with-memory-size</code></b>
1441 — memory (in MB) available in the build system,
1442 e.g. <code>--with-memory-size=1024</code>
1443 </li>
1444 </ul>
1445
1446 <p>It might also be necessary to specify the JVM arguments passed
1447 to the Bootstrap JDK, using e.g.
1448 <code>--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"</code>.
1449 Doing this will override the default JVM arguments
1450 passed to the Bootstrap JDK.</p>
1451
1452
1453 <p>One of the top goals of the new build system is to improve the
1454 build performance and decrease the time needed to build. This will
1455 soon also apply to the java compilation when the Smart Javac wrapper
1456 is fully supported.</p>
1457
1458 <p>At the end of a successful execution of <code>configure</code>,
1459 you will get a performance summary,
1460 indicating how well the build will perform. Here you will
1461 also get performance hints.
1462 If you want to build fast, pay attention to those!</p>
1463
1464 <h4>Building with ccache</h4>
1465
1466 <p>A simple way to radically speed up compilation of native code
1467 (typically hotspot and native libraries in JDK) is to install
1468 ccache. This will cache and reuse prior compilation results, if the
1469 source code is unchanged. However, ccache versions prior to 3.1.4
1470 does not work correctly with the precompiled headers used in
1471 OpenJDK. So if your platform supports ccache at 3.1.4 or later, we
1472 highly recommend installing it. This is currently only supported on
1473 linux.</p>
1474
1475 <h4>Building on local disk</h4>
1476
|