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 if [ -z "$DEFAULT_ARCHITECTURE" ]
63 # Try to automagically configure the native architecture
67 DEFAULT_ARCHITECTURE
=amd64
70 DEFAULT_ARCHITECTURE
=i386
73 [ -n "$DEFAULT_FORMAT" ] || DEFAULT_FORMAT
=elf
75 printf 'Testing for ruby...'
76 [ -n "$RUBY" ] || RUBY
=`which ruby 2>/dev/null`
83 WARNING: Ruby interpreter not found. You need a Ruby interpreter to
84 run the voodooc compiler.
89 printf 'Testing for nasm...'
90 [ -n "$NASM" ] || NASM
=`which nasm 2>/dev/null` || NASM
=`which yasm 2>/dev/null`
97 WARNING: NASM not found. You need NASM to create i386 object code.
102 printf 'Testing for GNU assembler...'
107 GAS
=`which "$x"` 2>/dev
/null
110 # Found an executable that has the right name;
111 # test if it is really the GNU assembler
112 output
=`$GAS --version < /dev/null 2>&1`
113 if echo "$output" |
grep -q '^GNU assembler'
115 # Yes, it is the GNU assembler
118 # Not the GNU assembler, continue the search
122 [ -z "$GAS" ] ||
break
132 WARNING: GNU assembler not found. You need the GNU assembler to create
133 mips or mipsel object code.
138 printf 'Testing for rdoc...'
139 [ -n "$RDOC" ] || RDOC
=`which rdoc 2>/dev/null`
146 WARNING: rdoc not found. You need rdoc to generate API documentation
147 from the library files.
152 printf 'Testing for gem...'
153 [ -n "$GEM" ] || GEM
=`which gem 2>/dev/null`
160 WARNING: RubyGems gem command not found. You need the gem command to
166 printf 'Writing Makefile.cfg...'
167 cat <<EOF > Makefile.cfg
170 DEFAULT_ARCHITECTURE = $DEFAULT_ARCHITECTURE
171 DEFAULT_FORMAT = $DEFAULT_FORMAT
177 RUBYLIBDIR = $RUBYLIBDIR