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)
17 # Process command line
27 --default-architecture)
29 DEFAULT_ARCHITECTURE
="$1"
40 echo "Invalid option: $1" >&2
44 echo "Invalid argument: $1" >&2
53 [ -n "$PREFIX" ] || PREFIX
=/usr
/local
54 [ -n "$BINDIR" ] || BINDIR
="\$(PREFIX)/bin"
55 [ -n "$DOCDIR" ] || DOCDIR
="\$(PREFIX)/share/doc"
56 [ -n "$MANDIR" ] || MANDIR
="\$(PREFIX)/share/man"
57 [ -n "$RUBYLIBDIR" ] || RUBYLIBDIR
="\$(PREFIX)/lib/site_ruby"
59 if [ -z "$DEFAULT_ARCHITECTURE" ]
61 # Try to automagically configure the native architecture
65 DEFAULT_ARCHITECTURE
=amd64
68 DEFAULT_ARCHITECTURE
=i386
71 [ -n "$DEFAULT_FORMAT" ] || DEFAULT_FORMAT
=elf
73 printf 'Testing for ruby...'
74 [ -n "$RUBY" ] || RUBY
=`which ruby 2>/dev/null`
81 WARNING: Ruby interpreter not found. You need a Ruby interpreter to
82 run the voodooc compiler.
87 printf 'Testing for nasm...'
88 [ -n "$NASM" ] || NASM
=`which nasm 2>/dev/null` || NASM
=`which yasm 2>/dev/null`
95 WARNING: NASM not found. You need NASM to create i386 object code.
100 printf 'Testing for rdoc...'
101 [ -n "$RDOC" ] || RDOC
=`which rdoc 2>/dev/null`
108 WARNING: rdoc not found. You need rdoc to generate API documentation
109 from the library files.
114 printf 'Writing Makefile.cfg...'
115 cat <<EOF > Makefile.cfg
116 DEFAULT_ARCHITECTURE = $DEFAULT_ARCHITECTURE
117 DEFAULT_FORMAT = $DEFAULT_FORMAT
123 RUBYLIBDIR = $RUBYLIBDIR