summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index b26da9a..8d6ab24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl vim: set sw=4 expandtab :
dnl
-dnl Copyright 2007-2009 GRAHAM DUMPLETON
+dnl Copyright 2007-2014 GRAHAM DUMPLETON
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
@@ -37,6 +37,22 @@ if test -z "${APXS}"; then
[$PATH:/usr/local/apache/bin:/usr/sbin])
fi
+XCODE_PREFIX="/Applications/Xcode.app/Contents/Developer/Toolchains/"
+XCODE_CC="${XCODE_PREFIX}XcodeDefault.xctoolchain/usr/bin/cc"
+
+if test -x "${APXS}"; then
+ APXS_CC=`${APXS} -q CC`
+ APXS_LIBTOOL=`${APXS} -q LIBTOOL | sed -e "s/ .*$//"`
+ if [[[ ${APXS_CC} = ${XCODE_PREFIX}* ]]]; then
+ cat "${APXS_LIBTOOL}" | sed -e \
+ "s/OSX10.[[89]].xctoolchain/XcodeDefault.xctoolchain/" > ./libtool
+ cat "${APXS}" | sed -e "s%get_vars(\"CC\")%\"${XCODE_CC}\"%" \
+ -e 's%^my $libtool = .*;%my $libtool = \"./libtool\";%' > ./apxs
+ chmod +x ./apxs ./libtool
+ APXS=./apxs
+ fi
+fi
+
AC_SUBST(APXS)
AC_CHECK_FUNCS(prctl)