summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile.in1
-rwxr-xr-xconfigure16
-rw-r--r--configure.ac16
4 files changed, 36 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 61d9ea9..9115e69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ autom4te.cache
config.log
config.status
.libs
+*.o
*.la
*.lo
*.loT
@@ -18,3 +19,5 @@ lib
.Python
*.pyc
.tox
+apxs
+libtool
diff --git a/Makefile.in b/Makefile.in
index f5268b5..b513e51 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52,6 +52,7 @@ clean :
distclean : clean
-rm -f Makefile
+ -rm -f apxs libtool
-rm -rf .Python bin lib include
-rm -rf .tox
diff --git a/configure b/configure
index 7f946e4..881da7d 100755
--- a/configure
+++ b/configure
@@ -1930,6 +1930,22 @@ test -n "$APXS" || APXS="apxs"
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_ext=c
diff --git a/configure.ac b/configure.ac
index a81bffa..5482ce3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)