Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 18th, 2012  |  syntax: None  |  size: 1.97 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. #
  4. #  xcodeがなんやかんやなせいなのか、動かなくなっちゃいました(ゝω・)v
  5. #
  6.  
  7. #
  8. #  Run this shell script on Mac OS X *Lion*.
  9. #  I referred to http://osx86.boeaja.info/2009/10/building-xnu-kernel-on-snow-leopard/
  10. #  You can download XNU kernel source code from http://www.opensource.apple.com/tarballs/xnu/
  11. #
  12.  
  13. cd /tmp
  14. mkdir prepare_env_for_build_xnu
  15. cd prepare_env_for_build_xnu
  16.  
  17. #
  18. #  Download tarballs
  19. #
  20.  
  21. curl -O http://www.opensource.apple.com/tarballs/cxxfilt/cxxfilt-9.tar.gz
  22. curl -O http://www.opensource.apple.com/tarballs/dtrace/dtrace-90.tar.gz
  23. curl -O http://www.opensource.apple.com/tarballs/kext_tools/kext_tools-252.2.tar.gz
  24. curl -O http://www.opensource.apple.com/tarballs/bootstrap_cmds/bootstrap_cmds-80.tar.gz
  25.  
  26.  
  27. #
  28. #  Extract tarballs
  29. #
  30.  
  31. tar xf cxxfilt-9.tar.gz
  32. tar xf dtrace-90.tar.gz
  33. tar xf kext_tools-252.2.tar.gz
  34. tar xf bootstrap_cmds-80.tar.gz
  35.  
  36.  
  37. #
  38. #  Build and Install softwares
  39. #
  40.  
  41. cd cxxfilt-9
  42. mkdir -p obj sym dst
  43. make install RC_ARCHS="i386 x86_64" RC_CFLAGS="-arch i386 -arch x86_64 -pipe" \
  44.              RC_OS=macos RC_RELEASE=Lion SRCROOT=$PWD \
  45.              OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
  46. sudo ditto $PWD/dst/usr/local /usr/local
  47. cd ..
  48.  
  49. cd dtrace-90
  50. mkdir -p obj sym dst
  51. xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge \
  52.                    ARCHS="i386 x86_64" \
  53.                    SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
  54. sudo ditto $PWD/dst/usr/local /usr/local
  55. cd ..
  56.  
  57. cd kext_tools-252.2
  58. mkdir -p obj sym dst
  59. xcodebuild install -target kextsymboltool -target setsegname \
  60.                    ARCHS="i386 x86_64" \
  61.                    SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
  62. sudo ditto $PWD/dst/usr/local /usr/local
  63. cd ..
  64.  
  65. cd bootstrap_cmds-80
  66. make install RC_ARCHS="i386" RC_CFLAGS="-arch i386 -pipe" RC_OS=macos RC_RELEASE=Lion \
  67.              SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst
  68. sudo ditto $PWD/dst/usr/local /usr/local
  69.  
  70. echo "Done"