3 usage
="USAGE: configure [--prefix <path>]"
4 help="Valid options are:
6 --default-architecture <architecture>
7 Set the default architecture (default: autodetected)
9 --default-format <format>
10 Set the default output format (default: elf)
13 Install to <path> (default: /usr/local)
19 # Process command line
29 --default-architecture)
31 DEFAULT_ARCHITECTURE
="$1"
42 echo "Invalid option: $1" >&2
46 echo "Invalid argument: $1" >&2
55 [ -n "$PREFIX" ] || PREFIX
=/usr
/local
56 [ -n "$BINDIR" ] || BINDIR
="\$(PREFIX)/bin"
57 [ -n "$DOCDIR" ] || DOCDIR
="\$(PREFIX)/share/doc"
58 [ -n "$MANDIR" ] || MANDIR
="\$(PREFIX)/share/man"
59 [ -n "$RUBYLIBDIR" ] || RUBYLIBDIR
="\$(PREFIX)/lib/site_ruby"
61 [ -n "$DEFAULT_ARCHITECTURE" ] || DEFAULT_ARCHITECTURE
=auto
62 [ -n "$DEFAULT_FORMAT" ] || DEFAULT_FORMAT
=elf
64 printf 'Testing for ruby...'
65 [ -n "$RUBY" ] || RUBY
=`which ruby 2>/dev/null`
72 WARNING: Ruby interpreter not found. You need a Ruby interpreter to
73 run the voodooc compiler.
78 printf 'Testing for nasm...'
79 [ -n "$NASM" ] || NASM
=`which nasm 2>/dev/null` || NASM
=`which yasm 2>/dev/null`
86 WARNING: NASM not found. You need NASM to create i386 object code.
91 printf 'Testing for GNU assembler...'
96 GAS
=`which "$x"` 2>/dev
/null
99 # Found an executable that has the right name;
100 # test if it is really the GNU assembler
101 output
=`$GAS --version < /dev/null 2>&1`
102 if echo "$output" |
grep -q '^GNU assembler'
104 # Yes, it is the GNU assembler
107 # Not the GNU assembler, continue the search
111 [ -z "$GAS" ] ||
break
121 WARNING: GNU assembler not found. You need the GNU assembler to create
122 mips or mipsel object code.
127 printf 'Testing for rdoc...'
128 [ -n "$RDOC" ] || RDOC
=`which rdoc 2>/dev/null`
135 WARNING: rdoc not found. You need rdoc to generate API documentation
136 from the library files.
141 printf 'Testing for gem...'
142 [ -n "$GEM" ] || GEM
=`which gem 2>/dev/null`
149 WARNING: RubyGems gem command not found. You need the gem command to
155 printf 'Writing Makefile.cfg...'
156 cat <<EOF > Makefile.cfg
159 DEFAULT_ARCHITECTURE = $DEFAULT_ARCHITECTURE
160 DEFAULT_FORMAT = $DEFAULT_FORMAT
166 RUBYLIBDIR = $RUBYLIBDIR