This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
configure-qsk
executable file
·99 lines (87 loc) · 2.48 KB
/
configure-qsk
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
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
CPU="$1$2"
if [ "$2" == "v7le" ]; then
CPUDIR="$1le-v7"
BUSUFFIX="$1v7"
elif [ "$2" == "a9" ]; then
CPUDIR="$1le-v7"
CPU="$1v7le"
BUSUFFIX="$1v7"
CPUGEN="a9"
else
CPUDIR="$CPU"
BUSUFFIX="$1"
fi
if [ "$QCONF_OVERRIDE" != "" ]; then
cp -p $QCONF_OVERRIDE /tmp/owbqsk$$.mk
echo "all:" >>/tmp/owbqsk$$.mk
echo ' echo $(INSTALL_ROOT_nto)' >>/tmp/owbqsk$$.mk
STAGE_DIR=`make -s -f /tmp/owbqsk$$.mk`
rm /tmp/owbqsk$$.mk
fi
if [ "$STAGE_DIR" == "" ]; then
STAGE_DIR="$HOME/stage/nto"
echo Staging directory could not be determined. Using: $STAGE_DIR
else
echo Using staging directory: $STAGE_DIR
fi
if [ ! -z "$USE_ICECC" ] ; then
CC_COMMAND=`which icecc`
echo "Using icecream for distributed compiling"
else
CC_COMMAND=$QNX_HOST/usr/bin/qcc
fi
if [ -z "$BUILDTYPE" ] ; then
BUILDTYPE="Release"
fi
if [ ! -z "$PROFILE" ] ; then
PROFILER_FLAGS="-p"
else
PROFILER_FLAGS=""
fi
STAGE_LIB="$STAGE_DIR/$CPUDIR/lib"
STAGE_USR_LIB="$STAGE_DIR/$CPUDIR/usr/lib"
STAGE_INC="$STAGE_DIR/usr/include"
COMP_PATHS=" \
-Wl,-rpath-link,$STAGE_LIB \
-Wl,-rpath-link,$STAGE_USR_LIB \
-L$STAGE_LIB \
-L$STAGE_USR_LIB \
-I$STAGE_INC \
-I$STAGE_INC/freetype2"
if [ "$CCWRAP" ] ; then
CMAKE_EXTRA_OPTIONS=" \
-DCMAKE_C_COMPILER_ARG1=qcc \
-DCMAKE_CXX_COMPILER_ARG1=qcc"
CC_COMMAND="$CCWRAP"
fi
if [ "$CPUGEN" == "a9" ] ; then
CMAKE_EXTRA_OPTIONS=" \
-DTARGETING_PLAYBOOK=1 \
$CMAKE_EXTRA_OPTIONS"
fi
if [ `uname` == "Darwin" ] ; then
CMAKE_EXTRA_OPTIONS=" \
-DCMAKE_SKIP_RPATH='ON' \
$CMAKE_EXTRA_OPTIONS"
fi
cmake \
-DCMAKE_SYSTEM_PROCESSOR="$CPUDIR" \
-DCMAKE_SYSTEM_NAME="QNX" \
-DCMAKE_SYSTEM_VERSION="1" \
-DCMAKE_BUILD_TYPE="$BUILDTYPE" \
-DCMAKE_C_COMPILER="$CC_COMMAND" \
-DCMAKE_CXX_COMPILER="$CC_COMMAND" \
-DCMAKE_C_FLAGS="-Vgcc_nto$CPU -g $COMP_PATHS $PROFILER_FLAGS" \
-DCMAKE_CXX_FLAGS="-Vgcc_nto${CPU}_cpp-ne -g -lang-c++ $COMP_PATHS $PROFILER_FLAGS" \
-DCMAKE_INCLUDE_PATH="$STAGE_INC;$STAGE_INC/skia" \
-DCMAKE_LIBRARY_PATH="$STAGE_LIB;$STAGE_USR_LIB" \
-DCMAKE_INSTALL_PREFIX="$STAGE_DIR" \
-DCMAKE_AR="$QNX_HOST/usr/bin/nto$BUSUFFIX-ar" \
-DCMAKE_RANLIB="$QNX_HOST/usr/bin/nto$BUSUFFIX-ranlib" \
-DCMAKE_LD="$QNX_HOST/usr/bin/nto$BUSUFFIX-ld" \
-DCMAKE_LINKER="$QNX_HOST/usr/bin/nto$BUSUFFIX-ld" \
-DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE \
-G"Eclipse CDT4 - Unix Makefiles" \
$CMAKE_EXTRA_OPTIONS \
$3 ../