|
|
|
@ -1,19 +1,19 @@
|
|
|
|
|
From 7d6c389b4f3330696e737110bbb9f7c38101da55 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From b2c370ea75648dd768ed3605430e45b9c841267e Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Fabio Valentini <decathorpe@gmail.com>
|
|
|
|
|
Date: Wed, 10 Jan 2024 17:12:19 +0100
|
|
|
|
|
Date: Fri, 17 May 2024 21:30:52 +0200
|
|
|
|
|
Subject: [PATCH] unconditionally use pkg-config to link with system zlib
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
build.rs | 197 ++-------------------------------------------------
|
|
|
|
|
build_zng.rs | 60 ----------------
|
|
|
|
|
2 files changed, 4 insertions(+), 253 deletions(-)
|
|
|
|
|
build.rs | 209 +--------------------------------------------------
|
|
|
|
|
build_zng.rs | 60 ---------------
|
|
|
|
|
2 files changed, 4 insertions(+), 265 deletions(-)
|
|
|
|
|
delete mode 100644 build_zng.rs
|
|
|
|
|
|
|
|
|
|
diff --git a/build.rs b/build.rs
|
|
|
|
|
index 1368a12..8d1acf7 100644
|
|
|
|
|
index e00ae65..8d1acf7 100644
|
|
|
|
|
--- a/build.rs
|
|
|
|
|
+++ b/build.rs
|
|
|
|
|
@@ -1,198 +1,9 @@
|
|
|
|
|
@@ -1,210 +1,9 @@
|
|
|
|
|
-use std::env;
|
|
|
|
|
-use std::fs;
|
|
|
|
|
-use std::path::PathBuf;
|
|
|
|
@ -51,7 +51,16 @@ index 1368a12..8d1acf7 100644
|
|
|
|
|
- .print_system_libs(false)
|
|
|
|
|
- .probe("zlib");
|
|
|
|
|
- match zlib {
|
|
|
|
|
- Ok(_) => return,
|
|
|
|
|
- Ok(zlib) => {
|
|
|
|
|
- if !zlib.include_paths.is_empty() {
|
|
|
|
|
- let paths = zlib
|
|
|
|
|
- .include_paths
|
|
|
|
|
- .iter()
|
|
|
|
|
- .map(|s| s.display().to_string())
|
|
|
|
|
- .collect::<Vec<_>>();
|
|
|
|
|
- println!("cargo:include={}", paths.join(","));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- Err(e) => {
|
|
|
|
|
- println!("cargo-warning={}", e.to_string())
|
|
|
|
|
- }
|
|
|
|
@ -83,11 +92,10 @@ index 1368a12..8d1acf7 100644
|
|
|
|
|
- // Apple platforms have libz.1.dylib, and it's usually available even when
|
|
|
|
|
- // cross compiling (via fat binary or in the target's Xcode SDK)
|
|
|
|
|
- let cross_compiling = target != host;
|
|
|
|
|
- let apple_to_apple = host.contains("-apple-") && target.contains("-apple-");
|
|
|
|
|
- if target.contains("msvc")
|
|
|
|
|
- || target.contains("pc-windows-gnu")
|
|
|
|
|
- || want_static
|
|
|
|
|
- || (cross_compiling && !apple_to_apple)
|
|
|
|
|
- || (cross_compiling && !target.contains("-apple-"))
|
|
|
|
|
- {
|
|
|
|
|
- return build_zlib(&mut cfg, &target);
|
|
|
|
|
- }
|
|
|
|
@ -205,7 +213,11 @@ index 1368a12..8d1acf7 100644
|
|
|
|
|
-
|
|
|
|
|
-fn zlib_installed(cfg: &mut cc::Build) -> bool {
|
|
|
|
|
- let mut cmd = cfg.get_compiler().to_command();
|
|
|
|
|
- cmd.arg("src/smoke.c").arg("-o").arg("/dev/null").arg("-lz");
|
|
|
|
|
- cmd.arg("src/smoke.c")
|
|
|
|
|
- .arg("-g0")
|
|
|
|
|
- .arg("-o")
|
|
|
|
|
- .arg("/dev/null")
|
|
|
|
|
- .arg("-lz");
|
|
|
|
|
-
|
|
|
|
|
- println!("running {:?}", cmd);
|
|
|
|
|
- if let Ok(status) = cmd.status() {
|
|
|
|
@ -283,5 +295,5 @@ index 2557625..0000000
|
|
|
|
|
- build_zlib_ng(&target, false);
|
|
|
|
|
-}
|
|
|
|
|
--
|
|
|
|
|
2.43.0
|
|
|
|
|
2.45.1
|
|
|
|
|
|
|
|
|
|