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

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/configure-iphone

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
F="configure-iphone"
 
4
 
 
5
if test "$*" = "--help" -o "$*" = "-h"; then
 
6
  echo "$F [OPTIONS]"
 
7
  echo ""
 
8
  echo "where:"
 
9
  echo "  OPTIONS    Other options that will be passed directly to"
 
10
  echo "             ./aconfigure script. Run ./aconfigure --help"
 
11
  echo "             for more info."
 
12
  echo ""
 
13
  echo "Environment variables:"
 
14
  echo "  IPHONESDK  Optionally specify which SDK to use. Value is the full "
 
15
  echo "             path of the SDK. By default, the latest SDK installed"
 
16
  echo "             will be used."
 
17
  echo "  CC         Optionally specify the path of the ARM cross compiler"
 
18
  echo "             to use. By default, the compiler is deduced from the"
 
19
  echo "             SDK."
 
20
  echo "  ARCH       Optional flags to specify target architecture, e.g."
 
21
  echo "                ARCH='-arch armv6'"
 
22
  echo ""
 
23
  exit 0
 
24
fi
 
25
 
 
26
# Set the main iPhone developer directory, if not set
 
27
if test "x${DEVPATH}" = "x"; then
 
28
  DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
 
29
  if test  ! -d $DEVPATH; then
 
30
    DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer
 
31
  fi
 
32
  echo "$F: DEVPATH is not specified, using ${DEVPATH}"
 
33
fi
 
34
 
 
35
# Make sure $DEVPATH directory exist
 
36
if test ! -d $DEVPATH; then
 
37
  echo "$F error: directory $DEVPATH does not exist. Please install iPhone development kit"
 
38
  exit 1
 
39
fi
 
40
 
 
41
# Choose SDK version to use
 
42
if test "$IPHONESDK" = ""; then
 
43
  # If IPHONESDK is not set, use the latest one
 
44
  for f in `ls $DEVPATH/SDKs/`; do echo $f | sed 's/\(.sdk\)//'; done | sort | tail -1 > tmpsdkname
 
45
  IPHONESDK=`cat tmpsdkname`.sdk
 
46
  rm -f tmpsdkname
 
47
  SDKPATH=${DEVPATH}/SDKs/${IPHONESDK}
 
48
  echo "$F: IPHONESDK is not specified, choosing ${IPHONESDK}"
 
49
elif test -d ${IPHONESDK}; then
 
50
  # .. else if IPHONESDK is set and it points to a valid path, just use it
 
51
  SDKPATH=${IPHONESDK}
 
52
else
 
53
  # .. else assume the SDK name is used.
 
54
  SDKPATH=${DEVPATH}/SDKs/${IPHONESDK}
 
55
fi
 
56
 
 
57
# Test the SDK directory
 
58
if test ! -d ${SDKPATH}/usr/include; then
 
59
  echo "$F error: unable to find valid iPhone SDK in ${SDKPATH}"
 
60
  exit 1
 
61
fi
 
62
 
 
63
# Default CFLAGS if it's not specified
 
64
if test "$CFLAGS" = ""; then
 
65
  CFLAGS="-O2 -Wno-unused-label"
 
66
fi
 
67
 
 
68
# Default LDFLAGS if it's not specified
 
69
if test "$LDFLAGS" = ""; then
 
70
  LDFLAGS="-O2"
 
71
fi
 
72
 
 
73
# Determine which gcc for this SDK. Binaries should have the
 
74
# full path as it's not normally in user's PATH
 
75
 
 
76
if test "${CC}" = ""; then
 
77
  # Try to use llvm-gcc if available
 
78
  gccpath="${DEVPATH}/usr/bin/llvm-gcc"
 
79
  if test -e ${gccpath}; then
 
80
    export CC="${gccpath}"
 
81
 
 
82
    if test "${ARCH}" = ""; then
 
83
       export ARCH="-arch armv7"
 
84
       echo "$F: ARCH is not specified, choosing ${ARCH}"
 
85
    fi
 
86
  else
 
87
    for archpath in `ls -d ${SDKPATH}/usr/lib/gcc/arm-apple-darwin*`; do
 
88
       archname=`basename ${archpath}`
 
89
       for gccver in `ls ${archpath}`; do
 
90
          gccpath="${DEVPATH}/usr/bin/${archname}-gcc-${gccver}"
 
91
          if test -e ${gccpath}; then
 
92
            export CC="${gccpath}"
 
93
          fi
 
94
       done
 
95
    done
 
96
  fi
 
97
  if test ! "${CC}" = ""; then
 
98
    echo "$F: CC is not specified, choosing ${CC}"
 
99
  fi
 
100
fi
 
101
 
 
102
if test "${CC}" = ""; then
 
103
    echo "$F error: unable to find gcc for ${IPHONESDK}. If you think you have the right gcc, set the full path in CC environment variable."
 
104
    exit 1
 
105
fi
 
106
 
 
107
# Set CXX if not set
 
108
if test "${CXX}" = ""; then
 
109
  export CXX=`echo ${CC} | sed 's/gcc/g++/'`
 
110
  echo "$F: CXX is not specified, using ${CXX}"
 
111
fi
 
112
 
 
113
# Other settings to feed to configure script. 
 
114
#ARCH="-arch armv6"
 
115
export CFLAGS="${CFLAGS} -DPJ_SDK_NAME=\"\\\"`basename $SDKPATH`\\\"\" ${ARCH} -isysroot ${SDKPATH}"
 
116
export LDFLAGS="${LDFLAGS} ${ARCH} -isysroot ${SDKPATH} -framework AudioToolbox -framework Foundation"
 
117
export AR="${DEVPATH}/usr/bin/libtool -static -o"
 
118
export RANLIB="echo ranlib"
 
119
# Use gcc -E as preprocessor instead of cpp, since cpp will find the
 
120
# header files in standard /usr/include instead of in isysroot
 
121
export CPP="${CC} ${ARCH} -E -isysroot ${SDKPATH}"
 
122
 
 
123
# Print settings
 
124
if test "1" = "1"; then
 
125
  echo "$F: calling ./aconfigure with env vars:"
 
126
  echo " CC = ${CC}"
 
127
  echo " CXX = ${CXX}"
 
128
  echo " SDKPATH = ${SDKPATH}"
 
129
  echo " CFLAGS = ${CFLAGS}"
 
130
  echo " LDFLAGS = ${LDFLAGS}"
 
131
  echo " AR = ${AR}"
 
132
  echo " RANLIB = ${RANLIB}"
 
133
fi
 
134
 
 
135
# And finally invoke the configure script itself
 
136
./aconfigure --host=arm-apple-darwin9 --disable-sdl $*
 
137
 
 
138
if test "$?" = "0"; then
 
139
  echo "Done configuring for `basename $SDKPATH`"
 
140
  echo ""
 
141
fi
 
142