Brian Silverman avatar Brian Silverman committed 7e44302

Changed the versions of the supporting projects and the download locations so
that they should stay the same for a while and fixed a capitalization issue.
Also created a ruby script and data file for it to make debian packages for the
compiler.

Comments (0)

Files changed (4)

 #!/bin/bash
 
 # BEGIN CONFIGURATION
-BINUTILS_VERSION=2.21
+BINUTILS_VERSION=2.22
 GCC_VERSION=4.5.2
-MPFR_VERSION=3.0.1
-GMP_VERSION=5.0.2
-MPC_VERSION=0.8.2
+MPFR_VERSION=2.4.2
+GMP_VERSION=4.3.2
+MPC_VERSION=0.8.1
 JOBS=4
 # END CONFIGURATION
 
 
 function download()
 {
-    [ -e "$SRC/$1" ] || wget -O "$SRC/$1" "$2"
+    [ -e "$SRC/$1" ] || wget -O "$SRC/$1" "$2" || die "retrieving $2 failed"
 }
 
 export PATH="$PREFIX/bin:$PATH"
 download "gccdist.zip" "ftp://ftp.ni.com/pub/devzone/tut/updated_vxworks63gccdist.zip"
 download "binutils-$BINUTILS_VERSION.tar.bz2" "http://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.bz2"
 download "gcc-$GCC_VERSION.tar.bz2" "http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2"
-download "mpfr-$MPFR_VERSION.tar.bz2" "http://www.mpfr.org/mpfr-current/mpfr-$MPFR_VERSION.tar.bz2"
-download "gmp-$GMP_VERSION.tar.bz2" "ftp://ftp.gmplib.org/pub/gmp-$GMP_VERSION/gmp-$GMP_VERSION.tar.bz2"
-download "mpc-$MPC_VERSION.tar.gz" "http://www.multiprecision.org/mpc/download/mpc-$MPC_VERSION.tar.gz"
+download "mpfr-$MPFR_VERSION.tar.bz2" "ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-$MPFR_VERSION.tar.bz2"
+download "gmp-$GMP_VERSION.tar.bz2" "ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-$GMP_VERSION.tar.bz2"
+download "mpc-$MPC_VERSION.tar.gz" "ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-$MPC_VERSION.tar.gz"
 
 # Extract
 echo "Extracting files (this will take a long time)..."
 cd "$SRC"
 echo "  gccdist.zip"
-unzip -q gccdist.zip
+unzip -q -o gccdist.zip
 echo "  binutils-$BINUTILS_VERSION.tar.bz2"
 tar --bzip2 -xf "binutils-$BINUTILS_VERSION.tar.bz2"
 echo "  gcc-$GCC_VERSION.tar.bz2"
  // 17.4.1.2 Headers
  
  // C
-+#include <VxWorks.h>
++#include <vxWorks.h>
  #ifndef _GLIBCXX_NO_ASSERT
  #include <cassert>
  #endif
+#!/usr/bin/env ruby
+
+unless ARGV.length == 2
+	puts <<END
+usage: make_deb.rb arch path/to/package_info
+
+This script creates a debian package from a directory setup.
+Required files:
+./control/
+./data/ # stuff from ./data/ gets installed to /
+path/to/package_info
+
+make sure to chown -R root:root data/ control/ && chmod -R 644 data/ control/ otherwise it will install with non-root permissions
+fakeroot is useful for doing that
+chmod 755 any executables
+debian-binary is made to be "2.0\\n" in the archive.
+END
+exit 1
+end
+
+class DPKG_Control
+	def initialize(file)
+		@tags = []
+		@fields = {}
+		append_parse(file)
+	end
+	def [](key)
+		@fields[key]
+	end
+	def []=(key,value)
+		@fields[key] = value
+	end
+	def output()
+		string = ""
+		@tags.each do |key|
+			value = @fields[key]
+			string += "#{key}: #{value.gsub(/\n/,"\n ")}\n"
+		end
+		return string
+	end
+	def append_parse(file)
+		begin
+			tag = ""
+			while true
+				if((char = file.read_nonblock(1)) =~ /\w/)
+					tag = char
+					while((char = file.read_nonblock(1)) != ":")
+						tag += char
+					end
+					file.read(1)
+					@fields[tag] = file.gets
+					@tags.push(tag)
+				else
+					@fields[tag] += file.gets
+				end
+			end
+		rescue EOFError
+			@fields.each_pair do |key,value|
+				value.gsub!(/^\s*|\s*$/,"")
+			end
+			@tags.uniq
+		end
+	end
+end
+$pwd = Dir.pwd
+File.open(ARGV[1]) do |f|	
+	$control_file = DPKG_Control.new(f)
+end
+$control_file['Architecture'] = ARGV[0]
+$pkg_name = "#{$control_file["Package"]}_"\
+	"#{$control_file["Version"]}_"\
+	"#{$control_file["Architecture"]}.deb"
+
+
+$control_file["Installed-Size"] = (`du data -s`.split(/\s/))[0]
+
+Dir.chdir("./control")
+File.open("control", "w+") {|f| f.puts($control_file.output) }
+puts "compressing: ./control/* "
+system("tar -cvzf ../control.tar.gz ./")
+
+Dir.chdir($pwd)
+Dir.chdir("./data")
+
+puts "compressing: ./data/* "
+system("tar -cvzf ../data.tar.gz ./")
+Dir.chdir($pwd)
+puts "Building Package #{$pkg_name} ..."
+File.open($pkg_name, "wb+") { |f| f.puts(<<END)}
+!<arch>
+debian-binary/  #{Time.now.to_i.to_s.ljust(12)}0     0     100644  4         `
+2.0
+END
+
+system("ar rcs #{$pkg_name} control.tar.gz data.tar.gz")
+
+Package: powerpc-wrs-vxworks
+Version: 4.5.0-1.1
+Architecture: MAKE_DEB_RB
+Maintainer: Austin and Parker Schuh <parker.powerpc@boardsailor.com>
+Installed-Size: MAKE_DEB_RB
+Depends: libmpfr4
+Suggests: 
+Section: compiler
+Priority: optional
+Description: A cross compiler for powerpc for use with NI cRIO-FRC[II] (powerpc vxworks) robots.
+ This is a .deb file for ease of installation.
+ Note: it installs the compiler into /usr/local.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.