You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.69
Former-commit-id: fc39669a0b707dd3c063977486506b6793da2890
This commit is contained in:
parent
d8f8abd549
commit
e2950ec768
164
external/corert/buildscripts/buildvars-setup.sh
vendored
164
external/corert/buildscripts/buildvars-setup.sh
vendored
@@ -2,14 +2,15 @@
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Usage: $0 [managed] [native] [BuildArch] [BuildType] [clean] [cross] [verbose] [clangx.y]"
|
||||
echo "Usage: $0 [managed] [native] [BuildArch] [BuildType] [clean] [cross] [verbose] [objwriter] [clangx.y]"
|
||||
echo "managed - optional argument to build the managed code"
|
||||
echo "native - optional argument to build the native code"
|
||||
echo "The following arguments affect native builds only:"
|
||||
echo "BuildArch can be: x64, x86, arm, arm64, armel"
|
||||
echo "BuildArch can be: x64, x86, arm, arm64, armel, wasm"
|
||||
echo "BuildType can be: Debug, Release"
|
||||
echo "clean - optional argument to force a clean build."
|
||||
echo "verbose - optional argument to enable verbose build output."
|
||||
echo "objwriter - optional argument to enable build ObjWriter library"
|
||||
echo "clangx.y - optional argument to build using clang version x.y."
|
||||
echo "cross - optional argument to signify cross compilation,"
|
||||
echo " - will use ROOTFS_DIR environment variable if set."
|
||||
@@ -56,99 +57,43 @@ check_native_prereqs()
|
||||
hash clang-$__ClangMajorVersion.$__ClangMinorVersion 2>/dev/null || hash clang$__ClangMajorVersion$__ClangMinorVersion 2>/dev/null || hash clang 2>/dev/null || { echo >&2 "Please install clang before running this script"; exit 1; }
|
||||
}
|
||||
|
||||
get_current_linux_rid() {
|
||||
# Construct RID for current distro
|
||||
|
||||
get_current_linux_distro() {
|
||||
# Detect Distro
|
||||
if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then
|
||||
if [ "$(cat /etc/*-release | grep -cim1 16.04)" -eq 1 ]; then
|
||||
echo "ubuntu.16.04"
|
||||
return 0
|
||||
rid=linux
|
||||
|
||||
if [ -e /etc/os-release ]; then
|
||||
source /etc/os-release
|
||||
if [[ $ID == "alpine" ]]; then
|
||||
# remove the last version digit
|
||||
VERSION_ID=${VERSION_ID%.*}
|
||||
rid=alpine.$VERSION_ID
|
||||
elif [[ $ID == "ubuntu" ]]; then
|
||||
rid=$ID.$VERSION_ID
|
||||
fi
|
||||
|
||||
echo "ubuntu.14.04"
|
||||
return 0
|
||||
elif [ -e /etc/redhat-release ]; then
|
||||
redhatRelease=$(</etc/redhat-release)
|
||||
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
|
||||
rid=rhel.6
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cannot determine Linux distribution, assuming Ubuntu 14.04.
|
||||
echo "ubuntu.14.04"
|
||||
return 0
|
||||
echo $rid
|
||||
}
|
||||
|
||||
|
||||
export __scriptpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
export __ProjectRoot=$__scriptpath/..
|
||||
export __packageroot=$__ProjectRoot/packages
|
||||
export __sourceroot=$__ProjectRoot/src
|
||||
export __rootbinpath="$__ProjectRoot/bin"
|
||||
export __buildmanaged=false
|
||||
export __buildnative=false
|
||||
export __dotnetclipath=$__ProjectRoot/Tools/dotnetcli
|
||||
|
||||
# Use uname to determine what the CPU is.
|
||||
export CPUName=$(uname -p)
|
||||
# Some Linux platforms report unknown for platform, but the arch for machine.
|
||||
if [ $CPUName == "unknown" ]; then
|
||||
export CPUName=$(uname -m)
|
||||
fi
|
||||
# Initialize variables that depend on the compilation host
|
||||
. $__scriptpath/hostvars-setup.sh
|
||||
|
||||
case $CPUName in
|
||||
i686)
|
||||
export __BuildArch=x86
|
||||
;;
|
||||
|
||||
x86_64)
|
||||
export __BuildArch=x64
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
echo "Unsupported CPU $CPUName detected, build might not succeed!"
|
||||
export __BuildArch=arm
|
||||
;;
|
||||
|
||||
aarch64)
|
||||
echo "Unsupported CPU $CPUName detected, build might not succeed!"
|
||||
export __BuildArch=arm64
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown CPU $CPUName detected, configuring as if for x64"
|
||||
export __BuildArch=x64
|
||||
;;
|
||||
esac
|
||||
export __HostArch=$__BuildArch
|
||||
|
||||
# Use uname to determine what the OS is.
|
||||
export OSName=$(uname -s)
|
||||
case $OSName in
|
||||
Darwin)
|
||||
export __BuildOS=OSX
|
||||
export __NugetRuntimeId=osx.10.10-x64
|
||||
ulimit -n 2048
|
||||
;;
|
||||
|
||||
FreeBSD)
|
||||
export __BuildOS=FreeBSD
|
||||
# TODO: Add proper FreeBSD target
|
||||
export __NugetRuntimeId=ubuntu.14.04-x64
|
||||
;;
|
||||
|
||||
Linux)
|
||||
export __BuildOS=Linux
|
||||
export __NugetRuntimeId=$(get_current_linux_distro)-x64
|
||||
;;
|
||||
|
||||
NetBSD)
|
||||
export __BuildOS=NetBSD
|
||||
# TODO: Add proper NetBSD target
|
||||
export __NugetRuntimeId=ubuntu.14.04-x64
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unsupported OS $OSName detected, configuring as if for Linux"
|
||||
export __BuildOS=Linux
|
||||
export __NugetRuntimeId=ubuntu.14.04-x64
|
||||
;;
|
||||
esac
|
||||
export __BuildType=Debug
|
||||
|
||||
export BUILDERRORLEVEL=0
|
||||
@@ -157,10 +102,12 @@ export BUILDERRORLEVEL=0
|
||||
export __UnprocessedBuildArgs=
|
||||
export __CleanBuild=0
|
||||
export __VerboseBuild=0
|
||||
export __ObjWriterBuild=0
|
||||
export __ClangMajorVersion=3
|
||||
export __ClangMinorVersion=9
|
||||
export __CrossBuild=0
|
||||
|
||||
__BuildArch=$__HostArch
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
lowerI="$(echo $1 | awk '{print tolower($0)}')"
|
||||
@@ -176,21 +123,22 @@ while [ "$1" != "" ]; do
|
||||
export __buildnative=true
|
||||
;;
|
||||
x86)
|
||||
export __BuildArch=x86
|
||||
__BuildArch=x86
|
||||
;;
|
||||
x64)
|
||||
export __BuildArch=x64
|
||||
__BuildArch=x64
|
||||
;;
|
||||
arm)
|
||||
export __BuildArch=arm
|
||||
__BuildArch=arm
|
||||
;;
|
||||
arm64)
|
||||
export __BuildArch=arm64
|
||||
__BuildArch=arm64
|
||||
;;
|
||||
armel)
|
||||
export __BuildArch=armel
|
||||
export __ClangMajorVersion=3
|
||||
export __ClangMinorVersion=5
|
||||
__BuildArch=armel
|
||||
;;
|
||||
wasm)
|
||||
__BuildArch=wasm
|
||||
;;
|
||||
debug)
|
||||
export __BuildType=Debug
|
||||
@@ -204,6 +152,9 @@ while [ "$1" != "" ]; do
|
||||
verbose)
|
||||
export __VerboseBuild=1
|
||||
;;
|
||||
objwriter)
|
||||
export __ObjWriterBuild=1
|
||||
;;
|
||||
clang3.6)
|
||||
export __ClangMajorVersion=3
|
||||
export __ClangMinorVersion=6
|
||||
@@ -240,6 +191,44 @@ while [ "$1" != "" ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
export $__BuildArch
|
||||
|
||||
if [ $__BuildArch == "wasm" ]; then
|
||||
export __BuildOS=WebAssembly
|
||||
else
|
||||
# Use uname to determine what the OS is.
|
||||
export OSName=$(uname -s)
|
||||
case $OSName in
|
||||
Darwin)
|
||||
export __BuildOS=OSX
|
||||
export __NugetRuntimeId=osx.10.10-x64
|
||||
ulimit -n 2048
|
||||
;;
|
||||
|
||||
FreeBSD)
|
||||
export __BuildOS=FreeBSD
|
||||
# TODO: Add proper FreeBSD target
|
||||
export __NugetRuntimeId=ubuntu.14.04-x64
|
||||
;;
|
||||
|
||||
Linux)
|
||||
export __BuildOS=Linux
|
||||
export __NugetRuntimeId=$(get_current_linux_rid)-$__HostArch
|
||||
;;
|
||||
|
||||
NetBSD)
|
||||
export __BuildOS=NetBSD
|
||||
# TODO: Add proper NetBSD target
|
||||
export __NugetRuntimeId=ubuntu.14.04-x64
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unsupported OS $OSName detected, configuring as if for Linux"
|
||||
export __BuildOS=Linux
|
||||
export __NugetRuntimeId=ubuntu.14.04-x64
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If neither managed nor native are passed as arguments, default to building both
|
||||
|
||||
@@ -253,11 +242,10 @@ export __IntermediatesDir="$__rootbinpath/obj/Native/$__BuildOS.$__BuildArch.$__
|
||||
if [ $__CrossBuild = 1 ]; then
|
||||
export __IntermediatesHostDir="$__rootbinpath/obj/Native/$__BuildOS.$__HostArch.$__BuildType"
|
||||
fi
|
||||
export __ProductBinDir="$__rootbinpath/Product/$__BuildOS.$__BuildArch.$__BuildType"
|
||||
export __ProductBinDir="$__rootbinpath/$__BuildOS.$__BuildArch.$__BuildType"
|
||||
if [ $__CrossBuild = 1 ]; then
|
||||
export __ProductHostBinDir="$__rootbinpath/Product/$__BuildOS.$__HostArch.$__BuildType"
|
||||
export __ProductHostBinDir="$__rootbinpath/$__BuildOS.$__HostArch.$__BuildType"
|
||||
fi
|
||||
export __RelativeProductBinDir="bin/Product/$__BuildOS.$__BuildArch.$__BuildType"
|
||||
|
||||
# CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to set.
|
||||
# This is needed by CLI to function.
|
||||
|
Reference in New Issue
Block a user