serf: fix CPP invalid path build error on ML

serf-1.1.1 queries `apr-1-config --cpp` which return a non-existent
path on Mountain Lion.  This causes a build error where `configure`
can't find a working `CPP`.  Add an ENV var to use `#{ENV.cc} -E`

serf then tries to use `/usr/share/apr-1/build-1/libtool` which
also has that non-existent path buried inside it.  Add an ENV var
to specify using HB `glibtool`.

Tested on ML using clang and llvm from XCode-4.4 using the native
and universal options.

Fixes Homebrew/homebrew#13586

Closes Homebrew/homebrew#13891.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
master
nibbles 2bits 2012-08-02 09:00:30 -07:00 committed by Adam Vandenberg
parent b90dd99758
commit b0044ade54
1 changed files with 10 additions and 0 deletions

View File

@ -5,12 +5,22 @@ class Serf < Formula
url 'http://serf.googlecode.com/files/serf-1.1.0.tar.bz2'
sha1 '231af70b7567a753b49df4216743010c193884b7'
depends_on :automake
depends_on :libtool
def options
[['--universal', 'Builds a universal binary.']]
end
def install
ENV.universal_binary if ARGV.build_universal?
if MacOS.mountain_lion?
# Fixes a bad path returned by `apr-1-config --cpp` on ML.
# https://github.com/mxcl/homebrew/issues/13586
ENV['CPP'] = "#{ENV.cc} -E"
# Use HB libtool not the one from apr that also has a bad path.
ENV['APR_LIBTOOL'] = 'glibtool'
end
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}"