From 2061909a7b56ae819ca3849c34e64a9c60525548 Mon Sep 17 00:00:00 2001 From: inglorion Date: Sun, 11 Apr 2010 10:51:45 +0200 Subject: [PATCH] Added generators to create ELF files for mips and mipsel. Added autodetection for the GNU assembler. --- configure | 37 ++++++++++++++++++++++++ lib/voodoo/Makefile | 1 + lib/voodoo/config.rb.in | 4 +++ lib/voodoo/generators/mips_elf_generator.rb | 45 +++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 lib/voodoo/generators/mips_elf_generator.rb diff --git a/configure b/configure index 7edf0b0..2ef763e 100755 --- a/configure +++ b/configure @@ -99,6 +99,42 @@ WARNING: NASM not found. You need NASM to create i386 object code. EOT fi +printf 'Testing for GNU assembler...' +if [ -z "$GAS" ] +then + for x in gas as + do + GAS=`which "$x"` 2>/dev/null + if [ $? -eq 0 ] + then + # Found an executable that has the right name; + # test if it is really the GNU assembler + output=`$GAS --version < /dev/null 2>&1` + if echo "$output" | grep -q '^GNU assembler' + then + # Yes, it is the GNU assembler + true + else + # Not the GNU assembler, continue the search + unset GAS + fi + fi + [ -z "$GAS" ] || break + done +fi + +if [ -n "$GAS" ] +then + echo $GAS +else + echo "not found" + cat </dev/null` if [ $? -eq 0 ] @@ -140,6 +176,7 @@ DOCDIR = $DOCDIR MANDIR = $MANDIR RUBYLIBDIR = $RUBYLIBDIR +GAS = $GAS GEM = $GEM NASM = $NASM RDOC = $RDOC diff --git a/lib/voodoo/Makefile b/lib/voodoo/Makefile index 63ff491..d5a0633 100644 --- a/lib/voodoo/Makefile +++ b/lib/voodoo/Makefile @@ -17,6 +17,7 @@ config.rb : config.rb.in ../../Makefile.cfg env DEFAULT_ARCHITECTURE="$(DEFAULT_ARCHITECTURE)" \ DEFAULT_FORMAT="$(DEFAULT_FORMAT)" \ NASM="$(NASM)" \ + GAS="$(GAS)" \ $(RUBY) config.rb.in > config.rb .PHONY : all clean distclean install diff --git a/lib/voodoo/config.rb.in b/lib/voodoo/config.rb.in index 01b0da1..d2ea15a 100644 --- a/lib/voodoo/config.rb.in +++ b/lib/voodoo/config.rb.in @@ -4,6 +4,7 @@ default_architecture = ENV['DEFAULT_ARCHITECTURE'] default_format = ENV['DEFAULT_FORMAT'] +gas_command = ENV['GAS'] || 'as' nasm_command = ENV['NASM'] || ENV['YASM'] || 'nasm' print < :mips, + :format => :elf + + # Register class for mipsel + Voodoo::CodeGenerator.register_generator MIPSELFGenerator, + :architecture => :mipsel, + :format => :elf +end -- 2.11.4.GIT