/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use std::process::Command;
use std::env;


fn main() {
    assert!(Command::new("make")
        .args(&["-f", "makefile.cargo", "-j4"])
        .status()
        .unwrap()
        .success());
    println!("cargo:rustc-flags=-L native={}", env::var("OUT_DIR").unwrap());
}

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#![feature(io, os)]

use std::old_io::process::{Command, ProcessExit, StdioContainer};
use std::os;


fn main() {
    let out_dir = os::getenv("OUT_DIR").unwrap();
    let result = Command::new("make")
        .args(&["-f", "makefile.cargo", "-j4"])
        .stdout(StdioContainer::InheritFd(1))
        .stderr(StdioContainer::InheritFd(2))
        .status()
        .unwrap();
    assert_eq!(result, ProcessExit::ExitStatus(0));
    println!("cargo:rustc-flags=-L native={}", out_dir);
}

--- 
+++ 
@@ -2,15 +2,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-use std::process::Command;
-use std::env;
+#![feature(io, os)]
+
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
+use std::os;
 
 
 fn main() {
-    assert!(Command::new("make")
+    let out_dir = os::getenv("OUT_DIR").unwrap();
+    let result = Command::new("make")
         .args(&["-f", "makefile.cargo", "-j4"])
+        .stdout(StdioContainer::InheritFd(1))
+        .stderr(StdioContainer::InheritFd(2))
         .status()
-        .unwrap()
-        .success());
-    println!("cargo:rustc-flags=-L native={}", env::var("OUT_DIR").unwrap());
+        .unwrap();
+    assert_eq!(result, ProcessExit::ExitStatus(0));
+    println!("cargo:rustc-flags=-L native={}", out_dir);
 }
Upgrade to rustc 1.0.0-dev (47551b574 2015-04-14) (built 2015-03-18)
