-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild-cmd.sh
66 lines (55 loc) · 2.03 KB
/
build-cmd.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
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
TOP="$(dirname "$0")"
# turn on verbose debugging output for parabuild logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
# make errors fatal
set -e
# complain about unset env variables
set -u
PROJECT="libndofdev"
VERSION=$(gawk 'END{print MAJOR"."MINOR} /NDOFDEV_MAJOR/{MAJOR=$3} /NDOFDEV_MINOR/{MINOR=$3}' ${TOP}/${PROJECT}/ndofdev_version.h)
SOURCE_DIR="$PROJECT"
if [ -z "$AUTOBUILD" ] ; then
exit 1
fi
if [ "$OSTYPE" = "cygwin" ] ; then
autobuild="$(cygpath -u $AUTOBUILD)"
else
autobuild="$AUTOBUILD"
fi
stage="$(pwd)"
if [ ! -d "$stage/include" ]
then
mkdir -p "$stage/include"
fi
"$autobuild" source_environment > "$stage/variables_setup.sh" || exit 1
. "$stage/variables_setup.sh"
build=${AUTOBUILD_BUILD_ID:=0}
echo "${VERSION}.${build}" > "${stage}/VERSION.txt"
case "$AUTOBUILD_PLATFORM" in
windows*|darwin*)
# Given forking and future development work, it seems unwise to
# hardcode the actual URL of the current project's libndofdev
# repository in this message. Try to determine the URL of this
# open-libndofdev repository and remove "open-" as a suggestion.
echo "Windows/Mac libndofdev is in a separate bitbucket repository \
-- try $(hg paths default | sed -E 's/open-(libndofdev)/\1/')" 1>&2 ; exit 1
;;
linux)
echo "Platform linux is unsupported"
exit 1
;;
linux64)
opts="-DTARGET_OS_LINUX -m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE"
#Dumb - $LL_BUILD_RELEASE contains c++ standard flags which are meaningful to the c++
#compiler only, SDL is written in C and polluting CFLAGS with that nonsense just makes
#the compiler spew out a whole load of noise, so lets strip that junk out from CFLAGS
opts=$(echo "$opts" | sed 's/-std=c++[0-9][0-9]*//')
cmake ../libndofdev -DCMAKE_CXX_FLAGS="$opts" -DCMAKE_C_FLAGS="$opts" \
-DCMAKE_OSX_ARCHITECTURES="$AUTOBUILD_CONFIGURE_ARCH" \
-DCMAKE_BUILD_TYPE:STRING=Release
make
cp -a ../libndofdev/*.h $stage/include
cp -a ../libndofdev/LICENSES LICENSES
;;
esac