summaryrefslogtreecommitdiff
path: root/build-packages.sh
diff options
context:
space:
mode:
authorGaurav Khanna <gkhanna@microsoft.com>2016-12-19 11:54:51 -0800
committerGaurav Khanna <gkhanna@microsoft.com>2016-12-19 11:54:51 -0800
commit1c5dc536278102fa628150127c31ed743d090f17 (patch)
tree3f58e7329fd3534ce71f4481b58aea423d4d3fb7 /build-packages.sh
parentdec5a1ff4088780bf0b8226002a5a51d7d6c4d3a (diff)
downloadcoreclr-1c5dc536278102fa628150127c31ed743d090f17.tar.gz
coreclr-1c5dc536278102fa628150127c31ed743d090f17.tar.bz2
coreclr-1c5dc536278102fa628150127c31ed743d090f17.zip
Update build-packages.sh to support portableLinux
Diffstat (limited to 'build-packages.sh')
-rwxr-xr-xbuild-packages.sh66
1 files changed, 62 insertions, 4 deletions
diff --git a/build-packages.sh b/build-packages.sh
index 6ac0ab23aa..0dd1035f6d 100755
--- a/build-packages.sh
+++ b/build-packages.sh
@@ -3,14 +3,56 @@
usage()
{
echo "Builds the NuGet packages from the binaries that were built in the Build product binaries step."
- echo "Usage: build-packages -BuildArch -BuildType"
- echo "arch can be x64, x86, arm, arm64 (default is x64)"
- echo "configuration can be release, checked, debug (default is debug)"
+ echo "Usage: build-packages -BuildArch -BuildType [portableLinux]"
+ echo "BuildArch can be x64, x86, arm, arm64 (default is x64)"
+ echo "BuildType can be release, checked, debug (default is debug)"
+ echo "portableLinux - build for Portable Linux Distribution"
echo
exit 1
}
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+__PortableLinux=0
+
+# Use uname to determine what the OS is.
+OSName=$(uname -s)
+case $OSName in
+ Linux)
+ __BuildOS=Linux
+ __HostOS=Linux
+ ;;
+
+ Darwin)
+ __BuildOS=OSX
+ __HostOS=OSX
+ ;;
+
+ FreeBSD)
+ __BuildOS=FreeBSD
+ __HostOS=FreeBSD
+ ;;
+
+ OpenBSD)
+ __BuildOS=OpenBSD
+ __HostOS=OpenBSD
+ ;;
+
+ NetBSD)
+ __BuildOS=NetBSD
+ __HostOS=NetBSD
+ ;;
+
+ SunOS)
+ __BuildOS=SunOS
+ __HostOS=SunOS
+ ;;
+
+ *)
+ echo "Unsupported OS $OSName detected, configuring as if for Linux"
+ __BuildOS=Linux
+ __HostOS=Linux
+ ;;
+esac
unprocessedBuildArgs=
@@ -28,13 +70,29 @@ while :; do
unprocessedBuildArgs="$unprocessedBuildArgs $1"
__Arch=$(echo $1| cut -d'=' -f 2)
;;
+
+ portableLinux)
+ if [ "$__BuildOS" == "Linux" ]; then
+ __PortableLinux=1
+ else
+ echo "ERROR: portableLinux not supported for non-Linux platforms."
+ exit 1
+ fi
+ ;;
*)
unprocessedBuildArgs="$unprocessedBuildArgs $1"
esac
shift
done
-$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
+# Portable builds target the base RID only for Linux based platforms
+if [ $__PortableLinux == 1 ]; then
+ export __DistroRid="linux-$__Arch"
+else
+ export __DistroRid="\${OSRid}-$__Arch"
+fi
+
+$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=$__DistroRid -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
if [ $? -ne 0 ]
then
echo "ERROR: An error occurred while building packages; See build-packages.log for more details."