build.sh 634 B

123456789101112131415
  1. #!/bin/sh
  2. USED_CC=${GCC:-${CC}}
  3. make install PREFIX=${PREFIX} CFLAGS="${CFLAGS}" CC="${USED_CC}"
  4. # build shared library
  5. if [[ ${target_platform} =~ .*linux*. ]]; then
  6. make -f Makefile-libbz2_so CFLAGS="${CFLAGS}" CC="${USED_CC}"
  7. ln -s libbz2.so.${PKG_VERSION} libbz2.so
  8. cp -d libbz2.so* ${PREFIX}/lib/
  9. elif [[ ${target_platform} == osx-64 ]]; then
  10. ${USED_CC} -shared -Wl,-install_name -Wl,libbz2.dylib -o libbz2.${PKG_VERSION}.dylib blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
  11. cp libbz2.${PKG_VERSION}.dylib ${PREFIX}/lib/
  12. ln -s libbz2.${PKG_VERSION}.dylib ${PREFIX}/lib/libbz2.dylib
  13. fi