~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.2.1/configure-android

  • Committer: Package Import Robot
  • Author(s): Francois Marier, Francois Marier, Mark Purcell
  • Date: 2014-10-18 15:08:50 UTC
  • mfrom: (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20141018150850-2exfk34ckb15pcwi
Tags: 1.4.1-0.1
[ Francois Marier ]
* Non-maintainer upload
* New upstream release (closes: #759576, #741130)
  - debian/rules +PJPROJECT_VERSION := 2.2.1
  - add upstream patch to fix broken TLS support
  - add patch to fix pjproject regression

[ Mark Purcell ]
* Build-Depends:
  - sflphone-daemon + libavformat-dev, libavcodec-dev, libswscale-dev,
  libavdevice-dev, libavutil-dev
  - sflphone-gnome + libclutter-gtk-1.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
 
 
4
F="configure-android"
 
5
 
 
6
if test "$*" = "--help" -o "$*" = "-h"; then
 
7
  echo "$F [--use-ndk-cflags] [OPTIONS]"
 
8
  echo ""
 
9
  echo "where:"
 
10
  echo "  --use-ndk-cflags Optional parameter to use the same compilation flags"
 
11
  echo "                   as the one used by ndk-build"
 
12
  echo "  OPTIONS          Other options that will be passed directly to"
 
13
  echo "                   ./aconfigure script. Run ./aconfigure --help"
 
14
  echo "                   for more info."
 
15
  echo ""
 
16
  echo "Environment variables:"
 
17
  echo "  ANDROID_NDK_ROOT Specify the directory of Android NDK to use."
 
18
  echo "  APP_PLATFORM     Optionally specify the platform level used, e.g."
 
19
  echo "                   android-9. By default, configure will use the"
 
20
  echo "                   maximum platform level detected."
 
21
  echo "  TARGET_ABI       Optionally specify a single target architecture,"
 
22
  echo "                   e.g. armeabi-v7a, mips, x86. By default, the target"
 
23
  echo "                   architecture is armeabi. Only used when"
 
24
  echo "                   --use-ndk-cflags is specified."
 
25
  echo "  IGNORE_CFLAGS    Optionally specify compilation flags to be ignored."
 
26
  echo "                   Each grepped flag that satisfies the criteria will"
 
27
  echo "                   be ignored. Default:"
 
28
  echo "                   IGNORE_CFLAGS=\"\-M\|\-f*stack\|\-f*alias\""
 
29
  echo "                   Only used when --use-ndk-cflags is specified."
 
30
  echo ""
 
31
  exit 0
 
32
fi
 
33
 
 
34
if test "x${ANDROID_NDK_ROOT}" = "x"; then
 
35
  echo "$F error: ANDROID_NDK_ROOT must be specified"
 
36
  exit 0
 
37
fi
 
38
 
 
39
#if test "$1" = "--simulator"; then
 
40
if test "1" = "0"; then
 
41
  shift
 
42
  TARGET_HOST="i686-android-linux"
 
43
  TC_DIR="x86"
 
44
else
 
45
  TARGET_HOST="arm-linux-androideabi"
 
46
  TC_DIR=${TARGET_HOST}
 
47
fi
 
48
 
 
49
if test "x$APP_PLATFORM" = "x"; then
 
50
  APP_PLATFORM=`ls ${ANDROID_NDK_ROOT}/platforms/ | sed 's/android-//' | sort -gr | head -1`
 
51
  APP_PLATFORM="android-${APP_PLATFORM}"
 
52
  echo "$F: APP_PLATFORM not specified, using ${APP_PLATFORM}"
 
53
fi
 
54
 
 
55
if test "x$TARGET_ABI" = "x"; then
 
56
  TARGET_ABI="armeabi"
 
57
  echo "$F: TARGET_ABI not specified, using ${TARGET_ABI}"
 
58
fi
 
59
 
 
60
if test "$1" = "--use-ndk-cflags"; then
 
61
  shift
 
62
  ADD_CFLAGS="1"
 
63
  if test "x${IGNORE_CFLAGS}" = "x"; then
 
64
    IGNORE_CFLAGS="\-M\|\-f*stack\|\-f*alias"
 
65
  fi
 
66
  for i in `${ANDROID_NDK_ROOT}/ndk-build -n -C ${ANDROID_NDK_ROOT}/samples/hello-jni NDK_LOG=1 APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI}`; do
 
67
    if test "x${NDK_CXX}" != "x" -a "$i" = "-o"; then break; fi
 
68
 
 
69
    # Parse NDK CXXFLAGS
 
70
    if test "x${NDK_CXX}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x"; then
 
71
      if test "x`echo $i|grep '\-\-sysroot='`" != "x"; then
 
72
        ANDROID_SYSROOT=`echo $i|sed 's/--sysroot=//'`;
 
73
      fi
 
74
      NDK_CXXFLAGS="${NDK_CXXFLAGS} $i"
 
75
    fi
 
76
 
 
77
    # Parse NDK CFLAGS
 
78
    if test "x${NDK_CC}" != "x" -a "x`echo $i|grep 'hello-jni'`" = "x" -a "${ADD_CFLAGS}" = "1"; then
 
79
      if test "$i" = "-c"; then ADD_CFLAGS="0"; else
 
80
        if test "x`echo $i|grep ${IGNORE_CFLAGS}`" = "x"; then
 
81
          NDK_CFLAGS="${NDK_CFLAGS} $i"
 
82
        fi
 
83
      fi
 
84
    fi
 
85
 
 
86
    # Find gcc toolchain
 
87
    if test "x${NDK_CC}" = "x" -a "x`echo $i | grep 'gcc'`" != "x"; then
 
88
      NDK_CC=$i
 
89
    fi
 
90
    # Find g++ toolchain
 
91
    if test "x`echo $i | grep 'g++'`" != "x"; then
 
92
      NDK_CXX=$i
 
93
    fi
 
94
  done
 
95
 
 
96
  export CC="${NDK_CC}"
 
97
  export CXX="${NDK_CXX}"
 
98
  export AR=`echo ${NDK_CXX}|sed 's/-g++/-ar/'`;
 
99
  export RANLIB=`echo ${NDK_CXX}|sed 's/-g++/-ranlib/'`;
 
100
 
 
101
  export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
 
102
  export LIBS="${LIBS} -lc -lgcc"
 
103
  export CFLAGS="${NDK_CFLAGS} ${CFLAGS}"
 
104
  export CPPFLAGS="${CFLAGS} -fexceptions -frtti"
 
105
  export CXXFLAGS="${NDK_CXXFLAGS} -fexceptions -frtti"
 
106
 
 
107
else
 
108
 
 
109
  ANDROID_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/toolchains/${TC_DIR}-* | sed 's/clang/0/' | sort -gr | head -1`
 
110
  ANDROID_TC=`ls -d ${ANDROID_TC_VER}/prebuilt/* | grep -v gdbserver | head -1`
 
111
  if test ! -d ${ANDROID_TC}; then
 
112
    echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK"
 
113
    exit 1
 
114
  fi
 
115
 
 
116
  export ANDROID_SYSROOT="${ANDROID_NDK_ROOT}/platforms/${APP_PLATFORM}/arch-arm"
 
117
  if test ! -d ${ANDROID_SYSROOT}; then
 
118
    echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK"
 
119
    exit 1
 
120
  fi
 
121
 
 
122
  export CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc"
 
123
  export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++"
 
124
  export AR="${ANDROID_TC}/bin/${TARGET_HOST}-ar"
 
125
  export RANLIB="${ANDROID_TC}/bin/${TARGET_HOST}-ranlib"
 
126
 
 
127
  export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
 
128
  export LIBS="${LIBS} -lc -lgcc"
 
129
  export CFLAGS="${CFLAGS} -I${ANDROID_SYSROOT}/usr/include"
 
130
  export CPPFLAGS="${CFLAGS} -fexceptions -frtti"
 
131
  export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT} -fexceptions -frtti"
 
132
 
 
133
fi
 
134
 
 
135
# C++ STL
 
136
# Note: STL for pjsua2 sample app is specified in pjsip-apps/src/swig/java/android/jni/Application.mk
 
137
 
 
138
# gnustl
 
139
STDCPP_TC_VER=`ls -d ${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/[0-9]* | sort -gr | head -1`
 
140
STDCPP_CFLAGS="-I${STDCPP_TC_VER}/include -I${STDCPP_TC_VER}/libs/armeabi/include"
 
141
STDCPP_LIBS="${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o -lgnustl_static"
 
142
STDCPP_LDFLAGS="-L${STDCPP_TC_VER}/libs/armeabi"
 
143
 
 
144
# stlport
 
145
#STDCPP_CFLAGS="-I${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/stlport"
 
146
#STDCPP_LIBS="${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o -lstlport_static -ldl"
 
147
#STDCPP_LDFLAGS="-L${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi"
 
148
 
 
149
export CFLAGS="${CFLAGS} ${STDCPP_CFLAGS}"
 
150
export LIBS="${STDCPP_LIBS} ${LIBS}"
 
151
export LDFLAGS="${LDFLAGS} ${STDCPP_LDFLAGS}"
 
152
 
 
153
# Print settings
 
154
if test "1" = "1"; then
 
155
  echo "$F: calling ./configure with env vars:"
 
156
  echo " CC = ${CC}"
 
157
  echo " CXX = ${CXX}"
 
158
  echo " CFLAGS = ${CFLAGS}"
 
159
  echo " CXXFLAGS = ${CXXFLAGS}"
 
160
  echo " LDFLAGS = ${LDFLAGS}"
 
161
  echo " LIBS = ${LIBS}"
 
162
  echo " AR = ${AR}"
 
163
  echo " RANLIB = ${RANLIB}"
 
164
fi
 
165
 
 
166
./configure --host=${TARGET_HOST} --disable-video $*