aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pkg-config.rb
diff options
context:
space:
mode:
authorsamueljohn2012-08-21 16:38:23 +0200
committerJack Nagel2012-08-23 16:26:28 -0500
commit17469d7ad648754462ee3348bae1e496c831a52f (patch)
tree251b4e5dfd419bf83cbfbafe7333226d16ea977e /Library/Formula/pkg-config.rb
parent0afd719bc9dd2045050ccf6c1abc78a3f2cd06f2 (diff)
downloadhomebrew-17469d7ad648754462ee3348bae1e496c831a52f.tar.bz2
Xcode-only: Clean up compiler flags. Use CPATH.
- When using CPATH, we only need -isysroot and not the other -I spam. - LDFLAGS use -isysroot instead of -L Turns out that the linker also understands the -isysroot flag which behaves more natural (in the sense: "like the internal defaults `/usr/lib` etc.) than adding `-L$(SDKROOT). Especially for duplicates, the linker first searches through all `-L` dirs and then looks at the sysroot or internal defaults. This is what we want. - Pkg-config needs CC with CFLAGS passed to configure. Closes #14351. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/pkg-config.rb')
-rw-r--r--Library/Formula/pkg-config.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/Library/Formula/pkg-config.rb b/Library/Formula/pkg-config.rb
index 5449007c0..8e47b2b00 100644
--- a/Library/Formula/pkg-config.rb
+++ b/Library/Formula/pkg-config.rb
@@ -21,10 +21,17 @@ class PkgConfig < Formula
/usr/local/lib/pkgconfig
/usr/lib/pkgconfig
].uniq
- system "./configure", "--disable-debug",
- "--prefix=#{prefix}",
- "--with-pc-path=#{paths*':'}",
- "--with-internal-glib"
+
+ args = %W[
+ --disable-debug
+ --prefix=#{prefix}
+ --with-pc-path=#{paths*':'}
+ --with-internal-glib
+ ]
+ args << "CC=#{ENV.cc} #{ENV.cflags}" unless MacOS::CLT.installed?
+
+ system "./configure", *args
+
system "make"
system "make check"
system "make install"