#[cfg(feature="gnustep_runtime")]
extern crate gcc;
#[cfg(feature="gnustep_runtime")]
use std::path::PathBuf;


#[cfg(not(feature="gnustep_runtime"))]
fn compile() {
}

#[cfg(feature="gnustep_runtime")]
fn compile() {
    gcc::Config::new().flag("-lobjc")
                      .flag("-fobjc-runtime=gnustep-1.8")
                      .flag("-fno-objc-legacy-dispatch")
                      .file("extern/NSObject.m")
                      .cargo_metadata(false)
                      .compile("libNSObject.a");
    let path = ::std::env::var_os("OUT_DIR").map(PathBuf::from).unwrap();
    println!("cargo:rustc-link-search=native={}", path.display()); 
}
fn main() {
    compile();
}

#[cfg(feature="gnustep_runtime")]
extern crate gcc;

#[cfg(not(feature="gnustep_runtime"))]
fn compile() {
}

#[cfg(feature="gnustep_runtime")]
fn compile() {
    gcc::Config::new().flag("-lobjc")
                      .flag("-fobjc-runtime=gnustep-1.8")
                      .flag("-fno-objc-legacy-dispatch")
                      .file("extern/NSObject.m")
                      .link(false)
                      .compile("libNSObject.a");
}
fn main() {
    compile();
}

--- 
+++ 
@@ -1,5 +1,8 @@
 #[cfg(feature="gnustep_runtime")]
 extern crate gcc;
+#[cfg(feature="gnustep_runtime")]
+use std::path::PathBuf;
+
 
 #[cfg(not(feature="gnustep_runtime"))]
 fn compile() {
@@ -11,8 +14,10 @@
                       .flag("-fobjc-runtime=gnustep-1.8")
                       .flag("-fno-objc-legacy-dispatch")
                       .file("extern/NSObject.m")
-                      .link(false)
+                      .cargo_metadata(false)
                       .compile("libNSObject.a");
+    let path = ::std::env::var_os("OUT_DIR").map(PathBuf::from).unwrap();
+    println!("cargo:rustc-link-search=native={}", path.display()); 
 }
 fn main() {
     compile();
Update to track proposed gcc-rs API
