build 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  4. distdir=/var/tmp/dist/[% project %]
  5. mkdir -p /var/tmp/build
  6. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  7. cd /var/tmp/build/[% project %]-[% c('version') %]
  8. [% IF c("var/osname") == "linux-i686" -%]
  9. export CC='gcc -m32'
  10. [% END %]
  11. [% IF c("var/osx") -%]
  12. # Tricking OpenSSL into using our clang as cross-compiler
  13. ln -s $clangdir/bin/clang $clangdir/bin/x86_64-apple-darwin11-cc
  14. export CC="cc [% c("var/FLAGS") %]"
  15. [% END -%]
  16. [% IF c("var/windows") -%]
  17. patch -p1 < $rootdir/use-SOURCE_DATE_EPOCH.patch
  18. [% END -%]
  19. # OpenSSL expects the NDK home to include the pre-assembled architecture directory
  20. [% IF c("var/android") -%]
  21. export ANDROID_NDK_HOME=$ANDROID_NDK_HOME/[% c("var/toolchain_arch") %]
  22. [% END -%]
  23. export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
  24. ./Configure [% c('var/configure_opts') %]
  25. make
  26. make DESTDIR="$distdir" install
  27. cd /var/tmp/dist
  28. ln -s '[% c("var/openssldir") %]' openssl/openssl
  29. [% c('tar', {
  30. tar_src => [ project ],
  31. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  32. }) %]