From: James Hilliard Date: Tue, 8 Oct 2019 15:54:46 +0000 (+0200) Subject: configure.ac: automatically detect xcode path X-Git-Tag: VALGRIND_3_16_0~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d687db28752f650fd77e34074975d3d107c24b3;p=thirdparty%2Fvalgrind.git configure.ac: automatically detect xcode path This should fix build errors due to /usr/include not existing. Signed-off-by: James Hilliard --- diff --git a/configure.ac b/configure.ac index 3596d2fecf..29b88f7cc7 100755 --- a/configure.ac +++ b/configure.ac @@ -995,6 +995,30 @@ AC_ARG_WITH(tmpdir, AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory]) AC_SUBST(VG_TMPDIR, [$tmpdir]) +#---------------------------------------------------------------------------- +# Detect xcode path +#---------------------------------------------------------------------------- +AM_COND_IF([VGCONF_OS_IS_DARWIN], +[AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no]) +AC_MSG_CHECKING([for xcode sdk include path]) +AC_ARG_WITH(xcodedir, + [ --with-xcode-path=PATH Specify path for xcode sdk includes], + [xcodedir="$withval"], + [ + if test "x$XCRUN" != "xno" -a ! -d /usr/include; then + xcrundir=`xcrun --sdk macosx --show-sdk-path` + if test -z "$xcrundir"; then + xcodedir="/usr/include" + else + xcodedir="$xcrundir/usr/include" + fi + else + xcodedir="/usr/include" + fi + ]) +AC_MSG_RESULT([$xcodedir]) +AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory]) +AC_SUBST(XCODE_DIR, [$xcodedir])]) #---------------------------------------------------------------------------- # Libc and suppressions diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index e2636f5ff3..6a1a925fb5 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -157,10 +157,10 @@ mach_hdrs += \ m_mach/thread_act.h \ m_mach/vm_map.h mach_defs += \ - /usr/include/mach/mach_vm.defs \ - /usr/include/mach/task.defs \ - /usr/include/mach/thread_act.defs \ - /usr/include/mach/vm_map.defs + @XCODE_DIR@/mach/mach_vm.defs \ + @XCODE_DIR@/mach/task.defs \ + @XCODE_DIR@/mach/thread_act.defs \ + @XCODE_DIR@/mach/vm_map.defs endif # Be careful w.r.t. parallel builds. See section 27.9 of the automake info