diff options
| author | Max Howell | 2012-08-31 15:23:43 -0400 |
|---|---|---|
| committer | Max Howell | 2012-08-31 15:25:14 -0400 |
| commit | 7f31785d7afbddf983b02b774af160c561800b4c (patch) | |
| tree | b70d52ad85e445aef09066dbe11576a0e0bbd10d /Library/Formula | |
| parent | b6323bbfabf67f1dc55a790868198f37fb23cca1 (diff) | |
| download | homebrew-7f31785d7afbddf983b02b774af160c561800b4c.tar.bz2 | |
Fix superenv libgcrypt
This started happening because I undefined CC. Now a lot of tools pick gcc. The problem here is that we add to cflags before configure, and during configure we are 'servile' so when configure uses gcc it *is* llvm-gcc and not clang, which we will be during make because then we are *not* servile.
So we have to assign these cflags during make only, which is easy enough. Code is neater now too.
I am now working on superenv so that it can determine if a tool cannot use certain flags and then pick another. The last stage of always-just-works.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/libgcrypt.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Library/Formula/libgcrypt.rb b/Library/Formula/libgcrypt.rb index bf5c50a95..18c7a88e4 100644 --- a/Library/Formula/libgcrypt.rb +++ b/Library/Formula/libgcrypt.rb @@ -14,20 +14,21 @@ class Libgcrypt < Formula end end + def cflags + cflags = "#{ENV['CFLAGS']}" + cflags += '-std=gnu89 -fheinous-gnu-extensions' if ENV.compiler == :clang + cflags + end + def install ENV.universal_binary # build fat so wine can use it - if ENV.compiler == :clang - ENV.append 'CFLAGS', '-std=gnu89' - ENV.append 'CFLAGS', '-fheinous-gnu-extensions' - end - system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--disable-asm", "--with-gpg-error-prefix=#{HOMEBREW_PREFIX}" # Parallel builds work, but only when run as separate steps - system "make" + system "make", "CFLAGS=#{cflags}" system "make check" system "make install" end |
