From ec6535cf62f78422ab6601809d787e9f9aa02b93 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 12 Mar 2012 21:28:23 -0700 Subject: [PATCH] glib: fail if pkg-config not found; use actual compiler --- Formula/glib.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Formula/glib.rb b/Formula/glib.rb index dfe3686312..160abf9031 100644 --- a/Formula/glib.rb +++ b/Formula/glib.rb @@ -91,6 +91,11 @@ class Glib < Formula end def test + unless Formula.factory("pkg-config").installed? + puts "pkg-config is required to run this test, but is not installed" + exit 1 + end + mktemp do (Pathname.pwd/'test.c').write <<-EOS.undent #include @@ -107,7 +112,7 @@ class Glib < Formula return (strcmp(str, result_2) == 0) ? 0 : 1; } EOS - system "clang", "-o", "test", "test.c", + system ENV.cc, "-o", "test", "test.c", *`pkg-config --cflags --libs glib-2.0`.split system "./test" end