unzip-6.0-bzip2-configure.patch 780 B

1234567891011121314151617181920212223242526272829
  1. --- unzip60/unix/configure.orig 2009-04-16 16:25:12.000000000 -0300
  2. +++ unzip60/unix/configure 2017-05-14 18:53:49.000000000 -0300
  3. @@ -640,7 +640,24 @@
  4. D_USE_BZ2="-DUSE_BZIP2"
  5. L_BZ2="${BZLF} -lbz2"
  6. else
  7. - echo "-- bzip2 sources not found - no bzip2 support"
  8. + echo " Check if OS already has bzip2 library installed"
  9. + cat > conftest.c << _EOF_
  10. +#include "bzlib.h"
  11. +int main()
  12. +{
  13. + bz_stream strm;
  14. + BZ2_bzCompressEnd(&strm);
  15. + return 0;
  16. +}
  17. +_EOF_
  18. + $CC $CFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
  19. + if test $? -eq 0; then
  20. + echo "-- OS supports bzip2 - linking in bzip2"
  21. + D_USE_BZ2="-DUSE_BZIP2"
  22. + L_BZ2="${BZLF} -lbz2"
  23. + else
  24. + echo "-- Either bzlib.h or libbz2.a not found - no bzip2"
  25. + fi
  26. fi
  27. fi