# openjdk08/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. In theory, "openjdk08" is obsolete. Additionally, the "build" pro- cedure for this release of Java is ridiculously complicated compared to new releases. However, "openjdk08" needs to be built and installed, because numerous old Java programs need it. "openjdk08" isn't the default copy of Java. To use it, set PATH as follows: export PATH=$PRODTREE/openjdk08/bin:$PATH or, in a package "cfg" file, add "openjdk08" to the "setpaths" list in the "settings" block. #--------------------------------------------------------------------- 2. "openjdk08" is built, or rebuilt, using itself. If it doesn't al- ready exist, a prebuilt binary copy from BLFS is used for bootstrap purposes. #--------------------------------------------------------------------- 3. There is a bug of some type in the following source file in the "openjdk08" source tree: make/common/NativeCompilation.gmk The bug seems to occur in releases u92 and up; at least through u141. The bug causes the build procedure to try to link the following object file without the required "ld" option switches: genSocketOptionRegistry.o This "cfg" file includes a work-around. It's a kludge. #--------------------------------------------------------------------- 4. This package installs a JDK8-compatible Java development kit in the following directory tree: $PRODTREE/openjdk8 #--------------------------------------------------------------------- 5. In some cases, the following directories may need to be added, at run-time, to LD_LIBRARY_PATH for this release of Java to work: $PRODTRE/fontconfig/lib $PRODTREE/openjdk08/jre/lib/i386/server #--------------------------------------------------------------------- [buildtimes] 00.20 hours (or 011.98 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM 00.26 hours (or 015.57 minutes) - HP EliteBook 8560w 32GB RAM 00.33 hours (or 019.83 minutes) - ThinkPad W530 i7 4x2 32GB RAM 00.39 hours (or 023.40 minutes) - ThinkPad E540 i7 4x2 16GB RAM 00.92 hours (or 055.48 minutes) - Dell Inspiron 6400 2.0 GHz Intel Duo 7200 2GB RAM 04.17 hours (or 250.33 minutes) - Compaq 1.7 GHz Intel Pentium 4 512MB RAM #--------------------------------------------------------------------- [settings] altpkg = yes configure = none # Handled during "build" stage defer = glibc64 nowerror = yes dontfind = giflib4, openjdk10 gccpause = 5 large = yes license = GNU General Public License, version 2 (June 1991) nosyslinks = yes setpaths = fontconfig, freetype2, xorg, zlib tmpsize = 2903M unpack = none #--------------------------------------------------------------------- [depends] actools alsa coreutils cpio cups file fontconfig freetype2 gawk giflib5 grep gtkcore gzip infozip jpeg libpng libxp make mercurial # Not presently used patch pkgconf rebuild-certs sed tar wget # Not presently used xerces3 xorg zlib #--------------------------------------------------------------------- [build] JAVACERTS=/etc/ssl/java/cacerts.jks if [ \! -f $JAVACERTS ]; then cat << END Error: $JAVACERTS is missing Try rebuilding openssl or running: $PRODTREE/openssl/makecerts/rebuild-certs.sh END exit 1 fi #--------------------------------------------------------------------- unset ANT_HOME JAVA_HOME unset CC CXX UPDATE=141 BUILD=15 FTDIR=$PRODTREE/freetype2 FTINCDIR=$FTDIR/include/freetype2 ISPREFIX=$PRODTREE/openjdk08 JAVACACERTS=/etc/ssl/java/cacerts.jks MANBASE=$ISPREFIX/man SPCARCH=$PKGDIR_SPECIAL/spcarch-jdk8u${UPDATE}-b${BUILD} SPCWRAP=$PKGDIR_SPECIAL/wrappers export FORCENAMEMAX=yes export FORCEPATHMAX=yes export TEMP=/ram/openjdk08 export TEMPDIR=$TEMP export TMP=$TEMP export TMPDIR=$TEMP #--------------------------------------------------------------------- tar jxf $SPCARCH/jdk8u${UPDATE}-b${BUILD}.tar.bz2 cd jdk8u-jdk8u${UPDATE}-b${BUILD} BINSTR=openjdk08-prebuilt tar Jxf $PKGDIR_SPECIAL/$BINSTR.tar.xz #--------------------------------------------------------------------- BSPREFIX=`pwd`/$BINSTR BSJDKBINDIR=$BSPREFIX/bin ls $BSJDKBINDIR > /dev/null BSJREBINDIR=$BSPREFIX/jre/bin if [ -d $BSJREBINDIR ]; then PATH=$BSJREBINDIR:$PATH fi TOPDIR=`pwd` export PATH=.:$TOPDIR:$BSJDKBINDIR:$PATH unset BSJDKBINDIR BSJREBINDIR TOPDIR #--------------------------------------------------------------------- rm -fr $ISPREFIX $TEMP mkdir -p $ISPREFIX $TEMP #--------------------------------------------------------------------- for x in g++ gcc gawk wc do t=/usr/bin/$x if [ \! -f $t ]; then echo Error: Missing $t exit 1 fi done #--------------------------------------------------------------------- cp -p $SPCWRAP/uname.wrapper uname chmod 755 uname hash uname #--------------------------------------------------------------------- for subproject in corba hotspot jaxp jaxws jdk langtools nashorn do mkdir -pv $subproject tar jxf $SPCARCH/$subproject.tar.bz2 \ --strip-components=1 -C $subproject done patch -p0 < $SPCARCH/hotspot.spcpat patch -p0 < $SPCARCH/jdk.spcpat #--------------------------------------------------------------------- n=`getconf _NPROCESSORS_ONLN` NUMJOBS=$n #--------------------------------------------------------------------- ACFLAGS="-std=c++98 -Wno-error -fno-delete-null-pointer-checks \ -fno-lifetime-dse" ACXXFLAGS="-std=c++98 -fno-delete-null-pointer-checks \ -fno-lifetime-dse" rm -fr $PKGDIR_PROD/bin/javadoc* #--------------------------------------------------------------------- echo configure start bash ./configure \ --prefix=$ISPREFIX \ --disable-ccache \ --enable-unlimited-crypto \ --disable-precompiled-headers \ --openjdk-target=$LACARCHHOST \ --mandir=$MANBASE \ \ --with-alsa=$PRODTREE/alsa \ --with-boot-jdk=$BSPREFIX \ --with-build-number=b$BUILD \ --with-cacerts-file=$JAVACACERTS \ --with-cups=$PRODTREE/cups \ --with-extra-cflags="$ACFLAGS" \ --with-extra-cxxflags="$ACXXFLAGS" \ --with-freetype=$FTDIR \ --with-freetype-include=$FTINCDIR \ --with-freetype-lib=$FTDIR/lib \ --with-giflib=bundled \ --with-jobs=$NUMJOBS \ --with-milestone=laclin \ --with-update-version=$UPDATE \ --with-x \ --with-zlib=system echo configure end #--------------------------------------------------------------------- # Compile the package. # The kludge used below seems to be required presently. The problem # that it bypasses seems to exist for all "openjdk08" releases from # "u92" through "u141". export CPPSTDLAC=gnu++98 make SCTP_WERROR= all || true OBJFILE=`find . -type f -name genSocketOptionRegistry.o` EXEFILE=`echo $OBJFILE | sed 's/\.o$//'` gcc -o $EXEFILE $OBJFILE make SCTP_WERROR= all #--------------------------------------------------------------------- # Install the package. J1=j2sdk-image J2=images/j2sdk-image chmod a+r build/*/$J2/lib/ct.sym find build/*/$J2 -iname \*.debuginfo -delete find build/*/$J2 -iname \*.diz -delete find build/*/$J2 -iname \*.jar -exec chmod a+r {} \; rm -fr $ISPREFIX mkdir -p $ISPREFIX cp -R build/*/$J2 $ISPREFIX mv $ISPREFIX/$J1/* $ISPREFIX/ rmdir $ISPREFIX/$J1 chown -R root:root $ISPREFIX cd $ISPREFIX/lib ln -nsf `find .. -type f -name libjvm.so` . cd $ISPREFIX for subdir in `find . -type d -name security | grep lib` do pushd $subdir ln -nsf $JAVACACERTS . ln -nsf `basename $JAVACACERTS` cacerts popd done cd $PKGDIR_PROD/bin rm -fr javadoc.bin mv javadoc javadoc.bin cat > javadoc << 'END' $0.bin -Xdoclint:none $* END chmod 755 javadoc #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = Not checked yet url_home = http://www.linuxfromscratch.org/blfs/view/svn/\ general/openjdk.html url_lfs = http://www.linuxfromscratch.org/blfs/view/svn/\ general/openjdk.html url_tarball = n/a #--------------------------------------------------------------------- [history] 180506 Reworked build procedure 210217 Patched to fix FTBFS with "gcc" 10