diff --git a/configure b/configure index 4e606a1711..0497264153 100755 --- a/configure +++ b/configure @@ -1,10 +1,61 @@ #!/bin/sh # -# configure +# configure [ --floppy ] # # No parameters for now. +# usage +# +# Prints usage. +# +usage() +{ + cat << EOF + +Usage: $0 +options: + --floppy Specifies the location of the floppy + (device or image). + --help Prints out this help. +EOF +} + +# assertparam +# +# Checks whether at least one parameter is left. +# +assertparam() +{ + if [ $2 \< 2 ]; then + echo $0: \`$1\': Parameter expected. + exit 1 + fi +} + +# default parameter values +# platform=`uname` +floppy= + +# parse parameters +# +while [ $# \> 0 ] ; do + case "$1" in + --floppy) assertparam "$1" $#; floppy=$2; shift 2;; + --help | -h) usage; exit 0;; + *) echo Invalid argument: \`$1\'; exit 1;; + esac +done + +# check parameters +# +if [ -n "$floppy" ]; then + case "$floppy" in + /*) ;; + *) echo "Warning: non-absolute floppy path. Parameter ignored."; + floppy=;; + esac +fi # BeOS if [ "${platform}" == "BeOS" ] ; then @@ -33,5 +84,6 @@ cat << EOF > BuildConfig # BuildConfig # Note: This file has been automatically generated by configure. -GCC_PATH = ${GCC_PATH} ; +FLOPPY_PATH = "$floppy" ; +GCC_PATH = ${GCC_PATH} ; EOF