Repository: PistonDevelopers/glfw-rs (language: rust)

Issue:
Improve error message on Mac an Linux when pkg-config could not be found
@brownhead ran into this in #207. The error is pretty obscure:

```
   Compiling semver v0.0.1 (https://github.com/rust-lang/semver#e17191f5)
   Compiling link_glfw v0.1.0 (file:/private/tmp/clean/glfw-rs)
   Compiling glfw v0.0.1 (file:/private/tmp/clean/glfw-rs)
src/glfw/ffi/link.rs:27:1: 27:13 error: io error: no such file or directory
src/glfw/ffi/link.rs:27 #[link_glfw]
                        ^~~~~~~~~~~~
error: aborting due to previous error
Could not compile `glfw`.

To learn more, run the command again with --verbose.
```



Discussion / hints:

Fix patch:
diff --git a/src/link_glfw/lib.rs b/src/link_glfw/lib.rs
index 5dc9bae7..3ee720bf 100644
--- a/src/link_glfw/lib.rs
+++ b/src/link_glfw/lib.rs
@@ -69,6 +69,7 @@ pub fn expand(context: &mut base::ExtCtxt, span: codemap::Span,
         .arg("--static")
         .arg("--libs-only-l")
         .arg("--libs-only-other")
+        .arg("--print-errors")
         .arg("glfw3")
         .output();
     match out {
@@ -98,8 +99,17 @@ pub fn expand(context: &mut base::ExtCtxt, span: codemap::Span,
                 });
                 box (GC) item
             } else {
-                context.span_err(span, format!("error returned by \
-                    `pkg-config`: ({})", out.status).as_slice());
+                context.span_err( 
+                    span, 
+                    format!(
+                        "error returned by \
+                        `pkg-config`: ({})\n\
+                        `pkg-config stdout`: {}\n\
+                        `pkg-config stderr`: {}", 
+                        out.status, 
+                        String::from_utf8(out.output).unwrap(),
+                        String::from_utf8(out.error).unwrap())
+                        .as_slice());
                 item
             }
         },


Test patch: