Skip to content

Instantly share code, notes, and snippets.

@RyuKojiro
Last active June 13, 2016 05:34
Show Gist options
  • Save RyuKojiro/3a826a0af3293404cacae15a3ccd2f61 to your computer and use it in GitHub Desktop.
Save RyuKojiro/3a826a0af3293404cacae15a3ccd2f61 to your computer and use it in GitHub Desktop.
Quick and dirty script to do everything necessary to build and install just mtoc from the Apple cctools. Used for setting up an EFI development environment.
#!/bin/sh
# This is an alternative to following the instructions at https://github.com/tianocore/tianocore.github.io/wiki/Xcode
CCTOOLS=cctools-877.8
LLVM=llvm-3.0
curl -O http://opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
tar xvzf ${CCTOOLS}.tar.gz
rm ${CCTOOLS}.tar.gz
mv ${CCTOOLS}/include/llvm-c/Disassembler.h ${CCTOOLS}/Disassembler.backup.h
rmdir ${CCTOOLS}/include/llvm-c/
curl -O http://llvm.org/releases/3.0/${LLVM}.tar.gz
tar xvzf ${LLVM}.tar.gz
cp -r ${LLVM}.src/include/llvm ${LLVM}.src/include/llvm-c ${CCTOOLS}/include/
mv ${CCTOOLS}/Disassembler.backup.h ${CCTOOLS}/include/llvm-c/Disassembler.h
rm -rf ${LLVM}.src
cd ${CCTOOLS}
make
cd efitools
make
echo "This is the part where we install mdoc..."
sudo install mtoc.NEW /usr/local/bin/mtoc
cd ../..
rm -rf ${CCTOOLS} ${LLVM}.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment