diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000000000000000000000000000000000..85c75f4e6fc5e9aef079b963317baa8bfe649a02
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "compll"]
+	path = compll
+	url = git://g.blicky.net/compll.git/
diff --git a/compll b/compll
new file mode 160000
index 0000000000000000000000000000000000000000..f089f64220c1a41532853c5e4ee17daa8f40b2ff
--- /dev/null
+++ b/compll
@@ -0,0 +1 @@
+Subproject commit f089f64220c1a41532853c5e4ee17daa8f40b2ff
diff --git a/configure.in b/configure.in
index c4ee13e3e33371764904ca32e0ff8226580c5924..d350e0da0208ecb53db2a2052bd0af069ca0e56b 100644
--- a/configure.in
+++ b/configure.in
@@ -18,6 +18,8 @@ AC_CHECK_HEADERS(
 AC_TYPE_OFF_T
 AC_SYS_LARGEFILE
 AC_STRUCT_ST_BLOCKS
+AC_CHECK_TYPE([unsigned long long], [],
+              [AC_MSG_ERROR([your compiler does not have an unsigned long long type.])])
 
 # Check for library functions.
 AC_CHECK_FUNCS(
@@ -47,6 +49,28 @@ AC_CHECK_LIB([$ncurses],
 
 
 
+# compll configuration (only zlib is supported currently)
+compll=no
+AC_ARG_WITH([compll],
+            AC_HELP_STRING([--with-compll=zlib], [use zlib for in-memory compression (experimental)]),
+            [compll=$withval])
+if test "x$compll" != "xno"; then
+  AC_CHECK_LIB([z],
+               [zlibVersion],
+               [AC_CHECK_HEADER([zlib.h], [LIBS="$LIBS -lz"; compll=zlib],
+                                [if test "x$compll" = "xauto"; then compll=no
+                                 else AC_MSG_ERROR([--with-compll is given, but zlib.h could not be found]); fi])
+               ],
+               [if test "x$compll" = "xauto"; then compll=no
+                else AC_MSG_ERROR([--with-compll is given, but no zlib library could not be found]); fi])
+fi
+if test "x$compll" = "xno"; then
+  AC_DEFINE([COMPLL_NOLIB], [1], [don't use compll])
+fi
+AM_CONDITIONAL([COMPLL], [test "x$compll" != "xno"])
+
+
+
 AC_OUTPUT([Makefile src/Makefile doc/Makefile])
 
 echo ""
diff --git a/src/Makefile.am b/src/Makefile.am
index 3047a5ef5d30ffac9b9bfca3f7c0eda86633ce2e..698d5eb43139003ac9e3269bbaeb995992f7c418 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,8 @@
 bin_PROGRAMS = ncdu
 
 ncdu_SOURCES = browser.c calc.c delete.c dirlist.c exclude.c help.c main.c path.c util.c
+if COMPLL
+ncdu_SOURCES += compll.c
+endif
 
-noinst_HEADERS = browser.h calc.h delete.h dirlist.h exclude.h global.h help.h path.h util.h
+noinst_HEADERS = browser.h compll.h calc.h delete.h dirlist.h exclude.h global.h help.h path.h util.h
diff --git a/src/compll.c b/src/compll.c
new file mode 120000
index 0000000000000000000000000000000000000000..60ae19380d6c07b191970db989fee9ee07608630
--- /dev/null
+++ b/src/compll.c
@@ -0,0 +1 @@
+../compll/compll.c
\ No newline at end of file
diff --git a/src/compll.h b/src/compll.h
new file mode 120000
index 0000000000000000000000000000000000000000..042557979b636204a0740e4f5d8da872fc9f311a
--- /dev/null
+++ b/src/compll.h
@@ -0,0 +1 @@
+../compll/compll.h
\ No newline at end of file