mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-11 03:54:36 +08:00
Fixing the openjdk7 PKGBUILD to allow for cross compilations.
In this way we can build an i686 package from an x86_64 machine.
This commit is contained in:
parent
d841543d64
commit
fbfb5dba2b
@ -18,13 +18,10 @@ makedepends=('openjdk6' 'apache-ant' 'zip' 'unzip' 'fastjar'
|
|||||||
source=("http://www.java.net/download/openjdk/jdk${_pkgver}/promoted/${_pkgbld}/openjdk-${_pkgver}-fcs-src-${_pkgbld}-${_pkgdate}.zip")
|
source=("http://www.java.net/download/openjdk/jdk${_pkgver}/promoted/${_pkgbld}/openjdk-${_pkgver}-fcs-src-${_pkgbld}-${_pkgdate}.zip")
|
||||||
md5sums=('37699588f783c07a71fbae00623889fa')
|
md5sums=('37699588f783c07a71fbae00623889fa')
|
||||||
|
|
||||||
[ "${CARCH}" = 'i686' ] && {
|
# CPU-dependant values
|
||||||
_cpubits=32
|
[ "${CARCH}" = 'i686' ] \
|
||||||
_cpuname=i586
|
&& _cpuname=i586 \
|
||||||
} || {
|
|| _cpuname=amd64
|
||||||
_cpubits=64
|
|
||||||
_cpuname=amd64
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/openjdk"
|
cd "${srcdir}/openjdk"
|
||||||
@ -32,33 +29,37 @@ build() {
|
|||||||
. /etc/profile.d/apache-ant.sh
|
. /etc/profile.d/apache-ant.sh
|
||||||
. /etc/profile.d/openjdk6.sh
|
. /etc/profile.d/openjdk6.sh
|
||||||
|
|
||||||
# Determine the number of CPU cores
|
# Fix options for parallel builds
|
||||||
local _cpucores="$(grep -c '^processor' /proc/cpuinfo)"
|
export ALT_PARALLEL_COMPILE_JOBS="${MAKEFLAGS/-j}"
|
||||||
|
export HOTSPOT_BUILD_JOBS="${ALT_PARALLEL_COMPILE_JOBS}"
|
||||||
|
|
||||||
# Fix the value of some environmental variables
|
# Fix the value of some environmental variables
|
||||||
export ALT_BOOTDIR="${JAVA_HOME}" \
|
export LANG="C"
|
||||||
LANG="C" \
|
export LC_ALL="C"
|
||||||
LC_ALL="C" \
|
export USER="chakra-buildbot"
|
||||||
MILESTONE="fcs" \
|
export MILESTONE="fcs"
|
||||||
BUILD_NUMBER="${_pkgbld}" \
|
export SKIP_DEBUG_BUILD="true"
|
||||||
SKIP_DEBUG_BUILD="true" \
|
export ALT_BOOTDIR="${JAVA_HOME}"
|
||||||
HOTSPOT_BUILD_JOBS="${_cpucores}" \
|
export BUILD_NUMBER="${_pkgbld}"
|
||||||
ALT_PARALLEL_COMPILE_JOBS="${_cpucores}"
|
|
||||||
|
if [ "${CARCH}" != "$(uname -m)" ]; then
|
||||||
|
export CROSS_COMPILE_ARCH="${_cpuname}"
|
||||||
|
export ALT_COMPILER_PATH="$(dirname "$(which gcc)")"
|
||||||
|
fi
|
||||||
|
|
||||||
# Unset some harmful variables
|
# Unset some harmful variables
|
||||||
unset LD_PRELOAD MAKEFLAGS JAVA_HOME
|
unset LD_PRELOAD MAKEFLAGS JAVA_HOME JDK_HOME
|
||||||
|
|
||||||
# Apply some fixes, needed for a correct build in a Chakra environment
|
# Apply some fixes, needed for a correct build in a Chakra environment
|
||||||
sed -e 's,\$(UTILS_COMMAND_PATH)touch,/usr/bin/touch,g' \
|
sed -e 's,\$(UTILS_COMMAND_PATH)touch,touch,g' \
|
||||||
-e 's,\$(USRBIN_PATH)gawk,/bin/gawk,g' \
|
-e 's,\$(USRBIN_PATH)gawk,gawk,g' \
|
||||||
|
-e 's,SHARED_LIBRARY_FLAG = -shared -mimpure-text,SHARED_LIBRARY_FLAG = -shared,g' \
|
||||||
-i jdk/make/common/shared/Defs-utils.gmk \
|
-i jdk/make/common/shared/Defs-utils.gmk \
|
||||||
-i jdk/make/common/shared/Compiler-gcc.gmk
|
-i jdk/make/common/shared/Compiler-gcc.gmk \
|
||||||
sed -e 's,SHARED_LIBRARY_FLAG = -shared -mimpure-text,SHARED_LIBRARY_FLAG = -shared,g' \
|
-i corba/make/common/shared/Defs-utils.gmk \
|
||||||
-i corba/make/common/shared/Defs-utils.gmk
|
-i corba/make/common/shared/Platform.gmk
|
||||||
sed -e "s,\$(uname -m),\"${CARCH}\",g" \
|
|
||||||
-i jdk/make/jdk_generic_profile.sh
|
|
||||||
|
|
||||||
# Setup the generic environmental variables and start the build
|
# Test the environment and start the build
|
||||||
. jdk/make/jdk_generic_profile.sh
|
. jdk/make/jdk_generic_profile.sh
|
||||||
make sanity && make ALLOW_DOWNLOADS=true
|
make sanity && make ALLOW_DOWNLOADS=true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user