mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
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:
parent
69b9746989
commit
022fa24472
56
configure
vendored
56
configure
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user