Blame SOURCES/unzip-6.0-bzip2-configure.patch

623fdc
diff -up unzip60/unix/configure.bzip2-configure unzip60/unix/configure
623fdc
--- unzip60/unix/configure.bzip2-configure	2009-04-16 21:25:12.000000000 +0200
623fdc
+++ unzip60/unix/configure	2009-11-18 11:22:14.598389194 +0100
623fdc
@@ -640,7 +640,24 @@ else
623fdc
     D_USE_BZ2="-DUSE_BZIP2"
623fdc
     L_BZ2="${BZLF} -lbz2"
623fdc
   else
623fdc
-    echo "-- bzip2 sources not found - no bzip2 support"
623fdc
+    echo "  Check if OS already has bzip2 library installed"
623fdc
+    cat > conftest.c << _EOF_
623fdc
+#include "bzlib.h"
623fdc
+int main()
623fdc
+{
623fdc
+  bz_stream strm;
623fdc
+  BZ2_bzCompressEnd(&strm;;
623fdc
+  return 0;
623fdc
+}
623fdc
+_EOF_
623fdc
+    $CC $CFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
623fdc
+    if test $? -eq 0; then
623fdc
+      echo "-- OS supports bzip2 - linking in bzip2"
623fdc
+      D_USE_BZ2="-DUSE_BZIP2"
623fdc
+      L_BZ2="${BZLF} -lbz2"
623fdc
+    else
623fdc
+      echo "-- Either bzlib.h or libbz2.a not found - no bzip2"
623fdc
+    fi
623fdc
   fi
623fdc
 fi
623fdc
 
623fdc