Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu <manu-silicon@users.noreply.github.com>2015-11-19 08:06:26 +0300
committerManu <manu-silicon@users.noreply.github.com>2015-11-24 02:20:27 +0300
commitfa1a910a817fb9080ab0294bbd1ac4e768885cf7 (patch)
treecd4cd9fe6349d8331a645104867cb0d7f21cf580 /build.sh
parent6777eed82be4184bb91831b08af627ae17d1becd (diff)
Add automatic detection for ARM processors.
Use `uname -p' to find out the processor type and set the build target accordingly.
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh30
1 files changed, 28 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 1a3025c40..f6609508d 100755
--- a/build.sh
+++ b/build.sh
@@ -6,7 +6,7 @@ usage()
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, arm"
+ echo "BuildArch can be: x64, x86, arm, arm64"
echo "BuildType can be: Debug, Release"
echo "clean - optional argument to force a clean build."
echo "verbose - optional argument to enable verbose build output."
@@ -180,7 +180,6 @@ __msbuildpackageversion="14.1.0.0-prerelease"
__msbuildpath=$__packageroot/$__msbuildpackageid.$__msbuildpackageversion/lib/MSBuild.exe
__ToolNugetRuntimeId=ubuntu.14.04-x64
__TestNugetRuntimeId=ubuntu.14.04-x64
-__BuildArch=x64
__buildmanaged=true
__buildnative=true
@@ -188,6 +187,33 @@ __buildnative=true
export TZ=UTC
export MONO_THREADS_PER_CPU=2000
+# Use uname to determine what the CPU is.
+CPUName=$(uname -p)
+case $CPUName in
+ i686)
+ __BuildArch=x86
+ ;;
+
+ x86_64)
+ __BuildArch=x64
+ ;;
+
+ armv7l)
+ echo "Unsupported CPU $CPUName detected, build might not succeed!"
+ __BuildArch=arm
+ ;;
+
+ aarch64)
+ echo "Unsupported CPU $CPUName detected, build might not succeed!"
+ __BuildArch=arm64
+ ;;
+
+ *)
+ echo "Unknown CPU $CPUName detected, configuring as if for x64"
+ __BuildArch=x64
+ ;;
+esac
+
# Use uname to determine what the OS is.
OSName=$(uname -s)
case $OSName in