Building OpenJDK on Ubuntu

Ubuntu 7.10 の上で openjdk をビルドする手順を確認。

コンパイラgcc を入れた程度(後に g++ がないというエラーになった)

mercurial は apt でインストールしておき、forest extension を以前書いた手順でセットアップしておく。

$ hg fclone http://hg.openjdk.java.net./jdk7/jdk7 myjdk7

Binary Plug をダウンロードして実行する。

http://download.java.net/openjdk/jdk7/


$ file jdk-7-ea-plug-b25-linux-i586-09_apr_2008.jar
Linux self-extracting Jar file
jdk-7-ea-plug-b25-linux-i586-09_apr_2008.jar, 0.28 MB (MD5 Checksum)

$ java -jar jdk-7-ea-plug-b25-linux-i586-09_apr_2008.jar

ライセンスを読み、Agree. 解凍先を聞かれるので、パスを入力する。
ここでは $HOME/local/jbplugs にした。

2つの環境変数をセットしておく。ALT_BOOTDIR は jdk6 のディレクトリを指定し、ALT_BINARY_PLUGS_PATH には先ほど binary plugs を展開したディレクトリを指定する。
実はこれは間違いで、その下にできている openjdk-binary-plugs まで含めないといけない。


$ export ALT_BOOTDIR=$JAVA_HOME
$ export ALT_BINARY_PLUGS_PATH=$HOME/local/jbplugs #間違い
$ export ALT_BINARY_PLUGS_PATH=$HOME/local/jbplugs/openjdk-binary-plugs

make に挑戦


$ cd myjdk7/
$ time make
/bin/sh: /usr/bin/gawk: not found
linux i586 1.7.0-internal build started: 08-04-20 10:17
/bin/mkdir -p ./build/linux-i586
/bin/mkdir -p ./build/linux-i586/j2sdk-image
/bin/sh: /usr/bin/gawk: not found
/bin/sh: /usr/bin/gawk: not found
/bin/sh: ant: not found
/bin/sh: findbugs: not found
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' に入ります
/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/common/shared/Sanity-Settings.gmk:121: WARNING: ANT_VER should not be empty [Sanity-Settings.gmk]
/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/common/shared/Sanity-Settings.gmk:122: WARNING: FINDBUGS_VER should not be empty [Sanity-Settings.gmk]
/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/common/shared/Sanity-Settings.gmk:191: WARNING: TEMP_FREE_SPACE should not be empty [Sanity-Settings.gmk]
/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/common/shared/Sanity-Settings.gmk:192: WARNING: FREE_SPACE should not be empty [Sanity-Settings.gmk]
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:1:28: error: alsa/asoundlib.h: No such file or directory
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c: In function ‘main’:
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: 警告: incompatible implicit declaration of built-in function ‘printf’
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: ‘SND_LIB_VERSION_STR’ undeclared (first use in this function)
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: (Each undeclared identifier is reported only once
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: for each function it appears in.)
make[1]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck] エラー 1
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' から出ます
make: *** [jdk-sanity] エラー 2

gawk, ant をインストール


$ time make
linux i586 1.7.0-internal build started: 08-04-20 11:02
/bin/mkdir -p ./build/linux-i586
/bin/mkdir -p ./build/linux-i586/j2sdk-image
/bin/sh: findbugs: not found
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' に入ります
/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/common/shared/Sanity-Settings.gmk:122: WARNING: FINDBUGS_VER should not be empty [Sanity-Settings.gmk]
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:1:28: error: alsa/asoundlib.h: No such file or directory
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c: In function ‘main’:
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: 警告: incompatible implicit declaration of built-in function ‘printf’
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: ‘SND_LIB_VERSION_STR’ undeclared (first use in this function)
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: (Each undeclared identifier is reported only once
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: for each function it appears in.)
make[1]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck] エラー 1
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' から出ます
make: *** [jdk-sanity] エラー 2

findbugs はSynaptic package manager では見付からない。

