Fix LibreSSL cms.h detection
Also test without system OpenSSL headers when building OpenSSL on CircleCI
This commit is contained in:
parent
8830bd5daf
commit
6e66bf9c38
|
|
@ -35,6 +35,7 @@ job: &JOB
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: apt-get update
|
- run: apt-get update
|
||||||
|
- run: apt-get remove -y libssl-dev
|
||||||
- run: ./test/add_target.sh
|
- run: ./test/add_target.sh
|
||||||
- *RESTORE_REGISTRY
|
- *RESTORE_REGISTRY
|
||||||
- run: cargo generate-lockfile
|
- run: cargo generate-lockfile
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ use std::env;
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut cfg = ctest::TestGenerator::new();
|
let mut cfg = ctest::TestGenerator::new();
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").unwrap();
|
||||||
|
let mut is_libressl = false;
|
||||||
|
|
||||||
if let Ok(out) = env::var("DEP_OPENSSL_INCLUDE") {
|
if let Ok(out) = env::var("DEP_OPENSSL_INCLUDE") {
|
||||||
cfg.include(&out);
|
cfg.include(&out);
|
||||||
|
|
@ -24,6 +25,7 @@ fn main() {
|
||||||
|
|
||||||
if let Ok(_) = env::var("DEP_OPENSSL_LIBRESSL") {
|
if let Ok(_) = env::var("DEP_OPENSSL_LIBRESSL") {
|
||||||
cfg.cfg("libressl", None);
|
cfg.cfg("libressl", None);
|
||||||
|
is_libressl = true;
|
||||||
} else if let Ok(version) = env::var("DEP_OPENSSL_VERSION") {
|
} else if let Ok(version) = env::var("DEP_OPENSSL_VERSION") {
|
||||||
cfg.cfg(&format!("ossl{}", version), None);
|
cfg.cfg(&format!("ossl{}", version), None);
|
||||||
}
|
}
|
||||||
|
|
@ -41,12 +43,6 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let has_cms_h = if let Ok(version) = env::var("DEP_OPENSSL_LIBRESSL_VERSION") {
|
|
||||||
version != "261" && version != "262"
|
|
||||||
} else {
|
|
||||||
true
|
|
||||||
};
|
|
||||||
|
|
||||||
cfg.header("openssl/comp.h")
|
cfg.header("openssl/comp.h")
|
||||||
.header("openssl/dh.h")
|
.header("openssl/dh.h")
|
||||||
.header("openssl/ossl_typ.h")
|
.header("openssl/ossl_typ.h")
|
||||||
|
|
@ -64,7 +60,7 @@ fn main() {
|
||||||
.header("openssl/aes.h")
|
.header("openssl/aes.h")
|
||||||
.header("openssl/ocsp.h");
|
.header("openssl/ocsp.h");
|
||||||
|
|
||||||
if has_cms_h {
|
if !is_libressl {
|
||||||
cfg.header("openssl/cms.h");
|
cfg.header("openssl/cms.h");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue