1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! # libperl-config
//!
//! Build-time helper for crates that link against `libperl`. Reads the
//! local Perl installation's `Config.pm` (via `perl -V:...`) and turns
//! the answers into `cargo:` directives + `cfg(...)` flags.
//!
//! Used by [`libperl-sys`](https://docs.rs/libperl-sys) and
//! [`libperl-rs`](https://docs.rs/libperl-rs) build scripts to:
//!
//! - emit `cargo:rustc-link-search` / `rustc-link-lib` / `rustc-link-arg`
//! from `$Config{ccopts}` and `$Config{ldopts}`,
//! - expose feature toggles like `cfg(perl_useithreads)` based on
//! `$Config{useithreads}`,
//! - emit per-API-version cfgs (`cfg(perlapi_ver26)` ...
//! `cfg(perlapi_ver42)`) so source can branch on Perl version.
//!
//! Typical usage in a downstream `build.rs`:
//!
//! ```no_run
//! use libperl_config::PerlConfig;
//!
//! fn main() {
//! let config = PerlConfig::default();
//! config.emit_cargo_ldopts();
//! config.emit_features(&["useithreads"]);
//! config.emit_all_perlapi_versions(10);
//! }
//! ```
//!
//! ## Selecting which perl to build against
//!
//! By default the `perl` found on `PATH` is used. Set the `PERL`
//! environment variable to an absolute path to pick a specific
//! interpreter — e.g. an ExtUtils::MakeMaker postamble runs
//! `PERL=$(FULLPERL) cargo build ...` so the perl that ran Makefile.PL
//! and the perl being linked against are the same. Build scripts are
//! automatically re-run when `PERL` changes.
//!
//! See [`PerlConfig`] for the full API.
pub use *;
pub use *;