homebrew-core/Formula/ohcount.rb
Jack Nagel d1a2bb3c32 Use Homebrew's pcre where appropriate
We provide a pcre formula as OS X does not provide libpcre headers.
However, it does provide the library itself and so occasionally things
will use Homebrew's pcre headers and link against the system library.
This should be avoided to prevent incompatibilities, so explicitly tell
the build system where to look for the library where necessary.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-24 16:51:33 -06:00

44 lines
991 B
Ruby

require 'formula'
class Ohcount < Formula
homepage 'http://sourceforge.net/apps/trac/ohcount/'
url 'http://downloads.sourceforge.net/project/ohcount/ohcount-3.0.0.tar.gz'
md5 '08f97d01adde8b45635abfe93f8a717a'
depends_on 'ragel'
depends_on 'pcre'
def patches
DATA
end
def install
# find Homebrew's libpcre
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
system "./build", "ohcount"
bin.install 'bin/ohcount'
end
end
__END__
--- a/build
+++ b/build
@@ -29,7 +29,7 @@ else
INC_DIR=/opt/local/include
LIB_DIR=/opt/local/lib
# You shouldn't have to change the following.
- CFLAGS="-fno-common -g"
+ #CFLAGS="-fno-common -g"
WARN="-Wall -Wno-parentheses"
SHARED="-dynamiclib -L$LIB_DIR -lpcre"
SHARED_NAME=libohcount.dylib
@@ -38,7 +38,7 @@ else
fi
# C compiler and flags
-cc="gcc -fPIC -g $CFLAGS $WARN -I$INC_DIR -L$LIB_DIR"
+cc="$CC $CFLAGS -O0 $WARN $CPPFLAGS $LDFLAGS"
# Ohcount source files
files="src/sourcefile.c \