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 16:39:57 +04:00
|
|
|
--bochs-debug Activates bochs serial debug emulation.
|
2004-03-07 01:39:28 +03:00
|
|
|
--include-gpl-addons Include GPL licensed add-ons.
|
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
|
|
|
|
}
|
|
|
|
|
2003-05-06 02:07:33 +04:00
|
|
|
# standard_gcc_settings
|
|
|
|
#
|
|
|
|
# Sets the variables for a GCC platform.
|
|
|
|
#
|
|
|
|
standard_gcc_settings()
|
|
|
|
{
|
|
|
|
# PLATFORM_LINKLIBS
|
|
|
|
gcclib=`gcc -print-libgcc-file-name`
|
|
|
|
gccdir=`dirname ${gcclib}`
|
2003-10-13 00:55:52 +04:00
|
|
|
gcc_version=`gcc -dumpversion`
|
2003-05-06 02:07:33 +04:00
|
|
|
if [ "x${PLATFORM_LINKLIBS}" == "x" ] ; then
|
|
|
|
PLATFORM_LINKLIBS="-L ${gccdir} -lgcc"
|
|
|
|
fi
|
|
|
|
if [ "x${PLATFORM_HEADERS}" == "x" ] ; then
|
|
|
|
PLATFORM_HEADERS="${gccdir}/include"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2002-07-15 02:09:44 +04:00
|
|
|
# default parameter values
|
|
|
|
#
|
2002-07-09 16:24:59 +04:00
|
|
|
platform=`uname`
|
2003-10-12 21:47:07 +04:00
|
|
|
gcc_version=
|
2002-07-15 02:09:44 +04:00
|
|
|
floppy=
|
2002-07-16 16:39:57 +04:00
|
|
|
bochs_debug=0
|
2004-03-07 01:39:28 +03:00
|
|
|
include_gpl_addons=0
|
2002-07-15 02:09:44 +04:00
|
|
|
|
|
|
|
# parse parameters
|
|
|
|
#
|
|
|
|
while [ $# \> 0 ] ; do
|
|
|
|
case "$1" in
|
2004-03-07 01:39:28 +03:00
|
|
|
--include-gpl-addons) include_gpl_addons=1; shift 1;;
|
2002-07-15 02:09:44 +04:00
|
|
|
--floppy) assertparam "$1" $#; floppy=$2; shift 2;;
|
2002-07-17 20:27:37 +04:00
|
|
|
--bochs-debug) bochs_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
|
2003-05-06 02:07:33 +04:00
|
|
|
standard_gcc_settings
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
# Linux
|
|
|
|
else if [ "${platform}" == "Linux" ] ; then
|
2003-05-06 02:07:33 +04:00
|
|
|
standard_gcc_settings
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
# Unknown platform
|
|
|
|
else
|
|
|
|
echo Unsupported platform: ${platform}
|
|
|
|
exit 1
|
|
|
|
fi; fi
|
|
|
|
|
|
|
|
# Generate BuildConfig
|
2002-11-20 03:43:42 +03:00
|
|
|
cat << EOF > build/BuildConfig
|
2002-07-09 16:24:59 +04:00
|
|
|
# BuildConfig
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
2003-05-06 02:07:33 +04:00
|
|
|
FLOPPY_PATH ?= "${floppy}" ;
|
|
|
|
PLATFORM_LINKLIBS ?= ${PLATFORM_LINKLIBS} ;
|
|
|
|
PLATFORM_HEADERS ?= ${PLATFORM_HEADERS} ;
|
2003-10-13 00:55:52 +04:00
|
|
|
GCC_RAW_VERSION ?= ${gcc_version} ;
|
2003-05-06 02:07:33 +04:00
|
|
|
BOCHS_DEBUG_HACK ?= ${bochs_debug} ;
|
2004-03-07 01:39:28 +03:00
|
|
|
INCLUDE_GPL_ADDONS ?= ${include_gpl_addons} ;
|
2002-07-16 03:42:06 +04:00
|
|
|
EOF
|
|
|
|
|