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:
@@ -1,10 +1,61 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# configure
|
# configure [ --floppy <floppy location> ]
|
||||||
#
|
#
|
||||||
# No parameters for now.
|
# 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`
|
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
|
# BeOS
|
||||||
if [ "${platform}" == "BeOS" ] ; then
|
if [ "${platform}" == "BeOS" ] ; then
|
||||||
@@ -33,5 +84,6 @@ cat << EOF > BuildConfig
|
|||||||
# BuildConfig
|
# BuildConfig
|
||||||
# Note: This file has been automatically generated by configure.
|
# Note: This file has been automatically generated by configure.
|
||||||
|
|
||||||
|
FLOPPY_PATH = "$floppy" ;
|
||||||
GCC_PATH = ${GCC_PATH} ;
|
GCC_PATH = ${GCC_PATH} ;
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user