diff options
| author | Miguel Gaiowski | 2013-09-16 18:31:50 -0300 |
|---|---|---|
| committer | Adam Vandenberg | 2013-09-19 07:44:11 -0700 |
| commit | 98910994323df8fc8067616d1f2e5c23022a61cb (patch) | |
| tree | 78f566777c1f2ac312c4b0d9c863a2056f403e81 /Library/Formula | |
| parent | 11488f530f1abba5ecd1d3e9340cd1e0161b661b (diff) | |
| download | homebrew-98910994323df8fc8067616d1f2e5c23022a61cb.tar.bz2 | |
electric-fence 2.1.13-0.1
Formula for Electric Fence, the C malloc debug library written by Bruce Perens.
Closes #22596.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/electric-fence.rb | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Library/Formula/electric-fence.rb b/Library/Formula/electric-fence.rb new file mode 100644 index 000000000..acbfa794c --- /dev/null +++ b/Library/Formula/electric-fence.rb @@ -0,0 +1,59 @@ +require 'formula' + +class ElectricFence < Formula + homepage 'http://perens.com/FreeSoftware/ElectricFence/' + url 'http://perens.com/FreeSoftware/ElectricFence/electric-fence_2.1.13-0.1.tar.gz' + version '2.1.13-0.1' + sha1 'e6765bcb1543272040b806eea706fc7ae9b60524' + + def install + system "make" + lib.install "libefence.a" + man3.install "libefence.3" + end + + def patches + # Patch based on this MacPorts port: https://trac.macports.org/ticket/23836 + # Discussion on how to port it to OS X: http://lists.apple.com/archives/xcode-users/2005/Oct/msg00791.html + DATA + end + + test do + (testpath/'test1.c').write <<-EOS.undent + #include <stdlib.h> + int main() { + int *arr = (int*)malloc(sizeof(int) * 10); + arr[10] = 1000; + return 0; + } + EOS + #{ENV.cc}, (testpath/'test1.c'), '-lefence' + end +end + +__END__ +diff --git a/Makefile b/Makefile +index 660f586..82054b9 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,7 +4,7 @@ AR= ar + INSTALL= install + MV= mv + CHMOD= chmod +-CFLAGS= -g ++CFLAGS= -g -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS + LIB_INSTALL_DIR= /usr/lib + MAN_INSTALL_DIR= /usr/man/man3 + +diff --git a/page.c b/page.c +index 07ac9d5..69374c4 100644 +--- a/page.c ++++ b/page.c +@@ -30,7 +30,7 @@ + static caddr_t startAddr = (caddr_t) 0; + + #if ( !defined(sgi) && !defined(_AIX) ) +-extern int sys_nerr; ++/*extern int sys_nerr;*/ + /*extern char * sys_errlist[];*/ + #endif |
