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