http://findbugs.sourceforge.net/

manual に findbugs のインストール方法が書かれている。tgz あるいは zip ファイルをダウンロード、展開して FINDBUGS_HOME を指定すれば良さそう。


$ cd $HOME/local
$ jar tf ~/findbugs-1.3.3.zip
$ export FINDBUGS_HOME=$HOME/local/findbugs-1.3.3


$ time make
linux i586 1.7.0-internal build started: 08-04-20 11:14
/bin/mkdir -p ./build/linux-i586
/bin/mkdir -p ./build/linux-i586/j2sdk-image
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' に入ります
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:1:28: error: alsa/asoundlib.h: No such file or directory
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c: In function ‘main’:
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: 警告: incompatible implicit declaration of built-in function ‘printf’
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: ‘SND_LIB_VERSION_STR’ undeclared (first use in this function)
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: (Each undeclared identifier is reported only once
/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck.c:3: error: for each function it appears in.)
make[1]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/alsaversioncheck] エラー 1
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' から出ます
make: *** [jdk-sanity] エラー 2

alsa/asoundlib.h というヘッダがないらしい。Google を探すと linuxサウンドのプロジェクトだと出てくる。

http://www.alsa-project.org/main/index.php/Main_Page
Advanced Linux Sound Architecture (ALSA) project homepage

libasound2 というパッケージは入っているが、libasound-dev など関連パッケージは入っていない。
libasound2-dev をとりあえず入れてみる。


