use std::{env, path::PathBuf};
use autotools::Config;
use fs_extra::dir::{CopyOptions, copy};
fn main() {
if cfg!(target_os = "windows") {
return;
}
let out_dir: PathBuf = env::var("OUT_DIR").unwrap().parse().unwrap();
let options = CopyOptions {
overwrite: true,
..Default::default()
};
copy("unixODBC", &out_dir, &options).unwrap();
let unix_odbc_src = out_dir.join("unixODBC");
let path = Config::new(&unix_odbc_src)
.cflag("-std=gnu99")
.env("ACLOCAL", "true")
.env("AUTOMAKE", "true")
.env("AUTOCONF", "true")
.build();
let path = path.join("lib");
println!("cargo:rustc-link-search=native={}", path.display());
}