2009-10-30 10:44:27 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Sdcc < Formula
|
2009-10-30 10:44:27 +00:00
|
|
|
homepage 'http://sdcc.sourceforge.net/'
|
2014-01-21 03:29:34 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/sdcc/sdcc/3.3.0/sdcc-src-3.3.0.tar.bz2'
|
|
|
|
sha1 'beed1b8c73f13344e018f48b1563ff2a948b70cf'
|
2013-02-27 06:26:35 +00:00
|
|
|
|
|
|
|
head 'https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc/'
|
2009-10-30 10:44:27 +00:00
|
|
|
|
2011-01-31 17:32:46 +00:00
|
|
|
depends_on 'gputils'
|
2013-02-27 06:26:35 +00:00
|
|
|
depends_on 'boost'
|
|
|
|
|
|
|
|
option 'enable-avr-port', "Enables the AVR port (UNSUPPORTED, MAY FAIL)"
|
|
|
|
option 'enable-xa51-port', "Enables the xa51 port (UNSUPPORTED, MAY FAIL)"
|
|
|
|
|
|
|
|
def patches
|
|
|
|
# SDCC Doesn't build huge-stack-auto by default for mcs51, but it
|
|
|
|
# is needed by Contiki and others. This simple patch enables it to build.
|
2014-01-21 03:29:34 +00:00
|
|
|
'https://gist.github.com/anonymous/5042275/raw/a2e084f29cd4ad9cd95e38683209991b7ac038d3/sdcc-huge-stack-auto.diff'
|
2013-02-27 06:26:35 +00:00
|
|
|
end
|
2011-01-31 17:32:46 +00:00
|
|
|
|
2009-10-30 10:44:27 +00:00
|
|
|
def install
|
2014-01-21 03:29:34 +00:00
|
|
|
args = ["--prefix=#{prefix}", '--disable-sdcdb']
|
2013-02-27 06:26:35 +00:00
|
|
|
|
|
|
|
args << '--enable-avr-port' if build.include? 'enable-avr-port'
|
|
|
|
args << '--enable-xa51-port' if build.include? 'enable-xa51-port'
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-09-15 00:35:59 +00:00
|
|
|
system "make all"
|
2009-10-30 10:44:27 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2013-02-27 06:26:35 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/sdcc", "-v"
|
|
|
|
end
|
2009-10-30 10:44:27 +00:00
|
|
|
end
|