From 2ac7e53520d94a15568277e74013c05416dfac0e Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Wed, 2 Sep 2015 08:41:44 +1000 Subject: [PATCH] x/sys/unix: use xcrun to find OS X and iOS SDKs in mkall.sh. This makes the script resistant to changes in the SDK location, which apparently happens from time to time. While I was at it, made another cosmetic touch-up: use a .gitignore file to stop `git status` from showing the _obj/ directory generated by mkall.sh. Change-Id: Ia706114d94e324ab443f6f5d6aa7c0c9f8a84620 Reviewed-on: https://go-review.googlesource.com/14192 Reviewed-by: Ian Lance Taylor --- unix/.gitignore | 1 + unix/mkall.sh | 6 +++--- unix/zsysnum_darwin_arm64.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 unix/.gitignore diff --git a/unix/.gitignore b/unix/.gitignore new file mode 100644 index 00000000..e4827159 --- /dev/null +++ b/unix/.gitignore @@ -0,0 +1 @@ +_obj/ diff --git a/unix/mkall.sh b/unix/mkall.sh index d41d6100..de95a4bb 100755 --- a/unix/mkall.sh +++ b/unix/mkall.sh @@ -116,12 +116,12 @@ _* | *_ | _) darwin_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32" - mksysnum="./mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; darwin_amd64) mkerrors="$mkerrors -m64" - mksysnum="./mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; darwin_arm) @@ -131,7 +131,7 @@ darwin_arm) ;; darwin_arm64) mkerrors="$mkerrors -m64" - mksysnum="./mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sys/syscall.h" + mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; dragonfly_386) diff --git a/unix/zsysnum_darwin_arm64.go b/unix/zsysnum_darwin_arm64.go index 39537d21..26677ebb 100644 --- a/unix/zsysnum_darwin_arm64.go +++ b/unix/zsysnum_darwin_arm64.go @@ -1,4 +1,4 @@ -// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sys/syscall.h +// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/include/sys/syscall.h // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT // +build arm64,darwin