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 ++++++++++++-------- third_party/srtp/crypto/cipher/aes_icm.c | 2 +- third_party/srtp/crypto/math/datatypes.c | 2 +- 3 files changed, 14 insertions(+), 10 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++/'` diff --git a/third_party/srtp/crypto/cipher/aes_icm.c b/third_party/srtp/crypto/cipher/aes_icm.c index b466ca9a..e7e8c599 100644 --- a/third_party/srtp/crypto/cipher/aes_icm.c +++ b/third_party/srtp/crypto/cipher/aes_icm.c @@ -283,7 +283,7 @@ aes_icm_set_iv(aes_icm_ctx_t *c, void *iv) { * this is an internal, hopefully inlined function */ -inline void +static inline void aes_icm_advance_ismacryp(aes_icm_ctx_t *c, uint8_t forIsmacryp) { /* fill buffer with new keystream */ v128_copy(&c->keystream_buffer, &c->counter); diff --git a/third_party/srtp/crypto/math/datatypes.c b/third_party/srtp/crypto/math/datatypes.c index 331aed8b..4707522f 100644 --- a/third_party/srtp/crypto/math/datatypes.c +++ b/third_party/srtp/crypto/math/datatypes.c @@ -124,7 +124,7 @@ octet_string_hex_string(const void *s, int length) { return bit_string; } -inline int +static inline int hex_char_to_nibble(uint8_t c) { switch(c) { case ('0'): return 0x0; -- cgit v1.2.3