forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-thirdparty.sh
More file actions
executable file
·89 lines (75 loc) · 2.59 KB
/
build-thirdparty.sh
File metadata and controls
executable file
·89 lines (75 loc) · 2.59 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
source "${BASEDIR}/scripts/platform.inc"
source "${BASEDIR}/scripts/lib_versions.inc"
echo $Thirdparty_BUILDREVISION
echo $Thirdparty_VERSION
echo $PLATFORM
echo $SUBPLATFORM
echo $ARCH
if [ "$XCODEBUILD" == "" ]; then
XCODEBUILD="xcodebuild"
fi
if [ "$EMMAKE" == "" ]; then
EMMAKE="emmake"
fi
TARGET_NAME=$PLATFORM
if [ "$ARCH" != "" -a "$ARCH" != "universal" ]; then
TARGET_NAME=$TARGET_NAME-$ARCH
fi
if [ "$SUBPLATFORM" != "" -a "$PLATFORM" != "android" ]; then
TARGET_NAME=$TARGET_NAME-$SUBPLATFORM
fi
MAKE_TARGET=$TARGET_NAME
if [ "$PLATFORM" == "mac" ]; then
LIBS="${Thirdparty_LIBS_mac}"
BUILDPATH="../_build/mac/Release"
LIBPATH="lib/mac"
elif [ "$PLATFORM" == "linux" ]; then
LIBS="${Thirdparty_LIBS_linux}"
BUILDPATH="../build-linux-$ARCH/livecode/out/Release/obj.target/thirdparty"
LIBPATH="lib/linux/$ARCH"
elif [ "$PLATFORM" == "ios" ]; then
LIBS="${Thirdparty_LIBS_ios}"
BUILDPATH="../_build/ios/$SUBPLATFORM/Release"
LIBPATH="lib/ios/$SUBPLATFORM"
elif [ "$PLATFORM" == "emscripten" ]; then
MAKE_TARGET=emscripten
LIBS="${Thirdparty_LIBS_emscripten}"
BUILDPATH="../build-emscripten/livecode/out/Release/obj.target/thirdparty"
LIBPATH="lib/emscripten/js"
elif [ "$PLATFORM" == "android" ]; then
LIBS="${Thirdparty_LIBS_android}"
BUILDPATH="../build-android-$ARCH/livecode/out/Release/obj.target/thirdparty"
LIBPATH="lib/android/$ARCH/$SUBPLATFORM"
elif [ "$PLATFORM" == "win32" ]; then
LIBS="${Thirdparty_LIBS_win32}"
BUILDPATH=""
LIBPATH=""
fi
make -C .. config-$MAKE_TARGET
if [ "$PLATFORM" == "mac" ] || [ "$PLATFORM" == "ios" ] ; then
${XCODEBUILD} -project "../build-$TARGET_NAME/livecode/livecode.xcodeproj" -configuration "Release" -target "thirdparty-prebuilts"
elif [ "$PLATFORM" == "linux" ] ; then
export BUILDTYPE=Release
make -C "../build-${PLATFORM}-${ARCH}/livecode" thirdparty-prebuilts
elif [ "$PLATFORM" == "emscripten" ] ; then
export BUILDTYPE=Release
${EMMAKE} make -j16 -C "../build-${PLATFORM}/livecode" thirdparty-prebuilts
elif [ "$PLATFORM" == "android" ] ; then
export BUILDTYPE=Release
make -j16 -C "../build-${PLATFORM}-${ARCH}/livecode" thirdparty-prebuilts
fi
mkdir -p "$LIBPATH"
for t_lib in $LIBS ; do
if [ "$PLATFORM" == "mac" ] || [ "$PLATFORM" == "ios" ] ; then
cp "$BUILDPATH/${t_lib}.a" "$LIBPATH"
if [ "${t_lib}" == "libskia" ]; then
cp "$BUILDPATH/${t_lib}"_*.a "$LIBPATH"
fi
elif [ "$PLATFORM" == "linux" ] || [ "$PLATFORM" == "android" ] || [ "$PLATFORM" == "emscripten" ]; then
cp "$BUILDPATH/${t_lib}/${t_lib}.a" "$LIBPATH"
if [ "${t_lib}" == "libskia" ]; then
cp "$BUILDPATH/${t_lib}/${t_lib}"_*.a "$LIBPATH"
fi
fi
done