Guest User

Untitled

a guest
Nov 12th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # ---------------------------------------------------------------------------------------------------------
  4. # place as many old macOS SDKs into the directory with this script e.g. if you have
  5. #
  6. # my-macpro:SDKs natb$ ls -ahl
  7. # total 4254792
  8. # drwxr-xr-x 17 natb admin 578B Nov 21 2017 .
  9. # drwxrwxr-x 24 root admin 884B Aug 29 06:46 ..
  10. # drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.10.sdk
  11. # drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.11.sdk
  12. # drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.12.sdk
  13. # drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.13.sdk
  14. # drwxr-xr-x 7 natb admin 238B Oct 17 2017 MacOSX10.6.sdk
  15. # drwxr-xr-x 7 natb admin 238B Oct 17 2017 MacOSX10.7.sdk
  16. # drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.8.sdk
  17. # drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.9.sdk
  18. #
  19. # then run it to allow your current version of Xcode is to have access to SDKs back to 10.6
  20. # tested with Xcode 8.x - 9.4.x. Works with Xcode 10, but Xcode 10 will not support 32-bit targets
  21. # and complains indefinitely for 9.4.x and higher. I suggest 9.2.x as your stopping point if
  22. # you plan to build universal/fat binaries that can run pre-10.14
  23. # this same tactic works for iOS and tvOS SDKs.
  24. # ---------------------------------------------------------------------------------------------------------
  25.  
  26. SDK_DIR="$(cd $(dirname $0) && echo $PWD)"
  27.  
  28. OSX_PLAT=`xcrun --sdk macosx --show-sdk-platform-path`
  29. OSX_SDK=$OSX_PLAT/Developer/SDKs
  30.  
  31. pushd "$OSX_SDK"
  32.  
  33. # this links
  34. sudo ln -sfn "$SDK_DIR"/* .
  35.  
  36. # this is a magic tweak for an ommission in the 10.9 SDK which can trip you up
  37. if [ -e "$SDK_DIR/MacOSX10.10.sdk/usr/lib/crt1.10.6.o" -a ! -e "$SDK_DIR/MacOSX10.9.sdk/usr/lib/crt1.10.6.o" ]
  38. then
  39. cp "$SDK_DIR/MacOSX10.10.sdk/usr/lib/crt1.10.6.o" "$SDK_DIR/MacOSX10.9.sdk/usr/lib/"
  40. fi
  41.  
  42. popd
  43.  
  44. # this is the magic tweak to Info.plist to enable older SDKs that you have symlink'd in
  45. sudo plutil -replace MinimumSDKVersion -string 10.6 "$OSX_PLAT"/Info.plist
Add Comment
Please, Sign In to add comment