Path: blob/master/Utilities/Release/sunos/docker/sysroot.bash
3153 views
#!/usr/bin/env bash12set -e34arch="$1"5readonly arch67case "$arch" in8x86_64)9tarball="sysroot-x86_64-pc-solaris2.10-sunos5.10-1.tar.xz"10sha256sum="bea632b3ae755f89a1c0e64775437a9b29001a3fc3a3c2c6247b921776059231"11;;12sparc64)13tarball="sysroot-sparc64-sun-solaris2.10-sunos5.10-1.tar.xz"14sha256sum="fd60cc1be951ae314ff2b4246ac055c8e5b21c39b4cd41b23ebcec709451d90f"15;;16*)17echo >&2 "Unknown architecture: $arch"18exit 119;;20esac21# To build externally, provide a Solaris sysroot tarball:22# --build-arg SYSROOT_URL=...23# --build-arg SYSROOT_SHA256SUM=...24# The tarball must contain one of:25# sysroot/x86_64-pc-solaris2.10/{lib,usr/lib,usr/include}26# sysroot/sparc64-sun-solaris2.10/{lib,usr/lib,usr/include}27# The content may be retrieved from a real Solaris host.28if test -n "$SYSROOT_URL"; then29url="$SYSROOT_URL"30if test -n "$SYSROOT_SHA256SUM"; then31sha256sum="$SYSROOT_SHA256SUM"32else33sha256sum=""34fi35tarball=$(basename "$url")36else37# This URL is only visible inside of Kitware's network.38url="https://cmake.org/files/dependencies/internal/sunos/$tarball"39fi40readonly url41readonly tarball42readonly sha256sum4344cd /tmp4546curl -OL "$url"47if test -n "$sha256sum"; then48echo "$sha256sum $tarball" > sysroot.sha256sum49sha256sum --check sysroot.sha256sum50fi5152tar xf "$tarball" -C /opt/cross535455