diff options
author | Manu <manu-silicon@users.noreply.github.com> | 2015-11-19 08:06:26 +0300 |
---|---|---|
committer | Manu <manu-silicon@users.noreply.github.com> | 2015-11-24 02:20:27 +0300 |
commit | fa1a910a817fb9080ab0294bbd1ac4e768885cf7 (patch) | |
tree | cd4cd9fe6349d8331a645104867cb0d7f21cf580 /build.sh | |
parent | 6777eed82be4184bb91831b08af627ae17d1becd (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-x | build.sh | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -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 |