32bitBuilds - daudo/ojdkbuild GitHub Wiki

Goal

Building 32bit versions of ojdkbuild is simple.

Outline:

Prerequisites

  • development setup on Windows 2012 that allows to run one-off builds using run.bat launcher (see Win2012DevSetup)

  • for 32bit builds, all submodules need to be checked out recursively. If you haven't done so when initially checking out the project, do so now in a terminal emulator in the ojdkbuild root directory:

    git submodule update --init
    

Process - OpenJDK8

  1. In terminal emulator run the following to setup the appropriate development environment builds:

    call "resources/scripts/set-compile-env-vs10-x86.bat"
    
  2. Go to build directory and cleanup possible existing build artifacts:

    cd build    
    creset
    
  3. Configure overall CMake project (that contains OpenJDK and dependencies) specifying the openjdk_32_BIT option:

    cmake ../src/java-1.8.0-openjdk -Dopenjdk_32_BIT=ON -Dopenjdk_ENABLE_OPENJFX=ON -Dopenjdk_BOOTSTRAP_BUILD=ON 
    

    If you don't want to include OpenJFX in your builds, you can omit the openjdk_ENABLE_OPENJFX option.

  4. Run default nmake target to build all the dependencies (FreeType, NSS etc):

    nmake
    
  5. Run zip targets. This will build the project and produce compressed OpenJDK images:

    nmake zip
    nmake zip_jre
    nmake openjfx_zip
    

    If you haven't included the OpenJFX build flag in step 3, you can omit the nmake openjfx_zip line.

  6. Once the last step has been successfully finished, you'll find the build results in the ojdkbuild/dist directory

Process - OpenJDK9

  1. In terminal emulator run the following to setup the appropriate development environment builds:

    for OpenJDK 9:

    call "resources/scripts/set-compile-env-vs12-x86.bat"
    
  2. Go to build directory and cleanup possible existing build artifacts:

    cd build    
    creset
    
  3. Configure overall CMake project (that contains OpenJDK and dependencies) specifying the openjdk_32_BIT option:

    cmake ../src/java-9-openjdk -Dopenjdk_32_BIT=ON -Dopenjdk_ENABLE_OPENJFX=ON -Dopenjdk_BOOTSTRAP_BUILD=ON
    

    If you don't want to include OpenJFX in your builds, you can omit the openjdk_ENABLE_OPENJFX option.

  4. Run default nmake target to build all the dependencies (FreeType, NSS etc):

    nmake
    
  5. Run zip targets. This will build the project and produce compressed OpenJDK images:

    nmake zip
    nmake zip_jre
    nmake openjfx_zip
    

    If you haven't included the OpenJFX build flag in step 3, you can omit the nmake openjfx_zip line.

  6. Once the last step has been successfully finished, you'll find the build results in the ojdkbuild/dist directory

Helper scripts

Optionally, you can also use the following helper scripts in the ojdkbuild root directory to trigger 32bit builds:

  1. OpenJDK 8:

    @echo off
    
    rem shortcuts from script directory
    set BAD_SLASH_SCRIPT_DIR=%~dp0
    set SCRIPT_DIR=%BAD_SLASH_SCRIPT_DIR:\=/%
    set OJDKBUILD_DIR=%SCRIPT_DIR%
    
    call "%OJDKBUILD_DIR%/resources/scripts/modules.bat"
    if errorlevel 1 exit /b 1
    
    call "%OJDKBUILD_DIR%/resources/profiles/jdk8_zip.gitmodules.txt"
    if errorlevel 1 exit /b 1
    
    call "%OJDKBUILD_DIR%/resources/scripts/set-compile-env-vs10-x86.bat"
    @echo off
    if errorlevel 1 exit /b 1
    
    rmdir /s /q build
    if exist build exit /b 1
    mkdir build || exit /b 1
    pushd build || exit /b 1
    
    cmake "%OJDKBUILD_DIR%/src/java-1.8.0-openjdk" -Dopenjdk_ENABLE_OPENJFX=ON -Dopenjdk_32_BIT=ON -G "NMake Makefiles" || exit /b 1
    nmake zip VERBOSE=1 || exit /b 1
    nmake zip_jre VERBOSE=1 || exit /b 1
    nmake openjfx_jre VERBOSE=1 || exit /b 1
    
    popd || exit /b 1
    echo OJDKBUILD32_FINISH_SUCCESS
    
  2. OpenJDK 9

    @echo off
    
    rem shortcuts from script directory
    set BAD_SLASH_SCRIPT_DIR=%~dp0
    set SCRIPT_DIR=%BAD_SLASH_SCRIPT_DIR:\=/%
    set OJDKBUILD_DIR=%SCRIPT_DIR%
    
    call "%OJDKBUILD_DIR%/resources/scripts/modules.bat"
    if errorlevel 1 exit /b 1
    
    call "%OJDKBUILD_DIR%/resources/profiles/jdk9_zip.gitmodules.txt"
    if errorlevel 1 exit /b 1
    
    call "%OJDKBUILD_DIR%/resources/scripts/set-compile-env-vs12-x86.bat"
    @echo off
    if errorlevel 1 exit /b 1
    
    rmdir /s /q build
    if exist build exit /b 1
    mkdir build || exit /b 1
    pushd build || exit /b 1
    
    cmake "%OJDKBUILD_DIR%/src/java-9-openjdk" -Dopenjdk_ENABLE_OPENJFX=ON -Dopenjdk_32_BIT=ON -G "NMake Makefiles" || exit /b 1
    nmake zip VERBOSE=1 || exit /b 1
    nmake zip_jre VERBOSE=1 || exit /b 1
    nmake openjfx_jre VERBOSE=1 || exit /b 1
    
    popd || exit /b 1
    echo OJDKBUILD32_FINISH_SUCCESS