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

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