<div>hi Damjan,<br></div><div><br></div><div>Firstly, congrats on your efforts.<br></div><div><br></div><div>Just a side note for reference. You may have already tried it, but just in case.</div><div><br></div><div>We(me and my colleague Vaibhav cced.) had tried building open jdk on Netbeans some time back. </div>
<div><br></div><div>Only getting freetype was a pain, I remember but looks like Kelly has a solution to that now.</div><div><br></div><div><a href="http://blogs.sun.com/vaibhav/entry/openjdk_build_on_netbeans_with">http://blogs.sun.com/vaibhav/entry/openjdk_build_on_netbeans_with</a><br>
</div><div><a href="http://blogs.sun.com/vaibhav/entry/openjdk_build_on_netbeans_with1">http://blogs.sun.com/vaibhav/entry/openjdk_build_on_netbeans_with1</a><br></div><div><a href="http://blogs.sun.com/vaibhav/entry/openjdk_build_on_netbeans_with2">http://blogs.sun.com/vaibhav/entry/openjdk_build_on_netbeans_with2</a></div>
<div><br></div><div>rgds,</div><div>Vikram.</div><div><br></div><div><br></div><div><br></div><div class="gmail_quote">On Fri, Dec 11, 2009 at 4:14 AM, Kelly O'Hair <span dir="ltr"><<a href="mailto:Kelly.Ohair@sun.com">Kelly.Ohair@sun.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
Andrew John Hughes wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2009/12/10 Kelly O'Hair <<a href="mailto:Kelly.Ohair@sun.com" target="_blank">Kelly.Ohair@sun.com</a>>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Damjan Jovanovic wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
I'm documenting my (unbelievably difficult but ultimately) successful<br>
experience of building OpenJDK on Windows with Visual Studio express<br>
edition.<br>
</blockquote>
Thanks for sending this out. You do deserve some kind of medal, building<br>
on Windows is very difficult.<br>
<br>
First off, where and how did you get the sources?<br>
It's not exactly clear what sources we are dealing with here.<br>
<br>
</blockquote>
<br>
Errr... he says in the next paragraph 'the awt tree from about a week<br>
ago' i.e. <a href="http://hg.openjdk.java.net/jdk7/awt" target="_blank">http://hg.openjdk.java.net/jdk7/awt</a><br>
</blockquote>
<br></div>
Ah.. You are right. When I saw "awt tree" I was thinking the awt sources<br>
in some jdk tree.... :^( Clearly it is the awt forest.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
My congratulations too on the successful build. I wouldn't even want<br>
to contemplate this...<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I built the awt tree from about a week ago, with Windows Vista, Cygwin<br>
1.5.25-15, Microsoft Visual Studio 2008 Express Edition SP1, Freetype<br>
2.3.5-1, jdk-7-ea-plug-b77-windows-i586-03_dec_2009.jar, DirectX SDK<br>
as per README-builds.html, Ant copied from Netbeans 6.7, and make from<br>
the <a href="http://cmake.org" target="_blank">cmake.org</a> website (as per README-builds.html). The import JDK was<br>
1.6.0.<br>
</blockquote>
So the devil is in the details, but first off, you have picked a few things<br>
that differ from our recommended set of things:<br>
<br>
* Windows Vista - My condolences, but I don't know of anyone using Vista<br>
to build. I know Windows 2000 is almost 10 years old, and Windows XP is<br>
pretty old, but XP is the newest OS we can recommend. Anything newer is<br>
in the 'on your own' category. But I am glad you were ultimately<br>
successful,<br>
at least we know it is possible.<br>
<br>
* Microsoft Visual Studio 2008 Express Edition SP1 - We recommend the<br>
purchased copy, but we understand why you are using this version and<br>
we would like to see it work, but it's the ATL issue that is the killer.<br>
Whatever adjustments we can make to allow it's use we will do.<br>
<br>
* Freetype (on windows) - A royal pain in my side. More later.<br>
<br>
* The jdk-7-ea-plug-b77-windows-i586-03_dec_2009.jar should not be needed<br>
anymore for a successful build. I would skip it. (Binary plugs are<br>
optional).<br>
<br>
</blockquote>
<br>
Reminds me we need to forwardport the doc. update for this. OpenJDK6<br>
lists them as optional, but 7 doesn't.<br>
</blockquote>
<br></div></div>
I added a note to 6896978 for jdk7 to fix this. You are right.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* DirectX SDK - Which version did you use? Just curious.<br>
<br>
* Ant copied from Netbeans 6.7 - If that worked, fine. But I would really<br>
rather people download and install the official 1.7.1 version of ant.<br>
NetBeans may be sifting out parts of ant in it's install, so using the<br>
ant from NetBeans may not be the same behavior as from an official ant<br>
install. But if you got it to work, that's great.<br>
<br>
</blockquote>
<br>
This is especially true with the recent jaxp/jaxws changes which rely<br>
on the regexp extension. I know that's not in the base package on<br>
most GNU/Linux distros.<br>
</blockquote>
<br></div>
I added a note to 6896978 for jdk7 on this. We should be clear about this.<br>
<br>
You could spend a lifetime keeping these READMEs up-to-date. :^(<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Was the cmake you got 3.81? Just curious.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Firstly the README-builds.html talks a lot about path problems,<br>
without offering any good solutions. After much effort, I discovered<br>
that you have to use /cygpath/c paths only in $PATH and use double<br>
quote quoted C:/ style paths everywhere else (eg. export<br>
WindowsSdkDir="C:/Program Files/Microsoft SDKs/Windows/v6.0A/").<br>
</blockquote>
If this isn't clear I'll try and improve it.<br>
By the way, the Microsoft SDK should probably be v6.1, but I don't<br>
think it will matter much. You did not list installing the Microsoft SDK<br>
above, did you explicitly install v6.0A or did that come with the Visual<br>
Studio compiler install?<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Microsoft's quality C compilers apparently need environment variables<br>
set before they work properly, otherwise they crash (not complain, but<br>
actually crash). The vcvars32.bat doesn't work from inside cygwin, so<br>
I had to run "set > a.txt", then run "vcvars32.bat", then "set ><br>
b.txt", and finally diff a.txt with b.txt to find out what these<br>
mysterious variables were, then convert them into C:/ and /cygpath/c<br>
style paths that get set in cygwin. Running<br>
jdk/make/jdk_generic_profile.sh loses the variables again, so I<br>
avoided it.<br>
</blockquote>
Sigh... I should change jdk/make/jdk_generic_profile.sh, it was never<br>
made cygwin compliant. That file was mainly meant for documentation<br>
purposes, not sure how I feel about people using it as part of their<br>
build process, :^(<br>
<br>
On vcvars32.bat, I have created a shell script called vsvars.sh<br>
(See <a href="http://blogs.sun.com/kto/entry/windows_visual_studio_stupid_pet" target="_blank">http://blogs.sun.com/kto/entry/windows_visual_studio_stupid_pet</a>)<br>
that I plan on adding to the jdk repository at some point.<br>
It will (from a cygwin shell) effectively do the vcvars32.bat for<br>
you and set PATH correctly. All you need to do is run<br>
eval `vsvars.sh -v9`<br>
<br>
I hate vcvars32.bat. And you are right about the crashes and unfriendly<br>
behavior, it's windows. Sorry.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Compilation misdetects the Ant version and complains it is too old,<br>
but works fine.<br>
</blockquote>
"Compilation misdetects"? Can you run 'ant -version' from the command line?<br>
<br>
The ant startup scripts are a bit crufty on Windows, better in ant 1.7.1,<br>
but I have no idea what NetBeans has done with the Windows ant.bat or<br>
ant shell script startup files.<br>
On Windows, you usually need at least three things to get 'ant -version'<br>
to work: 1. ant in PATH, 2. ANT_HOME set, and 3. JAVA_HOME set.<br>
Unfortunately, when building the jdk, we don't allow JAVA_HOME to be<br>
set right now due to the potential build problems it can introduce.<br>
So getting 'ant -version' on windows has been tricky.<br>
With the older ant versions (like 1.6.*, this ant startup was worse).<br>
<br>
When ant is broken up and spread around, like on some Linux systems,<br>
it's hard to set ANT_HOME, and I had that problem with NetBeans, and<br>
on Windows, sometimes you just have to set ANT_HOME because the startup<br>
script can't seem to find where it is living. :^(<br>
So I always just install my own ant, makes life easier.<br>
<br>
</blockquote>
<br>
Indeed, my own GNU/Linux builds set ANT to /usr/bin/ant explicitly and<br>
so does IcedTea.<br>
</blockquote>
<br></div></div>
The problem I've had with Linux builds is that depending on the Linux,<br>
you might have a different version of ant. Some have newer ones than<br>
others. Most work, but I just find it easier to have my own little<br>
ant farm on all platforms. ;^)<br>
<br>
I also work on JavaFX and it has a requirement of ant 1.7.1 because<br>
it uses some NetBeans ant project files for building, and I think<br>
NetBeans 6.7 started requiring ant 1.7.1, which is no sweat for NetBeans<br>
itself because it ships it's own ant, but building outside of NetBeans<br>
means you need ant 1.7.1 in your PATH. Oh well...<br>
<br>
What a world ... what a world... <a href="http://www.youtube.com/watch?v=qfV_ENR5IZE" target="_blank">http://www.youtube.com/watch?v=qfV_ENR5IZE</a><br>
<br>
-kto<div><div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Even "make sanity" rapidly died as freetype_versioncheck didn't build.<br>
<a href="http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000023.html" target="_blank">http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000023.html</a><br>
claims you need OPENJDK=true set, an undocumented fact that doesn't<br>
help. After much effort I discovered<br>
<a href="http://www.mail-archive.com/build-dev@openjdk.java.net/msg02319.html" target="_blank">http://www.mail-archive.com/build-dev@openjdk.java.net/msg02319.html</a><br>
where someone got it to work with Freetype 2.3.5 by copying<br>
bin/freetype.dll into lib/freetype6.dll and applying a patch; I also<br>
had to copy zlib1.dll into the build/windows-i586/btbins. Please at<br>
least document the fact Freetype 2.3.4 is the last working version?<br>
</blockquote>
Sigh... freetype... :^( What a pain on windows.<br>
I'm going to file a bug on this, see if we can't clean up this dependency<br>
at least as far as building or setting up goes.<br>
I have been down this path, and finally published freetype binary bundles<br>
at <a href="http://cr.openjdk.java.net/~ohair/FreeType/" target="_blank">http://cr.openjdk.java.net/~ohair/FreeType/</a><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It then compiled for a few minutes further and died in the corba/<br>
subdirectory, with "COMPILER_PATH cannot be empty here". I found<br>
<a href="http://mail.openjdk.java.net/pipermail/build-dev/2009-March/001767.html" target="_blank">http://mail.openjdk.java.net/pipermail/build-dev/2009-March/001767.html</a><br>
and edited the file in question to fix RC (I had to use the full C:/<br>
style path, the one from that email didn't work for me), unfortunately<br>
it still didn't help, so I just commented out lines 96-98 and it<br>
compiled much further.<br>
</blockquote>
Usually when you get "COMPILER_PATH cannot be empty here", one of<br>
* PATH is not setup correctly (according to vcvars32.bat)<br>
* ALT_COMPILER_PATH (if you set it) is not set correctly<br>
* The system environment variable VS90CMNTOOLS is not defined<br>
or the Makefiles can't find the default location for the compilers.<br>
If you ssh into a windows system, VS90CMNTOOLS will not be set.<br>
If you installed in a non-standard location, that could be the issue.<br>
<br>
So I'm a little confused as how you could continue at this point and<br>
would like to understand that.<br>
<br>
Can you send me the "C:/Program Files/" directory where the<br>
cl.exe compiler file was found in your install?<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The problem repeated itself under the jdk/ directory, and I had to<br>
edit another file and fix the path to RC and RCS.<br>
</blockquote>
Yes, the path to RC/RCS is problematic, I think we have a bug on that.<br>
It appears to be a moving and sometimes replicated exe that moves<br>
with each release. :^(<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Then, still in jdk/, came missing headers. The first was afxres.h<br>
which I got from mingw and copied into Visual Studio's include<br>
directory. This got it to compile further.<br>
</blockquote>
Humm... I thought we replaced a bunch of these afxres.h uses with<br>
just windows.h or winres.h. Ah... jkernel... new stuff.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Next missing header was atlbase.h which lead me to discover an email<br>
<br>
(<a href="http://mail.openjdk.java.net/pipermail/build-dev/2007-December/000654.html" target="_blank">http://mail.openjdk.java.net/pipermail/build-dev/2007-December/000654.html</a>)<br>
stating that the Visual Studio express editions are not supposed to<br>
work (again, undocumented in README-builds.html). Indeed I found that<br>
atlbase.h is part of ATL, which isn't part of any Visual Studio<br>
express edition or the Platform SDK (6 or 7). Visual Studio is<br>
expensive to buy just to compile OpenJDK. But am I really going to let<br>
that stop me, after the previous 8 hour battle?<br>
</blockquote>
Well, we can't document everything that doesn't work, but I understand<br>
your situation. We had been trying to allow for the Express compiler to<br>
work, but we could not guarantee it.<br>
At one point, I thought we were ATL #include free, but I see jkernel changes<br>
were added recently and re-introduced an atl dependency.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
$ grep atl * -iR | grep include<br>
Binary file hotspot/.hg/store/data/src/share/vm/include_d_b__core.i<br>
matches<br>
jdk/make/jdk_generic_profile.sh:<br>
include4sdk="${vc7_root}/atlmfc/include"<br>
jdk/make/jdk_generic_profile.sh:<br>
include4sdk="${include4sdk};${platform_sdk}/Include/atl"<br>
jdk/src/windows/native/sun/jkernel/kernel.cpp:#include <atlbase.h><br>
jdk/src/windows/native/sun/jkernel/kernel.cpp:#include <atlwin.h><br>
jdk/src/windows/native/sun/jkernel/stdafx.h:#include <atlbase.h><br>
jdk/src/windows/native/sun/jkernel/stdafx.h:#include <atlcom.h><br>
jdk/src/windows/native/sun/jkernel/stdafx.h:#include <atlwin.h><br>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlbase.h><br>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlcom.h><br>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlwin.h><br>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlhost.h><br>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlbase.h><br>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlcom.h><br>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlwin.h><br>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlhost.h><br>
jdk/src/windows/native/sun/jkernel/stdafx.cpp:#include <atlimpl.cpp><br>
<br>
</blockquote>
I see this bug has been filed recently on this problem:<br>
<a href="http://bugs.sun.com/view_bug.do?bug_id=6903970" target="_blank">http://bugs.sun.com/view_bug.do?bug_id=6903970</a><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So in other words only jkernel uses the ATL for anything. Pity that it<br>
uses it extensively, so there's no easy way to take ATL out as a<br>
dependency. Someone should rewrite it without ATL: 4000 lines of code<br>
shouldn't hold 7 million lines hostage.<br>
</blockquote>
There may be a way to skip the jkernel build. Perhaps if you<br>
removed the jkernel from SUBDIRS in jdk/make/sun/Makefile?<br>
I have no idea if that would work, just a guess.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But if ATL can't come out of jkernel, maybe jkernel can come out of<br>
Java. I put in lots of #if 0 around the entire contents of all the<br>
jkernel .cpp files, and made preJVMStartup() into a no-op.<br>
</blockquote>
That's another way I suppose.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It compiled further, complaining in at least one place about missing<br>
/usr/bin/diff which isn't documented as a dependency, but luckily that<br>
doesn't stop the build.<br>
</blockquote>
What? Where did it complain about /usr/bin/diff? That's strange.<br>
You have one I assume, but Windows processes may not accept some<br>
cygwin files as being valid. Let me know if you still have<br>
the error message on this, I'd like to get to the bottom of this.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When it got to compiling fonts, it broke again, this time looking for<br>
freetype.dll instead of freetype6.dll. I copied the one to the other<br>
and typed make with crossed fingers. After 20 minutes of compiling it<br>
got to the fonts again and they compiled.<br>
<br>
</blockquote>
Sigh... freetype again... I'm glad you got it to compile, it<br>
should not be this hard. Sorry about that.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
After a very long wait, it finally compiled successfully...<br>
<br>
...and the hello world worked :-).<br>
</blockquote>
Glad it was finally successful.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now I'm onto what I thought would be the hard part: the actual patch I<br>
want to write :-).<br>
<br>
Patches I used to build it are attached.<br>
</blockquote>
I'll try and make sure there are bugs filed on these issues, can't<br>
promise your exact patches can be used.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hope this helps someone.<br>
</blockquote>
I'm sure it will.<br>
<br>
Now you can go get a little devil tatoo that says<br>
"I built OpenJDK on Windows". ;^)<br>
<br>
-kto<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards<br>
Damjan<br>
<br>
</blockquote></blockquote>
<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br>