Seid gegrüßt,
Ich versuche die Makefiles für die OpenJDK Packages und Ports zu verstehen.
Es gibt zwei natürlich Sprachliche Beschreibungen, wie man für die BSDs die
OpenJDKs übersetzt. Einmal gibt es die Beschreibung von Fuller (weiter unten ls Punkt [3] eingefügt), dann gibt es die OpenJDK7-HOWTO (als Punkt [4] eingefügt).
Dann habe ich hier die Makefiles von NetBSDs pkgsrc und von FreeBSDs Ports
(jeweils als Punkt [1] und [2] eingefügt).
Meine Fragen sind:
1) Sehe ich das richtig, dass weder das Makefile von Net[1] noch das Makefile von FreeBSD[2] es genau so machen wie in den Beschreibungen?
2) Verstehe ich das richtig, dass das Makefile von NetBSD[1] nur ein binäres Files herunterlädt und dann es "passend" entpackt?
Von der Adresse MASTER_SITES wird die Datei unter JAVA_NAME im Format EXTRACT_SUFX heruntergeladen, wobei JAVA_NAME schon fertig kompiliert
wird.
3) Oder sind irgendwo im NetBSD Makefile[1] die Kompilieranweisungen "versteckt"? Wenn ja, wo?
4) Aber auch das Makefile von FreeBSD[2] scheint mir nichts zu kompilieren!? Ich sehe weder ein direkten Aufruf von configure noch von make aber auch kein ${MAKE} oder sowas. Kann ja sein, dass irgendwo noch ein Überstzungsprozess gestartet wird, aber nur wo?
Ich hoffe mal, dass ihr meinem Rätselraten ein Ende bereiten könnt. :-)
MfG
Menhir
[1]
Das NetBSD OpenJDK7 Makefile
ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/openjdk7-bin/Makefile
[2]
Das FreeBSD OpenJDK7
http://www.freebsd.org/cgi/cvsweb.cgi/ports/java/openjdk6/Makefile?rev=1.14
[3]
Die FreeBSD & Mac OS X Build Instructions von Landon Fuller
http://mail.openjdk.java.net/pipermail/bsd-port-dev/2008-August/000006.html
[4]
Das OpenJDK7-HOWTO
http://ftp.netbsd.org/pub/NetBSD/misc/spz/openjdk/openjdk7-howto
Ich versuche die Makefiles für die OpenJDK Packages und Ports zu verstehen.
Es gibt zwei natürlich Sprachliche Beschreibungen, wie man für die BSDs die
OpenJDKs übersetzt. Einmal gibt es die Beschreibung von Fuller (weiter unten ls Punkt [3] eingefügt), dann gibt es die OpenJDK7-HOWTO (als Punkt [4] eingefügt).
Dann habe ich hier die Makefiles von NetBSDs pkgsrc und von FreeBSDs Ports
(jeweils als Punkt [1] und [2] eingefügt).
Meine Fragen sind:
1) Sehe ich das richtig, dass weder das Makefile von Net[1] noch das Makefile von FreeBSD[2] es genau so machen wie in den Beschreibungen?
2) Verstehe ich das richtig, dass das Makefile von NetBSD[1] nur ein binäres Files herunterlädt und dann es "passend" entpackt?
Von der Adresse MASTER_SITES wird die Datei unter JAVA_NAME im Format EXTRACT_SUFX heruntergeladen, wobei JAVA_NAME schon fertig kompiliert
wird.
3) Oder sind irgendwo im NetBSD Makefile[1] die Kompilieranweisungen "versteckt"? Wenn ja, wo?
4) Aber auch das Makefile von FreeBSD[2] scheint mir nichts zu kompilieren!? Ich sehe weder ein direkten Aufruf von configure noch von make aber auch kein ${MAKE} oder sowas. Kann ja sein, dass irgendwo noch ein Überstzungsprozess gestartet wird, aber nur wo?
Ich hoffe mal, dass ihr meinem Rätselraten ein Ende bereiten könnt. :-)
MfG
Menhir
[1]
Das NetBSD OpenJDK7 Makefile
ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/openjdk7-bin/Makefile
Code:
# $NetBSD: Makefile,v 1.4 2009/05/18 22:04:28 abs Exp $
#
DISTNAME= jdk1.7.0-20090502-${MACHINE_ARCH}-NetBSD_5.0
PKGNAME= ${DISTNAME:C:-${MACHINE_ARCH}.*:::C:[^-]*-:openjdk7-bin-:}
CATEGORIES= lang
MASTER_SITES= http://ftp.NetBSD.org/pub/NetBSD/misc/java/openjdk/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= abs@NetBSD.org
HOMEPAGE= http://openjdk.java.net/projects/bsd-port/
COMMENT= Binary OpenJDK package
JAVA_NAME= openjdk7-bin
JAVA_HOME= ${PREFIX}/java/${JAVA_NAME}
JAVA_WRAPPERS= jar java javac javadoc javah javap keytool orbd \
policytool rmid rmiregistry servertool tnameserv
WRKSRC= ${WRKDIR}/openjdk7-j2sdk
USE_LANGUAGES= # none
USE_TOOLS+= pax
CHECK_SHLIBS_SUPPORTED= NO
JAVA_MACHINE_ARCH=${MACHINE_ARCH}
.if ${MACHINE_ARCH} == "i386"
PLIST.client= yes
.elif ${MACHINE_ARCH} == "x86_64"
JAVA_MACHINE_ARCH= amd64
.endif
PLIST_SUBST+= JAVA_MACHINE_ARCH=${JAVA_MACHINE_ARCH:Q}
PLIST_VARS+= client
ONLY_FOR_PLATFORM= NetBSD-[5-9]*-i386 NetBSD-[5-9]*-x86_64
INSTALLATION_DIRS= java/${JAVA_NAME}
PKG_DESTDIR_SUPPORT= user-destdir
do-build:
# Cannot use NO_BUILD as need java wrappers
do-install:
cd ${WRKSRC} && ${PAX} -rwp ma . ${DESTDIR}${JAVA_HOME}
.include "../../mk/java-env.mk"
.include "../../mk/bsd.pkg.mk"
[2]
Das FreeBSD OpenJDK7
http://www.freebsd.org/cgi/cvsweb.cgi/ports/java/openjdk6/Makefile?rev=1.14
Code:
# New ports collection makefile for: openjdk6
# Date created: 2009/2/21
# Whom: Brian Gardner <brian@experts-exchange.com>
#
# $FreeBSD: ports/java/openjdk6/Makefile,v 1.14 2009/06/03 03:47:56 glewis Exp $
#
PORTNAME= openjdk6
PORTVERSION= b16
PORTREVISION= 1
CATEGORIES= java devel
MASTER_SITES= http://download.java.net/openjdk/jdk6/promoted/${PORTVERSION}/
DISTNAME= openjdk-6-src-${PORTVERSION}-${OPENJDK_BUILDDATE}
MAINTAINER= openjdk@getsnappy.com
COMMENT= Sun\'s java 6 virtual machine release under the GPL v2
RUN_DEPENDS= javavm:${PORTSDIR}/java/javavmwrapper
OPENJDK_BUILDDATE=24_apr_2009
OPTIONS= DEBUG "Enable debugging support" off \
IPV6 "Enable IPv6 support" off \
POLICY "Install the Unlimited Strength Policy Files" off \
# java extracts directly to the cwd
WRKSRC= ${WRKDIR}
USE_GMAKE= yes
USE_MOTIF= yes
USE_XORG= xtst xi xt x11
LIB_DEPENDS+= freetype.9:${PORTSDIR}/print/freetype2
BUILD_DEPENDS+= ant:${PORTSDIR}/devel/apache-ant
BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip
BUILD_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
BUILD_DEPENDS+= ${LOCALBASE}/include/cups/cups.h:${PORTSDIR}/print/cups-client
.include <bsd.port.pre.mk>
.if defined(WITH_IPV6)
CATEGORIES+= ipv6
.endif
# avoid ARCH in MAKEFLAGS, breaks build
NOPRECIOUSMAKEVARS= yes
ONLY_FOR_ARCHS= amd64 i386
BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk6 \
${LOCALBASE}/jdk1.6.0 \
${LOCALBASE}/diablo-jdk1.6.0
# do we have valid native jdk installed?
.for CJDK in ${BOOTSTRAP_JDKS}
. if !defined(BOOTSTRAPJDKDIR) && exists(${CJDK}/bin/javac)
BOOTSTRAPJDKDIR= ${CJDK}
. endif
.endfor
# if no valid jdk found, set dependency
.if !defined(BOOTSTRAPJDKDIR)
BOOTSTRAPJDKDIR?= ${LOCALBASE}/diablo-jdk1.6.0
BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/diablo-jdk16
.endif
MAKE_ENV= LANG=C LC_ALL=C \
ALT_BOOTDIR=${BOOTSTRAPJDKDIR} \
ALT_FREETYPE_HEADERS_PATH=${LOCALBASE}/include \
ALT_FREETYPE_LIB_PATH=${LOCALBASE}/lib \
ALT_X11_PATH=${LOCALBASE} \
ALT_PACKAGE_PATH=${LOCALBASE} \
ANT_HOME=${LOCALBASE} \
NO_DOCS=true
.if !defined(WITH_IPV6)
MAKE_ENV+= DONT_ENABLE_IPV6="YES"
.endif
.if defined(WITH_DEBUG)
ALL_TARGET= debug_build
OPENJDK_OSARCH= bsd-${ARCH:S/i386/i586/}-debug
.else
OPENJDK_OSARCH= bsd-${ARCH:S/i386/i586/}
.endif
# perhaps we could check to see how many processors are availble and set this equivelent to that
MAKE_ENV+= HOTSPOT_BUILD_JOBS=4
JDK_MAJOR_VERSION= 6
POLICYFILE= jce_policy-${JDK_MAJOR_VERSION}.zip
.if defined(WITH_POLICY)
DISTFILES= ${DISTNAME}.tar.gz ${POLICYFILE}
.endif
.if defined(WITH_POLICY) && !exists(${DISTDIR}/${POLICYFILE})#{
DISTFILE_INSTRUCTIONS =\n\
Due to licensing restrictions, certain files must be fetched manually.\n\n
DISTFILE_INSTRUCTIONS += Please open http://java.sun.com/javase/downloads/index.jsp\n\
in a web browser and follow the \"Download\" link for\n\
\"Other Downloads\" to obtain the JCE policy file, ${POLICYFILE}.\n\
This file must be placed is ${PORTSDIR}/distfiles\n\n
.endif#}
pre-fetch:
.if defined(DISTFILE_INSTRUCTIONS)
@${PRINTF} "${DISTFILE_INSTRUCTIONS}"
@exit 1
.endif
COPYDIRS= \
hotspot/src/os/linux/launcher \
hotspot/src/os/linux/vm \
hotspot/src/os_cpu/linux_x86/vm \
hotspot/build/linux \
hotspot/build/linux/makefiles \
hotspot/agent/src/os/linux \
hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux \
hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64 \
hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86 \
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux \
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64 \
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86 \
jdk/src/linux/doc/man
COPYFILES= \
corba/make/common/Defs-linux.gmk \
corba/make/common/shared/Defs-linux.gmk \
hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java \
jdk/make/com/sun/tools/attach/mapfile-linux \
jdk/make/common/Defs-linux.gmk \
jdk/make/common/shared/Defs-linux.gmk \
jdk/make/java/nio/mapfile-linux \
jdk/make/netbeans/common/architectures/name-Linux.properties \
jdk/make/sun/awt/mapfile-vers-linux \
jdk/make/tools/sharing/classlist.linux \
jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux \
jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.properties \
jdk/src/solaris/classes/sun/tools/attach/LinuxAttachProvider.java \
jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java \
jdk/src/solaris/hpi/include/largefile_linux.h \
jdk/src/solaris/native/java/net/linux_close.c \
jdk/src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
post-extract:
@for d in ${COPYDIRS}; do \
${MKDIR} `echo ${WRKDIR}/$$d | ${SED} 's/linux/bsd/g;'`; \
cd ${WRKDIR}/$$d; \
for f in *; do \
if [ -f $$f ]; then \
t=`echo ${WRKDIR}/$$d/$$f | ${SED} 's/linux/bsd/g; s/Linux/Bsd/g'`; \
${SED} 's/linux/bsd/g; s/Linux/Bsd/g' < $$f > $$t; \
fi; \
done; \
done
@for f in ${COPYFILES}; do \
t=`echo $$f | ${SED} 's/linux/bsd/g; s/Linux/Bsd/g'`; \
${SED} 's/linux/bsd/g; s/Linux/Bsd/g' < ${WRKDIR}/$$f > ${WRKDIR}/$$t; \
done
@${SED} 's/solaris/bsd/g; s/Solaris/Bsd/g' \
< ${WRKDIR}/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c \
> ${WRKDIR}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c
@${CP} ${WRKDIR}/jdk/src/share/lib/security/java.security \
${WRKDIR}/jdk/src/share/lib/security/java.security-openbsd
do-install:
${MKDIR} ${PREFIX}/openjdk6/
${CP} -Rp ${WRKSRC}/build/${OPENJDK_OSARCH}/j2sdk-image/ ${PREFIX}/openjdk6/
${INSTALL_DATA} ${FILESDIR}/cacerts \
${PREFIX}/openjdk6/jre/lib/security/cacerts
.if defined(WITH_POLICY)
${INSTALL_DATA} ${WRKDIR}/jce/*.jar ${PREFIX}/openjdk6/jre/lib/security
.endif
@${FIND} -s ${PREFIX}/openjdk6 -not -type d | \
${SED} -e 's#^${PREFIX}/##' >> ${TMPPLIST}
@${ECHO} "@exec mkdir ${PREFIX}/openjdk6/jre/lib/applet" >> ${TMPPLIST}
@${FIND} ${PREFIX}/openjdk6 -type d | ${SORT} -r | \
${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
.include <bsd.port.post.mk>
[3]
Die FreeBSD & Mac OS X Build Instructions von Landon Fuller
http://mail.openjdk.java.net/pipermail/bsd-port-dev/2008-August/000006.html
Hi all,
Here are my build instructions for FreeBSD and Mac OS X. I don't have
an OpenBSD machine, so I haven't been able to test there.
I'm not sure what would be the best software to use (or who has
hardware to spare), but it would be great to have a build farm going
for at least FreeBSD, OpenBSD, and Mac OS X.
== Code Access ==
OpenJDK uses Mercurial with the Forest extension. Before checking out
the BSD sources, you will need to install and configure Mercurial. See
the OpenJDK Developer's Guide for more information.
To check out the BSD-Port forest:
hg fclone http://hg.openjdk.java.net/bsd-port/bsd-port
== Dependencies ==
Kurt Miller's BSD binary plugs:
http://www.intricatesoftware.com/distfiles/jdk-7-icedtea-plugs-1.6.tar.gz
or
http://landonf.bikemonkey.org/static/soylatte/jdk-7-icedtea-plugs-1.6.tar.gz
Mac OS X bootstrap requires SoyLatte 1.0.3:
http://landonf.bikemonkey.org/static/soylatte/
On FreeBSD, you'll need the following ports:
- Java 6 - java/diablo-jdk16
- freetype2 - print/freetype2
- Xorg libraries (these will be installed as dependencies of the Java
6 port)
== Building ==
Adjust the paths below as necessary, they assume that the JDK is
installed in /usr/local,
and the binary plugs in your home directory.
If you have a SMP machine, I suggest setting HOTSPOT_BUILD_JOBS to
match your available cores.
Mac OS X:
make \
ALT_BOOTDIR=/usr/local/soylatte-i386-1.0.3
ALT_BINARY_PLUGS_PATH=$HOME/jdk-7-icedtea-plugs \
ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \
ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \
ALT_CUPS_HEADERS_PATH=/usr/include \
ANT_HOME=/usr/share/ant \
NO_DOCS=true \
HOTSPOT_BUILD_JOBS=1
FreeBSD:
gmake \
ALT_BOOTDIR=/usr/local/diablo-jdk1.6.0 \
ALT_FREETYPE_HEADERS_PATH=/usr/local/include \
ALT_FREETYPE_LIB_PATH=/usr/local/lib \
ALT_BINARY_PLUGS_PATH=$HOME/jdk-7-icedtea-plugs \
ANT_HOME=/usr/local \
NO_DOCS=true \
HOTSPOT_BUILD_JOBS=1
Should output a full JDK installation in build/bsd-i586, or build/bsd-
amd64 if you're running 64-bit FreeBSD.
[4]
Das OpenJDK7-HOWTO
http://ftp.netbsd.org/pub/NetBSD/misc/spz/openjdk/openjdk7-howto
This instruction list is a derivative of Christos' openjdk build howto.
It gets one a snapshot of the openjdk7 bsd-port built (provided it builds,
of course. It's not a release (although the openjdk folks are running up
to one), handle with care. I needed to fiddle with the source to get a
working jar binary, see the patch.
The tarballs in this directory are the result of the j2sdk rebuilding itself,
so it reaches at least this level of working. No guarantees otherwise.
+ Dependencies for getting the source:
- install the package devel/mercurial
- install forest.py (see http://www.selenic.com/mercurial/wiki/index.cgi/ForestExtension)
+ build dependencies
- install the package devel/nspr
- install the package print/cups
- install the package archivers/zip
- potentially (no native X installed e.g.) install graphics/freetype2
- install the package devel/gmake
- install a jdk (lang/openjdk-bin if that covers your needs)
- install the package devel/apache-ant (this one wants a jdk package;
if you have a non-packaged jdk you need to comment out the dependency
and set JAVA_HOME and JVM_HOME in the installed files to your jdk)
+ Fetching the sources:
- the openjdk bsd-port source:
hg fclone http://hg.openjdk.java.net/bsd-port/bsd-port
# note that hg.openjdk.java.net doesn't seem to have IPv6 connectivity
- check out the openjdk mainline tree:
hg fclone http://hg.openjdk.java.net/jdk7/jdk7/
ln -s jdk7 jdk1.7.0
- the plugins from icedtea:
ftp http://www.intricatesoftware.com/distfiles/jdk-7-icedtea-plugs-1.6b.tar.gz
(check for a newer version)
tar -xzf jdk-7-icedtea-plugs-1.6b.tar.gz
+ setting up the environment:
- make space etc:
unsetenv LD_LIBRARY_PATH
unsetenv LD_RUN_PATH
unsetenv LD_PRELOAD
# also any other LD_*
unsetenv JAVA_HOME
# best delete all env variables except the ones explicitly needed
setenv TMPDIR /var/tmp
# or any other place with enough free space
- path overrides:
setenv ALT_NSPR_HEADERS_PATH /usr/pkg/include/nspr
setenv ALT_CUPS_HEADERS_PATH /usr/pkg/include
setenv ALT_FREETYPE_HEADERS_PATH /usr/X11R7/include
setenv ALT_FREETYPE_LIB_PATH /usr/X11R7/lib
setenv ALT_DEVTOOLS_PATH /usr/pkg/bin
setenv ALT_BINARY_PLUGS_PATH `pwd`/jdk-7-icedtea-plugs
setenv ALT_JDK_IMPORT_PATH `pwd`/jdk1.7.0
setenv ALT_BOOTDIR /usr/pkg/java/<yourjdk>
# the dir with bin/javac inside
# and probably also
setenv JVM_HOME /usr/pkg/java/<yourjdk>
# but don't set JAVA_HOME
+ build:
cd bsd-port
gmake
# go make tea and play with the cats, or something
+ harvest and use:
# the result of the build will be in bsd-port/build/bsd-<arch>/j2sdk-image
# and bsd-port/build/bsd-<arch>/j2re-image. Move them somewhere they can stay,
# then
setenv JAVA_HOME <path to your jdk or jre>
setenv JVM_HOME <path to your jdk or jre>
# enjoy![]()
. It's not a release (although the openjdk folks are running up