// Copyright (C) 2015 Daniel Trebbien // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library. If not, see . extern crate pkg_config; use std::env; fn main() { pkg_config::find_library("augeas").unwrap(); // pkg_config::find_library() prints cargo:rustc-link-* lines for the Augeas library's // link_paths and libs. We just need to add a cargo:rustc-link-lib line for libfa. let statik = env::var_os("FA_STATIC").is_some() || (!env::var_os("FA_DYNAMIC").is_some() && env::var_os("PKG_CONFIG_ALL_STATIC").is_some()); if statik { println!("cargo:rustc-link-lib=static=fa"); } else { println!("cargo:rustc-link-lib=fa"); } }