|
|
|
@ -1,15 +1,15 @@
|
|
|
|
|
From dfbd6b8c91aa8f35eef5afa6593b8ef06ce2bfe1 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 94271fbfcdafac911bfa9ec7bdfee7c33f6423c4 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Fabio Valentini <decathorpe@gmail.com>
|
|
|
|
|
Date: Thu, 23 Feb 2023 18:50:32 +0100
|
|
|
|
|
Date: Tue, 1 Aug 2023 15:13:34 +0200
|
|
|
|
|
Subject: [PATCH] unconditionally use bindgen and pkg-config to link against
|
|
|
|
|
system libzstd
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
build.rs | 218 +------------------------------------------------------
|
|
|
|
|
1 file changed, 3 insertions(+), 215 deletions(-)
|
|
|
|
|
build.rs | 210 +------------------------------------------------------
|
|
|
|
|
1 file changed, 3 insertions(+), 207 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/build.rs b/build.rs
|
|
|
|
|
index 04fb94f..44f36b0 100644
|
|
|
|
|
index a77a10e..e748b4b 100644
|
|
|
|
|
--- a/build.rs
|
|
|
|
|
+++ b/build.rs
|
|
|
|
|
@@ -1,8 +1,6 @@
|
|
|
|
@ -33,7 +33,7 @@ index 04fb94f..44f36b0 100644
|
|
|
|
|
fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
|
|
|
|
|
let library = pkg_config::Config::new()
|
|
|
|
|
.statik(true)
|
|
|
|
|
@@ -47,189 +42,6 @@ fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
|
|
|
|
|
@@ -47,31 +42,6 @@ fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
|
|
|
|
|
(vec!["PKG_CONFIG"], library.include_paths)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,19 +62,13 @@ index 04fb94f..44f36b0 100644
|
|
|
|
|
-#[cfg(not(feature = "zstdmt"))]
|
|
|
|
|
-fn enable_threading(_config: &mut cc::Build) {}
|
|
|
|
|
-
|
|
|
|
|
-/// This function would find the first flag in `flags` that is supported
|
|
|
|
|
-/// and add that to `config`.
|
|
|
|
|
-#[allow(dead_code)]
|
|
|
|
|
-fn flag_if_supported_with_fallbacks(config: &mut cc::Build, flags: &[&str]) {
|
|
|
|
|
- let option = flags
|
|
|
|
|
- .iter()
|
|
|
|
|
- .find(|flag| config.is_flag_supported(flag).unwrap_or_default());
|
|
|
|
|
-
|
|
|
|
|
- if let Some(flag) = option {
|
|
|
|
|
- config.flag(flag);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/// This function would find the first flag in `flags` that is supported
|
|
|
|
|
/// and add that to `config`.
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
|
@@ -85,156 +55,6 @@ fn flag_if_supported_with_fallbacks(config: &mut cc::Build, flags: &[&str]) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-fn compile_zstd() {
|
|
|
|
|
- let mut config = cc::Build::new();
|
|
|
|
|
-
|
|
|
|
@ -118,10 +112,15 @@ index 04fb94f..44f36b0 100644
|
|
|
|
|
- config.file("zstd/lib/decompress/huf_decompress_amd64.S");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let is_wasm = env::var("TARGET")
|
|
|
|
|
- .map_or(false, |target| target.starts_with("wasm32-"));
|
|
|
|
|
- // List out the WASM targets that need wasm-shim.
|
|
|
|
|
- // Note that Emscripten already provides its own C standard library so
|
|
|
|
|
- // wasm32-unknown-emscripten should not be included here.
|
|
|
|
|
- // See: https://github.com/gyscos/zstd-rs/pull/209
|
|
|
|
|
- let need_wasm_shim = env::var("TARGET").map_or(false, |target| {
|
|
|
|
|
- target == "wasm32-unknown-unknown" || target == "wasm32-wasi"
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if is_wasm {
|
|
|
|
|
- if need_wasm_shim {
|
|
|
|
|
- cargo_print(&"rerun-if-changed=wasm-shim/stdlib.h");
|
|
|
|
|
- cargo_print(&"rerun-if-changed=wasm-shim/string.h");
|
|
|
|
|
-
|
|
|
|
@ -223,7 +222,7 @@ index 04fb94f..44f36b0 100644
|
|
|
|
|
/// Print a line for cargo.
|
|
|
|
|
///
|
|
|
|
|
/// If non-cargo is set, do not print anything.
|
|
|
|
|
@@ -242,32 +54,8 @@ fn cargo_print(content: &dyn fmt::Display) {
|
|
|
|
|
@@ -247,32 +67,8 @@ fn cargo_print(content: &dyn fmt::Display) {
|
|
|
|
|
fn main() {
|
|
|
|
|
cargo_print(&"rerun-if-env-changed=ZSTD_SYS_USE_PKG_CONFIG");
|
|
|
|
|
|
|
|
|
@ -258,5 +257,5 @@ index 04fb94f..44f36b0 100644
|
|
|
|
|
let includes: Vec<_> = headerpaths
|
|
|
|
|
.iter()
|
|
|
|
|
--
|
|
|
|
|
2.39.2
|
|
|
|
|
2.41.0
|
|
|
|
|
|
|
|
|
|