$ time make
linux i586 1.7.0-internal build started: 08-04-20 11:18
/bin/mkdir -p ./build/linux-i586
/bin/mkdir -p ./build/linux-i586/j2sdk-image
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' に入ります
make[2]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/tools/freetypecheck' に入ります
freetypecheck.c:32:22: error: ft2build.h: No such file or directory
freetypecheck.c:33:10: error: #include は "ファイル名" あるいは <ファイル名> を必要とします
freetypecheck.c: In function ‘main’:
freetypecheck.c:40: error: ‘FT_Int’ undeclared (first use in this function)
freetypecheck.c:40: error: (Each undeclared identifier is reported only once
freetypecheck.c:40: error: for each function it appears in.)
freetypecheck.c:40: error: expected ‘;’ before ‘major’
freetypecheck.c:41: error: ‘FT_Library’ undeclared (first use in this function)
freetypecheck.c:41: error: expected ‘;’ before ‘library’
freetypecheck.c:42: error: ‘FREETYPE_MAJOR’ undeclared (first use in this function)
freetypecheck.c:42: error: ‘FREETYPE_MINOR’ undeclared (first use in this function)
freetypecheck.c:42: error: ‘FREETYPE_PATCH’ undeclared (first use in this function)
freetypecheck.c:52: 警告: implicit declaration of function ‘FT_Init_FreeType
freetypecheck.c:52: error: ‘library’ undeclared (first use in this function)
freetypecheck.c:53: 警告: implicit declaration of function ‘FT_Library_Version’
freetypecheck.c:53: error: ‘major’ undeclared (first use in this function)
freetypecheck.c:53: error: ‘minor’ undeclared (first use in this function)
freetypecheck.c:53: error: ‘patch’ undeclared (first use in this function)
make[2]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/freetype_versioncheck] エラー 1
make[2]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/tools/freetypecheck' から出ます
make[1]: [sane-freetype] エラー 2 (無視されました)
/bin/sh: /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/freetype_versioncheck: not found
make[1]: *** ターゲット `4月_2008_11_18-b00' を make するルールがありません. 中止.
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' から出ます
make: *** [jdk-sanity] エラー 2

こんどは FreeType

libfreetype6-dev を追加してみる。


$ time make
linux i586 1.7.0-internal build started: 08-04-20 11:21
/bin/mkdir -p ./build/linux-i586
/bin/mkdir -p ./build/linux-i586/j2sdk-image
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' に入ります
make[2]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/tools/freetypecheck' に入ります
make[2]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/tools/freetypecheck' から出ます
make[1]: *** ターゲット `4月_2008_11_21-b00' を make するルールがありません. 中止.
make[1]: ディレクトリ `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make' から出ます
make: *** [jdk-sanity] エラー 2

なんと?言語をCにしてみるか。


$ export LANG=C
$ time make
linux i586 1.7.0-internal build started: 08-04-20 11:22
/bin/mkdir -p ./build/linux-i586
/bin/mkdir -p ./build/linux-i586/j2sdk-image
make[1]: Entering directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make'
make[2]: Entering directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/tools/freetypecheck'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/tools/freetypecheck'
make[1]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make'

Build Machine Information:
build machine = u710yoshi-laptop

Build Directory Structure:
CWD = /home/yoshi/local/openjdk/buildtest/myjdk7
TOPDIR = .
CONTROL_TOPDIR = .
LANGTOOLS_TOPDIR = ./langtools
JAXP_TOPDIR = ./jaxp
JAXWS_TOPDIR = ./jaxws
CORBA_TOPDIR = ./corba
HOTSPOT_TOPDIR = ./hotspot
JDK_TOPDIR = ./jdk

Build Directives:
BUILD_LANGTOOLS = true
BUILD_JAXP = true
BUILD_JAXWS = true
BUILD_CORBA = true
BUILD_HOTSPOT = true
BUILD_JDK = true

Hotspot Settings:
HOTSPOT_BUILD_JOBS =
HOTSPOT_OUTPUTDIR = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/outputdir
HOTSPOT_EXPORT_PATH = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/import



Bootstrap Settings:
BOOTDIR = /home/yoshi/local/jdk1.6.0_10
ALT_BOOTDIR = /home/yoshi/local/jdk1.6.0_10
BOOT_VER = 1.6 [requires at least 1.5]
OUTPUTDIR = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586
ALT_OUTPUTDIR = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586
ABS_OUTPUTDIR = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586

Build Tool Settings:
SLASH_JAVA = /NOT-SET
ALT_SLASH_JAVA =
VARIANT = OPT
JDK_DEVTOOLS_DIR = /NOT-SET/devtools
ALT_JDK_DEVTOOLS_DIR =
ANT_HOME = /usr/share/ant
FINDBUGS_HOME = /home/yoshi/local/findbugs-1.3.3
UNIXCOMMAND_PATH = /bin/
ALT_UNIXCOMMAND_PATH =
COMPILER_PATH = /usr/bin/
ALT_COMPILER_PATH =
DEVTOOLS_PATH = /usr/bin/
ALT_DEVTOOLS_PATH =
UNIXCCS_PATH = /usr/ccs/bin/
ALT_UNIXCCS_PATH =
USRBIN_PATH = /usr/bin/
ALT_USRBIN_PATH =
COMPILER_NAME = GCC
COMPILER_VERSION =
CC_VER = 4.1 [requires at least 3.2]
ZIP_VER = 2.32 [requires at least 2.2]
UNZIP_VER = 5.52 [requires at least 5.12]
ANT_VER = 1.7 [requires at least 1.6.3]
FINDBUGS_VER = 1.3 [requires at least 1.2]
TEMPDIR = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp

Build Directives:
OPENJDK = true
USE_HOTSPOT_INTERPRETER_MODE =
PEDANTIC =
DEV_ONLY =
NO_DOCS =
NO_IMAGES =
TOOLS_ONLY =
INSANE =
COMPILE_APPROACH = parallel
PARALLEL_COMPILE_JOBS = 2
ALT_PARALLEL_COMPILE_JOBS =
FASTDEBUG =
COMPILER_WARNINGS_FATAL = false
COMPILER_WARNING_LEVEL =
INCREMENTAL_BUILD = false
CC_HIGHEST_OPT = -O3
CC_HIGHER_OPT = -O3
CC_LOWER_OPT = -O2
CXXFLAGS = -O2 -fPIC -DCC_NOEX -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN
CFLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN
BOOT_JAVA_CMD = /home/yoshi/local/jdk1.6.0_10/bin/java -client -Xmx375m -Xms128m -XX:PermSize=32m -XX:MaxPermSize=160m
BOOT_JAVAC_CMD = /home/yoshi/local/jdk1.6.0_10/bin/javac -J-XX:ThreadStackSize=768 -J-client -J-Xmx375m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii
BOOT_JAR_CMD = /home/yoshi/local/jdk1.6.0_10/bin/jar
BOOT_JARSIGNER_CMD = /home/yoshi/local/jdk1.6.0_10/bin/jarsigner
JAVAC_CMD = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/linux-i586/bin/javac -J-XX:ThreadStackSize=768 -J-client -J-Xmx375m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -source 1.5 -target 5 -encoding ascii -Xbootclasspath:/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/classes
JAVAH_CMD = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/linux-i586/bin/javah -bootclasspath /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/classes
JAVADOC_CMD = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/linux-i586/bin/javadoc -J-client -J-Xmx375m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m

Build Platform Settings:
USER = yoshi
PLATFORM = linux
ARCH = i586
LIBARCH = i386
ARCH_FAMILY = i586
ARCH_DATA_MODEL = 32
ARCHPROP = i386
LINUX_VERSION = Unknown linux
ALSA_VERSION = 1.0.14a
OS_VERSION = 2.6.22-14-generic [requires at least 2.4.9-e.3]
OS_NAME = linux
TEMP_FREE_SPACE = 2835476
FREE_SPACE = 2835476
MB_OF_MEMORY = 503

GNU Make Settings:
MAKE = make
MAKE_VER = 3.81 [requires at least 3.78]
MAKECMDGOALS = sanity
MAKEFLAGS = w
SHELL = /bin/sh

Target Build Versions:
JDK_VERSION = 1.7.0
MILESTONE = internal
RELEASE = 1.7.0-internal
FULL_VERSION = 1.7.0-internal-yoshi_20_apr_2008_11_22-b00
BUILD_NUMBER = b00

External File/Binary Locations:
USRJDKINSTANCES_PATH = /opt/java
BUILD_JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries
ALT_BUILD_JDK_IMPORT_PATH =
JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/linux-i586
ALT_JDK_IMPORT_PATH =
LANGTOOLS_DIST =
ALT_LANGTOOLS_DIST = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/langtools/dist
CORBA_DIST =
ALT_CORBA_DIST = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/corba/dist
JAXP_DIST =
ALT_JAXP_DIST = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/jaxp/dist
JAXWS_DIST =
ALT_JAXWS_DIST = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/jaxws/dist
HOTSPOT_DOCS_IMPORT_PATH = /NO_DOCS_DIR
ALT_HOTSPOT_DOCS_IMPORT_PATH =
HOTSPOT_IMPORT_PATH = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/import
ALT_HOTSPOT_IMPORT_PATH = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/import
HOTSPOT_CLIENT_PATH = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/import/jre/lib/i386/client
ALT_HOTSPOT_CLIENT_PATH =
HOTSPOT_SERVER_PATH = /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/import/jre/lib/i386/server
ALT_HOTSPOT_SERVER_PATH =
CACERTS_FILE = ./../src/share/lib/security/cacerts
ALT_CACERTS_FILE =
CUPS_HEADERS_PATH = /usr/include
ALT_CUPS_HEADERS_PATH =

OpenJDK-specific settings:
FREETYPE_HEADERS_PATH = /usr/include
ALT_FREETYPE_HEADERS_PATH =
FREETYPE_LIB_PATH = /usr/lib
ALT_FREETYPE_LIB_PATH =

OPENJDK Import Binary Plug Settings:
BINARY_PLUGS_JARFILE = /home/yoshi/local/jbplugs/jre/lib/rt-closed.jar
ALT_BINARY_PLUGS_JARFILE =
BINARY_PLUGS_PATH = /home/yoshi/local/jbplugs
ALT_BINARY_PLUGS_PATH = /home/yoshi/local/jbplugs
BUILD_BINARY_PLUGS_PATH = /NOT-SET/re/jdk/1.7.0/promoted/latest/openjdk/binaryplugs
ALT_BUILD_BINARY_PLUGS_PATH =
PLUG_LIBRARY_NAMES =

Previous JDK Settings:
PREVIOUS_RELEASE_PATH = /NOT-SET/re/jdk/1.6.0/archive/fcs/bundles/linux-i586
ALT_PREVIOUS_RELEASE_PATH =
PREVIOUS_JDK_VERSION = 1.6.0
ALT_PREVIOUS_JDK_VERSION =
PREVIOUS_JDK_FILE = jdk--linux-i586.tar.gz
ALT_PREVIOUS_JDK_FILE =
PREVIOUS_JRE_FILE = jre--linux-i586.tar.gz
ALT_PREVIOUS_JRE_FILE =
PREVIOUS_RELEASE_IMAGE =
ALT_PREVIOUS_RELEASE_IMAGE =


WARNING: This machine appears to only have 503Mb of physical memory,
builds on this machine could be slow.

ERROR: Your JAVA_HOME environment variable is set. This will
most likely cause the build to fail. Please unset it
and start your build again.

ERROR: You do not have access to valid Cups header files.
Please check your access to
/usr/include/cups/cups.h
and/or check your value of ALT_CUPS_HEADERS_PATH,
CUPS is frequently pre-installed on many systems,
or may be downloaded from http://www.cups.org

Exiting because of the above error(s).

make: *** [post-sanity] Error 1

JAVA_HOME は外しておく必要があるようだ。


$ unset JAVA_HOME

cups 関連のエラーがでていた。これは common unix printing service と言うものらしくlibcupsimage2-dev を Synaptic パッケージ・マネージャでいれておく。


...
/myjdk7/hotspot/src/share/vm/adlc/adlparse.cpp
make[5]: g++: Command not found
make[5]: *** [../generated/adfiles/adlparse.o] Error 127
make[5]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/outputdir/linux_i486_compiler2/product'
make[4]: *** [ad_stuff] Error 2
make[4]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/outputdir/linux_i486_compiler2/product'
make[3]: *** [product] Error 2
make[3]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/hotspot/outputdir'
make[2]: *** [generic_build2] Error 2
make[2]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/hotspot/make'
make[1]: *** [product] Error 2
make[1]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/hotspot/make'
make: *** [hotspot-build] Error 2

g++ が入っていなかった。Synaptic で入れてみる。
Synatic は CD-ROM メディアを要求してくる。
ubuntu 710 のインストール CD を入れる。


<<>>Recursively making redist all @ Sun Apr 20 11:54:35 JST 2008 ...
make[3]: Entering directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/java/redist'
BinaryPlugs import started: Sun Apr 20 11:54:35 JST 2008
BINARY_PLUGS_PATH=/home/yoshi/local/jbplugs
make[3]: *** No rule to make target `/home/yoshi/local/jbplugs/jre/lib/i386/libjsoundhs.so', needed by `/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/lib/i386/libjsoundhs.so'. Stop.
make[3]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/java/redist'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/java'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make'
make: *** [jdk-build] Error 2

