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

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