Skip to content

Commit

Permalink
glib: fail if pkg-config not found; use actual compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
adamv authored and jacknagel committed Mar 14, 2012
1 parent 68faf98 commit 02b7093
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Library/Formula/glib.rb
Expand Up @@ -91,6 +91,11 @@ def install
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 <string.h>
Expand All @@ -107,7 +112,7 @@ def test
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
Expand Down

0 comments on commit 02b7093

Please sign in to comment.