From aa9fa138a2f8f7f253dbe349237c08a54e9d869c Mon Sep 17 00:00:00 2001 From: Tim Biermann Date: Sun, 14 Mar 2021 16:43:43 +0100 Subject: [PATCH] openjdk14-boot: share common options --- openjdk14-boot/Pkgfile | 87 ++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 55 deletions(-) diff --git a/openjdk14-boot/Pkgfile b/openjdk14-boot/Pkgfile index bd5c543..fb8f0a9 100644 --- a/openjdk14-boot/Pkgfile +++ b/openjdk14-boot/Pkgfile @@ -13,13 +13,9 @@ source=(https://crux.ster.zone/downloads/java/openjdk-$version.tar.bz2 https://crux.ster.zone/downloads/java/java_cacerts-${_cert_ver}) build() { - # Make sure we do not have ccache masquerade directory in PATH. - # Use --enable-ccache instead of providing a wrapped compiler. - # NOTE: the check for usr/bin/ccache may be too specific, since it rules out - # local or opt installs. if [ -e '/usr/bin/ccache' ]; then PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//') - PKGMK_JDK13+=' --enable-ccache' + PKGMK_JDK14+=' --enable-ccache' fi OLD_PATH=$PATH @@ -30,39 +26,41 @@ build() { unset CXXFLAGS unset LDFLAGS unset MAKEFLAGS + export _CFLAGS+=' -fcommon' + export _CXXFLAGS+=' -fcommon' [ -z $JOBS ] && JOBS=$(nproc) + local _COMMON_OPTIONS=" + --disable-hotspot-gtest + --disable-precompiled-headers + --disable-warnings-as-errors + --enable-dtrace=no + --enable-headless-only + --enable-unlimited-crypto + --with-native-debug-symbols=none + --with-debug-level=release + --with-stdc++lib=dynamic + --with-jvm-variants=server + --with-cacerts-file=$SRC/java_cacerts-$_cert_ver + --with-jtreg=no + --with-boot-jdk=$JAVA_HOME + --with-version-opt=CRUX-r$release + --with-version-build=${version#*+} + --with-vendor-name=CRUX + --with-jobs=$JOBS + --with-libjpeg=system + --with-giflib=system + --with-libpng=system + --with-zlib=system + --with-lcms=system" mkdir $SRC/{build-boot,build} cd $SRC/build-boot - export _CFLAGS+=' -fcommon' - export _CXXFLAGS+=' -fcommon' - LC_ALL=C - /bin/bash ../jdk14u-jdk-$version/configure $PKGMK_JDK13 \ + LC_ALL=C \ + /bin/bash $SRC/jdk14u-jdk-$version/configure $PKGMK_JDK14 \ + $_COMMON_OPTIONS \ --prefix=$SRC/build-boot/images/jdk \ - --disable-hotspot-gtest \ - --disable-precompiled-headers \ - --disable-warnings-as-errors \ - --enable-dtrace=no \ - --enable-headless-only \ - --enable-unlimited-crypto \ - --with-native-debug-symbols=none \ - --with-debug-level=release \ - --with-stdc++lib=dynamic \ - --with-jvm-variants=server \ - --with-cacerts-file=$SRC/java_cacerts-$_cert_ver \ - --with-jtreg=no \ - --with-boot-jdk=$JAVA_HOME \ - --with-version-opt="CRUX-r$release" \ - --with-version-build="${version#*+}" \ - --with-vendor-name="CRUX" \ - --with-jobs=$JOBS \ - --with-libjpeg=system \ - --with-giflib=system \ - --with-libpng=system \ - --with-zlib=system \ - --with-lcms=system \ --with-extra-cflags="$_CFLAGS" \ --with-extra-cxxflags="$_CXXFLAGS" @@ -75,31 +73,10 @@ build() { cd $SRC/build - LC_ALL=C - /bin/bash ../jdk14u-jdk-$version/configure $PKGMK_JDK13 \ + LC_ALL=C \ + /bin/bash $SRC/jdk14u-jdk-$version/configure $PKGMK_JDK14 \ + $_COMMON_OPTIONS \ --prefix=/$name \ - --disable-hotspot-gtest \ - --disable-precompiled-headers \ - --disable-warnings-as-errors \ - --enable-dtrace=no \ - --enable-headless-only \ - --enable-unlimited-crypto \ - --with-native-debug-symbols=none \ - --with-debug-level=release \ - --with-stdc++lib=dynamic \ - --with-jvm-variants=server \ - --with-cacerts-file=$SRC/java_cacerts-$_cert_ver \ - --with-jtreg=no \ - --with-boot-jdk=$JAVA_HOME \ - --with-version-opt="CRUX-r$release" \ - --with-version-build="${version#*+}" \ - --with-vendor-name="CRUX" \ - --with-jobs=$JOBS \ - --with-libjpeg=system \ - --with-giflib=system \ - --with-libpng=system \ - --with-zlib=system \ - --with-lcms=system \ --with-extra-cflags="$_CFLAGS" \ --with-extra-cxxflags="$_CXXFLAGS"