fedora12でjdk1.6.0_18のコンパイルをおこなった。
jdk1.6.0_18のビルドをする。仕事である。
jar -jar jdk-6u18-fcs-src-b07-jrl-17_dec_2009.jar
jar -jar jdk-6u18-fcs-bin-b07-jrl-17_dec_2009.jar
jar -jar jdk-6u18-fcs-mozilla_headers-b07-unix-17_dec_2009.jar
で必要なものを展開しておく。(簡単なインストーラになっている)
その他にgcc 2.95.3のソースtar、
openmotif 2.1とそのdevelop用tarをダウンロードした。
(1)gcc2.9のインストール
mozilla用plugin作成(しなくても必要というバグ)のために必要だとあった。
まず、gcc 2.95.3をコンパイルする。これはそれほど苦労しない。gcc 2.95.1はかなりダメで
エラーがたくさんでた。
./configure –enable-languages=c,c++ –prefix=${HOME}/gcc2 –host=i686-pc-linux-gnu –target=i686-pc-linux-gnu
でconfigureする。
このgcc2というディレクトリはあらかじめ作成しておいた。
その後、makeでエラーがでたが、無視。make installで${HOME}/gcc2にインストール。
(2)awtのためにmotifをインストール(システムディレクトリでない場所に)
motif(openmotif-2.1.30-linux-i386.tgz)のtarを展開する。相対でusr/X11R6/などというディレクトリが作成され、以下のようになった。
.
├── X11R6
│ ├── bin
│ ├── include
│ │ ├── Mrm
│ │ ├── Xm
│ │ ├── bitmaps
│ │ └── uil
│ ├── lib
│ │ └── X11
│ │ ├── app-defaults
│ │ └── uid
│ │ ├── C
│ │ │ └── uid
│ │ ├── english
│ │ │ └── uid
│ │ ├── french
│ │ │ └── uid
│ │ ├── hebrew
│ │ │ └── uid
│ │ ├── japanese
│ │ │ └── uid
│ │ └── swedish
│ │ └── uid
cd ${HOME]/src/
tar xvf openmotif-2.1.30-linux-i386.tgz
mkdir motif
mv usr motif
mkdir include
mkdir lib
ln -s ${HOME}/src/motif/usr/X11R6/include/Xm ${HOME}/src/motif/include/Xm
ln -s ${HOME}/src/motif/usr/X11R6/lib/libXm.a ${HOME}/src/motif/lib/libXm.a
(3) CUPSのインストール
java printのため、以下のCommon Unix Printing System(CUPS)をインストールする。
yum install cups-devel.i686
(4) 環境変数の設定
以下の環境変数を設定すること
export ALT_BOOTDIR=/usr/java/latest
export ALT_JDK_IMPORT_PATH=/usr/java/jdk1.6.0_18
export ALT_MOZILLA_HEADERS_PATH=${HOME}/jdk1.6.0-18src/mozilla/share/plugin
export ALT_MOTIF_DIR=${HOME}/src/motif
export ALT_DEVTOOLS_PATH=/usr/bin
export ALT_GCC29_COMPILER_PATH=${HOME}/gcc2
(5) ALSAをインストール
これは、音の関係のライブラリの作成に使う。ALSAは入っていたのでOK。
(6) 環境チェック
cd control/make
make dev-sanity ARCH_DATA_MODEL=32 ALT_OUTPUTDIR=out MILESTONE=jdkicba \
BUILD_NUMBER=b10
としてみる。OKになるが警告がすこし。無視する。
WARNING: You are not building MOTIF workspace from
the control build. MOTIF libs will be obtained from
the usual location or from the ALT_MOTIF_DIR,
location, if it is defined.
WARNING: Your are not building INSTALL workspace from
the control build. This will result in a development-only
build of the J2SE workspace, lacking the installation bundles
WARNING: Your build environment has the variable DEV_ONLY
defined. This will result in a development-only
build of the J2SE workspace, lacking the documentation
build and installation bundles.
WARNING: The official linux builds use OS version 2.4.9-e.3.
You appear to be using OS version 2.6.31.12-174.2.22.fc12.i686.PAE.
WARNING: The build is being done on Linux (Constantine) .
The official linux builds use Linux Advanced Server,
specifically Linux Advanced Server release 2.1AS.
The version found was '2.6.31.12-174.2.22.fc12.i686.PAE'.
WARNING: LANG has been set to ja_JP.UTF-8, this can cause build failures.
Try setting LANG to "C".
WARNING: The linux compiler must be version 3.2
Specifically the GCC compiler.
You appear to be using compiler version: 4.4
The compiler was obtained from the following location:
/usr/bin/
Please change your compiler.
(7) make
make dev ARCH_DATA_MODEL=32 ALT_OUTPUTDIR=out \
MILESTONE=jdktest BUILD_NUMBER=b10
でコンパイルする。かなり重たい。
../../../../src/solaris/hpi/native_threads/src/interrupt_md.c:114: error: stati\
c declaration of ‘sigignore’ follows non-static declaration
/usr/include/signal.h:385: note: previous declaration of ‘sigignore’ was here
などとなる。
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6463269
をみると、static を消せとある。以下このようなヘッダーファイルにはstatic がないが、
cまたはc++のファイルの本体にはstatic があると言う矛盾を最近のgcc 4.4.3はチェックしているようだ。
おすすめは3.2らしい。
またUNIXProcess_md.cでexecvpe()の部分を
/* static -- melange 2010-03-16 */
int
/* execvpe(const char *file, const char *const argv[], const char *const envp[]\
) */
/* melange 2010-03-16 */
execvpe(const char *file, char *const argv[], char *const envp[])
にした。
HAE_API_LinuxOS_Capture.cで 以下のように不必要なヘッダーのincludeをコメントにした。
// for I_FLUSH \
// melange 2010-03-16 \
// #include \
とした。
また、undefined reference to `__ctype_b’というエラーがたくさんでるので、
http://www.webmo.net/support/download/ctype.c
をロードし、
cc -c ctype.c
で適当にコンパイル。
gcc でリンクしている最後あたりに
mawt.gmkの以下の部分を修正
ifeq ($(PLATFORM), linux)
OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
OTHER_CFLAGS += -DMOTIF_VERSION=2
OTHER_CFLAGS += -DXMSTRINGDEFINES=1
#OTHER_LDLIBS = $(LIBXM) $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
OTHER_LDLIBS = $(LIBXM) $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi -lXaw -lXt -lXp ${HOME}/jdk1.6.0-18src/ctype.o
endif
また、j2se/src/solaris/native/sun/awt/awt_motif21.c
の88行あたりで
if (im_height == 0) {
/* melange 2010-03-16 patch comment this */
/* im_height = _XmImGetGeo(w); */
}
としてリンクエラーが出ないようにした。ここのライブラリ呼び出しはgeometryを求めているのだろうが、なぜか解決できない。
また、
deploy/src/javaws/share/native/launchFile.c
で
/* melange 2010-03-16 removed static */
/*static*/ int isSecureProperty(char *key) {
とした。
さらに、
deploy/src/javaws/share/native/xmlparser.c
/* melange 2010-03-16 romoved static */
/* static */ void RemoveNonAsciiUTF8FromBuffer(char *buf) {
とした。
また、deploy/make/common/Release.gmk
で
@#
@# Copy the script L10N message files into the JRE image directory
@#
if [ -d $(LIBDIR) ]; then \
$(MKDIR) -p $(TMP_DEPLOY_IMAGE_DIR)/lib; \
$(CD) $(LIBDIR); \
@# melange 2010-03-16 skip these tar copy
@# $(TAR) cf - `$(FIND) . -name 'sunw_java_plugin.mo' -print` | \
@# ($(CD) $(TMP_DEPLOY_IMAGE_DIR)/lib; $(TAR) xf -); \
fi
として、スキップするようにした。上記のファイルで修正した行は先頭に確実にTABが入るようにemacsではc-q tab
とすること。tabがどうのとか、UNIXのこの部分は古い設計でもういいのでは?
その後もこの関係のエラーが2ー3でるが、プラグインを作るのが目的ではないので、このあたりは適当にコメントにした。