Added handling of floppy location parameter.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@227 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2002-07-14 22:09:44 +00:00
parent 69b9746989
commit 022fa24472
1 changed files with 54 additions and 2 deletions

56
configure vendored
View File

@ -1,10 +1,61 @@
#!/bin/sh
#
# configure
# configure [ --floppy <floppy location> ]
#
# No parameters for now.
# usage
#
# Prints usage.
#
usage()
{
cat << EOF
Usage: $0 <options>
options:
--floppy <floppy location> 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