blob: 4474947e0750e103e2b0f366dc12a8dc453bebdd [file] [log] [blame]
Tristan Matthews0a329cc2013-07-17 13:20:14 -04001#!/bin/sh
2#
3
4F="configure-bb10"
5
6if test "$*" = "--help" -o "$*" = "-h"; then
7 echo "$F [--simulator] [OPTIONS]"
8 echo ""
9 echo "where:"
10 echo " --simulator Optional parameter to specify that the compilation"
11 echo " target is a simulator."
12 echo " OPTIONS Other options that will be passed directly to"
13 echo " ./configure script. Run ./configure --help"
14 echo " for more info."
15 exit 0
16fi
17
18# Find simulator argument
19args=""
20simulator="no"
21for arg in "$@"; do
22 if test "$arg" = "--simulator"; then
23 simulator="yes"
24 else
25 args="$args $arg"
26 fi
27done
28
29if test "$simulator" = "yes"; then
30 TARGET_ARCH="x86"
31 TARGET_ARCHEND=${TARGET_ARCH}
32 LIBDIR=${TARGET_ARCH}
33 TARGET_HOST="i486-pc-nto-qnx8.0.0"
34else
35 TARGET_ARCH="armv7"
36 TARGET_ARCHEND="${TARGET_ARCH}le"
37 LIBDIR="armle-v7"
38 TARGET_HOST="arm-unknown-nto-qnx8.0.0eabi"
39fi
40
41RANLIB="${QNX_HOST}/usr/bin/nto${TARGET_ARCH}-ranlib "
42CPP="${QNX_HOST}/usr/bin/qcc -V4.6.3,gcc_nto${TARGET_ARCHEND}_cpp -E "
43CC="${QNX_HOST}/usr/bin/qcc -V4.6.3,gcc_nto${TARGET_ARCHEND}_cpp "
44LD="${QNX_HOST}/usr/bin/nto${TARGET_ARCH}-ld "
45export LDFLAGS="$LDFLAGS -L${QNX_TARGET}/${LIBDIR}/usr/lib -L${QNX_TARGET}/${LIBDIR}/lib -L${QNX_HOST}/usr/lib/gcc/${TARGET_HOST}/4.6.3 -lgcc -lasound -laudio_manager"
46
47if test "$CFLAGS" = ""; then
48 # Default if no CFLAGS is set in env
49 export CFLAGS=" -g -O2"
50fi
51export CFLAGS="$CFLAGS -fPIC -DPJ_CONFIG_BB10=1 -DPJMEDIA_AUDIO_DEV_HAS_BB10=1"
52
53# Invoke configure
54./configure --host=${TARGET_HOST} --disable-oss $args
55RETVAL=$?
56
57# Write to pjsip.pri only if configure was successful
58if test $RETVAL -eq 0; then
59 echo "# Config file to be included in app's .pro file" > pjsip.pri
60 echo "# Auto-generated by 'configure-bb10 $*'" >> pjsip.pri
61 make -f bb10-config.mak >> pjsip.pri
62
63 echo PJSIP config file for BB10 has been written to \'pjsip.pri\'. You can include this file from your application\'s .pro file.
64 echo
65fi
66
67