aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2009-09-21 12:20:05 -0700
committerAdam Vandenberg2009-09-21 13:06:21 -0700
commit2bfef1dbc2555b6149c0a7fe74b438af0321cffb (patch)
tree054232cfe3c7fb60adb9e0ca03710f2a661abb61 /Library
parent6e70ca1f635d4e0a8651f2dd5e784f0738953065 (diff)
downloadhomebrew-2bfef1dbc2555b6149c0a7fe74b438af0321cffb.tar.bz2
Build mod_wsgi with the same arch's as Python.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/mod_wsgi.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/Library/Formula/mod_wsgi.rb b/Library/Formula/mod_wsgi.rb
index c557300a8..790854215 100644
--- a/Library/Formula/mod_wsgi.rb
+++ b/Library/Formula/mod_wsgi.rb
@@ -15,10 +15,23 @@ class ModWsgi <Formula
FileUtils.mv 'LICENCE', 'LICENSE'
system "./configure --prefix='#{prefix}' --disable-debug --disable-dependency-tracking"
- # Just build 32-bit Intel
# The arch flags should match your Python's arch flags.
- inreplace 'Makefile', "-Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' -Wc,'-arch x86_64'", "-Wc,'-arch i386'"
- inreplace 'Makefile', "-arch ppc7400 -arch ppc64 -arch i386 -arch x86_64", "-arch i386"
+ archs = arch_for_command "`which python`"
+
+ comp_flags = ''
+ link_flags = ''
+ archs.each do |a|
+ comp_flags += " -Wc,'-arch #{a}'"
+ link_flags += " -arch #{a}"
+ end
+
+ inreplace 'Makefile',
+ "-Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' -Wc,'-arch x86_64'",
+ "#{comp_flags}"
+
+ inreplace 'Makefile',
+ "-arch ppc7400 -arch ppc64 -arch i386 -arch x86_64",
+ "#{link_flags}"
# --libexecdir parameter to ./configure isn't changing this, so cram it in
inreplace 'Makefile', "LIBEXECDIR = /usr/libexec/apache2", "LIBEXECDIR = #{libexec}"