From be2bd5ef4b2537602e688fd2cb4c5e5add4dce50 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 1 Oct 2006 18:52:48 +0000 Subject: [PATCH] * implemented a suggestion of korli: the legacy & gcc4 cross-tools are now built in separate folders ('cross-tools-legacy' and 'cross-tools-gcc4') and you can use the new cmdline-switches 'use-cross-tools' and 'use-cross-tools-gcc4' to switch between those two. Before, you always had to recompile the tools in order to switch. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18985 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/scripts/build_cross_tools | 4 +-- build/scripts/build_cross_tools_gcc4 | 4 +-- configure | 46 +++++++++++++++++++++++----- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/build/scripts/build_cross_tools b/build/scripts/build_cross_tools index a07a230ea3..9e21d39bb8 100755 --- a/build/scripts/build_cross_tools +++ b/build/scripts/build_cross_tools @@ -48,8 +48,8 @@ haikuOutputDir=$(pwd) # create the object and installation directories for the cross compilation tools -installDir=$haikuOutputDir/cross-tools -objDir=$haikuOutputDir/cross-tools-build +installDir=$haikuOutputDir/cross-tools-legacy +objDir=$haikuOutputDir/cross-tools-legacyt-build binutilsObjDir=$objDir/binutils gccObjDir=$objDir/gcc tmpIncludeDir=$objDir/sysincludes diff --git a/build/scripts/build_cross_tools_gcc4 b/build/scripts/build_cross_tools_gcc4 index 00ed393b1b..6b9269ef32 100755 --- a/build/scripts/build_cross_tools_gcc4 +++ b/build/scripts/build_cross_tools_gcc4 @@ -62,8 +62,8 @@ fi # create the object and installation directories for the cross compilation tools -installDir=$haikuOutputDir/cross-tools -objDir=$haikuOutputDir/cross-tools-build +installDir=$haikuOutputDir/cross-tools-gcc4 +objDir=$haikuOutputDir/cross-tools-gcc4-build binutilsObjDir=$objDir/binutils gccObjDir=$objDir/gcc tmpIncludeDir=$objDir/sysincludes diff --git a/configure b/configure index c901eb6a41..79cf1729a0 100755 --- a/configure +++ b/configure @@ -26,13 +26,25 @@ options: Assume cross compilation. defines the location of the build tools sources. They will be compiled and placed in the output - directory under "cross-tools". The HAIKU_* tools - variables will be set accordingly. + directory under "cross-tools-legacy". The HAIKU_* + tools variables will be set accordingly. --build-cross-tools-gcc4 Like "--build-cross-tools" just that gcc 4 will - be used for cross-compilation. Note, that the - resulting Haiku installation built with gcc 4 - will not be binary compatible with BeOS R5. + be used for cross-compilation and the cross-tools + will be placed in the output directory under + "cross-tools-current". Note, that the resulting + Haiku installation built with gcc 4 will not be + binary compatible with BeOS R5. + specifies the target architecture, either + "x86" or "ppc". + --use-cross-tools + Selects the cross-tools from "cross-tools-legacy" + for compilation. The HAIKU_* tools variables will + be set accordingly. + --use-cross-tools-gcc4 + Selects the cross-tools from "cross-tools-gcc4" + for compilation. The HAIKU_* tools variables will + be set accordingly. specifies the target architecture, either "x86" or "ppc". --target=TARGET Select build target platform. [default=${target}] @@ -236,7 +248,10 @@ while [ $# -gt 0 ] ; do --bochs-debug) bochs_debug=1; shift 1;; --target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;; --cross-tools-prefix) assertparam "$1" $#; crossToolsPrefix=$2; shift 2;; - --build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;; + --build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; + crossToolsFolder="cross-tools-legacy"; + shift 2;; + --use-cross-tools) crossToolsFolder="cross-tools-legacy"; shift 1;; --build-cross-tools-gcc4) assertparams "$1" 2 $#; buildCrossTools=$3; buildCrossToolsScript="${buildCrossToolsScript}_gcc4"; case "$2" in @@ -245,8 +260,19 @@ while [ $# -gt 0 ] ; do *) echo "Unsupported target architecture: $2" exit 1;; esac - buildCrossToolsMachine=$haikuGCCMachine + buildCrossToolsMachine=$haikuGCCMachine; + crossToolsFolder="cross-tools-gcc4"; shift 3;; + --use-cross-tools-gcc4) assertparam "$1" $#; + case "$2" in + x86) haikuGCCMachine=i586-pc-haiku;; + ppc) haikuGCCMachine=powerpc-apple-haiku;; + *) echo "Unsupported target architecture: $2" + exit 1;; + esac + buildCrossToolsMachine=$haikuGCCMachine; + crossToolsFolder="cross-tools-gcc4"; + shift 2;; --help | -h) usage; exit 0;; *) echo Invalid argument: \`$1\'; exit 1;; esac @@ -295,7 +321,11 @@ mkdir -p "$buildOutputDir" || exit 1 if [ -n "$buildCrossTools" ]; then "$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \ "$buildCrossTools" "$outputDir" || exit 1 - crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-" +fi + +# use specified cross tools +if [ -n "$crossToolsFolder" ]; then + crossToolsPrefix="$outputDir/$crossToolsFolder/bin/${haikuGCCMachine}-" fi # cross tools