From bdbfd5278e868122f92b62b574bdddb1fe2e01d6 Mon Sep 17 00:00:00 2001 From: Nibbles 2bits Date: Wed, 16 Nov 2011 19:36:53 -0800 Subject: pkg-config: Add gnu89 fixes Lion + Clang pkg-config append to cflags -std=gnu89 on Lion fixes duplicate symbols linking libglib when compiling with Clang-3.0 from XCode-4.2 (4D199). Add make check to confirm success, given the critical nature of the software. The flag is appended only on Lion, though it successfully tests on Snow Leopard in 64bit, too. EDIT: checks if lion and if clang before switching to gnu89. Closes #8631. Signed-off-by: Charlie Sharpsteen --- Library/Formula/pkg-config.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/pkg-config.rb b/Library/Formula/pkg-config.rb index fe0b4278c..5f340994b 100644 --- a/Library/Formula/pkg-config.rb +++ b/Library/Formula/pkg-config.rb @@ -10,6 +10,9 @@ class PkgConfig < Formula md5 'a3270bab3f4b69b7dc6dbdacbcae9745' def install + # fixes compile error on Lion with Clang duplicate symbols in libglib + ENV.append_to_cflags '-std=gnu89' if MacOS.lion? and ENV.compiler == :clang + paths = %W[ #{HOMEBREW_PREFIX}/lib/pkgconfig /usr/local/lib/pkgconfig @@ -19,6 +22,8 @@ class PkgConfig < Formula system "./configure", "--disable-debug", "--prefix=#{prefix}", "--with-pc-path=#{paths*':'}" + system "make" + system "make check" system "make install" end end -- cgit v1.2.3