build 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. builddir=/var/tmp/build/[% project %]-[% c('version') %]
  4. distdir=/var/tmp/dist/[% project %]
  5. mkdir -p /var/tmp/dist
  6. tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %]
  7. tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
  8. tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %]
  9. # We don't export the path to clang here to follow Mozilla's build script at
  10. # taskcluster/scripts/misc/build-cctools-port.sh more closely.
  11. export PATH="/var/tmp/dist/cmake/bin:/var/tmp/dist/ninja:$PATH"
  12. export CLANG_DIR=/var/tmp/dist/clang
  13. mkdir -p /var/tmp/build
  14. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  15. export CC=$CLANG_DIR/bin/clang
  16. export CXX=$CLANG_DIR/bin/clang++
  17. # We also need this LD_LIBRARY_PATH at build time, since tapi builds bits of
  18. # clang build tools, and then executes those tools.
  19. export LD_LIBRARY_PATH=$CLANG_DIR/lib
  20. cd $builddir
  21. mkdir build
  22. cd build
  23. # Values taken from build.sh
  24. TAPI_REPOSITORY=tapi-1000.10.8
  25. TAPI_VERSION=10.0.0
  26. INCLUDE_FIX="-I $builddir/src/llvm/projects/clang/include -I $PWD/projects/clang/include"
  27. cmake $builddir/src/llvm \
  28. -GNinja \
  29. -DCMAKE_CXX_FLAGS="$INCLUDE_FIX" \
  30. -DLLVM_INCLUDE_TESTS=OFF \
  31. -DCMAKE_BUILD_TYPE=RELEASE \
  32. -DCMAKE_INSTALL_PREFIX=$distdir \
  33. -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
  34. -DTAPI_REPOSITORY_STRING=$TAPI_REPOSITORY \
  35. -DTAPI_FULL_VERSION=$TAPI_VERSION \
  36. -DPYTHON_EXECUTABLE=/usr/bin/python3
  37. ninja clangBasic
  38. ninja libtapi install-libtapi install-tapi-headers
  39. cd /var/tmp/dist
  40. [% c('tar', {
  41. tar_src => [ project ],
  42. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  43. }) %]