Changed test program to use symbolic section names.
[voodoo-lang.git] / configure
blob9a0d10dc5aac1423245e0a623fa45d2a130aa3aa
1 #! /bin/sh
3 usage="USAGE: configure [--prefix <path>]"
4 help="Valid options are:
6 --prefix <path>
7 Install to <path> (default: /usr/local)
11 # Process command line
13 while [ $# -gt 0 ]
15 case "$1" in
16 --help)
17 echo "$usage"
18 echo "$help"
19 exit
21 --prefix)
22 shift
23 PREFIX="$1"
25 -*)
26 echo "Invalid option: $1" >&2
27 exit 128
30 echo "Invalid argument: $1" >&2
31 exit 128
32 esac
33 shift
34 done
37 # Defaults
39 [ -n "$PREFIX" ] || PREFIX=/usr/local
40 [ -n "$BINDIR" ] || BINDIR="\$(PREFIX)/bin"
41 [ -n "$DOCDIR" ] || DOCDIR="\$(PREFIX)/share/doc"
42 [ -n "$RUBYLIBDIR" ] || RUBYLIBDIR="\$(PREFIX)/lib/site_ruby"
44 printf 'Testing for ruby...'
45 [ -n "$RUBY" ] || RUBY=`which ruby 2>/dev/null`
46 if [ $? -eq 0 ]
47 then
48 echo $RUBY
49 else
50 echo "not found"
51 cat <<EOT
52 WARNING: Ruby interpreter not found. You need a Ruby interpreter to
53 run the voodooc compiler.
55 EOT
58 printf 'Testing for nasm...'
59 [ -n "$NASM" ] || NASM=`which nasm 2>/dev/null`
60 if [ $? -eq 0 ]
61 then
62 echo $NASM
63 else
64 echo "not found"
65 cat <<EOT
66 WARNING: NASM not found. You need NASM to compile the assembly code
67 generated by the voodooc compiler to object code.
69 EOT
72 printf 'Writing Makefile.cfg...'
73 cat <<EOF > Makefile.cfg
74 PREFIX = $PREFIX
75 BINDIR = $BINDIR
76 DOCDIR = $DOCDIR
77 RUBYLIBDIR = $RUBYLIBDIR
79 NASM = $NASM
80 RUBY = $RUBY
81 EOF
82 if [ $? -eq 0 ]
83 then
84 echo 'done'