build 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. distdir=/var/tmp/dist/[% project %]
  4. mkdir -p /var/tmp/dist
  5. tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
  6. export PATH="/var/tmp/dist/cmake/bin:$PATH"
  7. [% IF c("var/linux") %]
  8. # We need a link to our GCC, otherwise the system cc gets used which points to
  9. # /usr/bin/gcc.
  10. [% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcc'),
  11. hardened_gcc => 0 }) %]
  12. ln -s gcc /var/tmp/dist/gcc/bin/cc
  13. [% END -%]
  14. mkdir -p /var/tmp/build
  15. cd /var/tmp/build
  16. tar -xf $rootdir/[% c('input_files_by_name/llvm') %]
  17. tar -xf $rootdir/[% c('input_files_by_name/cfe') %]
  18. tar -xf $rootdir/[% c('input_files_by_name/libcxx') %]
  19. tar -xf $rootdir/[% c('input_files_by_name/libcxxabi') %]
  20. mv cfe-* clang
  21. mv libcxx-* libcxx
  22. mv libcxxabi-* libcxxabi
  23. mv clang llvm-*/tools
  24. mv libcxx llvm-*/projects
  25. mv libcxxabi llvm-*/projects
  26. cd llvm-*
  27. export LLVM_HOME=$(pwd)
  28. mkdir build
  29. cd build
  30. cmake .. -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$distdir -DCMAKE_BUILD_TYPE:STRING=Release $LLVM_HOME
  31. make -j[% c("buildconf/num_procs") %]
  32. make install
  33. cd /var/tmp/dist
  34. [% c('tar', {
  35. tar_src => [ project ],
  36. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  37. }) %]