* Added -j<n> option to configure. It is passed to the

build_cross_tools[_gcc4] script which in turn passes it to make. Cores and
  hyperthreads are plentiful these days; no need to let most of them idle when
  building the cross tools.
* Sorted the configure options alphabetically again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34199 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-23 19:34:55 +00:00
parent d9333ff158
commit 60d8d8fcc5
3 changed files with 55 additions and 54 deletions
+10 -12
View File
@@ -1,21 +1,19 @@
#!/bin/sh #!/bin/sh
# parameters <haiku sourcedir> <buildtools dir> [ <haiku output dir> ] # parameters <haiku sourcedir> <buildtools dir> <haiku output dir>
# get and check the parameters # get and check the parameters
if [ $# -lt 2 ]; then if [ $# -lt 3 ]; then
echo Usage: $0 '<haiku sourcedir> <buildtools dir> [ <haiku output dir> ]' >&2 echo Usage: $0 '<haiku sourcedir> <buildtools dir> <haiku output dir>' >&2
exit 1 exit 1
fi fi
haikuSourceDir=$1 haikuSourceDir=$1
buildToolsDir=$2/legacy buildToolsDir=$2/legacy
haikuOutputDir=$3
shift 3
additionalMakeArgs=$*
if [ $# -lt 3 ]; then
haikuOutputDir=$haikuSourceDir/generated
else
haikuOutputDir=$3
fi
if [ ! -d $haikuSourceDir ]; then if [ ! -d $haikuSourceDir ]; then
echo "No such directory: \"$haikuSourceDir\"" >&2 echo "No such directory: \"$haikuSourceDir\"" >&2
@@ -66,8 +64,8 @@ cd $binutilsObjDir
CFLAGS="-O2" CXXFLAGS="-O2" $buildToolsDir/binutils/configure \ CFLAGS="-O2" CXXFLAGS="-O2" $buildToolsDir/binutils/configure \
--prefix=$installDir --target=i586-pc-haiku --disable-nls \ --prefix=$installDir --target=i586-pc-haiku --disable-nls \
--enable-shared=yes --disable-werror || exit 1 --enable-shared=yes --disable-werror || exit 1
make || exit 1 make $additionalMakeArgs || exit 1
make install || exit 1 make $additionalMakeArgs install || exit 1
PATH=$PATH:$installDir/bin PATH=$PATH:$installDir/bin
export PATH export PATH
@@ -112,13 +110,13 @@ eval "sed $sedExpr Makefile.bak > Makefile" || exit 1
rm Makefile.bak rm Makefile.bak
# make gcc # make gcc
make cross || { make $additionalMakeArgs cross || {
echo "ERROR: Building gcc failed." >&2 echo "ERROR: Building gcc failed." >&2
exit 1 exit 1
} }
# install gcc # install gcc
make install-gcc-cross || { make $additionalMakeArgs install-gcc-cross || {
echo "ERROR: Installing the cross compiler failed." >&2 echo "ERROR: Installing the cross compiler failed." >&2
exit 1 exit 1
} }
+11 -13
View File
@@ -1,16 +1,20 @@
#!/bin/sh #!/bin/sh
# #
# parameters <machine> <haiku sourcedir> <buildtools dir> [ <haiku output dir> ] # parameters <machine> <haiku sourcedir> <buildtools dir> <haiku output dir>
# get and check the parameters # get and check the parameters
if [ $# -lt 3 ]; then if [ $# -lt 4 ]; then
echo Usage: $0 '<machine> <haiku sourcedir> <buildtools dir> [ <haiku output dir> ]' >&2 echo Usage: $0 '<machine> <haiku sourcedir> <buildtools dir>' \
'<haiku output dir>' >&2
exit 1 exit 1
fi fi
haikuMachine=$1 haikuMachine=$1
haikuSourceDir=$2 haikuSourceDir=$2
buildToolsDir=$3 buildToolsDir=$3
haikuOutputDir=$4
shift 4
additionalMakeArgs=$*
case $(uname) in case $(uname) in
FreeBSD|OpenBSD) FreeBSD|OpenBSD)
@@ -37,12 +41,6 @@ arm-*)
;; ;;
esac esac
if [ $# -lt 4 ]; then
haikuOutputDir=$haikuSourceDir/generated
else
haikuOutputDir=$4
fi
if [ ! -d $haikuSourceDir ]; then if [ ! -d $haikuSourceDir ]; then
echo "No such directory: \"$haikuSourceDir\"" >&2 echo "No such directory: \"$haikuSourceDir\"" >&2
exit 1 exit 1
@@ -105,8 +103,8 @@ cd $binutilsObjDir
CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \ CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \
--prefix=$installDir --target=$haikuMachine --disable-nls \ --prefix=$installDir --target=$haikuMachine --disable-nls \
--disable-shared --disable-werror $binutilsConfigureArgs || exit 1 --disable-shared --disable-werror $binutilsConfigureArgs || exit 1
$MAKE || exit 1 $MAKE $additionalMakeArgs || exit 1
$MAKE install || exit 1 $MAKE $additionalMakeArgs install || exit 1
export PATH=$PATH:$installDir/bin export PATH=$PATH:$installDir/bin
@@ -140,13 +138,13 @@ CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure --prefix=$installDir \
$gccConfigureArgs || exit 1 $gccConfigureArgs || exit 1
# make gcc # make gcc
$MAKE || { $MAKE $additionalMakeArgs || {
echo "ERROR: Building gcc failed." >&2 echo "ERROR: Building gcc failed." >&2
exit 1 exit 1
} }
# install gcc # install gcc
$MAKE install || { $MAKE $additionalMakeArgs install || {
echo "ERROR: Installing the cross compiler failed." >&2 echo "ERROR: Installing the cross compiler failed." >&2
exit 1 exit 1
} }
Vendored
+34 -29
View File
@@ -12,6 +12,20 @@ usage()
Usage: $0 <options> Usage: $0 <options>
options: options:
--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.
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.
--bochs-debug Enables bochs serial debug emulation (activated --bochs-debug Enables bochs serial debug emulation (activated
via kernel settings file). via kernel settings file).
--build-cross-tools <build tools dir> --build-cross-tools <build tools dir>
@@ -27,20 +41,6 @@ options:
will not be binary compatible with BeOS R5. will not be binary compatible with BeOS R5.
<arch> specifies the target architecture, either <arch> specifies the target architecture, either
"x86", "ppc", "m68k", "arm" or "mipsel". "x86", "ppc", "m68k", "arm" or "mipsel".
--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.
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.
--cross-tools-prefix <prefix> --cross-tools-prefix <prefix>
Assume cross compilation. <prefix> should be a Assume cross compilation. <prefix> should be a
path to the directory where the cross path to the directory where the cross
@@ -55,6 +55,7 @@ options:
official -- the official Haiku distribution. official -- the official Haiku distribution.
compatible -- a Haiku Compatible (tm) distro. compatible -- a Haiku Compatible (tm) distro.
default -- any other distro (default value). default -- any other distro (default value).
--enable-multiuser Enable experimental multiuser support.
--help Prints out this help. --help Prints out this help.
--include-gpl-addons Include GPL licensed add-ons. --include-gpl-addons Include GPL licensed add-ons.
--include-patented-code Enable code that is known to implemented patented --include-patented-code Enable code that is known to implemented patented
@@ -64,7 +65,9 @@ options:
option only disables code that is currently known option only disables code that is currently known
to be problematic. to be problematic.
--include-3rdparty Include 3rdparty/ in the build system. --include-3rdparty Include 3rdparty/ in the build system.
--enable-multiuser Enable experimental multiuser support. -j<n> Only relevant for --build-cross-tools and
--build-cross-tools-gcc4. Is passed on to the
make building the build tools.
--target=TARGET Select build target platform. [default=${target}] --target=TARGET Select build target platform. [default=${target}]
valid targets=r5,bone,dano,haiku valid targets=r5,bone,dano,haiku
--use-gcc-pipe Build with GCC option -pipe. Speeds up the build --use-gcc-pipe Build with GCC option -pipe. Speeds up the build
@@ -278,6 +281,7 @@ crossToolsPrefix=
buildCrossTools= buildCrossTools=
buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools" buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
buildCrossToolsMachine= buildCrossToolsMachine=
buildCrossToolsJobs=
alternativeGCCOutputDir= alternativeGCCOutputDir=
addAlternativeGCCLibs= addAlternativeGCCLibs=
@@ -302,6 +306,14 @@ set_default_value HAIKU_UNARFLAGS x
# #
while [ $# -gt 0 ] ; do while [ $# -gt 0 ] ; do
case "$1" in case "$1" in
--alternative-gcc-output-dir)
assertparam "$1" $#
cd $2 || exit 1
alternativeGCCOutputDir=`pwd`
addAlternativeGCCLibs=1
cd $currentDir
shift 2
;;
--bochs-debug) bochsDebug=1; shift 1;; --bochs-debug) bochsDebug=1; shift 1;;
--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;; --build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
--build-cross-tools-gcc4) --build-cross-tools-gcc4)
@@ -320,24 +332,11 @@ while [ $# -gt 0 ] ; do
buildCrossToolsMachine=$haikuGCCMachine buildCrossToolsMachine=$haikuGCCMachine
shift 3 shift 3
;; ;;
--alternative-gcc-output-dir)
assertparam "$1" $#
cd $2 || exit 1
alternativeGCCOutputDir=`pwd`
addAlternativeGCCLibs=1
cd $currentDir
shift 2
;;
--cross-tools-prefix) --cross-tools-prefix)
assertparam "$1" $# assertparam "$1" $#
crossToolsPrefix=$2 crossToolsPrefix=$2
shift 2 shift 2
;; ;;
--help | -h) usage; exit 0;;
--include-gpl-addons) includeGPLAddOns=1; shift 1;;
--include-patented-code) includePatentedCode=1; shift 1;;
--include-3rdparty) include3rdParty=1; shift 1;;
--enable-multiuser) enableMultiuser=1; shift 1;;
--distro-compatibility) --distro-compatibility)
assertparam "$1" $# assertparam "$1" $#
distroCompatibility=$2 distroCompatibility=$2
@@ -351,6 +350,12 @@ while [ $# -gt 0 ] ; do
esac esac
shift 2 shift 2
;; ;;
--enable-multiuser) enableMultiuser=1; shift 1;;
--help | -h) usage; exit 0;;
--include-gpl-addons) includeGPLAddOns=1; shift 1;;
--include-patented-code) includePatentedCode=1; shift 1;;
--include-3rdparty) include3rdParty=1; shift 1;;
-j*) buildCrossToolsJobs="$1"; shift 1;;
--target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;; --target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;;
--use-gcc-pipe) useGCCPipe=1; shift 1;; --use-gcc-pipe) useGCCPipe=1; shift 1;;
--use-32bit) use32bit=1; shift 1;; --use-32bit) use32bit=1; shift 1;;
@@ -433,7 +438,7 @@ mkdir -p "$buildOutputDir" || exit 1
# build cross tools from sources # build cross tools from sources
if [ -n "$buildCrossTools" ]; then if [ -n "$buildCrossTools" ]; then
"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \ "$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
"$buildCrossTools" "$outputDir" || exit 1 "$buildCrossTools" "$outputDir" $buildCrossToolsJobs || exit 1
crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-" crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-"
fi fi