diff --git a/build_tor_linux.py b/build_tor_linux.py index a7b8c5f683c9d57de00fb1216c03723eef8eed05..ab1fe8f846b470028d130f3e1d9f34f2c649498a 100755 --- a/build_tor_linux.py +++ b/build_tor_linux.py @@ -50,15 +50,6 @@ def build_linux_arch(arch, gcc_arch, cc_env, openssl_target, autogen_host, versi env['LIBS'] = "-ldl -L%s" % lib_dir env['CC'] = cc_env - # build lzma - xz_dir = os.path.join(BUILD_DIR, 'xz') - check_call(['./autogen.sh'], cwd=xz_dir) - check_call(['./configure', - '--prefix=%s' % prefix_dir, - '--host=%s' % autogen_host, - ] + XZ_CONFIGURE_FLAGS, cwd=xz_dir, env=env) - check_call(['make', '-j', str(os.cpu_count()), 'install'], cwd=xz_dir, env=env) - # build zlib zlib_dir = os.path.join(BUILD_DIR, 'zlib') check_call(['./configure', '--prefix=%s' % prefix_dir], cwd=zlib_dir, env=env) @@ -74,7 +65,7 @@ def build_linux_arch(arch, gcc_arch, cc_env, openssl_target, autogen_host, versi '--openssldir=%s' % prefix_dir, '-march=%s' % gcc_arch, openssl_target, - 'shared', + 'shared', # TODO remove more things not needed, see tor-build/Makefile ] + OPENSSL_CONFIGURE_FLAGS + extra_flags, cwd=openssl_dir, env=env) check_call(['make', '-j', str(os.cpu_count())], cwd=openssl_dir, env=env) check_call(['make', 'install_sw'], cwd=openssl_dir, env=env) @@ -96,13 +87,14 @@ def build_linux_arch(arch, gcc_arch, cc_env, openssl_target, autogen_host, versi check_call(['./configure', '--host=%s' % autogen_host, '--prefix=%s' % prefix_dir, - '--enable-lzma', + '--enable-zstd', '--enable-static-zlib', '--with-zlib-dir=%s' % prefix_dir, '--enable-static-libevent', '--with-libevent-dir=%s' % prefix_dir, '--enable-static-openssl', '--with-openssl-dir=%s' % prefix_dir, + '--disable-lzma', ] + TOR_CONFIGURE_FLAGS, cwd=tor_dir, env=env) check_call(['make', '-j', str(os.cpu_count()), 'install'], cwd=tor_dir, env=env) diff --git a/build_tor_windows.py b/build_tor_windows.py index 9a2f219f6eaf610af38eede133d1c51285e6e559..bb2e16dff084dfe26da4e43cf19c73368be0f5f0 100755 --- a/build_tor_windows.py +++ b/build_tor_windows.py @@ -46,15 +46,6 @@ def build_windows_arch(arch, host, versions): env['PKG_CONFIG_PATH'] = os.path.join(lib_dir, 'pkgconfig') # needed to find OpenSSL env['CHOST'] = host - # build lzma - xz_dir = os.path.join(BUILD_DIR, 'xz') - check_call(['./autogen.sh'], cwd=xz_dir) - check_call(['./configure', - '--prefix=%s' % prefix_dir, - '--host=%s' % host, - ] + XZ_CONFIGURE_FLAGS, cwd=xz_dir, env=env) - check_call(['make', '-j', str(os.cpu_count()), 'install'], cwd=xz_dir, env=env) - # build zlib zlib_dir = os.path.join(BUILD_DIR, 'zlib') check_call(['make', '-j', str(os.cpu_count()), '-f', 'win32/Makefile.gcc', 'BINARY_PATH=%s/bin' % prefix_dir, @@ -73,7 +64,7 @@ def build_windows_arch(arch, host, versions): '--openssldir=%s' % prefix_dir, # '-static', # https://github.com/openssl/openssl/issues/14574 '-static-libgcc', - 'no-shared', + 'no-shared', # TODO remove more things not needed, see tor-build/Makefile 'enable-ec_nistp_64_gcc_128', ] + OPENSSL_CONFIGURE_FLAGS, cwd=openssl_dir, env=env) check_call(['make', '-j', str(os.cpu_count())], cwd=openssl_dir, env=env) @@ -103,13 +94,14 @@ def build_windows_arch(arch, host, versions): check_call(['./configure', '--host=%s' % host, '--prefix=%s' % prefix_dir, - '--enable-lzma', + '--enable-zstd', '--enable-static-zlib', '--with-zlib-dir=%s' % prefix_dir, '--enable-static-libevent', '--with-libevent-dir=%s' % prefix_dir, '--enable-static-openssl', '--with-openssl-dir=%s' % prefix_dir, + '--disable-lzma', ] + TOR_CONFIGURE_FLAGS, cwd=tor_dir, env=env) check_call(['make', '-j', str(os.cpu_count())], cwd=tor_dir, env=env) check_call(['make', 'install'], cwd=tor_dir, env=env) diff --git a/tor-build/Makefile b/tor-build/Makefile index c17384320c227b33de6b50f646256edfe3703ce1..f7160c4e820ee957d8f61d2c16115e5d6413cd89 100644 --- a/tor-build/Makefile +++ b/tor-build/Makefile @@ -98,7 +98,6 @@ INSTALL_DIR := $(EXTERNAL_ROOT)/lib/$(APP_ABI) .PHONY = clean showsetup \ openssl-clean \ libevent-clean \ - lzma-clean \ tor tor-clean all: test-setup tor @@ -181,40 +180,6 @@ libevent-clean: -cd libevent && \ git clean -fdx > /dev/null - -#------------------------------------------------------------------------------# -# lzma - -xz/Makefile: xz/configure.ac xz/Makefile.am - cd xz && ./autogen.sh - cd xz && ./configure \ - --host=$(HOST) \ - --enable-static \ - --disable-doc \ - --disable-lzma-links \ - --disable-lzmadec \ - --disable-lzmainfo \ - --disable-scripts \ - --disable-shared \ - --disable-xz \ - --disable-xzdec \ - --prefix=/ - -lzma-build-stamp: xz/Makefile - $(MAKE) -C xz install DESTDIR=$(EXTERNAL_ROOT) - touch $@ - -lzma-clean: - -$(MAKE) -C xz uninstall DESTDIR=$(EXTERNAL_ROOT) - -$(MAKE) -C xz 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 > /dev/null - #------------------------------------------------------------------------------# # tor @@ -225,10 +190,12 @@ tor/Makefile: tor/configure.ac tor/Makefile.am ./configure \ --host=$(ALTHOST) \ --enable-android \ - --enable-lzma \ --enable-pic \ --enable-static-libevent --with-libevent-dir=$(EXTERNAL_ROOT) \ --enable-static-openssl --with-openssl-dir=$(EXTERNAL_ROOT) \ + --enable-static-zlib --with-zlib-dir=$(EXTERNAL_ROOT) \ + --enable-zstd \ + --disable-lzma \ --disable-module-dirauth \ --disable-module-relay \ --disable-unittests \ @@ -245,7 +212,7 @@ tor-build-stamp: tor/Makefile $(NDK_TOOLCHAIN_BASE)/bin/$(ALTHOST)-strip -D $(OUTPUT_FILE) touch $@ -tor: lzma-build-stamp libevent-build-stamp openssl-build-stamp tor-build-stamp +tor: libevent-build-stamp openssl-build-stamp tor-build-stamp tor-clean: -rm -f $(OUTPUT_FILE) @@ -257,7 +224,7 @@ tor-clean: #------------------------------------------------------------------------------# # cleanup, cleanup, put the toys away -clean: openssl-clean libevent-clean lzma-clean tor-clean +clean: openssl-clean libevent-clean tor-clean #------------------------------------------------------------------------------# diff --git a/tor-versions.json b/tor-versions.json index c6e1e4e14a10b08d97b80b6e74edcc87be42aee5..b01e29ed7d0b65fec6b4be086f936304355968fc 100644 --- a/tor-versions.json +++ b/tor-versions.json @@ -12,10 +12,6 @@ "url": "https://github.com/openssl/openssl.git", "commit": "openssl-3.5.0" }, - "xz": { - "url": "https://git.tukaani.org/xz.git", - "commit": "v5.6.4" - }, "zlib": { "url": "https://github.com/madler/zlib.git", "commit": "v1.3.1" diff --git a/utils.py b/utils.py index f6a71afbd312ed140ce203c5e3d9eb3ea0220a88..b3cd612b613af8bd5db90c9d383c0dc5ae35acca 100644 --- a/utils.py +++ b/utils.py @@ -83,7 +83,6 @@ def prepare_repos(versions): prepare_repo(os.path.join(BUILD_DIR, "tor"), versions['tor']['url'], versions['tor']['commit']) prepare_repo(os.path.join(BUILD_DIR, "libevent"), versions['libevent']['url'], versions['libevent']['commit']) prepare_repo(os.path.join(BUILD_DIR, "openssl"), versions['openssl']['url'], versions['openssl']['commit']) - prepare_repo(os.path.join(BUILD_DIR, "xz"), versions['xz']['url'], versions['xz']['commit']) prepare_repo(os.path.join(BUILD_DIR, "zlib"), versions['zlib']['url'], versions['zlib']['commit'])