forked from ideawu/rtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
72 lines (57 loc) · 1.2 KB
/
build.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
67
68
69
70
#!/bin/sh
# used to generate config.mk
DIR=`pwd`
cd `dirname $0`
BASE_DIR=`pwd`
cd $DIR
BASE_DIR=`echo $BASE_DIR | sed -e "s/^\/cygdrive\/\([a-z]\)/\1:/"`
DIST_LIB_DIR=${BASE_DIR}/dist/lib
DIST_OBJ_DIR=${BASE_DIR}/dist/obj
DIST_INC_DIR=${BASE_DIR}/dist/include/rtc
mkdir -p ${DIST_LIB_DIR}
mkdir -p ${DIST_OBJ_DIR}
mkdir -p ${DIST_INC_DIR}
TARGET_OS=`uname -s`
case "$TARGET_OS" in
Darwin)
OS=mac
C=clang
CC=clang++
AR="ar -cru "
OBJ=o
LIB=a
;;
CYGWIN_*)
OS=win
C=cl
CC=cl
AR="lib /NOLOGO /OUT:"
OBJ=obj
LIB=lib
;;
*)
echo "Unknown platform!" >&2
exit 1
esac
OS_UPPER=`echo $OS | tr '[:lower:]' '[:upper:]'`
#### generate config.mk ####
echo BASE_DIR := $BASE_DIR
echo DIST_LIB_DIR := $DIST_LIB_DIR
echo DIST_OBJ_DIR := $DIST_OBJ_DIR
echo DIST_INC_DIR := $DIST_INC_DIR
echo TARGET_ARCH=x86
echo OS=$OS
echo C=$C
echo CC=$CC
echo AR="$AR"
echo OBJ=$OBJ
echo LIB=$LIB
echo CFLAGS :=
echo CFLAGS += -I $BASE_DIR -I $BASE_DIR/multimedia
echo CFLAGS += -D WEBRTC_${OS_UPPER} -D WEBRTC_CLOCK_TYPE_REALTIME -DWEBRTC_NS_FIXED
if [ "$OS" == "mac" ]; then
echo CFLAGS += -Wall -Wno-sign-compare -g
fi
if [ "$OS" == "win" ]; then
echo CFLAGS += /EHsc
fi