From 17469d7ad648754462ee3348bae1e496c831a52f Mon Sep 17 00:00:00 2001 From: samueljohn Date: Tue, 21 Aug 2012 16:38:23 +0200 Subject: 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 --- Library/Formula/pkg-config.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Library/Formula') 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" -- cgit v1.2.3