7152336: Enable builds on Windows with MinGW/MSYS
Summary: Minimal makefile changes to enable building OpenJDK using MSYS on Windows7
Reviewed-by: ohair, tbell
Contributed-by: volker.simonis@gmail.com
--- a/README-builds.html Wed Jul 05 18:26:11 2017 +0200
+++ b/README-builds.html Tue Oct 23 10:10:49 2012 -0700
@@ -96,7 +96,8 @@
</li>
<li>Windows only:
<ul>
- <li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>)</li>
+ <li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>) <strong>or</strong></li>
+ <li>Minimalist GNU for Windows (<a href="#msys">MinGW/MSYS</a>)</li>
<li><a href="#dxsdk">DirectX 9.0 SDK</a> </li>
</ul>
</li>
@@ -161,7 +162,7 @@
<blockquote>
This file often describes specific requirements for what we call the
"minimum build environments" (MBE) for this
- specific release of the JDK,
+ specific release of the JDK,
Building with the MBE will generate the most compatible
bits that install on, and run correctly on, the most variations
of the same base OS and hardware architecture.
@@ -241,16 +242,16 @@
</tbody>
</table>
<p>
- These same sources do indeed build on many more systems than the
- above older generation systems, again the above is just a minimum.
+ These same sources do indeed build on many more systems than the
+ above older generation systems, again the above is just a minimum.
<p>
- Compilation problems with newer or different C/C++ compilers is a
- common problem.
- Similarly, compilation problems related to changes to the
+ Compilation problems with newer or different C/C++ compilers is a
+ common problem.
+ Similarly, compilation problems related to changes to the
<tt>/usr/include</tt> or system header files is also a
- common problem with newer or unreleased OS versions.
- Please report these types of problems as bugs so that they
- can be dealt with accordingly.
+ common problem with newer or unreleased OS versions.
+ Please report these types of problems as bugs so that they
+ can be dealt with accordingly.
</blockquote>
<!-- ------------------------------------------------------ -->
<hr>
@@ -266,15 +267,15 @@
<p>
<blockquote>
After installing <a href="http://fedoraproject.org">Fedora</a> 9
- you need to install several build dependencies. The simplest
- way to do it is to execute the following commands as user
+ you need to install several build dependencies. The simplest
+ way to do it is to execute the following commands as user
<tt>root</tt>:
<p/>
<code>yum-builddep java-1.6.0-openjdk</code>
<p/>
<code>yum install gcc gcc-c++</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
@@ -283,15 +284,15 @@
<p>
<blockquote>
After installing <a href="http://fedoraproject.org">Fedora</a> 10
- you need to install several build dependencies. The simplest
- way to do it is to execute the following commands as user
+ you need to install several build dependencies. The simplest
+ way to do it is to execute the following commands as user
<tt>root</tt>:
<p/>
<code>yum-builddep java-1.6.0-openjdk</code>
<p/>
<code>yum install gcc gcc-c++</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
@@ -300,15 +301,15 @@
<p>
<blockquote>
After installing <a href="http://fedoraproject.org">Fedora</a> 11
- you need to install several build dependencies. The simplest
- way to do it is to execute the following commands as user
+ you need to install several build dependencies. The simplest
+ way to do it is to execute the following commands as user
<tt>root</tt>:
<p/>
<code>yum-builddep java-1.6.0-openjdk</code>
<p/>
<code>yum install gcc gcc-c++</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
@@ -360,16 +361,16 @@
<h4>Debian 5.0 (Lenny)</h4>
<p>
<blockquote>
- After installing <a href="http://debian.org">Debian</a> 5
- you need to install several build dependencies.
- The simplest way to install the build dependencies is to
- execute the following commands as user <tt>root</tt>:
+ After installing <a href="http://debian.org">Debian</a> 5
+ you need to install several build dependencies.
+ The simplest way to install the build dependencies is to
+ execute the following commands as user <tt>root</tt>:
<p/>
<code>aptitude build-dep openjdk-6</code>
<p/>
<code>aptitude install openjdk-6-jdk libmotif-dev</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
@@ -380,52 +381,52 @@
<h4>Ubuntu 8.04</h4>
<p>
<blockquote>
- After installing <a href="http://ubuntu.org">Ubuntu</a> 8.04
- you need to install several build dependencies.
+ After installing <a href="http://ubuntu.org">Ubuntu</a> 8.04
+ you need to install several build dependencies.
<p/>
- First, you need to enable the universe repository in the
- Software Sources application and reload the repository
- information. The Software Sources application is available
- under the System/Administration menu.
+ First, you need to enable the universe repository in the
+ Software Sources application and reload the repository
+ information. The Software Sources application is available
+ under the System/Administration menu.
<p/>
- The simplest way to install the build dependencies is to
- execute the following commands:
+ The simplest way to install the build dependencies is to
+ execute the following commands:
<p/>
<code>sudo aptitude build-dep openjdk-6</code>
<p/>
<code>sudo aptitude install openjdk-6-jdk</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
<h4>Ubuntu 8.10</h4>
<p>
<blockquote>
- After installing <a href="http://ubuntu.org">Ubuntu</a> 8.10
- you need to install several build dependencies. The simplest
- way to do it is to execute the following commands:
+ After installing <a href="http://ubuntu.org">Ubuntu</a> 8.10
+ you need to install several build dependencies. The simplest
+ way to do it is to execute the following commands:
<p/>
<code>sudo aptitude build-dep openjdk-6</code>
<p/>
<code>sudo aptitude install openjdk-6-jdk</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
<h4>Ubuntu 9.04</h4>
<p>
<blockquote>
- After installing <a href="http://ubuntu.org">Ubuntu</a> 9.04
- you need to install several build dependencies. The simplest
- way to do it is to execute the following commands:
+ After installing <a href="http://ubuntu.org">Ubuntu</a> 9.04
+ you need to install several build dependencies. The simplest
+ way to do it is to execute the following commands:
<p/>
<code>sudo aptitude build-dep openjdk-6</code>
<p/>
<code>sudo aptitude install openjdk-6-jdk</code>
<p/>
- In addition, it's necessary to set a few environment variables for the build:
+ In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
@@ -436,20 +437,20 @@
<h4>OpenSUSE 11.1</h4>
<p>
<blockquote>
- After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1
- you need to install several build dependencies.
- The simplest way to install the build dependencies is to
- execute the following commands:
+ After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1
+ you need to install several build dependencies.
+ The simplest way to install the build dependencies is to
+ execute the following commands:
<p/>
<code>sudo zypper source-install -d java-1_6_0-openjdk</code>
<p/>
<code>sudo zypper install make</code>
<p/>
- In addition, it is necessary to set a few environment variables for the build:
+ In addition, it is necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk</code>
<p/>
- Finally, you need to unset the <code>JAVA_HOME</code> environment variable:
+ Finally, you need to unset the <code>JAVA_HOME</code> environment variable:
<p/>
<code>export -n JAVA_HOME</code>
</blockquote>
@@ -460,14 +461,14 @@
<h4>Mandriva Linux One 2009 Spring</h4>
<p>
<blockquote>
- After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring
- you need to install several build dependencies.
- The simplest way to install the build dependencies is to
- execute the following commands as user <tt>root</tt>:
+ After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring
+ you need to install several build dependencies.
+ The simplest way to install the build dependencies is to
+ execute the following commands as user <tt>root</tt>:
<p/>
<code>urpmi java-1.6.0-openjdk-devel ant make gcc gcc-c++ freetype-devel zip unzip libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel libxtst6-devel libxi-devel</code>
<p/>
- In addition, it is necessary to set a few environment variables for the build:
+ In addition, it is necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk</code>
</blockquote>
@@ -478,18 +479,18 @@
<h4>OpenSolaris 2009.06</h4>
<p>
<blockquote>
- After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06
- you need to install several build dependencies.
- The simplest way to install the build dependencies is to
- execute the following commands:
+ After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06
+ you need to install several build dependencies.
+ The simplest way to install the build dependencies is to
+ execute the following commands:
<p/>
<code>pfexec pkg install SUNWgmake SUNWj6dev SUNWant sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2</code>
<p/>
- In addition, it is necessary to set a few environment variables for the build:
+ In addition, it is necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_COMPILER_PATH=/opt/SunStudioExpress/bin/ ALT_CUPS_HEADERS_PATH=/usr/include/</code>
<p/>
- Finally, you need to make sure that the build process can find the Sun Studio compilers:
+ Finally, you need to make sure that the build process can find the Sun Studio compilers:
<p/>
<code>export PATH=$PATH:/opt/SunStudioExpress/bin/</code>
</blockquote>
@@ -687,31 +688,20 @@
</li>
<li>
<strong>Windows:</strong>
- Make sure you start your build inside a bash/sh/ksh shell
- and are using a <tt>make.exe</tt> utility built for that
- environment (a cygwin <tt>make.exe</tt> is not the same
- as a <tt>make.exe</tt> built for something like
- <a href="http://www.mkssoftware.com/">MKS</a>).
- <br>
- <b>WARNING:</b> Watch out on some make 3.81 versions, it may
- not work due to a lack of support for MS-DOS drive letter paths
- like <tt>C:/</tt> or <tt>C:\</tt>.
- <br>
- You may be able to use the information at the
- <a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
- mozilla developer center</a>
- on this topic.
- <br>
- It's hoped that when make 3.82 starts shipping in a future cygwin
- release that this MS-DOS path issue will be fixed.
- <br>
- It may be possible to download the version at
- <a href="http://www.cmake.org/files/cygwin/make.exe">
- www.cmake.org make.exe</a>.
- <br>
- It might be necessary for you to build your own GNU make 3.81,
- see the <a href="#buildgmake">"Building GNU make"</a> section
- in that case.
+ Make sure you start your build inside a bash/sh/ksh shell and are
+ using a <tt>make.exe</tt> utility built for that environment.<br/>
+ <strong>MKS</strong> builds need a native Windows version of GNU make
+ (see <a href="#buildgmake">Building GNU make</a>).<br/>
+ <strong>Cygwin</strong> builds need
+ a make version which was specially compiled for the Cygwin environment
+ (see <a href="#buildgmake">Building GNU make</a>). <strong>WARNING:</strong>
+ the OpenJDK build with the make utility provided by Cygwin will <strong>not</strong>
+ work because it does not support drive letters in paths. Make sure that
+ your version of make will be found before the Cygwins default make by
+ setting an appropriate <tt>PATH</tt> environment variable or by removing
+ Cygwin's make after you built your own make version.<br/>
+ <strong>MinGW/MSYS</strong> builds can use the default make which
+ comes with the environment.
</li>
</ul>
<p>
@@ -727,7 +717,7 @@
<!-- ------------------------------------------------------ -->
<h4><a name="buildgmake">Building GNU make</a></h4>
<blockquote>
- First step is to get the GNU make 3.81 source from
+ First step is to get the GNU make 3.81 (or newer) source from
<a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
ftp.gnu.org/pub/gnu/make/</a>.
Building is a little different depending on the OS and unix toolset
@@ -742,12 +732,24 @@
<tt>./configure && gmake CC=gcc</tt>
</li>
<li>
- <strong>Windows for CYGWIN:</strong>
- <tt>./configure && make</tt>
+ <strong>Windows for CYGWIN:</strong><br/>
+ <tt>./configure</tt><br/>
+ Add the line <tt>#define HAVE_CYGWIN_SHELL 1</tt> to the end of <tt>config.h</tt><br/>
+ <tt>make</tt><br/>
+ <br/>
+ This should produce <tt>make.exe</tt> in the current directory.
</li>
<li>
- <strong>Windows for MKS: (CYGWIN is recommended)</strong>
- <tt>./configure && make -f Makefile.win32</tt>
+ <strong>Windows for MKS:</strong><br/>
+ Edit <tt>config.h.W32</tt> and uncomment the line <tt>#define HAVE_MKS_SHELL 1</tt><br/>
+ Set the environment for your native compiler (e.g. by calling:<br/>
+ <tt>"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /Release /xp /x64)</tt>
+ <tt>nmake -f NMakefile.win32</tt>
+ <br/>
+ This should produce <tt>WinDebug/make.exe</tt> and <tt>WinRel/make.exe</tt>
+ <br/>
+ If you get the error: <tt>NMAKE : fatal error U1045: spawn failed : Permission denied</tt>
+ you have to set the <tt>Read & execute</tt> permission for the file <tt>subproc.bat</tt>.
</li>
</ul>
</blockquote>
@@ -894,39 +896,135 @@
<h4><a name="paths">Windows Paths</a></h4>
<blockquote>
<strong>Windows:</strong>
- Note that GNU make is a historic utility and is based very
- heavily on shell scripting, so it does not tolerate the Windows habit
+ Note that GNU make, the shell and other Unix-tools required during the build
+ do not tolerate the Windows habit
of having spaces in pathnames or the use of the <tt>\</tt>characters in pathnames.
- Luckily on most Windows systems, you can use <tt>/</tt>instead of \, and
- there is always a 'short' pathname without spaces for any path that
- contains spaces.
- Unfortunately, this short pathname can be somewhat dynamic and the
- formula is difficult to explain.
- You can use <tt>cygpath</tt> utility to map pathnames with spaces
- or the <tt>\</tt>character into the <tt>C:/</tt> style of pathname
- (called 'mixed'), e.g.
- <tt>cygpath -s -m "<i>path</i>"</tt>.
+ Luckily on most Windows systems, you can use <tt>/</tt>instead of <tt>\</tt>, and
+ there is always a short <a href="http://en.wikipedia.org/wiki/8.3_filename">
+ "8.3" pathname</a> without spaces for any path that contains spaces.
+ Unfortunately, this short pathname is somewhat dynamic (i.e. dependant on the
+ other files and directories inside a given directory) and can not be
+ algorithmicly calculated by only looking at a specific path name.
<p>
The makefiles will try to translate any pathnames supplied
to it into the <tt>C:/</tt> style automatically.
+ </p>
<p>
- Note that use of CYGWIN creates a unique problem with regards to
+ Special care has to be taken if native Windows applications
+ like <tt>nmake</tt> or <tt>cl</tt> are called with file arguments processed
+ by Unix-tools like <tt>make</tt> or <tt>sh</tt>!
+ </p>
+ </blockquote>
+ <!-- ------------------------------------------------------ -->
+ <h4><a name="paths">Windows build environments</a></h4>
+ <blockquote>
+ Building on Windows requires a Unix-like environment, notably a Unix-like shell.
+ There are several such environments available of which
+ <a href="http://www.mkssoftware.com/products/tk/ds_tkdev.asp">MKS</a>,
+ <a href="http://www.cygwin.com/">Cygwin</a> and
+ <a href="http://www.mingw.org/wiki/MSYS">MinGW/MSYS</a> are currently supported for
+ the OpenJDK build. One of the differences of these three systems is the way
+ they handle Windows path names, particularly path names which contain
+ spaces, backslashes as path separators and possibly drive letters. Depending
+ on the use case and the specifics of each environment these path problems can
+ be solved by a combination of quoting whole paths, translating backslashes to
+ forward slashes, escaping backslashes with additional backslashes and
+ translating the path names to their <a href="http://en.wikipedia.org/wiki/8.3_filename">
+ "8.3" version</a>.
+ <p>
+ As of this writing (MKS ver. 9.4, Cygwin ver. 1.7.9, MinGW/MSYS 1.0.17),
+ MKS builds are known to be the fastest Windows builds while MingGW/MSYS
+ builds are slightly slower (about 10%) than MKS builds and Cygwin builds
+ require nearly twice the time (about 180%) of MKS builds (e.g. on a
+ DualCore i7 notebook with 8GB of RAM, HDD and 64-bit Windows 7 operating system
+ the complete OpenJDK 8 product build takes about 49min with MKS, 54min with
+ MinGW/MSYS and 88min with Cygwin).
+ </p>
+ <p>
+ Mixing tools from the different Unix emulation environments is not a good
+ idea and will probably not work!
+ </p>
+ <p>
+ <strong>MKS:</strong> is a commercial product which includes
+ all the Unix utilities which are required to build the OpenJDK except GNU
+ make. In pre-OpenJDK times it was the only supported build environment on
+ Windows. The MKS tools support Windows paths with drive letters and
+ forward slashes as path separator. Paths in environment variables like (for
+ example) <tt>PATH</tt> are separated by semicolon '<tt>;</tt>'.
+ </p>
+ <p>
+ Recent versions of MKS provide the <tt>dosname</tt> utility to convert paths
+ with spaces to short (8.3) path names,e .g.
+ <tt>dosname -s "<i>path</i>"</tt>.
+ </p>
+ <p>
+ If you are using the MKS environment, you need a native Windows version
+ of Gnu make <a href="#buildgmake">which you can easily build yourself</a>.
+ </p>
+ <p>
+ <strong>Cygwin:</strong>
+ is an open source, Linux-like environment which tries to emulate
+ a complete POSIX layer on Windows. It tries to be smart about path names
+ and can usually handle all kinds of paths if they are correctly quoted
+ or escaped although internally it maps drive letters <tt><drive>:</tt>
+ to a virtual directory <tt>/cygdrive/<drive></tt>.
+ </p>
+ <p>
+ You can always use the <tt>cygpath</tt> utility to map pathnames with spaces
+ or the backslash character into the <tt>C:/</tt> style of pathname
+ (called 'mixed'), e.g. <tt>cygpath -s -m "<i>path</i>"</tt>.
+ </p>
+ <p>
+ Note that the use of CYGWIN creates a unique problem with regards to
setting <a href="#path"><tt>PATH</tt></a>. Normally on Windows
the <tt>PATH</tt> variable contains directories
- separated with the ";" character (Solaris and Linux uses ":").
+ separated with the ";" character (Solaris and Linux use ":").
With CYGWIN, it uses ":", but that means that paths like "C:/path"
cannot be placed in the CYGWIN version of <tt>PATH</tt> and
instead CYGWIN uses something like <tt>/cygdrive/c/path</tt>
which CYGWIN understands, but only CYGWIN understands.
- So be careful with paths on Windows.
+ </p>
+ <p>
+ If you are using the Cygwin environment, you need to
+ <a href="#buildgmake">compile your own version</a>
+ of GNU make because the default Cygwin make can not handle drive letters in paths.
+ </p>
+ <p>
+ <strong>MinGW/MSYS:</strong>
+ MinGW ("Minimalist GNU for Windows") is a collection of free Windows
+ specific header files and import libraries combined with GNU toolsets that
+ allow one to produce native Windows programs that do not rely on any
+ 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building
+ applications and programs which rely on traditional UNIX tools to
+ be present. Among others this includes tools like <tt>bash</tt> and <tt>make</tt>.
+ </p>
+ <p>
+ Like Cygwin, MinGW/MSYS can handle different types of path formats. They
+ are internally converted to paths with forward slashes and drive letters
+ <tt><drive>:</tt> replaced by a virtual
+ directory <tt>/<drive></tt>. Additionally, MSYS automatically
+ detects binaries compiled for the MSYS environment and feeds them with the
+ internal, Unix-style path names. If native Windows applications are called
+ from within MSYS programs their path arguments are automatically converted
+ back to Windows style path names with drive letters and backslashes as
+ path separators. This may cause problems for Windows applications which
+ use forward slashes as parameter separator (e.g. <tt>cl /nologo /I</tt>)
+ because MSYS may wrongly <a href="http://mingw.org/wiki/Posix_path_conversion">
+ replace such parameters by drive letters</a>.
+ </p>
+ <p>
+ If you are using the MinGW/MSYS system you can use the default make
+ version supplied by the environment.
+ </p>
</blockquote>
<!-- ------------------------------------------------------ -->
<h4><a name="windows_checklist">Basic Windows Check List</a></h4>
<blockquote>
<ol>
<li>
- Install the
- <a href="#cygwin">CYGWIN product</a>.
+ Install one of the
+ <a href="#cygwin">CYGWIN</a>, <a href="#msys">MinGW/MSYS</a> or
+ <a href="http://www.mkssoftware.com/products/tk/ds_tkdev.asp">MKS</a> environments.
</li>
<li>
Install the
@@ -1097,9 +1195,9 @@
<a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm" target="_blank">
Sun Studio 12 Update 1 Compilers</a>
(containing version 5.10 of the C and C++ compilers) is required,
- including specific patches.
+ including specific patches.
<p>
- The Solaris SPARC patch list is:
+ The Solaris SPARC patch list is:
<ul>
<li>
118683-05: SunOS 5.10: Patch for profiling libraries and assembler
@@ -1286,7 +1384,8 @@
The XRender header file is included with the other X11 header files
in the package <strong>SFWxwinc</strong> on new enough versions of
Solaris and will be installed in
- <tt>/usr/X11/include/X11/extensions/Xrender.h</tt>
+ <tt>/usr/X11/include/X11/extensions/Xrender.h</tt> or
+ <tt>/usr/openwin/share/include/X11/extensions/Xrender.h</tt>
</p><p>
<strong>Linux:</strong>
XRender header files are required for building the
@@ -1456,7 +1555,9 @@
<td>Devel</td>
<td>make</td>
<td>The GNU version of the 'make' utility built for CYGWIN.<br>
- <b>NOTE</b>: See <a href="#gmake">the GNU make section</a></td>
+ <b>NOTE</b>: the Cygwin make can not be used to build the
+ OpenJDK. You only need it to build your own version of make
+ (see <a href="#gmake">the GNU make section</a>)</td>
</tr>
<tr>
<td>m4.exe</td>
@@ -1521,6 +1622,21 @@
So it's important that the Visual Studio paths in PATH preceed
the CYGWIN path <tt>/usr/bin</tt>.
</blockquote>
+ <strong> Minimalist GNU for Windows (<a name="msys">MinGW/MSYS</a>)</strong>
+ <blockquote>
+ Alternatively, the set of unix command tools for the OpenJDK build on
+ Windows can be supplied by
+ <a href="http://www.mingw.org/wiki/MSYS" target="_blank">MinGW/MSYS</a>.
+ <p>
+ In addition to the tools which will be installed by default, you have
+ to manually install the <tt>msys-zip</tt> and <tt>msys-unzip</tt> packages.
+ This can be easily done with the MinGW command line installer:<br/>
+ <tt><br/>
+ mingw-get.exe install msys-zip<br/>
+ mingw-get.exe install msys-unzip<br/>
+ </tt>
+ </p>
+ </blockquote>
<strong><a name="dxsdk">Microsoft DirectX 9.0 SDK header files and libraries</a></strong>
<blockquote>
Microsoft DirectX 9.0 SDK (Summer 2004)
@@ -1781,10 +1897,10 @@
</dd>
<dt><a name="ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a></dt>
<dd>
- The top-level directory of the libraries and include files for the platform's
- graphical programming environment. The default location is platform specific.
- For example, on Linux it defaults to <tt>/usr/X11R6/</tt>.
- </dd>
+ The top-level directory of the libraries and include files for the platform's
+ graphical programming environment. The default location is platform specific.
+ For example, on Linux it defaults to <tt>/usr/X11R6/</tt>.
+ </dd>
<dt><strong>Windows specific:</strong></dt>
<dd>
<dl>
@@ -1792,9 +1908,9 @@
<dd>
The location of the
Microsoft Windows SDK where some tools will be
- located.
- The default is whatever WINDOWSSDKDIR is set to
- (or WindowsSdkDir) or the path
+ located.
+ The default is whatever WINDOWSSDKDIR is set to
+ (or WindowsSdkDir) or the path
<br>
<tt>c:\Program Files\Microsoft SDKs\Windows\v7.0a</tt>
</dd>
@@ -1823,17 +1939,17 @@
is that <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> is set
to point to the cross-compiler and that any cross-compilation specific flags
are passed using <a href="#EXTRA_CFLAGS"><tt>EXTRA_CFLAGS</tt></a>.
- The <a href="#ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a> variable should
- also be set to point to the graphical header files (e.g. X11) provided with
- the cross-compiler.
+ The <a href="#ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a> variable should
+ also be set to point to the graphical header files (e.g. X11) provided with
+ the cross-compiler.
When cross-compiling we skip execution of any demos etc that may be built, and
also skip binary-file verification.
</dd>
<dt><tt><a name="EXTRA_CFLAGS">EXTRA_CFLAGS</a></tt> </dt>
<dd>
- Used to pass cross-compilation options to the cross-compiler.
+ Used to pass cross-compilation options to the cross-compiler.
These are added to the <tt>CFLAGS</tt> and <tt>CXXFLAGS</tt> variables.
- </dd>
+ </dd>
<dt><tt><a name="USE_ONLY_BOOTDIR_TOOLS">USE_ONLY_BOOTDIR_TOOLS</a></tt> </dt>
<dd>
Used primarily for cross-compilation builds (and always set in that case)
@@ -1868,23 +1984,23 @@
<dt><tt><a name="BUILD_HEADLESS_ONLY"></a>BUILD_HEADLESS_ONLY</tt> </dt>
<dd>
Used when the build environment has no graphical capabilities at all. This
- excludes building anything that requires graphical libraries to be available.
+ excludes building anything that requires graphical libraries to be available.
</dd>
<dt><tt><a name="JAVASE_EMBEDDED"></a>JAVASE_EMBEDDED</tt> </dt>
<dd>
- Used to indicate this is a build of the Oracle Java SE Embedded product.
- This will enable the directives included in the SE-Embedded specific build
- files.
+ Used to indicate this is a build of the Oracle Java SE Embedded product.
+ This will enable the directives included in the SE-Embedded specific build
+ files.
</dd>
<dt><tt><a name="LIBZIP_CAN_USE_MMAP">LIBZIP_CAN_USE_MMAP</a></tt> </dt>
<dd>
- If set to false, disables the use of mmap by the zip utility. Otherwise,
- mmap will be used.
+ If set to false, disables the use of mmap by the zip utility. Otherwise,
+ mmap will be used.
</dd>
<dt><tt><a name="COMPRESS_JARS"></a>COMPRESS_JARS</tt> </dt>
<dd>
- If set to true, causes certain jar files that would otherwise be built without
- compression, to use compression.
+ If set to true, causes certain jar files that would otherwise be built without
+ compression, to use compression.
</dd>
</dl>
</dd>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/scripts/fixpath.pl Tue Oct 23 10:10:49 2012 -0700
@@ -0,0 +1,169 @@
+#!/bin/perl
+
+#
+# Copyright (c) 2012, 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.
+#
+
+# Crunch down the input(s) to Windows short (mangled) form.
+# Any elements not actually found in the filesystem will be dropped.
+#
+# This script needs three modes:
+# 1) DOS mode with drive letter followed by : and ; path separator
+# 2) Cygwin mode with /cygdrive/<drive letter>/ and : path separator
+# 3) MinGW/MSYS mode with /<drive letter>/ and : path separator
+
+use strict;
+use warnings;
+use Getopt::Std;
+
+sub Usage() {
+ print ("Usage:\n $0 -d | -c | -m \<PATH\>\n");
+ print (" -d DOS style (drive letter, :, and ; path separator)\n");
+ print (" -c Cywgin style (/cygdrive/drive/ and : path separator)\n");
+ print (" -m MinGW style (/drive/ and : path separator)\n");
+ exit 1;
+}
+# Process command line options:
+my %opts;
+getopts('dcm', \%opts) || Usage();
+
+if (scalar(@ARGV) != 1) {Usage()};
+
+# Translate drive letters such as C:/
+# if MSDOS, Win32::GetShortPathName() does the work (see below).
+# if Cygwin, use the /cygdrive/c/ form.
+# if MinGW, use the /c/ form.
+my $path0;
+my $sep2;
+if (defined ($opts{'d'})) {
+ #MSDOS
+ $path0 = '';
+ $sep2 = ';';
+} elsif (defined ($opts{'c'})) {
+ #Cygwin
+ $path0 = '/cygdrive';
+ $sep2 = ':';
+} elsif (defined ($opts{'m'})) {
+ #MinGW/MSYS
+ $path0 = '';
+ $sep2 = ':';
+} else {
+ Usage();
+}
+
+my $input = $ARGV[0];
+my $sep1;
+
+# Is the input ';' separated, or ':' separated, or a simple string?
+if (($input =~ tr/;/;/) > 0) {
+ # One or more ';' implies Windows style path.
+ $sep1 = ';';
+} elsif (($input =~ tr/:/:/) > 1) {
+ # Two or more ':' implies Cygwin or MinGW/MSYS style path.
+ $sep1 = ':';
+} else {
+ # Otherwise, this is not a path - take up to the end of string in
+ # one piece.
+ $sep1 = '/$/';
+}
+
+# Split the input on $sep1 PATH separator and process the pieces.
+my @pieces;
+for (split($sep1, $input)) {
+ my $try = $_;
+
+ if (($try =~ /^\/cygdrive\/(.)\/(.*)$/) || ($try =~ /^\/(.)\/(.*)$/)) {
+ # Special case #1: This is a Cygwin /cygrive/<drive letter/ path.
+ # Special case #2: This is a MinGW/MSYS /<drive letter/ path.
+ $try = $1.':/'.$2;
+ } elsif ($try =~ /^\/(.*)$/) {
+ # Special case #3: check for a Cygwin or MinGW/MSYS form with a
+ # leading '/' for example '/usr/bin/bash'.
+ # Look up where this is mounted and rebuild the
+ # $try string with that information
+ my $cmd = "df --portability --all --human-readable $try";
+ my $line = qx ($cmd);
+ my $status = $?;
+ if ($status == 0) {
+ my @lines = split ('\n', $line);
+ my ($device, $junk, $mountpoint);
+ # $lines[0] is the df header.
+ # Example string for split - we want the first and last elements:
+ # C:\jprt\products\P1\MinGW\msys\1.0 200G 78G 123G 39% /usr
+ ($device, $junk, $junk, $junk, $junk, $mountpoint) = split (/\s+/, $lines[1]);
+ # Replace $mountpoint with $device/ in the original string
+ $try =~ s|$mountpoint|$device/|;
+ } else {
+ printf ("Error %d from command %s\n%s\n", $status, $cmd, $line);
+ }
+ }
+
+ my $str = Win32::GetShortPathName($try);
+ if (!defined($str)){
+ # Special case #4: If the lookup did not work, loop through
+ # adding extensions listed in PATHEXT, looking for the first
+ # match.
+ for (split(';', $ENV{'PATHEXT'})) {
+ $str = Win32::GetShortPathName($try.$_);
+ if (defined($str)) {
+ last;
+ }
+ }
+ }
+
+ if (defined($str)){
+ if (!defined($opts{'d'})) {
+ # If not MSDOS, change C: to [/cygdrive]/c/
+ if ($str =~ /^(\S):(.*)$/) {
+ my $path1 = $1;
+ my $path2 = $2;
+ $str = $path0 . '/' . $path1 . '/' . $path2;
+ }
+ }
+ push (@pieces, $str);
+ }
+}
+
+# If input was a PATH, join the pieces back together with $sep2 path
+# separator.
+my $result;
+if (scalar(@pieces > 1)) {
+ $result = join ($sep2, @pieces);
+} else {
+ $result = $pieces[0];
+}
+
+if (defined ($result)) {
+
+ # Change all '\' to '/'
+ $result =~ s/\\/\//g;
+
+ # Remove duplicate '/'
+ $result =~ s/\/\//\//g;
+
+ # Map to lower case
+ $result =~ tr/A-Z/a-z/;
+
+ print ("$result\n");
+}
--- a/make/scripts/vsvars.sh Wed Jul 05 18:26:11 2017 +0200
+++ b/make/scripts/vsvars.sh Tue Oct 23 10:10:49 2012 -0700
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, 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
@@ -27,22 +27,6 @@
# variables normally set by the vcvars32.bat or vcvars64.bat file or
# SetEnv.cmd for older SDKs.
-# Use cygpath?
-isCygwin="`uname -s | grep CYGWIN`"
-if [ "${isCygwin}" != "" ] ; then
- cygpath="/usr/bin/cygpath"
- cygpath_short="${cygpath} -m -s"
- cygpath_windows="${cygpath} -w -s"
- cygpath_path="${cygpath} -p"
- pathsep=':'
-else
- cygpath="dosname"
- cygpath_short="${cygpath} -s"
- cygpath_windows="${cygpath} -s"
- cygpath_path="echo"
- pathsep=';'
-fi
-
########################################################################
# Error functions
msg() # message
@@ -60,8 +44,8 @@
}
envpath() # path
{
- if [ "${cygpath_short}" != "" -a -d "$1" ] ; then
- ${cygpath_short} "$1"
+ if [ "${fixpath}" != "" -a -d "$1" ] ; then
+ ${fixpath} "$1"
else
echo "$1"
fi
@@ -72,14 +56,65 @@
# Defaults settings
debug="false"
verbose="false"
-shellStyle="sh"
-parentCsh="` ps -p ${PPID} 2> /dev/null | grep csh `"
-if [ "${parentCsh}" != "" ] ; then
- shellStyle="csh"
-fi
set -e
+CYGWIN="nodosfilewarning ntsec"
+export CYGWIN
+
+# pathsepIn is always ; because the input strings are coming from
+# vcvarsxx.bat. This is true under all of MKS, Cygwin, MINGW/msys
+pathsepIn=';'
+
+OS="`uname -s`"
+case "${OS}" in
+ CYGWIN*)
+ pathflag='-c'
+ devnull=/dev/null
+ pathsepOut=':'
+ ;;
+
+ MINGW*)
+ pathflag='-m'
+ devnull=/dev/null
+ pathsepOut=':'
+ ;;
+
+ *)
+ # MKS?
+ # Continue using dosname -s
+ pathflag='-s'
+ fixpath="dosname ${pathflag}"
+ fixpath_windows="${fixpath}"
+ fixpath_path="echo"
+ devnull=NUL
+ pathsepOut=';'
+ ;;
+esac
+
+case "${OS}" in
+ CYGWIN*|MINGW*)
+ t=`dirname ${0}`
+ wd=`cd ${t} 2> ${devnull} && pwd`
+ fixpath_script="${wd}/fixpath.pl"
+ if [ ! -f "${fixpath_script}" ] ; then
+ error "Does not exist: ${fixpath_script}"
+ fi
+ fixpath="perl ${fixpath_script} ${pathflag}"
+ fixpath_windows="perl ${fixpath_script} -d"
+ fixpath_path="${fixpath_windows}"
+ ;;
+esac
+
+shellStyle="sh"
+## As far as I can tell from hg history, this has not worked
+## for a long time because PPID is unset. When run under Cygwin
+## the script quits due to the 1 return from grep.
+##parentCsh="` ps -p ${PPID} 2> ${devnull} | grep csh `"
+##if [ "${parentCsh}" != "" ] ; then
+## shellStyle="csh"
+##fi
+
# Check environment first
if [ "${PROGRAMFILES}" != "" ] ; then
progfiles=`envpath "${PROGRAMFILES}"`
@@ -96,15 +131,19 @@
# Arch data model
if [ "${PROCESSOR_IDENTIFIER}" != "" ] ; then
arch=`echo "${PROCESSOR_IDENTIFIER}" | cut -d' ' -f1`
-elif [ "${MACHTYPE}" != "" ] ; then
- if [ "`echo ${MACHTYPE} | grep 64`" != "" ] ; then
- # Assume this is X64, not IA64
- arch="x64"
+else
+ if [ "${MACHTYPE}" != "" ] ; then
+ if [ "`echo ${MACHTYPE} | grep 64`" != "" ] ; then
+ # Assume this is X64, not IA64
+ arch="x64"
+ else
+ arch="x86"
+ fi
else
- arch="x86"
+ arch="`uname -m`"
fi
-else
- arch="`uname -m`"
+ PROCESSOR_IDENTIFIER="${arch}"
+ export PROCESSOR_IDENTIFIER
fi
if [ "${arch}" = "X86" -o \
"${arch}" = "386" -o "${arch}" = "i386" -o \
@@ -121,11 +160,11 @@
"${arch}" = "intel64" -o "${arch}" = "Intel64" -o \
"${arch}" = "64" ] ; then
arch="x64"
- binarch64="/amd64"
+ binarch64="\\amd64"
fi
if [ "${arch}" = "IA64" ] ; then
arch="ia64"
- binarch64="/ia64"
+ binarch64="\\ia64"
fi
if [ "${arch}" != "x86" -a "${arch}" != "x64" -a "${arch}" != "ia64" ] ; then
error "No PROCESSOR_IDENTIFIER or MACHTYPE environment variables and uname -m is not helping"
@@ -324,25 +363,26 @@
}
# Remove all duplicate entries
-removeDeadDups() # string sep
+removeDeadDups() # string sepIn sepOut
{
set -e
- sep="$2"
+ sepIn="$2"
+ sepOut="$3"
pathlist="${tmp}/pathlist"
printf "%s\n" "$1" | \
sed -e 's@\\@/@g' | \
sed -e 's@//@/@g' | \
- ${awk} -F"${sep}" '{for(i=1;i<=NF;i++){printf "%s\n",$i;}}' \
+ ${awk} -F"${sepIn}" '{for(i=1;i<=NF;i++){printf "%s\n",$i;}}' \
> ${pathlist}
upaths="${tmp}/upaths"
cat ${pathlist} | while read orig; do
p="${orig}"
- if [ "${cygpath_short}" != "" ] ; then
+ if [ "${fixpath}" != "" ] ; then
if [ "${p}" != "" ] ; then
if [ -d "${p}" ] ; then
- short=`${cygpath_short} "${p}"`
+ short=`${fixpath} "${p}"`
if [ "${short}" != "" -a -d "${short}" ] ; then
- p=`${cygpath} "${short}"`
+ p="${short}"
fi
echo "${p}" >> ${upaths}
fi
@@ -356,11 +396,11 @@
if [ "${newpaths}" = "" ] ; then
newpaths="${i}"
else
- newpaths="${newpaths}${sep}${i}"
+ newpaths="${newpaths}${sepOut}${i}"
fi
done
printf "%s\n" "${newpaths}" | \
- ${awk} -F"${sep}" \
+ ${awk} -F"${sepOut}" \
'{a[$1];printf "%s",$1;for(i=2;i<=NF;i++){if(!($i in a)){a[$i];printf "%s%s",FS,$i;}};printf "\n";}'
}
@@ -388,7 +428,7 @@
set VSINSTALLDIR=
set WindowsSdkDir=
REM Run the vcvars bat file, send all output to stderr
-call `${cygpath_windows} ${bdir}`\\${command} > `${cygpath_windows} "${stdout}"`
+call `${fixpath_windows} ${bdir}`\\${command} > `${fixpath_windows} "${stdout}"`
REM Echo out env var settings
echo VS_VS71COMNTOOLS="%VS71COMNTOOLS%"
echo export VS_VS71COMNTOOLS
@@ -427,9 +467,18 @@
# Create env file
createEnv() # batfile envfile
{
- rm -f ${1}.stdout
- cmd.exe /Q /C `${cygpath_short} $1` | \
- sed -e 's@\\@/@g' | \
+ rm -f ${1}.stdout ${1}.temp1 ${1}.temp2
+ batfile=`${fixpath} ${1}`
+ cmd.exe -Q -C < "$batfile" 1> ${1}.temp1 2> ${1}.temp2
+ cat ${1}.temp1 | \
+ sed -e 's@^Microsoft.*@@' \
+ -e 's@^.*Copyright.*@@' \
+ -e 's@^.*>REM.*@@' \
+ -e 's@^.*>set.*@@' \
+ -e 's@^.*>echo.*@@' \
+ -e 's@^.*>call.*@@' \
+ -e 's@^.*>$@@' \
+ -e 's@\\@/@g' | \
sed -e 's@//@/@g' > $2
if [ -f "${1}.stdout" ] ; then
cat ${1}.stdout 1>&2
@@ -465,7 +514,7 @@
#############################################################################
# Get Visual Studio settings
-if [ "${cygpath}" != "" ] ; then
+if [ "${fixpath}" != "" ] ; then
# Create bat file to run
batfile="${tmp}/vs-to-env.bat"
@@ -485,11 +534,11 @@
. ${envfile}
# Derive unix style path, save old, and define new (remove dups)
- VS_UPATH=`${cygpath_path} "${VS_WPATH}"`
+ VS_UPATH=`${fixpath_path} "${VS_WPATH}"`
export VS_UPATH
VS_OPATH=`printf "%s" "${PATH}" | sed -e 's@\\\\@/@g'`
export VS_OPATH
- VS_PATH=`removeDeadDups "${VS_UPATH}${pathsep}${VS_OPATH}" "${pathsep}"`
+ VS_PATH=`removeDeadDups "${VS_UPATH}${pathsepIn}${VS_OPATH}" "${pathsepIn}" "${pathsepOut}"`
export VS_PATH
fi
@@ -536,11 +585,13 @@
checkPaths "Windows PATH" "${VS_WPATH}" ";"
checkPaths LIB "${VS_LIB}" ";"
checkPaths INCLUDE "${VS_INCLUDE}" ";"
- checkPaths PATH "${VS_PATH}" "${pathsep}"
+ checkPaths PATH "${VS_PATH}" "${pathsepIn}"
fi
# Remove all temp files
-rm -f -r ${tmp}
+if [ "${debug}" != "true" ] ; then
+ rm -f -r ${tmp}
+fi
exit 0