Even "make sanity" rapidly died as freetype_versioncheck didn't build.
http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-March/000023.html
claims you need OPENJDK=true set, an undocumented fact that doesn't
help. After much effort I discovered
http://www.mail-archive.com/build-dev@openjdk.java.net/msg02319.html
where someone got it to work with Freetype 2.3.5 by copying
bin/freetype.dll into lib/freetype6.dll and applying a patch; I also
had to copy zlib1.dll into the build/windows-i586/btbins. Please at
least document the fact Freetype 2.3.4 is the last working version?
Sigh... freetype... :^( What a pain on windows.
I'm going to file a bug on this, see if we can't clean up this dependency
at least as far as building or setting up goes.
I have been down this path, and finally published freetype binary bundles
at http://cr.openjdk.java.net/~ohair/FreeType/
It then compiled for a few minutes further and died in the corba/
subdirectory, with "COMPILER_PATH cannot be empty here". I found
http://mail.openjdk.java.net/pipermail/build-dev/2009-March/001767.html
and edited the file in question to fix RC (I had to use the full C:/
style path, the one from that email didn't work for me), unfortunately
it still didn't help, so I just commented out lines 96-98 and it
compiled much further.
Usually when you get "COMPILER_PATH cannot be empty here", one of
* PATH is not setup correctly (according to vcvars32.bat)
* ALT_COMPILER_PATH (if you set it) is not set correctly
* The system environment variable VS90CMNTOOLS is not defined
or the Makefiles can't find the default location for the compilers.
If you ssh into a windows system, VS90CMNTOOLS will not be set.
If you installed in a non-standard location, that could be the issue.
So I'm a little confused as how you could continue at this point and
would like to understand that.
Can you send me the "C:/Program Files/" directory where the
cl.exe compiler file was found in your install?
The problem repeated itself under the jdk/ directory, and I had to
edit another file and fix the path to RC and RCS.
Yes, the path to RC/RCS is problematic, I think we have a bug on that.
It appears to be a moving and sometimes replicated exe that moves
with each release. :^(
Then, still in jdk/, came missing headers. The first was afxres.h
which I got from mingw and copied into Visual Studio's include
directory. This got it to compile further.
Humm... I thought we replaced a bunch of these afxres.h uses with
just windows.h or winres.h. Ah... jkernel... new stuff.
Next missing header was atlbase.h which lead me to discover an email
(http://mail.openjdk.java.net/pipermail/build-dev/2007-December/000654.html)
stating that the Visual Studio express editions are not supposed to
work (again, undocumented in README-builds.html). Indeed I found that
atlbase.h is part of ATL, which isn't part of any Visual Studio
express edition or the Platform SDK (6 or 7). Visual Studio is
expensive to buy just to compile OpenJDK. But am I really going to let
that stop me, after the previous 8 hour battle?
Well, we can't document everything that doesn't work, but I understand
your situation. We had been trying to allow for the Express compiler to
work, but we could not guarantee it.
At one point, I thought we were ATL #include free, but I see jkernel changes
were added recently and re-introduced an atl dependency.
$ grep atl * -iR | grep include
Binary file hotspot/.hg/store/data/src/share/vm/include_d_b__core.i
matches
jdk/make/jdk_generic_profile.sh:
include4sdk="${vc7_root}/atlmfc/include"
jdk/make/jdk_generic_profile.sh:
include4sdk="${include4sdk};${platform_sdk}/Include/atl"
jdk/src/windows/native/sun/jkernel/kernel.cpp:#include <atlbase.h>
jdk/src/windows/native/sun/jkernel/kernel.cpp:#include <atlwin.h>
jdk/src/windows/native/sun/jkernel/stdafx.h:#include <atlbase.h>
jdk/src/windows/native/sun/jkernel/stdafx.h:#include <atlcom.h>
jdk/src/windows/native/sun/jkernel/stdafx.h:#include <atlwin.h>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlbase.h>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlcom.h>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlwin.h>
jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp:#include <atlhost.h>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlbase.h>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlcom.h>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlwin.h>
jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp:#include <atlhost.h>
jdk/src/windows/native/sun/jkernel/stdafx.cpp:#include <atlimpl.cpp>
I see this bug has been filed recently on this problem:
http://bugs.sun.com/view_bug.do?bug_id=6903970
So in other words only jkernel uses the ATL for anything. Pity that it
uses it extensively, so there's no easy way to take ATL out as a
dependency. Someone should rewrite it without ATL: 4000 lines of code
shouldn't hold 7 million lines hostage.
There may be a way to skip the jkernel build. Perhaps if you
removed the jkernel from SUBDIRS in jdk/make/sun/Makefile?
I have no idea if that would work, just a guess.
But if ATL can't come out of jkernel, maybe jkernel can come out of
Java. I put in lots of #if 0 around the entire contents of all the
jkernel .cpp files, and made preJVMStartup() into a no-op.
That's another way I suppose.
It compiled further, complaining in at least one place about missing
/usr/bin/diff which isn't documented as a dependency, but luckily that
doesn't stop the build.
What? Where did it complain about /usr/bin/diff? That's strange.
You have one I assume, but Windows processes may not accept some
cygwin files as being valid. Let me know if you still have
the error message on this, I'd like to get to the bottom of this.
When it got to compiling fonts, it broke again, this time looking for
freetype.dll instead of freetype6.dll. I copied the one to the other
and typed make with crossed fingers. After 20 minutes of compiling it
got to the fonts again and they compiled.
Sigh... freetype again... I'm glad you got it to compile, it
should not be this hard. Sorry about that.
After a very long wait, it finally compiled successfully...
...and the hello world worked :-).
Glad it was finally successful.
Now I'm onto what I thought would be the hard part: the actual patch I
want to write :-).
Patches I used to build it are attached.
I'll try and make sure there are bugs filed on these issues, can't
promise your exact patches can be used.
Hope this helps someone.
I'm sure it will.
Now you can go get a little devil tatoo that says
"I built OpenJDK on Windows". ;^)
-kto
Regards
Damjan