[tor-commits] [orbot/master] Add lzma and zstd

n8fr8 at torproject.org n8fr8 at torproject.org
Thu Dec 7 17:55:22 UTC 2017


commit 9ca36e1bffd618cfe7362499ba95c6fa6fda8fd3
Author: goapunk <noobie at goapunks.net>
Date:   Wed Nov 8 15:52:38 2017 +0100

    Add lzma and zstd
    
    Signed-off-by: goapunk <noobie at goapunks.net>
---
 .gitmodules       |  8 ++++++++
 external/Makefile | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 external/xz       |  1 +
 external/zstd     |  1 +
 4 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/.gitmodules b/.gitmodules
index 6cd626ac..d8f0459a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -34,3 +34,11 @@
 	path = external/jsocks
 	url = https://github.com/guardianproject/jsocks.git
 	ignore = dirty
+[submodule "external/zstd"]
+	path = external/zstd
+	url = https://github.com/facebook/zstd.git
+	ignore = dirty
+[submodule "external/xz"]
+	path = external/xz
+	url = https://git.tukaani.org/xz.git
+	ignore = dirty
diff --git a/external/Makefile b/external/Makefile
index 3d05250b..0c7b52b1 100644
--- a/external/Makefile
+++ b/external/Makefile
@@ -101,6 +101,8 @@ endif
 	assets assets-clean \
 	openssl-static openssl-static-clean \
 	libevent libevent-clean \
+	lzma lzma-clean \
+	zstd zstd-clean \
 	tor tor-clean \
 	polipo polipo-clean
 
@@ -191,7 +193,57 @@ libevent-clean:
 	-rm -f libevent-build-stamp
 	-cd libevent && \
 		git clean -fdx
+#------------------------------------------------------------------------------#
+# lzma
+
+xz/Makefile:
+	cd xz && ./autogen.sh
+	cp config.sub xz
+	cp config.guess xz
+	cd xz && \
+		 CC="$(CC)" CXX="$(CXX)" PKG_CONFIG_PATH="$(EXTERNAL_ROOT)/lib/pkgconfig" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(CFLAGS) -std=c99" LDFLAGS="$(LDFLAGS)"  \
+		./configure  --host=$(HOST) --disable-shared --enable-static --disable-doc --disable-xz --disable-xzdec --disable-lzmadec --disable-lzmainfo --disable-lzma-links --disable-scripts --prefix=$(EXTERNAL_ROOT)
+
+lzma: lzma-build-stamp
+	$(MAKE) -C xz install
+
+lzma-build-stamp: xz/Makefile
+	touch lzma-build-stamp
+
+lzma-clean:
+	-rm -rf include/lzma
+	-rm -f include/lzma.h
+	-rm -f lib/liblzma.a
+	-rm -f lib/liblzma.la
+	-rm -f lzma-build-stamp
+	-cd xz && \
+		git clean -fdx
+#------------------------------------------------------------------------------#
+# zstd
 
+zstd: zstd-build-stamp
+	$(MAKE) -C zstd/lib CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(CFLAGS)"  LDFLAGS="$(LDFLAGS)" PREFIX="$(EXTERNAL_ROOT)" libzstd.a-mt 
+	$(MAKE) -C zstd/lib CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(CFLAGS)"  LDFLAGS="$(LDFLAGS)" PREFIX="$(EXTERNAL_ROOT)" libzstd.pc 
+	test -d lib || mkdir lib
+	test -d lib/pkgconfig || mkdir lib/pkgconfig
+	test -d include || mkdir include
+	cp zstd/lib/libzstd.a lib
+	cp zstd/lib/libzstd.pc lib/pkgconfig
+	cp zstd/lib/zstd.h include
+	cp zstd/lib/common/zstd_errors.h include
+	cp zstd/lib/deprecated/zbuff.h include
+	cp zstd/lib/dictBuilder/zdict.h include
+
+zstd-build-stamp:
+	touch zstd-build-stamp
+
+zstd-clean:
+	-rm -f include/zstd.h include/zstd_errors.h include/zbuff.h include/zdict.h
+	-rm -f lib/libzstd.a
+	-rm -f lib/pkgconfig/libzstd.pc
+	-rm -f zstd-build-stamp
+	-cd zstd && \
+		git clean -fdx
 #------------------------------------------------------------------------------#
 # tor
 
@@ -216,14 +268,13 @@ tor/Makefile: tor/configure
 				--disable-asciidoc \
 				--enable-static-libevent --with-libevent-dir=$(EXTERNAL_ROOT) \
 				--enable-static-openssl --with-openssl-dir=$(EXTERNAL_ROOT) \
-				--disable-linker-hardening --disable-gcc-hardening --disable-tool-name-check \
-				--disable-lzma --disable-zstd
+				--disable-linker-hardening --disable-gcc-hardening --disable-tool-name-check --disable-systemd
 
 tor-build-stamp: tor/Makefile
 	$(MAKE) -C tor all-am
 	touch tor-build-stamp
 
-tor: libevent openssl tor-build-stamp
+tor: lzma zstd libevent openssl tor-build-stamp
 	test -d bin || mkdir bin
 	cp tor/src/or/tor bin
 
@@ -298,7 +349,7 @@ assets-clean:
 # cleanup, cleanup, put the toys away
 
 ##clean: openssl-clean libevent-clean tor-clean polipo-clean assets-clean
-clean: openssl-clean libevent-clean tor-clean polipo-clean pluto-clean
+clean: openssl-clean libevent-clean lzma-clean zstd-clean tor-clean polipo-clean pluto-clean
 
 #------------------------------------------------------------------------------#
 # debugging stuff
diff --git a/external/xz b/external/xz
new file mode 160000
index 00000000..3d566cd5
--- /dev/null
+++ b/external/xz
@@ -0,0 +1 @@
+Subproject commit 3d566cd519017eee1a400e7961ff14058dfaf33c
diff --git a/external/zstd b/external/zstd
new file mode 160000
index 00000000..f4340f46
--- /dev/null
+++ b/external/zstd
@@ -0,0 +1 @@
+Subproject commit f4340f46b2387bc8de7d5320c0b83bb1499933ad





More information about the tor-commits mailing list