summaryrefslogtreecommitdiff
path: root/configure-iphone
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2013-09-05 02:15:19 +0000
committerLiong Sauw Ming <ming@teluu.com>2013-09-05 02:15:19 +0000
commit64df0b84d27aeceeeadea8b44ba8064fa7aa74b5 (patch)
tree70eb042692fc1646a2185e3e67926ad2ac3c76a6 /configure-iphone
parentbbac274bdc7f33d5025aede241d74262438b12b5 (diff)
Closed #1576: Add support for clang compiler. Configure-iphone will now try to use clang as the default
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4588 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'configure-iphone')
-rwxr-xr-xconfigure-iphone20
1 files changed, 12 insertions, 8 deletions
diff --git a/configure-iphone b/configure-iphone
index 79bf226f..0b15287c 100755
--- a/configure-iphone
+++ b/configure-iphone
@@ -18,7 +18,7 @@ if test "$*" = "--help" -o "$*" = "-h"; then
echo " to use. By default, the compiler is deduced from the"
echo " SDK."
echo " ARCH Optional flags to specify target architecture, e.g."
- echo " ARCH='-arch armv6'"
+ echo " ARCH='-arch armv6'. Default is armv7."
echo ""
exit 0
fi
@@ -74,15 +74,14 @@ fi
# full path as it's not normally in user's PATH
if test "${CC}" = ""; then
- # Try to use llvm-gcc if available
+ # Try to use clang if available
+ ccpath="${DEVPATH}/../../../Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
+ # Next, try to use llvm-gcc
gccpath="${DEVPATH}/usr/bin/llvm-gcc"
- if test -e ${gccpath}; then
+ if test -e ${ccpath}; then
+ export CC="${ccpath}"
+ elif test -e ${gccpath}; then
export CC="${gccpath}"
-
- if test "${ARCH}" = ""; then
- export ARCH="-arch armv7"
- echo "$F: ARCH is not specified, choosing ${ARCH}"
- fi
else
for archpath in `ls -d ${SDKPATH}/usr/lib/gcc/arm-apple-darwin*`; do
archname=`basename ${archpath}`
@@ -104,6 +103,11 @@ if test "${CC}" = ""; then
exit 1
fi
+if test "${ARCH}" = ""; then
+ export ARCH="-arch armv7"
+ echo "$F: ARCH is not specified, choosing ${ARCH}"
+fi
+
# Set CXX if not set
if test "${CXX}" = ""; then
export CXX=`echo ${CC} | sed 's/gcc/g++/'`