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

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