ALT_BINARY_PLUGS_PATH を修正。openjdk-binary-plugs も含めるようにする。
ALT_BINARY_PLUGS_PATH=$HOME/local/jbplugs/openjdk-binary-plugs

違うエラーになった。


/usr/bin/gcc -O3 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH -Di586 -DARCH='"i586"' -DLINUX -DRELEASE='"1.7.0-internal"' -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -I. -I/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/awt/CClassHeaders -I../../../src/solaris/javavm/export -I../../../src/share/javavm/export -I../../../src/share/javavm/include -I../../../src/solaris/javavm/include -I../../../src/share/native/common -I../../../src/solaris/native/common -I../../../src/share/native/sun/awt -I../../../src/solaris/native/sun/awt -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions -I../../../src/solaris/native/sun/awt/font -I../../../src/share/native/sun/awt/debug -I../../../src/share/native/sun/awt/../font -I../../../src/solaris/native/sun/awt/../font -I../../../src/share/native/sun/awt/image -I../../../src/share/native/sun/awt/image/cvutils -I../../../src/share/native/sun/awt/shell -I../../../src/share/native/sun/awt/medialib -I../../../src/solaris/native/sun/awt/medialib -I../../../src/share/native/sun/awt/../java2d -I../../../src/solaris/native/sun/awt/../java2d -I../../../src/share/native/sun/awt/../java2d/loops -I../../../src/share/native/sun/awt/../java2d/pipe -I../../../src/share/native/sun/awt/../java2d/opengl -I../../../src/solaris/native/sun/awt/../java2d/opengl -I../../../src/solaris/native/sun/awt/../java2d/x11 -I../../../src/share/native/sun/awt/../dc/doe -I../../../src/share/native/sun/awt/../dc/path -I../../../src/solaris/native/sun/awt/../jdga -I../../../src/solaris/native/sun/awt -c -o /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/awt/obj/BufImgSurfaceData.o ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c
In file included from ../../../src/share/native/sun/awt/../java2d/pipe/Region.h:34,
from ../../../src/share/native/sun/awt/../java2d/pipe/Region.c:30:
../../../src/solaris/native/sun/awt/utility/rect.h:31:22: error: X11/Xlib.h: No such file or directory
In file included from ../../../src/share/native/sun/awt/../java2d/pipe/Region.h:34,
from ../../../src/share/native/sun/awt/../java2d/pipe/Region.c:30:
../../../src/solaris/native/sun/awt/utility/rect.h:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'RECT_T'
In file included from ../../../src/share/native/sun/awt/../java2d/pipe/Region.c:30:
../../../src/share/native/sun/awt/../java2d/pipe/Region.h:211: error: expected declaration specifiers or '...' before 'RECT_T'
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:243: error: expected declaration specifiers or '...' before 'RECT_T'
../../../src/share/native/sun/awt/../java2d/pipe/Region.c: In function 'RegionToYXBandedRectangles':
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:254: error: 'pRect' undeclared (first use in this function)
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:254: error: (Each undeclared identifier is reported only once
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:254: error: for each function it appears in.)
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:263: warning: comparison between signed and unsigned
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:264: error: 'RECT_T' undeclared (first use in this function)
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:264: error: expected expression before ')' token
make[4]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/awt/obj/Region.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from ../../../src/solaris/native/sun/awt/color.h:28,
from ../../../src/solaris/native/sun/awt/img_util_md.h:26,
from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/awt.h:38:27: error: X11/Intrinsic.h: No such file or directory
In file included from ../../../src/solaris/native/sun/awt/color.h:28,
from ../../../src/solaris/native/sun/awt/img_util_md.h:26,
from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/awt.h:162: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
../../../src/solaris/native/sun/awt/awt.h:163: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_appContext'
../../../src/solaris/native/sun/awt/awt.h:164: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_root_shell'
../../../src/solaris/native/sun/awt/awt.h:165: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_defaultBg'
../../../src/solaris/native/sun/awt/awt.h:166: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_defaultFg'
../../../src/solaris/native/sun/awt/awt.h:173: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_scrollCursor'
../../../src/solaris/native/sun/awt/awt.h:174: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_ModLockIsShiftLock'
In file included from ../../../src/solaris/native/sun/awt/img_util_md.h:26,
from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/color.h:34: error: expected specifier-qualifier-list before 'XPixmapFormatValues'
In file included from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/img_util_md.h:32: error: expected specifier-qualifier-list before 'XID'
../../../src/share/native/sun/awt/image/BufImgSurfaceData.c: In function 'Java_sun_awt_image_BufImgSurfaceData_freeNativeICMData':
../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:95: warning: cast to pointer from integer of different size
make[4]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/awt/obj/BufImgSurfaceData.o] Error 1
make[4]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun/awt'
make[3]: *** [library_parallel_compile] Error 2
make[3]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun/awt'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make'
make: *** [jdk-build] Error 2

