compile-deps.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. self_dir=$(cd "$(dirname "$0")";pwd)
  3. function do_xml_compiler() {
  4. cd $self_dir/source/xz-* && \
  5. ./configure --enable-static=yes && \
  6. make -j$(cat /proc/cpuinfo | grep processor | wc -l) && \
  7. make install && \
  8. echo "xz compiled!" && \
  9. cd ../libxml2-* && \
  10. ./configure --prefix=/usr --with-lzma --without-python && \
  11. make -j$(cat /proc/cpuinfo | grep processor | wc -l) && \
  12. make install && \
  13. echo "libxml2 compiled!"
  14. }
  15. function do_libzip_compiler() {
  16. cd $self_dir/source/libzip-* && \
  17. mkdir build && \
  18. cd build && \
  19. cmake -DBUILD_SHARED_LIBS=no .. -Wno-dev -DENABLE_BZIP2=no -DENABLE_LZMA=no && \
  20. make LDFLAGS="-llzma -lbz2" -j$(cat /proc/cpuinfo | grep processor | wc -l) && \
  21. make install && \
  22. echo "libzip compiled!"
  23. }
  24. function do_curl_compiler() {
  25. cd $self_dir/source/curl-* && \
  26. CC=gcc CXX=g++ CFLAGS=-fPIC CPPFLAGS=-fPIC ./configure \
  27. --without-nghttp2 \
  28. --with-ssl=/usr \
  29. --with-pic=pic \
  30. --enable-ipv6 \
  31. --enable-shared=no \
  32. --without-libidn2 \
  33. --disable-ldap \
  34. --without-libpsl \
  35. --without-lber \
  36. --enable-ares && \
  37. make -j$(cat /proc/cpuinfo | grep processor | wc -l) && \
  38. make install && \
  39. echo "curl compiled!"
  40. }
  41. function do_iconv_compiler() {
  42. cd $self_dir/source/libiconv-* && \
  43. ./configure --enable-static=yes --prefix=/usr && \
  44. make -j$(cat /proc/cpuinfo | grep processor | wc -l) && \
  45. make install && \
  46. echo "libiconv compiled!"
  47. }
  48. if [ ! -f "$self_dir/source/.deps-compiled" ]; then
  49. source ${self_dir}/deps-modules/libmcrypt.sh
  50. source ${self_dir}/deps-modules/gmp.sh
  51. do_xml_compiler && \
  52. do_curl_compiler && \
  53. do_libzip_compiler && \
  54. do_iconv_compiler && \
  55. touch "$self_dir/source/.deps-compiled"
  56. else
  57. echo "Skip compilation for dependencies"
  58. fi