use autotools::Config; use std::env; use std::path::PathBuf; fn main() { // Here we ask `make` to change directory to the source's lib // subdirectory, as a roundabout way of disabling documentation builds, // since these fail without `makeinfo` being present. There otherwise // appears to be no way to disable the building of the docs, and hence, // the otherwise necessary addition of a useless system dependency let out_path_lib = PathBuf::from(env::var("OUT_DIR").unwrap()) .join("build/lib"); // Build with autotools Config::new("gperf") .make_args(vec!["-C".to_string(), out_path_lib.display().to_string()]) .build(); // Fix the output search path so we can find the built library println!("cargo:rustc-link-search=native={}", out_path_lib.display()); println!("cargo:rustc-link-lib=static=gp"); }