2002-07-09 14:24:59 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2005-10-29 18:27:43 +02:00
|
|
|
# configure [ <options> ]
|
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:
|
2007-08-23 00:07:03 +02:00
|
|
|
--bochs-debug Enables bochs serial debug emulation (activated
|
2005-01-20 21:09:25 +01:00
|
|
|
via kernel settings file).
|
2005-10-29 18:27:43 +02:00
|
|
|
--build-cross-tools <build tools dir>
|
|
|
|
Assume cross compilation. <build tools dir>
|
|
|
|
defines the location of the build tools sources.
|
|
|
|
They will be compiled and placed in the output
|
2006-10-04 01:41:59 +02:00
|
|
|
directory under "cross-tools". The HAIKU_* tools
|
|
|
|
variables will be set accordingly.
|
2005-12-06 23:45:11 +01:00
|
|
|
--build-cross-tools-gcc4 <arch> <build tools dir>
|
2005-11-18 15:17:04 +01:00
|
|
|
Like "--build-cross-tools" just that gcc 4 will
|
2006-10-04 01:41:59 +02:00
|
|
|
be used for cross-compilation. Note, that the
|
|
|
|
resulting Haiku installation built with gcc 4
|
|
|
|
will not be binary compatible with BeOS R5.
|
2005-12-06 23:45:11 +01:00
|
|
|
<arch> specifies the target architecture, either
|
2009-04-18 20:37:07 +02:00
|
|
|
"x86", "ppc", "m68k", "arm" or "mipsel".
|
2008-05-18 01:47:39 +02:00
|
|
|
--alternative-gcc-output-dir <dir>
|
|
|
|
Build a Haiku installation that supports running
|
|
|
|
executables built with a gcc version incompatible
|
|
|
|
with the primary gcc (e.g. gcc 2 executables under
|
|
|
|
a gcc 4 Haiku or vice versa). <dir> specifies the
|
|
|
|
output directory of the other gcc. The directory
|
|
|
|
must already be fully configured.
|
2009-03-19 13:06:15 +01:00
|
|
|
Note, that a sub-jam will be executed when
|
|
|
|
building Haiku. When using a jam that is not
|
|
|
|
simply invoked by "jam", the JAM build variable
|
|
|
|
needs to be set accordingly.
|
|
|
|
To disable building the alternative libraries
|
|
|
|
the variable HAIKU_ADD_ALTERNATIVE_GCC_LIBS can be
|
|
|
|
unset in the UserBuildConfig file.
|
2007-02-04 15:03:21 +01:00
|
|
|
--cross-tools-prefix <prefix>
|
|
|
|
Assume cross compilation. <prefix> should be a
|
|
|
|
path to the directory where the cross
|
|
|
|
compilation tools are located, plus the platform
|
2008-03-24 00:06:23 +01:00
|
|
|
prefix, e.g. "/path/to/tools/i586-pc-haiku-".
|
2007-02-04 15:03:21 +01:00
|
|
|
This overrides the HAIKU_* tool variables.
|
2007-05-20 19:50:11 +02:00
|
|
|
--distro-compatibility <level>
|
|
|
|
The distribution's level of compatibility with
|
|
|
|
the official Haiku distribution. The generated
|
|
|
|
files will contain the respective trademarks
|
|
|
|
accordingly.
|
|
|
|
official -- the official Haiku distribution.
|
|
|
|
compatible -- a Haiku Compatible (tm) distro.
|
|
|
|
default -- any other distro (default value).
|
2007-02-04 15:03:21 +01:00
|
|
|
--help Prints out this help.
|
|
|
|
--include-gpl-addons Include GPL licensed add-ons.
|
2008-01-25 15:48:51 +01:00
|
|
|
--include-3rdparty Include 3rdparty/ in the build system.
|
2008-01-11 19:15:55 +01:00
|
|
|
--enable-multiuser Enable experimental multiuser support.
|
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
|
2007-02-04 15:03:21 +01:00
|
|
|
--use-gcc-pipe Build with GCC option -pipe. Speeds up the build
|
2007-02-15 10:10:31 +01:00
|
|
|
process, but uses more memory.
|
2007-08-23 00:07:03 +02:00
|
|
|
--use-32bit Use -m32 flag on 64bit host gcc compiler.
|
2007-04-08 04:19:01 +02:00
|
|
|
--use-xattr Use Linux xattr support for BeOS attribute
|
|
|
|
emulation. Warning: Make sure your file system
|
|
|
|
supports sufficient attribute sizes (4 KB per
|
|
|
|
file for all attributes won't suffice).
|
2005-10-29 18:27:43 +02:00
|
|
|
|
|
|
|
environment variables:
|
|
|
|
HAIKU_AR The static library archiver. Defaults to "ar".
|
|
|
|
HAIKU_CC The compiler. Defaults to "gcc".
|
|
|
|
HAIKU_LD The linker. Defaults to "ld".
|
|
|
|
HAIKU_OBJCOPY The objcopy to be used. Defaults to "objcopy".
|
|
|
|
HAIKU_RANLIB The static library indexer. Defaults to "ranlib".
|
2009-04-13 12:50:17 +02:00
|
|
|
HAIKU_YASM The yasm assembler (x86 only).
|
2005-10-29 18:27:43 +02:00
|
|
|
HAIKU_CPPFLAGS The preprocessor flags. Defaults to "".
|
|
|
|
HAIKU_CCFLAGS The C flags. Defaults to "".
|
|
|
|
HAIKU_CXXFLAGS The C++ flags. Defaults to "".
|
|
|
|
HAIKU_LDFLAGS The linker flags. Defaults to "".
|
|
|
|
HAIKU_ARFLAGS The flags passed to HAIKU_AR for archiving.
|
|
|
|
Defaults to "ru".
|
|
|
|
HAIKU_UNARFLAGS The flags passed to HAIKU_AR for unarchiving.
|
|
|
|
Defaults to "x".
|
2009-02-24 15:20:24 +01:00
|
|
|
|
2009-02-03 02:08:40 +01:00
|
|
|
Non-standard output directories:
|
2009-02-24 15:20:24 +01:00
|
|
|
By default all objects, build configuration, and other related files are
|
2009-02-03 02:08:40 +01:00
|
|
|
stored in /path/to/haiku_source/generated. To store objects in a non-default
|
2009-02-24 15:20:24 +01:00
|
|
|
location, run "../../relative/path/to/haiku_source/configure <options>" from
|
|
|
|
within your non-default location. "jam [ options ] targets" can then be run
|
|
|
|
directly inside your non-default location. Another option is to invoke "jam
|
|
|
|
[ options ] targets" from within haiku_source. This can be accomplished by
|
|
|
|
either "export HAIKU_OUTPUT_DIR=your non-default location" before invoking
|
|
|
|
jam or by creating a symlink of haiku_source/generated pointing to your
|
2009-02-03 02:08:40 +01:00
|
|
|
non-default location and running jam.
|
|
|
|
|
|
|
|
|
2002-07-15 00:09:44 +02:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
# assertparam
|
|
|
|
#
|
|
|
|
# Checks whether at least one parameter is left.
|
|
|
|
#
|
|
|
|
assertparam()
|
|
|
|
{
|
2005-12-06 23:45:11 +01:00
|
|
|
if [ $2 -lt 2 ]; then
|
2002-07-15 00:09:44 +02:00
|
|
|
echo $0: \`$1\': Parameter expected.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2005-12-06 23:45:11 +01:00
|
|
|
# assertparams
|
|
|
|
#
|
|
|
|
# Checks whether at least a certain number of parameters is left.
|
|
|
|
#
|
|
|
|
assertparams()
|
|
|
|
{
|
|
|
|
if [ $3 -le $2 ]; then
|
|
|
|
echo $0: \`$1\': Not enough parameters.
|
|
|
|
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
|
2005-10-29 18:27:43 +02:00
|
|
|
gcclib=`$HAIKU_CC -print-libgcc-file-name`
|
2003-05-06 00:07:33 +02:00
|
|
|
gccdir=`dirname ${gcclib}`
|
2006-09-03 19:22:48 +02:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
haikuGCCVersion=`$HAIKU_CC -dumpversion`
|
|
|
|
haikuGCCMachine=`$HAIKU_CC -dumpmachine`
|
2007-08-23 00:07:03 +02:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
HAIKU_GCC_LIB_DIR=${gccdir}
|
|
|
|
HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
|
|
|
|
HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
|
2009-01-28 03:08:39 +01:00
|
|
|
HAIKU_GCC_HEADERS_DIR="${gccdir}/include
|
|
|
|
${gccdir}/include-fixed"
|
2005-12-09 15:08:20 +01:00
|
|
|
HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o`
|
|
|
|
# Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and
|
|
|
|
# neither needed nor wanted.
|
2005-11-12 23:58:54 +01:00
|
|
|
|
|
|
|
case $haikuGCCVersion in
|
|
|
|
4.*)
|
2006-09-03 19:22:48 +02:00
|
|
|
# for gcc 4 we use the libstdc++ and libsupc++ that come with the
|
|
|
|
# compiler
|
2005-11-12 23:58:54 +01:00
|
|
|
haikuStaticLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.a`
|
|
|
|
haikuSharedLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.so`
|
2005-11-14 14:47:52 +01:00
|
|
|
haikuStaticLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.a`
|
|
|
|
haikuSharedLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.so`
|
2009-01-28 23:24:13 +01:00
|
|
|
|
|
|
|
local headers
|
|
|
|
if [ -d $gccdir/../../../../$haikuGCCMachine/include/c++/$haikuGCCVersion ]; then
|
|
|
|
headers=$gccdir/../../../../$haikuGCCMachine/include/c++/$haikuGCCVersion
|
|
|
|
else
|
|
|
|
headers=$gccdir/../../../../include/c++/$haikuGCCVersion
|
|
|
|
fi
|
|
|
|
|
2006-09-17 00:25:49 +02:00
|
|
|
haikuCxxHeadersDir=$headers
|
|
|
|
for d in $haikuGCCMachine backward ext; do
|
|
|
|
# Note: We need the line break, otherwise the line might become
|
|
|
|
# too long for jam (512 bytes max).
|
|
|
|
haikuCxxHeadersDir="$haikuCxxHeadersDir
|
|
|
|
$headers/$d"
|
|
|
|
done
|
|
|
|
|
2007-08-23 00:07:03 +02:00
|
|
|
|
|
|
|
# when not building the crosscompiler, to use cpp headers from
|
2006-09-17 15:32:53 +02:00
|
|
|
# tree first, but fallback to local C++ system headers (like <new>)
|
|
|
|
# if [ "$buildCrossTools" = "" ]; then
|
|
|
|
# haikuCxxHeadersDir="headers/cpp $haikuCxxHeadersDir"
|
|
|
|
# fi
|
2006-09-17 00:25:49 +02:00
|
|
|
|
2005-11-12 23:58:54 +01:00
|
|
|
if [ $haikuStaticLibStdCxx = libstdc++.a ]; then
|
|
|
|
haikuStaticLibStdCxx=
|
|
|
|
fi
|
|
|
|
if [ $haikuSharedLibStdCxx = libstdc++.so ]; then
|
|
|
|
haikuSharedLibStdCxx=
|
|
|
|
fi
|
2005-11-14 14:47:52 +01:00
|
|
|
if [ $haikuStaticLibSupCxx = libsupc++.a ]; then
|
|
|
|
haikuStaticLibSupCxx=
|
|
|
|
fi
|
|
|
|
if [ $haikuSharedLibSupCxx = libsupc++.so ]; then
|
|
|
|
haikuSharedLibSupCxx=
|
|
|
|
fi
|
2005-11-12 23:58:54 +01:00
|
|
|
;;
|
2006-11-16 20:52:27 +01:00
|
|
|
2.9*)
|
2006-09-03 19:22:48 +02:00
|
|
|
# check for correct (most up-to-date) legacy compiler and complain
|
|
|
|
# if an older one is installed
|
|
|
|
if [ $haikuGCCVersion != $haikuRequiredLegacyGCCVersion ]; then
|
|
|
|
echo "GCC version $haikuRequiredLegacyGCCVersion is required!";
|
|
|
|
echo "Please download it from www.haiku-os.org...";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
;;
|
2005-11-12 23:58:54 +01:00
|
|
|
esac
|
2005-10-29 18:27:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# set_default_value
|
|
|
|
#
|
|
|
|
# Set the value for a variable, if no value is set yet.
|
|
|
|
#
|
|
|
|
set_default_value()
|
|
|
|
{
|
2006-01-11 09:36:21 +01:00
|
|
|
eval "$1=\${$1-$2}"
|
2005-10-29 18:27:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# get_build_tool_path
|
|
|
|
#
|
|
|
|
# Gets a usable absolute path of a build tool.
|
|
|
|
#
|
|
|
|
get_build_tool_path()
|
|
|
|
{
|
|
|
|
local var="HAIKU_$1"
|
|
|
|
local tool=$2
|
|
|
|
local path="${crossToolsPrefix}$tool"
|
2007-08-23 00:07:03 +02:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
if [ -f "$path" ]; then
|
|
|
|
# get absolute path
|
2008-04-12 04:40:10 +02:00
|
|
|
local oldPwd="`pwd`"
|
|
|
|
cd "`dirname "$path"`"
|
|
|
|
path="`pwd`/`basename "$path"`"
|
2005-10-29 18:27:43 +02:00
|
|
|
cd $oldPwd
|
|
|
|
else
|
|
|
|
which "$path" &> /dev/null || {
|
|
|
|
echo "Build tool \"$path\" not found." >&2
|
|
|
|
exit 1
|
|
|
|
}
|
2004-07-05 20:35:35 +02:00
|
|
|
fi
|
2007-08-23 00:07:03 +02:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
eval "$var=$path"
|
2003-05-06 00:07:33 +02:00
|
|
|
}
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
# get cwd and the source directory
|
|
|
|
currentDir=`pwd`
|
2006-08-03 19:57:34 +02:00
|
|
|
cd `dirname "$0"`
|
2005-10-29 18:27:43 +02:00
|
|
|
sourceDir=`pwd`
|
2006-08-03 19:57:34 +02:00
|
|
|
cd "$currentDir"
|
2005-10-29 18:27:43 +02:00
|
|
|
|
2002-07-15 00:09:44 +02:00
|
|
|
# default parameter values
|
|
|
|
#
|
2002-07-09 14:24:59 +02:00
|
|
|
platform=`uname`
|
2009-02-24 15:20:24 +01:00
|
|
|
platformMachine=`uname -m`
|
2005-10-29 18:27:43 +02:00
|
|
|
haikuGCCVersion=
|
2008-03-24 00:06:23 +01:00
|
|
|
haikuGCCMachine=i586-pc-haiku
|
2005-11-12 23:58:54 +01:00
|
|
|
haikuStaticLibStdCxx=
|
|
|
|
haikuSharedLibStdCxx=
|
2005-11-14 14:47:52 +01:00
|
|
|
haikuStaticLibSupCxx=
|
|
|
|
haikuSharedLibSupCxx=
|
2005-11-12 23:58:54 +01:00
|
|
|
haikuCxxHeadersDir=
|
2006-01-30 19:38:23 +01:00
|
|
|
hostGCCVersion=`gcc -dumpversion`
|
2009-02-24 15:20:24 +01:00
|
|
|
bochsDebug=0
|
|
|
|
includeGPLAddOns=0
|
|
|
|
include3rdParty=0
|
|
|
|
enableMultiuser=0
|
2007-05-20 19:50:11 +02:00
|
|
|
distroCompatibility=default
|
2005-06-01 16:33:46 +02:00
|
|
|
target=haiku
|
2009-04-13 12:50:17 +02:00
|
|
|
targetArch=x86
|
2009-02-24 15:20:24 +01:00
|
|
|
useGCCPipe=0
|
|
|
|
use32bit=0
|
|
|
|
useXattr=0
|
2005-10-29 18:27:43 +02:00
|
|
|
crossToolsPrefix=
|
|
|
|
buildCrossTools=
|
2005-11-18 15:17:04 +01:00
|
|
|
buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
|
2005-12-06 23:45:11 +01:00
|
|
|
buildCrossToolsMachine=
|
2008-05-18 01:47:39 +02:00
|
|
|
alternativeGCCOutputDir=
|
2009-03-19 13:06:15 +01:00
|
|
|
addAlternativeGCCLibs=
|
2005-10-29 18:27:43 +02:00
|
|
|
|
2008-10-25 16:19:21 +02:00
|
|
|
haikuRequiredLegacyGCCVersion="2.95.3-haiku-081024"
|
2008-04-12 04:40:10 +02:00
|
|
|
export haikuRequiredLegacyGCCVersion
|
2006-09-16 17:40:36 +02:00
|
|
|
# version of legacy gcc required to build haiku
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
set_default_value HAIKU_AR ar
|
|
|
|
set_default_value HAIKU_CC gcc
|
|
|
|
set_default_value HAIKU_LD ld
|
|
|
|
set_default_value HAIKU_OBJCOPY objcopy
|
|
|
|
set_default_value HAIKU_RANLIB ranlib
|
2009-04-13 12:50:17 +02:00
|
|
|
set_default_value HAIKU_YASM yasm
|
2005-10-29 18:27:43 +02:00
|
|
|
set_default_value HAIKU_CPPFLAGS ""
|
|
|
|
set_default_value HAIKU_CCFLAGS ""
|
|
|
|
set_default_value HAIKU_CXXFLAGS ""
|
|
|
|
set_default_value HAIKU_LDFLAGS ""
|
|
|
|
set_default_value HAIKU_ARFLAGS ru
|
|
|
|
set_default_value HAIKU_UNARFLAGS x
|
2005-06-01 16:33:46 +02:00
|
|
|
|
2002-07-15 00:09:44 +02:00
|
|
|
# parse parameters
|
|
|
|
#
|
2005-12-06 23:45:11 +01:00
|
|
|
while [ $# -gt 0 ] ; do
|
2002-07-15 00:09:44 +02:00
|
|
|
case "$1" in
|
2009-02-24 15:20:24 +01:00
|
|
|
--bochs-debug) bochsDebug=1; shift 1;;
|
2006-10-04 01:41:59 +02:00
|
|
|
--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
|
2008-05-18 01:47:39 +02:00
|
|
|
--build-cross-tools-gcc4)
|
|
|
|
assertparams "$1" 2 $#
|
|
|
|
buildCrossTools=$3
|
|
|
|
buildCrossToolsScript="${buildCrossToolsScript}_gcc4"
|
|
|
|
case "$2" in
|
|
|
|
x86) haikuGCCMachine=i586-pc-haiku;;
|
2009-04-13 12:50:17 +02:00
|
|
|
ppc) haikuGCCMachine=powerpc-apple-haiku; targetArch=ppc;;
|
|
|
|
m68k) haikuGCCMachine=m68k-unknown-haiku; targetArch=m86k;;
|
|
|
|
arm) haikuGCCMachine=arm-unknown-haiku; targetArch=arm;;
|
|
|
|
mipsel) haikuGCCMachine=mipsel-unknown-haiku; targetArch=mips;;
|
2008-05-18 01:47:39 +02:00
|
|
|
*) echo "Unsupported target architecture: $2"
|
|
|
|
exit 1;;
|
|
|
|
esac
|
|
|
|
buildCrossToolsMachine=$haikuGCCMachine
|
|
|
|
shift 3
|
|
|
|
;;
|
|
|
|
--alternative-gcc-output-dir)
|
|
|
|
assertparam "$1" $#
|
|
|
|
cd $2 || exit 1
|
|
|
|
alternativeGCCOutputDir=`pwd`
|
2009-03-19 13:06:15 +01:00
|
|
|
addAlternativeGCCLibs=1
|
2008-05-18 01:47:39 +02:00
|
|
|
cd $currentDir
|
|
|
|
shift 2
|
|
|
|
;;
|
|
|
|
--cross-tools-prefix)
|
|
|
|
assertparam "$1" $#
|
|
|
|
crossToolsPrefix=$2
|
|
|
|
shift 2
|
|
|
|
;;
|
2002-07-15 00:09:44 +02:00
|
|
|
--help | -h) usage; exit 0;;
|
2009-02-24 15:20:24 +01:00
|
|
|
--include-gpl-addons) includeGPLAddOns=1; shift 1;;
|
|
|
|
--include-3rdparty) include3rdParty=1; shift 1;;
|
|
|
|
--enable-multiuser) enableMultiuser=1; shift 1;;
|
2007-05-20 19:50:11 +02:00
|
|
|
--distro-compatibility)
|
2008-05-18 01:47:39 +02:00
|
|
|
assertparam "$1" $#
|
|
|
|
distroCompatibility=$2
|
|
|
|
case "$distroCompatibility" in
|
|
|
|
official) ;;
|
|
|
|
compatible) ;;
|
|
|
|
default) ;;
|
|
|
|
*) echo "Invalid distro compatibility" \
|
|
|
|
"level: $distroCompatibility"
|
|
|
|
exit 1;;
|
|
|
|
esac
|
|
|
|
shift 2
|
|
|
|
;;
|
2007-02-04 15:03:21 +01:00
|
|
|
--target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;;
|
2009-02-24 15:20:24 +01:00
|
|
|
--use-gcc-pipe) useGCCPipe=1; shift 1;;
|
|
|
|
--use-32bit) use32bit=1; shift 1;;
|
|
|
|
--use-xattr) useXattr=1; shift 1;;
|
2002-07-15 00:09:44 +02:00
|
|
|
*) echo Invalid argument: \`$1\'; exit 1;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2005-10-31 01:00:27 +01:00
|
|
|
# detect the build platform
|
2005-10-29 18:27:43 +02:00
|
|
|
case "${platform}" in
|
2005-10-31 01:00:27 +01:00
|
|
|
BeOS) revision=`uname -r`
|
|
|
|
case "$revision" in
|
2005-11-08 10:29:13 +01:00
|
|
|
6.*) buildPlatform=dano ;;
|
2005-10-31 01:00:27 +01:00
|
|
|
5.1) buildPlatform=dano ;;
|
|
|
|
5.0.4) buildPlatform=bone ;;
|
|
|
|
5.0*) buildPlatform=r5 ;;
|
|
|
|
*) echo Unknown BeOS version: $revision
|
|
|
|
exit 1 ;;
|
|
|
|
esac
|
|
|
|
;;
|
2007-05-18 17:59:04 +02:00
|
|
|
Darwin) buildPlatform=darwin ;;
|
2009-02-24 15:14:40 +01:00
|
|
|
FreeBSD) buildPlatform=freebsd
|
2009-02-24 15:20:24 +01:00
|
|
|
if [ "$use32bit" = 1 ] ; then
|
|
|
|
echo Unsupported platform: FreeBSD ${platformMachine}
|
|
|
|
exit 1
|
2009-02-24 15:14:40 +01:00
|
|
|
fi ;;
|
2007-08-02 23:13:56 +02:00
|
|
|
Haiku) buildPlatform=haiku_host ;;
|
|
|
|
Linux) buildPlatform=linux ;;
|
2008-10-20 21:44:06 +02:00
|
|
|
OpenBSD) buildPlatform=openbsd ;;
|
2008-04-12 04:40:10 +02:00
|
|
|
SunOS) buildPlatform=sunos ;;
|
2008-07-23 23:38:49 +02:00
|
|
|
CYGWIN_NT-*) buildPlatform=cygwin ;;
|
2005-10-29 18:27:43 +02:00
|
|
|
*) echo Unsupported platform: ${platform}
|
|
|
|
exit 1 ;;
|
2005-09-02 15:23:51 +02:00
|
|
|
esac
|
2002-07-09 14:24:59 +02:00
|
|
|
|
2009-04-13 12:50:17 +02:00
|
|
|
# check yasm version
|
|
|
|
if [ $targetArch = "x86" ]; then
|
|
|
|
$HAIKU_YASM --version > /dev/null || {
|
2009-04-14 02:07:31 +02:00
|
|
|
echo "The yasm assembler version 0.7.0 or later must be installed."
|
2009-04-13 12:50:17 +02:00
|
|
|
echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
set -- $($HAIKU_YASM --version | head -n 1)
|
|
|
|
versionOK=0
|
|
|
|
case $2 in
|
2009-04-14 02:07:31 +02:00
|
|
|
0.[0-6].*) ;;
|
2009-04-13 12:50:17 +02:00
|
|
|
*) versionOK=1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ $versionOK = 0 ]; then
|
2009-04-14 02:07:31 +02:00
|
|
|
echo "The yasm assembler version 0.7.0 or later must be installed."
|
2009-04-13 12:50:17 +02:00
|
|
|
echo "The installed version is $2."
|
|
|
|
echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
# create output directory
|
|
|
|
if [ "$currentDir" = "$sourceDir" ]; then
|
|
|
|
outputDir=$currentDir/generated
|
|
|
|
else
|
|
|
|
outputDir=$currentDir
|
|
|
|
fi
|
2006-08-03 19:57:34 +02:00
|
|
|
buildOutputDir="$outputDir/build"
|
|
|
|
buildAttributesDir="$outputDir/attributes"
|
|
|
|
mkdir -p "$buildOutputDir" || exit 1
|
2005-10-29 18:27:43 +02:00
|
|
|
|
|
|
|
# build cross tools from sources
|
|
|
|
if [ -n "$buildCrossTools" ]; then
|
2005-12-06 23:45:11 +01:00
|
|
|
"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
|
2006-08-03 19:57:34 +02:00
|
|
|
"$buildCrossTools" "$outputDir" || exit 1
|
2006-10-04 01:41:59 +02:00
|
|
|
crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-"
|
2005-10-29 18:27:43 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# cross tools
|
|
|
|
if [ -n "$crossToolsPrefix" ]; then
|
|
|
|
get_build_tool_path AR ar
|
|
|
|
get_build_tool_path CC gcc
|
|
|
|
get_build_tool_path LD ld
|
|
|
|
get_build_tool_path OBJCOPY objcopy
|
|
|
|
get_build_tool_path RANLIB ranlib
|
|
|
|
fi
|
|
|
|
|
|
|
|
# prepare gcc settings
|
|
|
|
standard_gcc_settings
|
|
|
|
|
2007-02-21 15:08:08 +01:00
|
|
|
# check whether the Haiku compiler really targets Haiku or BeOS
|
|
|
|
case "$haikuGCCMachine" in
|
|
|
|
*-*-haiku) ;;
|
|
|
|
*-*-beos) ;;
|
|
|
|
*) echo The compiler specified as Haiku target compiler is not a valid \
|
|
|
|
Haiku cross-compiler. Please see ReadMe.cross-compile. >&2
|
|
|
|
echo compiler: $HAIKU_CC
|
|
|
|
echo compiler is configured for target: $haikuGCCMachine
|
|
|
|
exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
2002-07-09 14:24:59 +02:00
|
|
|
# Generate BuildConfig
|
2006-08-03 19:57:34 +02:00
|
|
|
cat << EOF > "$buildOutputDir/BuildConfig"
|
2002-07-09 14:24:59 +02:00
|
|
|
# BuildConfig
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
2007-05-20 19:50:11 +02:00
|
|
|
TARGET_PLATFORM ?= "${target}" ;
|
|
|
|
HOST_PLATFORM ?= "${buildPlatform}" ;
|
2005-10-29 18:27:43 +02:00
|
|
|
|
2009-02-24 15:20:24 +01:00
|
|
|
BOCHS_DEBUG_HACK ?= "${bochsDebug}" ;
|
|
|
|
INCLUDE_GPL_ADDONS ?= "${includeGPLAddOns}" ;
|
|
|
|
HAIKU_INCLUDE_3RDPARTY ?= "${include3rdParty}" ;
|
|
|
|
HAIKU_ENABLE_MULTIUSER ?= "${enableMultiuser}" ;
|
2008-05-18 01:47:39 +02:00
|
|
|
HAIKU_DISTRO_COMPATIBILITY ?= "${distroCompatibility}" ;
|
2009-02-24 15:20:24 +01:00
|
|
|
HAIKU_USE_GCC_PIPE ?= "${useGCCPipe}" ;
|
|
|
|
HAIKU_HOST_USE_32BIT ?= "${use32bit}" ;
|
|
|
|
HAIKU_HOST_USE_XATTR ?= "${useXattr}" ;
|
2008-05-18 01:47:39 +02:00
|
|
|
HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR ?= ${alternativeGCCOutputDir} ;
|
2009-03-19 13:06:15 +01:00
|
|
|
HAIKU_ADD_ALTERNATIVE_GCC_LIBS ?= ${addAlternativeGCCLibs} ;
|
2007-02-04 15:03:21 +01:00
|
|
|
|
2007-05-20 19:50:11 +02:00
|
|
|
HAIKU_GCC_RAW_VERSION ?= ${haikuGCCVersion} ;
|
|
|
|
HAIKU_GCC_MACHINE ?= ${haikuGCCMachine} ;
|
|
|
|
HAIKU_GCC_LIB_DIR ?= ${HAIKU_GCC_LIB_DIR} ;
|
|
|
|
HAIKU_GCC_HEADERS_DIR ?= ${HAIKU_GCC_HEADERS_DIR} ;
|
|
|
|
HAIKU_GCC_LIBGCC ?= ${HAIKU_GCC_LIBGCC} ;
|
2005-10-29 18:27:43 +02:00
|
|
|
|
2007-05-20 19:50:11 +02:00
|
|
|
HAIKU_STATIC_LIBSTDC++ ?= ${haikuStaticLibStdCxx} ;
|
|
|
|
HAIKU_SHARED_LIBSTDC++ ?= ${haikuSharedLibStdCxx} ;
|
|
|
|
HAIKU_STATIC_LIBSUPC++ ?= ${haikuStaticLibSupCxx} ;
|
|
|
|
HAIKU_SHARED_LIBSUPC++ ?= ${haikuSharedLibSupCxx} ;
|
|
|
|
HAIKU_C++_HEADERS_DIR ?= ${haikuCxxHeadersDir} ;
|
2005-11-12 23:58:54 +01:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
HAIKU_BUILD_ATTRIBUTES_DIR ?= ${buildAttributesDir} ;
|
|
|
|
|
2007-05-20 19:50:11 +02:00
|
|
|
HAIKU_AR ?= ${HAIKU_AR} ;
|
|
|
|
HAIKU_CC ?= ${HAIKU_CC} ;
|
|
|
|
HAIKU_LD ?= ${HAIKU_LD} ;
|
|
|
|
HAIKU_OBJCOPY ?= ${HAIKU_OBJCOPY} ;
|
|
|
|
HAIKU_RANLIB ?= ${HAIKU_RANLIB} ;
|
2009-04-13 12:50:17 +02:00
|
|
|
HAIKU_YASM ?= ${HAIKU_YASM} ;
|
2007-05-20 19:50:11 +02:00
|
|
|
HAIKU_CPPFLAGS ?= ${HAIKU_CPPFLAGS} ;
|
|
|
|
HAIKU_CCFLAGS ?= ${HAIKU_CCFLAGS} ;
|
|
|
|
HAIKU_CXXFLAGS ?= ${HAIKU_CXXFLAGS} ;
|
|
|
|
HAIKU_LDFLAGS ?= ${HAIKU_LDFLAGS} ;
|
|
|
|
HAIKU_ARFLAGS ?= ${HAIKU_ARFLAGS} ;
|
|
|
|
HAIKU_UNARFLAGS ?= ${HAIKU_UNARFLAGS} ;
|
|
|
|
|
|
|
|
HOST_GCC_RAW_VERSION ?= ${hostGCCVersion} ;
|
2005-11-12 23:58:54 +01:00
|
|
|
|
2002-07-16 01:42:06 +02:00
|
|
|
EOF
|
|
|
|
|
2005-01-26 02:34:37 +01:00
|
|
|
# Libgcc.a objects
|
|
|
|
|
2006-08-03 19:57:34 +02:00
|
|
|
cat << EOF > "$buildOutputDir/libgccObjects"
|
2005-01-26 02:34:37 +01:00
|
|
|
# libgcc.a objects to be linked against libroot.so
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
HAIKU_GCC_LIBGCC_OBJECTS ?= ${HAIKU_GCC_LIBGCC_OBJECTS} ;
|
2005-01-26 02:34:37 +01:00
|
|
|
EOF
|
|
|
|
|
2004-11-19 20:24:10 +01:00
|
|
|
# Generate Timezones binaries bindings
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
timezoneSources="africa antarctica asia australasia europe northamerica
|
|
|
|
southamerica pacificnew etcetera factory backward"
|
|
|
|
|
2006-08-03 19:57:34 +02:00
|
|
|
cat << EOF > "$buildOutputDir/Timezones"
|
2005-01-26 02:34:37 +01:00
|
|
|
# Timezones used for the build
|
|
|
|
# Note: This file has been automatically generated by configure.
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
HAIKU_TIME_ZONE_SOURCES = ${timezoneSources} ;
|
|
|
|
|
2005-01-26 02:34:37 +01:00
|
|
|
EOF
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
for source in ${timezoneSources}; do
|
|
|
|
f=$sourceDir/src/data/etc/timezones/$source
|
2004-11-19 20:24:10 +01:00
|
|
|
|
2006-08-03 19:57:34 +02:00
|
|
|
TZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' "$f" `
|
2004-11-19 20:24:10 +01:00
|
|
|
|
2006-08-03 19:57:34 +02:00
|
|
|
cat << EOF >> "$buildOutputDir/Timezones"
|
2005-10-29 18:27:43 +02:00
|
|
|
TZ_OBJECTS on <timezone-source>${source} ?= $TZOBJECTS ;
|
2004-11-19 20:24:10 +01:00
|
|
|
EOF
|
|
|
|
done
|
2005-10-29 18:27:43 +02:00
|
|
|
|
2008-05-18 01:47:39 +02:00
|
|
|
# Generate a boot strap Jamfile in the output directory.
|
2005-10-29 18:27:43 +02:00
|
|
|
|
|
|
|
cat << EOF > $outputDir/Jamfile
|
|
|
|
# automatically generated Jamfile
|
|
|
|
|
|
|
|
HAIKU_TOP = ${sourceDir} ;
|
|
|
|
HAIKU_OUTPUT_DIR = ${outputDir} ;
|
|
|
|
|
|
|
|
include [ FDirName \$(HAIKU_TOP) Jamfile ] ;
|
|
|
|
|
|
|
|
EOF
|