]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
configure.ac: automatically detect xcode path
authorJames Hilliard <james.hilliard1@gmail.com>
Tue, 8 Oct 2019 15:54:46 +0000 (17:54 +0200)
committerRhys Kidd <rhyskidd@gmail.com>
Mon, 28 Oct 2019 22:48:16 +0000 (09:48 +1100)
This should fix build errors due to /usr/include not existing.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
configure.ac
coregrind/Makefile.am

index 3596d2fecf8cfabec1c8b3c86f8b97ea437f2734..29b88f7cc719593d63affb96bf0805132337cb39 100755 (executable)
@@ -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
index e2636f5ff38e85bade7a33e595cba1701dd876fd..6a1a925fb58731fae14f7d50f47fc14677228378 100644 (file)
@@ -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