浏览代码

setup.py: bundled code vs system libs: use env vars we use anyway

these are already used internally when the build system can not find
a system library (neither via pkginfo nor BORG_LIBXXX_PREFIX is given)
and then triggers usage of the bundled code via these env vars.

now they are also used to tell right from the beginning "use the
bundled code" and in that case it will not try to locate system libs
and headers.
Thomas Waldmann 6 年之前
父节点
当前提交
7b27082a73
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. 11 6
      setup.py

+ 11 - 6
setup.py

@@ -24,14 +24,19 @@ import setup_compress
 import setup_crypto
 import setup_docs
 
-# True: use the shared liblz4 (>= 1.7.0 / r129) from the system, False: use the bundled lz4 code
-prefer_system_liblz4 = True
+# BORG_USE_BUNDLED_XXX=YES  -->  use the bundled code
+# BORG_USE_BUNDLED_XXX undefined  -->  try using system lib
+# Note: do not use =NO, that is not supported!
 
-# True: use the shared libzstd (>= 1.3.0) from the system, False: use the bundled zstd code
-prefer_system_libzstd = True
+# needed: lz4 (>= 1.7.0 / r129)
+prefer_system_liblz4 = not bool(os.environ.get('BORG_USE_BUNDLED_LZ4'))
+
+# needed: zstd (>= 1.3.0)
+prefer_system_libzstd = not bool(os.environ.get('BORG_USE_BUNDLED_ZSTD'))
+
+# needed: blake2 (>= 0.98.1)
+prefer_system_libb2 = not bool(os.environ.get('BORG_USE_BUNDLED_B2'))
 
-# True: use the shared libb2 (>= 0.98.1) from the system, False: use the bundled blake2 code
-prefer_system_libb2 = True
 
 cpu_threads = multiprocessing.cpu_count() if multiprocessing else 1