What's wrong with openjdk make file?
Franklyn Ding
franklynding at gmail.com
Sat Jul 18 23:55:57 PDT 2009
Hi
I am a fan of Java and I tried to build openjdk6 on my Linux. I came
across a weird error when issuing "make sanity".
Here are the details.
The openjdk source is from openjdk-6-src-b16-24_apr_2009.tar.gz
My env vars are:
declare -x ALT_BINARY_PLUGS_PATH="/root/buildjdk/openjdk-binary-plugs"
declare -x ALT_BOOTDIR="/usr/local/jdk1.6.0_14"
declare -x ALT_JIBX_LIBS_PATH="/root/buildjdk/jibx/lib"
declare -x ANT_HOME="/opt/ant"
declare -x BOOTDIR="/usr/local/jdk1.6.0_14"
After I issued "make sanity" I got the some error messages:
ERROR: Your BOOTDIR environment variable does not point
to a valid JDK for bootstrapping this build.
A JDK 6 build must be bootstrapped using
JDK 1.6.0 fcs (or later).
Apparently, your bootstrap JDK is version
Please update your ALT_BOOTDIR setting and start your build again.
ERROR: You do not have access to valid Motif 2.1 header files.
Please check your access to (for example)
/usr/include/Xm/AtomMgr.h
and/or check your value of ALT_MOTIF_DIR.
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).
The whole output can be found from my attached file.
The first ERROR is weird. And I checked makefile script.
I found it is generated from file jdk/make/common/shared/Sanity.gmk
######################################################
# BOOTDIR must point to a valid JDK.
######################################################
BOOT_CHECK :=$(call CheckVersions,$(BOOT_VER),$(REQUIRED_BOOT_VER))
sane-bootdir:
@if [ "$(BOOT_CHECK)" != "same" -a "$(BOOT_CHECK)" != "newer" ];
then \
$(ECHO) "ERROR: Your BOOTDIR environment variable does not point
\n" \
" to a valid JDK for bootstrapping this build. \n" \
" A JDK $(JDK_MINOR_VERSION) $(MARKET_NAME) build must be
bootstrapped using \n" \
" JDK $(PREVIOUS_JDK_VERSION) fcs (or later). \n" \
" Apparently, your bootstrap JDK is version $(BOOT_VER) \n"
\
" Please update your ALT_BOOTDIR setting and start your
build again. \n" \
"" >> $(ERROR_FILE) ; \
fi
It seems BOOT_VER is empty.
This can be confirmed by one line from the output.
make[1]: Entering directory `/root/buildjdk/openjdk6/jdk/make'
*/root/buildjdk/openjdk6/jdk/make/common/shared/Sanity-Settings.gmk:72:
WARNING: BOOT_VER should not be empty [Sanity-Settings.gmk]*
/root/buildjdk/openjdk6/jdk/make/common/shared/Sanity-Settings.gmk:119:
WARNING: ZIP_VER should not be empty [Sanity-Settings.gmk]
/root/buildjdk/openjdk6/jdk/make/common/shared/Sanity-Settings.gmk:120:
WARNING: UNZIP_VER should not be empty [Sanity-Settings.gmk]
/root/buildjdk/openjdk6/jdk/make/common/shared/Sanity-Settings.gmk:125:
WARNING: FINDBUGS_VER should not be empty [Sanity-Settings.gmk]
/root/buildjdk/openjdk6/jdk/make/common/shared/Sanity-Settings.gmk:201:
WARNING: MAKE_VER should not be empty [Sanity-Settings.gmk]
make[2]: Entering directory `/root/buildjdk/openjdk6/jdk/make/tools/
Note MAKE_VER, ZIP_VER and UNZIP_VER are also empty.
Then I tried to figure out why BOOT_VER is empty during make sanity.
I found BOOT_VER is init-ed in jdk/make/common/shared/Sanity.gmk
# Get the version numbers of what we are using
_MAKE_VER :=$(shell $(MAKE) --version 2>&1 | $(HEAD) -n 1)
_ZIP_VER :=$(shell $(ZIPEXE) -help 2>&1 | $(HEAD) -n 4 | $(EGREP) '^Zip')
_UNZIP_VER :=$(shell $(UNZIP) -help 2>&1 | $(HEAD) -n 4 | $(EGREP)
'^UnZip')
_BOOT_VER :=$(shell $(BOOTDIR)/bin/java -version 2>&1 | $(HEAD) -n 1)
MAKE_VER :=$(call GetVersion,"$(_MAKE_VER)")
ZIP_VER :=$(call GetVersion,"$(_ZIP_VER)")
UNZIP_VER :=$(call GetVersion,"$(_UNZIP_VER)")
BOOT_VER :=$(call GetVersion,"$(_BOOT_VER)")
and GetVersion is defined in ./jdk/make/common/shared/Defs.gmk as follows
# Given a line of text, get the major.minor version number from it
define GetVersion
$(shell echo $1 | sed -e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@' )
endef
I tested the commands combined above, and got the corrent result
root:~/buildjdk/openjdk6# $BOOTDIR/bin/java -version 2>&1 | head -n 1 | sed
-e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@'
1.6
So anybody has any hints?
Best regards,
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/jdk6-dev/attachments/20090719/fe162c4f/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: result.log
Type: application/octet-stream
Size: 9488 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/jdk6-dev/attachments/20090719/fe162c4f/attachment.obj
More information about the jdk6-dev
mailing list