unix-odbc 0.1.2

The unixODBC driver manager. It builds the unixODBC C-library, not the rust bindings to it. It is intended to support the `vendored-unix-odbc` feature `odbc-sys`. Therefore it is recommend to use `odbc-sys` as a dependency rather than to consume this crate directly.
Documentation
use std::{env, path::PathBuf};

use autotools::Config;
use fs_extra::dir::{CopyOptions, copy};

fn main() {
    if cfg!(target_os = "windows") {
        return;
    }

    // OUT_DIR is an environment provided by cargo. It points to a temporary build directory. This
    // allows us to keep our source tree clean.
    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")
        // Prevent recreating the configure script
        .env("ACLOCAL", "true")
        .env("AUTOMAKE", "true")
        .env("AUTOCONF", "true")
        .build();
    let path = path.join("lib");
    println!("cargo:rustc-link-search=native={}", path.display());
}