2002-07-09 16:24:59 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-07-15 02:09:44 +04:00
|
|
|
# configure [ --floppy <floppy location> ]
|
2002-07-09 16:24:59 +04:00
|
|
|
#
|
|
|
|
# No parameters for now.
|
|
|
|
|
2002-07-15 02:09:44 +04:00
|
|
|
# usage
|
|
|
|
#
|
|
|
|
# Prints usage.
|
|
|
|
#
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
Usage: $0 <options>
|
|
|
|
options:
|
|
|
|
--floppy <floppy location> Specifies the location of the floppy
|
|
|
|
(device or image).
|
2002-07-16 03:42:06 +04:00
|
|
|
--debug Activates bochs serial debug emulation.
|
2002-07-15 02:09:44 +04:00
|
|
|
--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
|
|
|
|
#
|
2002-07-09 16:24:59 +04:00
|
|
|
platform=`uname`
|
2002-07-15 02:09:44 +04:00
|
|
|
floppy=
|
2002-07-16 03:42:06 +04:00
|
|
|
debug=0
|
2002-07-15 02:09:44 +04:00
|
|
|
|
|
|
|
# parse parameters
|
|
|
|
#
|
|
|
|
while [ $# \> 0 ] ; do
|
|
|
|
case "$1" in
|
|
|
|
--floppy) assertparam "$1" $#; floppy=$2; shift 2;;
|
2002-07-16 03:42:06 +04:00
|
|
|
--debug) debug=1; shift 1;;
|
2002-07-15 02:09:44 +04:00
|
|
|
--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
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
# BeOS
|
|
|
|
if [ "${platform}" == "BeOS" ] ; then
|
|
|
|
# GGC_PATH
|
|
|
|
if [ "x${GCC_PATH}" == "x" ] ; then
|
|
|
|
gcclib=`gcc -print-libgcc-file-name`
|
|
|
|
GCC_PATH=`dirname ${gcclib}`
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Linux
|
|
|
|
else if [ "${platform}" == "Linux" ] ; then
|
|
|
|
# GGC_PATH
|
|
|
|
if [ "x${GCC_PATH}" == "x" ] ; then
|
|
|
|
gcclib=`gcc -print-libgcc-file-name`
|
|
|
|
GCC_PATH=`dirname ${gcclib}`
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Unknown platform
|
|
|
|
else
|
|
|
|
echo Unsupported platform: ${platform}
|
|
|
|
exit 1
|
|
|
|
fi; fi
|
|
|
|
|
|
|
|
# Generate BuildConfig
|
|
|
|
cat << EOF > BuildConfig
|
|
|
|
# BuildConfig
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
2002-07-15 02:09:44 +04:00
|
|
|
FLOPPY_PATH = "$floppy" ;
|
|
|
|
GCC_PATH = ${GCC_PATH} ;
|
2002-07-09 16:24:59 +04:00
|
|
|
EOF
|
2002-07-16 03:42:06 +04:00
|
|
|
|
|
|
|
# Generate bochs debug emulation hack header
|
|
|
|
cat << EOF > headers/private/kernel/arch/bochs_hack.h
|
|
|
|
// Bochs serial debug emulation hack definition
|
|
|
|
// Note: This file has been automatically generated by configure.
|
|
|
|
|
|
|
|
#define BOCHS_E9_HACK $debug
|
|
|
|
EOF
|
|
|
|
|