Friday, February 26, 2010

LLVM build on MinGW

building llvm-2.6

  1. download and install MinGW
  2. download and install cmake
  3. download llvm
  4. tar xvzf llvm-2.6.tar.gz
  5. mkdir llvm-cmake
  6. cd llvm-cmake
  7. cmake -G "MinGW Makefiles" ..\llvm-2.6
  8. it'll fail
  9. open CMakeCache.txt
  10. write CMAKE_C_COMPILER_ENVVAR:FILEPATH=C:/MinGW/bin/gcc.exe
  11. cmake -G "MinGW Makefiles" ..\llvm-2.6
  12. mingw32-make

For llvm 2.7,

  1. unzip llvm-2.7
  2. unzip clang source under llvm-27/tools/clang
  3. cd llvm-cmake
  4. cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="/home/opt/llvm" ..\llvm-2.7
  5. mingw32-make DESTDIR=C: install

Tuesday, February 16, 2010

v8 on mingw

  1. install python
  2. install scons
  3. install svn
  4. checkout v8 svn checkout http://v8.googlecode.com/svn/trunk/ v8
  5. edit Sconstruct and comment out -Werror (maybe there's a way to disable it from command line) vim v8/SConstruct
  6. cd v8
  7. scons
  8. g++ -Iinclude samples\shell.cc libv8.a -lwinmm -lws2_32 -o v8.exe