Skip to content

Commit

Permalink
Merge pull request vanhauser-thc#257 from DomT4/math_fix_macos
Browse files Browse the repository at this point in the history
configure: find math.h on Xcode-only macOS systems
  • Loading branch information
vanhauser-thc authored Sep 1, 2017
2 parents ba4a23d + 28e3e0b commit 67354f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ if [ "$SYSS" = "Linux" -o "$SYSS" = "OpenBSD" -o "$SYSS" = "FreeBSD" -o "$SYSS"
echo Detected 64 Bit $SYSS OS
fi
fi
# On macOS /usr/include only exists if one has installed the Command Line Tools package.
# If this is an Xcode-only system we need to look inside the SDK for headers.
SDK_PATH=""
if [ "$SYSS" = "Darwin" ] && [ ! -d "/usr/include" ]; then
SDK_PATH=`xcrun --show-sdk-path`
fi
LIBDIRS=`cat /etc/ld.so.conf /etc/ld.so.conf.d/* 2> /dev/null | grep -v '^#' | sort | uniq`
if [ "$SIXFOUR" = "64" ]; then
LIBDIRS="$LIBDIRS /lib64 /usr/lib64 /usr/local/lib64 /opt/local/lib64"
Expand All @@ -138,7 +144,7 @@ if [ -d "/Library/Developer/CommandLineTools/usr/lib" ]; then
LIBDIRS="$LIBDIRS /Library/Developer/CommandLineTools/usr/lib /Library/Developer/CommandLineTools/lib"
fi
LIBDIRS="$LIBDIRS /lib /usr/lib /usr/local/lib /opt/local/lib"
INCDIRS="/usr/include /usr/local/include /opt/include /opt/local/include"
INCDIRS="$SDK_PATH/usr/include /usr/local/include /opt/include /opt/local/include"
if [ -n "$PREFIX" ]; then
if [ -d "$PREFIX/lib" ]; then
LIBDIRS="$LIBDIRS $PREFIX/lib"
Expand Down Expand Up @@ -646,7 +652,7 @@ if [ "X" != "X$DEBUG" ]; then
echo DEBUG: MYSQL_IPATH=$MYSQL_IPATH/mysql.h
fi
MATH=""
if [ -f "/usr/include/math.h" ]; then
if [ -f "$SDK_PATH/usr/include/math.h" ]; then
MATH="-DHAVE_MATH_H"
if [ -n "$MYSQL_PATH" -a -n "$MYSQL_IPATH" -a -n "$MATH" ]; then
echo " ... found"
Expand Down

0 comments on commit 67354f9

Please sign in to comment.