diff --git a/Cargo.toml b/Cargo.toml index 89c13789..98a48f31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -143,10 +143,6 @@ make-cmd = "0.1" target = "2.0" syn = { version = "2", features = ["full"] } # git-version fails to parse inner macros without this. -[build-dependencies.rustflags] -version = "0.1" -optional = true - [dev-dependencies] tempfile = "3" @@ -160,8 +156,6 @@ panic = "abort" [features] default = ["full-version", "version-check"] full-version = ["dep:concat_const", "dep:git-version"] -# libcurl.so compatibility (Linux only). -curl-compat = ["rustflags"] # Check and report when a new version is available. version-check = ["shared_child"] # Download and apply new versions. diff --git a/build.rs b/build.rs index 36f7720d..857eef82 100644 --- a/build.rs +++ b/build.rs @@ -209,45 +209,6 @@ fn main() { println!("cargo:rerun-if-env-changed=CC"); println!("cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS"); - #[cfg(feature = "curl-compat")] - { - use rustflags::Flag; - if target_os != "linux" { - panic!("The curl-compat feature is only supported on linux"); - } else if std::env::var("DEP_CURL_STATIC").is_ok() { - panic!("The curl-compat feature is not compatible with building curl statically"); - } - let mut cmd = compiler.to_command(); - cmd.args(&[ - "-shared", - "-Wl,-soname,libcurl.so.4", - "src/curl-compat.c", - "-o", - ]); - let curl_dir = PathBuf::from(env_os("OUT_DIR")); - cmd.arg(curl_dir.join("libcurl.so")); - if let Ok(include) = std::env::var("DEP_CURL_INCLUDE") { - cmd.arg(format!("-I{}", normalize_path(&include))); - } - cmd.args(rustflags::from_env().flat_map(|flag| match flag { - Flag::Codegen { - opt, - value: Some(value), - } if opt == "link-arg" => vec![value], - Flag::Codegen { - opt, - value: Some(value), - } if opt == "link-args" => value.split(' ').map(ToString::to_string).collect(), - _ => vec![], - })); - match cmd.status() { - Ok(s) if s.success() => {} - _ => panic!("Failed to build libcurl.so with command {:?}", cmd), - } - println!("cargo:rerun-if-changed=src/curl-compat.c"); - println!("cargo:rustc-link-search=native={}", curl_dir.display()); - } - assert!(cmd .env("MAKEFLAGS", format!("-j {}", env("CARGO_MAKEFLAGS"))) .current_dir(&out_dir) diff --git a/src/curl-compat.c b/src/curl-compat.c deleted file mode 100644 index 6f594d55..00000000 --- a/src/curl-compat.c +++ /dev/null @@ -1,29 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include -#if LIBCURL_VERSION_NUM >= 0x073500 -#error curl-compat feature requires building with libcurl 7.52.x or older -#endif -void curl_easy_cleanup() {} -void curl_easy_duphandle() {} -void curl_easy_getinfo() {} -void curl_easy_init() {} -void curl_easy_setopt() {} -void curl_easy_strerror() {} -void curl_global_cleanup() {} -void curl_global_init() {} -void curl_global_init_mem() {} -void curl_multi_add_handle() {} -void curl_multi_cleanup() {} -void curl_multi_fdset() {} -void curl_multi_info_read() {} -void curl_multi_init() {} -void curl_multi_perform() {} -void curl_multi_remove_handle() {} -void curl_multi_strerror() {} -void curl_multi_timeout() {} -void curl_slist_append() {} -void curl_slist_free_all() {} -void curl_version_info() {}