fn main() {
    println!("cargo:rustc-link-lib=pam");

    // Emit AHFAIL_INSTALL_DIR so DEFAULT_PATH in lib.rs is correct on multiarch
    // systems (e.g. Debian/Ubuntu where libdir is /usr/lib/x86_64-linux-gnu).
    // Meson passes AHFAIL_LIBDIR=<libdir> when building; fall back to /usr/lib otherwise.
    let libdir = std::env::var("AHFAIL_LIBDIR").unwrap_or_else(|_| "/usr/lib".to_string());
    println!("cargo:rustc-env=AHFAIL_INSTALL_DIR={}/ahfail", libdir);
}
