-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinstall-clang-tarball.sh
executable file
·42 lines (37 loc) · 1.12 KB
/
install-clang-tarball.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
##
## Script: install-clang-tarball.sh
##
## This top-level script unzips the compressed tarball (TGZ) created
## from the files installed into the staging directory and subsequently
## zipped into a tarball in the "packages" subdirectory.
##
##- Make sure we're in the same directory as this script.
##
export TOP_DIR="$(cd "$(dirname "$0")" && pwd)"
cd $TOP_DIR
##- Get the Clang-related variables and command-line options for this build.
##
source ./clang-build-vars.sh
##- Retrieve useful information about the platform.
##
PLATFORM_INFO=(`$TOP_DIR/system-type.sh -f`)
PLATFORM_OS=${PLATFORM_INFO[0]}
PLATFORM_NAME=${PLATFORM_INFO[1]}
PLATFORM_ARCH=${PLATFORM_INFO[4]}
PLATFORM_DESC=${PLATFORM_INFO[5]}
if [ "$PLATFORM_OS" = "FreeBSD" ] && [ "$PLATFORM_ARCH" = "amd64" ]; then
PLATFORM_ARCH=x86_64
fi
PLATFORM_FULL="${PLATFORM_DESC}-${PLATFORM_ARCH}"
TARBALL=kewb-clang${CLANG_TAG}-${PLATFORM_FULL}.tgz
##- Unzip the tarball.
##
if [ -f ./packages/$TARBALL ]
then
UZCMD="tar --no-overwrite-dir -xvf ./packages/$TARBALL -C /"
echo $UZCMD
eval $UZCMD
else
echo "error: KEWB Clang tarball not found"
fi