Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.ac: autodetect OSX SDK path #647

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ case $host in
CFLAGS="${CFLAGS} -isysroot ${with_macosx_sdk}"
CXXFLAGS="${CXXFLAGS} -isysroot ${with_macosx_sdk}"
OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
else
AC_CHECK_PROG([XCODEBUILD],xcodebuild, yes)
if test x$XCODEBUILD = xyes; then
XCODE_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
if test x$XCODE_SYSROOT != x ; then
if test -d "$XCODE_SYSROOT" ; then
CFLAGS="${CFLAGS} -isysroot ${XCODE_SYSROOT}"
CXXFLAGS="${CXXFLAGS} -isysroot ${XCODE_SYSROOT}"
OBJC="${OBJC} -isysroot ${XCODE_SYSROOT}"
fi
fi
fi
fi
AC_ARG_WITH(macosx-version-min,
[AS_HELP_STRING([--with-macosx-version-min=VERSION],
Expand Down