From 64df0b84d27aeceeeadea8b44ba8064fa7aa74b5 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Thu, 5 Sep 2013 02:15:19 +0000 Subject: 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 --- configure-iphone | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'configure-iphone') 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++/'` -- cgit v1.2.3