Last active
October 20, 2021 03:17
-
-
Save dnozay/a08d4ee903af37832174 to your computer and use it in GitHub Desktop.
fix apxs on OSX10.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# apxs may fail with .../usr/bin/cc: not a directory | |
# solution: use your own apxs script. | |
# fix based on the configure.ac from mod_wsgi | |
# https://github.com/GrahamDumpleton/mod_wsgi | |
XCODE_PREFIX="/Applications/Xcode.app/Contents/Developer/Toolchains/" | |
XCODE_CC="${XCODE_PREFIX}XcodeDefault.xctoolchain/usr/bin/cc" | |
APXS=$(which apxs) | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment