annotate libpam-sys/build.rs @ 130:80c07e5ab22f

Transfer over (almost) completely to using libpam-sys. This reimplements everything in nonstick on top of the new -sys crate. We don't yet use libpam-sys's helpers for binary message payloads. Soon.
author Paul Fisher <paul@pfish.zone>
date Tue, 01 Jul 2025 06:11:43 -0400
parents ad77f2af5ff4
children a632a8874131
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
127
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
1 use libpam_sys_impls::__pam_impl_enum__;
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
2 use strum::{EnumIter, IntoEnumIterator};
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
3
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
4 __pam_impl_enum__!(#[derive(EnumIter)]);
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
5
106
49d9e2b5c189 An irresponsible mix of implementing libpam-sys and other stuff.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
6 fn main() {
49d9e2b5c189 An irresponsible mix of implementing libpam-sys and other stuff.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
7 println!("cargo:rustc-link-lib=pam");
127
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
8 let pam_impl_strs: Vec<_> = PamImpl::iter().map(|e| format!("\"{:?}\"", e)).collect();
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
9 let pam_impls = pam_impl_strs.join(",");
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
10 // We use this for ctest. Don't do what we've done; just use cfg_pam_impl.
128
ad77f2af5ff4 Fix `rustc-check-cfg` in `libpam-sys/build.rs`.
Paul Fisher <paul@pfish.zone>
parents: 127
diff changeset
11 println!("cargo:rustc-check-cfg=cfg(_private_pam_impl_hack, values({pam_impls}))");
130
80c07e5ab22f Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents: 128
diff changeset
12 println!(
80c07e5ab22f Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents: 128
diff changeset
13 "cargo:rustc-cfg=_private_pam_impl_hack=\"{:?}\"",
80c07e5ab22f Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents: 128
diff changeset
14 PamImpl::CURRENT
80c07e5ab22f Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents: 128
diff changeset
15 );
106
49d9e2b5c189 An irresponsible mix of implementing libpam-sys and other stuff.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
16 }