http://today.java.net/pub/a/today/2007/11/29/building-the-jdk.html
に似たような症状がある。libxt-dev をインストール。


...
Begin parallel compiles: /home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun/splashscreen
make[4]: Entering directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun/splashscreen'
/usr/bin/gcc -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN -DSPLASHSCREEN -DWITH_X11 -Di586 -DARCH='"i586"' -DLINUX -DRELEASE='"1.7.0-internal"' -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -I. -I/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/splashscreen/CClassHeaders -I../../../src/solaris/javavm/export -I../../../src/share/javavm/export -I../../../src/share/javavm/include -I../../../src/solaris/javavm/include -I../../../src/share/native/common -I../../../src/solaris/native/common -I../../../src/share/native/sun/awt -I../../../src/solaris/native/sun/awt -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions -I../../../src/solaris/native/sun/awt/splashscreen -I../../../src/share/native/sun/awt/splashscreen -I../../../src/share/native/sun/awt/image/jpeg -I../../../src/share/native/java/util/zip/zlib-1.1.3 -c -o /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/splashscreen/obj/java_awt_SplashScreen.o ../../../src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c
/usr/bin/gcc -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN -DSPLASHSCREEN -DWITH_X11 -Di586 -DARCH='"i586"' -DLINUX -DRELEASE='"1.7.0-internal"' -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -I. -I/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/splashscreen/CClassHeaders -I../../../src/solaris/javavm/export -I../../../src/share/javavm/export -I../../../src/share/javavm/include -I../../../src/solaris/javavm/include -I../../../src/share/native/common -I../../../src/solaris/native/common -I../../../src/share/native/sun/awt -I../../../src/solaris/native/sun/awt -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions -I../../../src/solaris/native/sun/awt/splashscreen -I../../../src/share/native/sun/awt/splashscreen -I../../../src/share/native/sun/awt/image/jpeg -I../../../src/share/native/java/util/zip/zlib-1.1.3 -c -o /home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/splashscreen/obj/splashscreen_gfx_impl.o ../../../src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c
In file included from ../../../src/share/native/sun/awt/splashscreen/splashscreen_impl.h:29,
from ../../../src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c:26:
../../../src/solaris/native/sun/awt/splashscreen/splashscreen_config.h:33:34: error: X11/extensions/shape.h: No such file or directory
In file included from ../../../src/share/native/sun/awt/splashscreen/splashscreen_gfx.h:32,
from ../../../src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h:29,
from ../../../src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c:26:
../../../src/solaris/native/sun/awt/splashscreen/splashscreen_config.h:33:34: error: X11/extensions/shape.h: No such file or directory
make[4]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/splashscreen/obj/java_awt_SplashScreen.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [/home/yoshi/local/openjdk/buildtest/myjdk7/build/linux-i586/tmp/sun/sun.awt/splashscreen/obj/splashscreen_gfx_impl.o] Error 1
make[4]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun/splashscreen'
make[3]: *** [library_parallel_compile] Error 2
make[3]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun/splashscreen'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make/sun'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/yoshi/local/openjdk/buildtest/myjdk7/jdk/make'
make: *** [jdk-build] Error 2

libxtst-dev をインストール
libxi-dev もインストール

この後、make が成功。

build//j2sdk-image の下に JDK のイメージができている。


$ build/linux-i586/j2sdk-image/jre/bin/java -version
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-yoshi_20_apr_2008_12_04-b00)

$ build/linux-i586/j2sdk-image/bin/java -server -version
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-yoshi_20_apr_2008_12_04-b00)
OpenJDK Server VM (build 12.0-b01, mixed mode)

Windows の build は Visual Studio が必要とある、Express Edition は free なのだが、やはり製品版でないとできないのか?