This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

gforth: fix 64-bit builds

Closes #16836.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
darvin authored and klausmeyer committed Jan 2, 2013
1 parent abe1696 commit c62acbf6b05e65fae2c7bdaba51cc5425ccf06b3
Showing with 21 additions and 4 deletions.
  1. +21 −4 Library/Formula/gforth.rb
View
@@ -5,12 +5,29 @@ class Gforth < Formula
url 'http://www.complang.tuwien.ac.at/forth/gforth/gforth-0.7.0.tar.gz'
sha1 '5bb357268cba683f2a8c63d2a4bcab8f41cb0086'
+ depends_on :libtool
+ depends_on 'libffi'
+ depends_on 'pcre'
+
+ def darwin_major_version
+ # kern.osrelease: 11.4.2
+ full_version = `/usr/sbin/sysctl -n kern.osrelease`
+ full_version.split("\.")[0]
+ end
+
def install
ENV.j1 # Parallel builds won't work
- # Install 32-bit only, even on Snow Leopard. See:
- # http://www.groupsrv.com/computers/about648918.html
- ENV['CC'] = "#{ENV.cc} -m32"
- system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"
+ args = %W[
+ --disable-debug
+ --disable-dependency-tracking
+ --prefix=#{prefix}
+ ]
+
+ if MacOS.prefer_64_bit?
+ args << "--build=x86_64-apple-darwin#{darwin_major_version}"
+ end
+
+ system "./configure", *args
system "make" # Separate build steps.
system "make install"
end

0 comments on commit c62acbf

Please sign in to comment.