fcgi: fix "Symbol not found: _environ"

Fixes Homebrew/homebrew#12844.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
master
Sean Lynch 2012-06-14 14:32:04 -07:00 committed by Misty De Meo
parent 5d8175cc98
commit 145593abae
1 changed files with 25 additions and 0 deletions

View File

@ -5,9 +5,34 @@ class Fcgi < Formula
homepage 'http://www.fastcgi.com/'
md5 'd15060a813b91383a9f3c66faf84867e'
def patches
# https://trac.macports.org/browser/trunk/dports/www/fcgi/files/patch-libfcgi-fcgi_stdio.c.diff
# Fixes "dyld: Symbol not found: _environ"
# Affects programs linking this library. Reported at
# http://mailman.fastcgi.com/pipermail/fastcgi-developers/2009-January/000152.html
DATA
end
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
end
__END__
--- a/libfcgi/fcgi_stdio.c
+++ b/libfcgi/fcgi_stdio.c
@@ -40,7 +40,12 @@
#ifndef _WIN32
+#if defined(__APPLE__)
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
extern char **environ;
+#endif
#ifdef HAVE_FILENO_PROTO
#include <stdio.h>