Files
haiku-beta6/configure
T

105 lines
1.9 KiB
Bash
Raw Normal View History

2002-07-09 12:24:59 +00:00
#!/bin/sh
#
# configure [ --floppy <floppy location> ]
2002-07-09 12:24:59 +00:00
#
# 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).
2002-07-16 12:39:57 +00:00
--bochs-debug Activates bochs serial debug emulation.
--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
}
# standard_gcc_settings
#
# Sets the variables for a GCC platform.
#
standard_gcc_settings()
{
# PLATFORM_LINKLIBS
gcclib=`gcc -print-libgcc-file-name`
gccdir=`dirname ${gcclib}`
if [ "x${PLATFORM_LINKLIBS}" == "x" ] ; then
PLATFORM_LINKLIBS="-L ${gccdir} -lgcc"
fi
if [ "x${PLATFORM_HEADERS}" == "x" ] ; then
PLATFORM_HEADERS="${gccdir}/include"
fi
}
# default parameter values
#
2002-07-09 12:24:59 +00:00
platform=`uname`
floppy=
2002-07-16 12:39:57 +00:00
bochs_debug=0
# parse parameters
#
while [ $# \> 0 ] ; do
case "$1" in
--floppy) assertparam "$1" $#; floppy=$2; shift 2;;
--bochs-debug) bochs_debug=1; shift 1;;
--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 12:24:59 +00:00
# BeOS
if [ "${platform}" == "BeOS" ] ; then
standard_gcc_settings
2002-07-09 12:24:59 +00:00
# Linux
else if [ "${platform}" == "Linux" ] ; then
standard_gcc_settings
2002-07-09 12:24:59 +00:00
# Unknown platform
else
echo Unsupported platform: ${platform}
exit 1
fi; fi
# Generate BuildConfig
2002-11-20 00:43:42 +00:00
cat << EOF > build/BuildConfig
2002-07-09 12:24:59 +00:00
# BuildConfig
# Note: This file has been automatically generated by configure.
FLOPPY_PATH ?= "${floppy}" ;
PLATFORM_LINKLIBS ?= ${PLATFORM_LINKLIBS} ;
PLATFORM_HEADERS ?= ${PLATFORM_HEADERS} ;
BOCHS_DEBUG_HACK ?= ${bochs_debug} ;
2002-07-15 23:42:06 +00:00
EOF