Added file COPYING with copyright information.
[voodoo-lang.git] / configure
blob42620dc2d0f03a7ad1d7699399048d549b1f4867
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 create i386 object code.
68 EOT
71 printf 'Testing for rdoc...'
72 [ -n "$RDOC" ] || RDOC=`which rdoc 2>/dev/null`
73 if [ $? -eq 0 ]
74 then
75 echo $RDOC
76 else
77 echo "not found"
78 cat <<EOT
79 WARNING: rdoc not found. You need rdoc to generate API documentation
80 from the library files.
82 EOT
85 printf 'Writing Makefile.cfg...'
86 cat <<EOF > Makefile.cfg
87 PREFIX = $PREFIX
88 BINDIR = $BINDIR
89 DOCDIR = $DOCDIR
90 RUBYLIBDIR = $RUBYLIBDIR
92 NASM = $NASM
93 RDOC = $RDOC
94 RUBY = $RUBY
95 EOF
96 if [ $? -eq 0 ]
97 then
98 echo 'done'