From: Ruben Undheim <ruben.undheim@gmail.com>
Date: Sat, 4 Aug 2018 13:17:43 +0000
Subject: The library bzlib is included in the source and

 built as a convenience library. This patch prevents this from being
 built and links berkeley-abc with debian's bzlib library instead.
Forwarded: doesn't make sense upstream
===================================================================
---
 Makefile                   | 4 +++-
 src/base/io/ioReadAiger.c  | 2 +-
 src/base/io/ioWriteAiger.c | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git Makefile Makefile
index e0e8b8f..36b0f89 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ MODULES := \
 	src/map/mapper src/map/mio src/map/super src/map/if \
 	src/map/amap src/map/cov src/map/scl src/map/mpm \
 	src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/nm \
-	src/misc/vec src/misc/hash src/misc/tim src/misc/bzlib src/misc/zlib \
+	src/misc/vec src/misc/hash src/misc/tim src/misc/zlib \
 	src/misc/mem src/misc/bar src/misc/bbl src/misc/parse \
 	src/opt/cut src/opt/fxu src/opt/fxch src/opt/rwr src/opt/mfs src/opt/sim \
 	src/opt/ret src/opt/fret src/opt/res src/opt/lpk src/opt/nwk src/opt/rwt \
@@ -143,6 +143,8 @@ ifneq ($(findstring Darwin, $(shell uname)), Darwin)
    LIBS += -lrt
 endif
 
+LIBS += -lbz2
+
 ifdef ABC_USE_LIBSTDCXX
    LIBS += -lstdc++
    $(info $(MSG_PREFIX)Using explicit -lstdc++)
diff --git src/base/io/ioReadAiger.c src/base/io/ioReadAiger.c
index f87d971..4f0f6a3 100644
--- a/src/base/io/ioReadAiger.c
+++ b/src/base/io/ioReadAiger.c
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "misc/bzlib/bzlib.h"
+#include <bzlib.h>
 #include "misc/zlib/zlib.h"
 #include "ioAbc.h"
 
diff --git src/base/io/ioWriteAiger.c src/base/io/ioWriteAiger.c
index 0a68c7e..f0744c6 100644
--- a/src/base/io/ioWriteAiger.c
+++ b/src/base/io/ioWriteAiger.c
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "misc/bzlib/bzlib.h"
+#include <bzlib.h>
 #include "misc/zlib/zlib.h"
 #include "ioAbc.h"
 
