-
-
Notifications
You must be signed in to change notification settings - Fork 617
/
Bootstrap.sh
executable file
·57 lines (50 loc) · 1.33 KB
/
Bootstrap.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
DIR=$( cd "$( dirname "$0" )" && pwd )
cd "$DIR"
COSMO_FLAG=""
for arg in "$@"; do
if [ "$arg" = "-cosmo" ]; then
COSMO_FLAG="cosmo"
break
fi
done
PLATFORM_ARG=""
CONFIG_ARG=""
PREMAKE_OPTS_ARG=""
if [ -n "$PLATFORM" ]; then
PLATFORM_ARG="PLATFORM=$PLATFORM"
fi
if [ -n "$CONFIG" ]; then
CONFIG_ARG="CONFIG=$CONFIG"
fi
if [ -n "$PREMAKE_OPTS" ]; then
PREMAKE_OPTS_ARG="PREMAKE_OPTS=$PREMAKE_OPTS"
else
PREMAKE_OPTS_ARG="PREMAKE_OPTS="
fi
SYSTEM=$(uname -s)
case "${SYSTEM}" in
Linux)
NPROC=$(nproc --all)
make -f Bootstrap.mak ${COSMO_FLAG:-linux} $PLATFORM_ARG $CONFIG_ARG "$PREMAKE_OPTS_ARG" -j$NPROC
;;
Darwin)
NPROC=$(sysctl -n hw.ncpu)
make -f Bootstrap.mak ${COSMO_FLAG:-osx} $PLATFORM_ARG $CONFIG_ARG "$PREMAKE_OPTS_ARG" -j$NPROC
;;
FreeBSD|OpenBSD|NetBSD|DragonFly)
NPROC=$(sysctl -n hw.ncpu)
gmake -f Bootstrap.mak ${COSMO_FLAG:-bsd} $PLATFORM_ARG $CONFIG_ARG "$PREMAKE_OPTS_ARG" -j$NPROC
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*)
make -f Bootstrap.mak ${COSMO_FLAG:-mingw} $PLATFORM_ARG $CONFIG_ARG "$PREMAKE_OPTS_ARG" -j$NPROC
;;
SunOS)
NPROC=$(nproc --all)
gmake -f Bootstrap.mak ${COSMO_FLAG:-solaris} $PLATFORM_ARG $CONFIG_ARG "$PREMAKE_OPTS_ARG" -j$NPROC
;;
*)
echo "Unsupported platform: '${SYSTEM}'"
exit 1
;;
esac