My windows build story

Kelly O'Hair Kelly.Ohair at Sun.COM
Thu Aug 9 15:27:44 UTC 2007


You have to specifically ask for the cygwin version of awk when installing
cygwin, you may be getting some other awk.

-kto


Igor Nekrestyanov wrote:
> Hi,
> 
> I tried to build openjdk on windows (WinXP) using home PC and following 
> instructions from openjdk.dev.java.net.
> I was able to do it. There were few issues though (because we rarely use 
> cygwin for internal builds).
> 
> Below is brief story of how i did it. It might be incomplete because i 
> am recovering it from the notes.
> I will double check this tonight with full clean build but it will be 
> nice if someone else can try to repeat it.
> 
> 1) Latest cygwin.
>    In addition to list from README-builds.html i also installed 
> zip/unzip packages.
> 
>    I think i have installed cygwin in default mode, i.e. using 
> Unix/binary default text file type.
>    However, this did not help fully (see item 5).
> 
> 2) Downgraded make to 3.80
> 
>    Download from 
> http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2
> 
>  cd /
>  tar xjf /cygdrive/c/where-your-download-is/make-3.80-1.tar.bz2
>  bin/make.exe --version
> 
>  GNU Make 3.80
>  Copyright (C) 2002  Free Software Foundation, Inc.
> 
> 3) Here is my buildenv.bat.
>   Note: avoid use /cygdrive/c paths because it will fool VC compiler
>         (cl will not resolve them properly, e.g. will not find header 
> files)
> 
> =================================================
> 
> rem Minimize hidden environment differences
> set 
> PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\tools\cygwin\bin 
> 
> set LD_LIBRARY_PATH=
> set CLASSPATH=
> set JAVA_HOME=
> 
> set ALT_BOOTDIR=c:/tools/jdk70b13
> set ALT_OUTPUTDIR=c:/tmp/openjdk-build
> set ALT_BINARY_PLUGS_PATH=c:/tools/bplugs/b17/openjdk-binary-plugs
> 
> rem not mentioned in the README-builds.html? (place hotspot VM comes 
> from) rem TODO: try to point to openjdk vm
> set ALT_JDK_IMPORT_PATH=c:/tools/bplugs/jdk1.7.0
> 
> set ALT_DXSDK_PATH=c:/Tools/dxsdk
> 
> set VC=c:/Progra~1/Micros~1.NET
> set ALT_COMPILER_PATH=%VC%/VC7/Bin set 
> ALT_MSDEVTOOLS_PATH=%VC%/Common7/Tools/Bin
> set ALT_MSVCR71_DLL_PATH=%VC%/SDK/v1.1/Bin
> 
> set ALT_FREETYPE_LIB_PATH=c:/tools/freetype/windows/freetype-i586/lib
> set 
> ALT_FREETYPE_HEADERS_PATH=c:/tools/freetype/windows/freetype-i586/include
> 
> rem NB: not documented? will be removed in b18? 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6332635
> rem unicows.dll/unicows.lib are available on the web. rem E.g. 
> http://www.microsoft.com/downloads/details.aspx?FamilyId=73BA7BD7-ED06-4F0D-80A4-2A7EEAEE17E2&displaylang=en 
> 
> set ALT_UNICOWS_LIB_PATH=c:/tools/devtools/MSLU
> set ALT_UNICOWS_DLL_PATH=c:/tools/devtools/MSLU
> 
> rem bug in the makefiles: should be set prior to freetypecheck. rem 
> TODO: file it
> set OPENJDK=true
> 
> call c:\Progra~1\Micros~1.NET\Common7\Tools\vsvars32.bat
> 
> bash
> =============================================
> 
> 4) technically further build is just
>    buildenv.bat
>    cd control/make;
>    make
> 
> 5) Sanity check passes, hotspot build without any problems.
>    j2se build failed in the make/java/java - LocaleDataMetaInfo.java 
> does not compile
> 
>    The reason was that string literals contained bunch of \r characters.
>    These were introduced by cygwin awk. I guess because it uses text 
> mode (at least for output).
> 
>    I am still not fully sure what is proper fix for this and whether 
> this is bug in cygwin
>    (Assuming i chosed Unix/binary during cygwin install process).
> 
>    My workaround was to edit j2se\make\java\java\localegen.sh and replace
>    localelist=`$NAWK -F$1_ '{print $2}' $2 | sort`
> with
>    localelist=`$NAWK -v BINMODE=w -F$1_ '{print $2}' $2 | sort`
> 
> 6) removed LocaleDataMetaInfo.java from gensrc dir and restarted build.
>    Build finished without new problems and at least java -jar 
> Font2DTest.jar works.
> 
> Any volunteers to follow these instructions?
> 
> Important note:
>  I know that cygwin builds on at least two Vista systems were failing in 
> random places because of some
> cygwin bugs (shell fails reporting failure to allocate memory or 
> something else).  Failures are random and build will process on  restart 
> of make after failure.
> I do not know if it is possible to get working build subsequently 
> restarting make.
> I also do not know if these problems were addressed in cygwin or perhaps 
> specific to these particular Vista systems.
> But I suggest to start with WinXP build first.
> 
> -igor
> 
> p.s.
>   if you need freetype binary to try this - i can provide my build of 
> it. Just drop me personal request.
> 



More information about the build-dev mailing list