e91f3ca1a7
include GPL licensed add-ons into the build. As GPL licensed add-ons may not be used with non GPL compatible applications, this rule normally is not invoked when building the tree. However, if the user is sure that he only uses GPL compatible software, he can use the new ./configure option --include-gpl-addons to enable the including of GPL licensed addons that are integrated by SubIncludeGPL instead of SubInclude. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6919 a95241bf-73f2-0310-859d-f6bbb57e9c96
112 lines
2.1 KiB
Bash
Executable File
112 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# 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).
|
|
--bochs-debug Activates bochs serial debug emulation.
|
|
--include-gpl-addons Include GPL licensed add-ons.
|
|
--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}`
|
|
gcc_version=`gcc -dumpversion`
|
|
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
|
|
#
|
|
platform=`uname`
|
|
gcc_version=
|
|
floppy=
|
|
bochs_debug=0
|
|
include_gpl_addons=0
|
|
|
|
# parse parameters
|
|
#
|
|
while [ $# \> 0 ] ; do
|
|
case "$1" in
|
|
--include-gpl-addons) include_gpl_addons=1; shift 1;;
|
|
--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
|
|
|
|
# BeOS
|
|
if [ "${platform}" == "BeOS" ] ; then
|
|
standard_gcc_settings
|
|
|
|
# Linux
|
|
else if [ "${platform}" == "Linux" ] ; then
|
|
standard_gcc_settings
|
|
|
|
# Unknown platform
|
|
else
|
|
echo Unsupported platform: ${platform}
|
|
exit 1
|
|
fi; fi
|
|
|
|
# Generate BuildConfig
|
|
cat << EOF > build/BuildConfig
|
|
# BuildConfig
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
FLOPPY_PATH ?= "${floppy}" ;
|
|
PLATFORM_LINKLIBS ?= ${PLATFORM_LINKLIBS} ;
|
|
PLATFORM_HEADERS ?= ${PLATFORM_HEADERS} ;
|
|
GCC_RAW_VERSION ?= ${gcc_version} ;
|
|
BOCHS_DEBUG_HACK ?= ${bochs_debug} ;
|
|
INCLUDE_GPL_ADDONS ?= ${include_gpl_addons} ;
|
|
EOF
|
|
|