2002-07-09 14:24:59 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-07-15 00:09:44 +02:00
|
|
|
# configure [ --floppy <floppy location> ]
|
2004-10-18 03:59:54 +02:00
|
|
|
|
2002-07-15 00:09:44 +02:00
|
|
|
# usage
|
|
|
|
#
|
|
|
|
# Prints usage.
|
|
|
|
#
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
Usage: $0 <options>
|
|
|
|
options:
|
2004-10-18 03:59:54 +02:00
|
|
|
--floppy <floppy location> Specifies the location of the floppy
|
|
|
|
(device or image).
|
2005-01-20 21:09:25 +01:00
|
|
|
--bochs-debug Enables bochs serial debug emulation (activated
|
|
|
|
via kernel settings file).
|
2004-10-18 03:59:54 +02:00
|
|
|
--target=TARGET Select build target platform. [default=${target}]
|
2004-10-25 10:44:06 +02:00
|
|
|
valid targets=r5,bone,dano,haiku
|
2004-10-18 03:59:54 +02:00
|
|
|
--include-gpl-addons Include GPL licensed add-ons.
|
|
|
|
--help Prints out this help.
|
2002-07-15 00:09:44 +02:00
|
|
|
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 00:07:33 +02: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-12 22:55:52 +02:00
|
|
|
gcc_version=`gcc -dumpversion`
|
2003-05-06 00:07:33 +02:00
|
|
|
if [ "x${PLATFORM_LINKLIBS}" == "x" ] ; then
|
|
|
|
PLATFORM_LINKLIBS="-L ${gccdir} -lgcc"
|
|
|
|
fi
|
|
|
|
if [ "x${PLATFORM_HEADERS}" == "x" ] ; then
|
|
|
|
PLATFORM_HEADERS="${gccdir}/include"
|
|
|
|
fi
|
2004-07-05 20:35:35 +02:00
|
|
|
if [ "${LIBGCC_DIR}" == "" ] ; then
|
|
|
|
LIBGCC_DIR="${gccdir}"
|
|
|
|
fi
|
|
|
|
if [ "${LIBGCC_OBJECTS}" == "" ] ; then
|
|
|
|
LIBGCC_OBJECTS=`ar t ${gccdir}/libgcc.a`
|
|
|
|
fi
|
2003-05-06 00:07:33 +02:00
|
|
|
}
|
|
|
|
|
2002-07-15 00:09:44 +02:00
|
|
|
# default parameter values
|
|
|
|
#
|
2002-07-09 14:24:59 +02:00
|
|
|
platform=`uname`
|
2003-10-12 19:47:07 +02:00
|
|
|
gcc_version=
|
2002-07-15 00:09:44 +02:00
|
|
|
floppy=
|
2002-07-16 14:39:57 +02:00
|
|
|
bochs_debug=0
|
2004-03-06 23:39:28 +01:00
|
|
|
include_gpl_addons=0
|
2005-06-01 16:33:46 +02:00
|
|
|
target=haiku
|
|
|
|
|
|
|
|
# host BeOS recognition not needed anymore
|
|
|
|
# revision=`uname -r`
|
|
|
|
# case "$revision" in
|
|
|
|
# 5.1) target=dano ;;
|
|
|
|
# 5.0.4) target=bone ;;
|
|
|
|
# 5.0*) target=r5 ;;
|
|
|
|
# *) target=haiku ;;
|
|
|
|
#esac
|
2002-07-15 00:09:44 +02:00
|
|
|
|
|
|
|
# parse parameters
|
|
|
|
#
|
|
|
|
while [ $# \> 0 ] ; do
|
|
|
|
case "$1" in
|
2004-03-06 23:39:28 +01:00
|
|
|
--include-gpl-addons) include_gpl_addons=1; shift 1;;
|
2002-07-15 00:09:44 +02:00
|
|
|
--floppy) assertparam "$1" $#; floppy=$2; shift 2;;
|
2002-07-17 18:27:37 +02:00
|
|
|
--bochs-debug) bochs_debug=1; shift 1;;
|
2004-11-01 00:56:16 +01:00
|
|
|
--target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;;
|
2002-07-15 00:09:44 +02: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 14:24:59 +02:00
|
|
|
|
2005-09-02 15:23:51 +02:00
|
|
|
# platform specific GCC settings
|
|
|
|
case "$platform" in
|
|
|
|
BeOS | Haiku | Linux)
|
|
|
|
standard_gcc_settings ;;
|
|
|
|
*)
|
|
|
|
# Unknown platform
|
|
|
|
echo Unsupported platform: ${platform}
|
|
|
|
exit 1 ;;
|
|
|
|
esac
|
2002-07-09 14:24:59 +02:00
|
|
|
|
|
|
|
# Generate BuildConfig
|
2002-11-20 01:43:42 +01:00
|
|
|
cat << EOF > build/BuildConfig
|
2002-07-09 14:24:59 +02:00
|
|
|
# BuildConfig
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
2003-05-06 00:07:33 +02:00
|
|
|
FLOPPY_PATH ?= "${floppy}" ;
|
|
|
|
PLATFORM_LINKLIBS ?= ${PLATFORM_LINKLIBS} ;
|
|
|
|
PLATFORM_HEADERS ?= ${PLATFORM_HEADERS} ;
|
2003-10-12 22:55:52 +02:00
|
|
|
GCC_RAW_VERSION ?= ${gcc_version} ;
|
2004-07-05 20:35:35 +02:00
|
|
|
LIBGCC_DIR ?= ${LIBGCC_DIR} ;
|
2003-05-06 00:07:33 +02:00
|
|
|
BOCHS_DEBUG_HACK ?= ${bochs_debug} ;
|
2004-03-06 23:39:28 +01:00
|
|
|
INCLUDE_GPL_ADDONS ?= ${include_gpl_addons} ;
|
2004-10-18 03:59:54 +02:00
|
|
|
TARGET_PLATFORM ?= ${target} ;
|
2002-07-16 01:42:06 +02:00
|
|
|
EOF
|
|
|
|
|
2005-01-26 02:34:37 +01:00
|
|
|
# Libgcc.a objects
|
|
|
|
|
|
|
|
cat << EOF > build/libgccObjects
|
|
|
|
# libgcc.a objects to be linked against libroot.so
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
|
|
|
LIBGCC_OBJECTS ?= ${LIBGCC_OBJECTS} ;
|
|
|
|
EOF
|
|
|
|
|
2004-11-19 20:24:10 +01:00
|
|
|
# Generate Timezones binaries bindings
|
|
|
|
|
2005-01-26 02:34:37 +01:00
|
|
|
cat << EOF > build/Timezones
|
|
|
|
# Timezones used for the build
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2005-03-17 11:33:36 +01:00
|
|
|
timezones=`echo src/data/etc/timezones/* | sed -e s@src/data/etc/timezones/.svn@@`
|
2004-11-20 00:01:47 +01:00
|
|
|
for f in ${timezones};
|
2004-11-19 20:24:10 +01:00
|
|
|
do
|
|
|
|
|
2004-11-22 00:22:56 +01:00
|
|
|
TZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' $f `
|
2004-11-19 20:24:10 +01:00
|
|
|
|
2005-01-26 02:34:37 +01:00
|
|
|
cat << EOF >> build/Timezones
|
2004-11-19 20:24:10 +01:00
|
|
|
TZ_OBJECTS on <src!data!etc!timezones>${f##src/data/etc/timezones/} ?= $TZOBJECTS ;
|
|
|
|
EOF
|
|
|
|
done
|