152a38012Sejakowatz#!/bin/sh 252a38012Sejakowatz# 3338b8dc3SIngo Weinhold# configure [ <options> ] 4614026d7Sshatty 5022fa244SIngo Weinhold# usage 6022fa244SIngo Weinhold# 7022fa244SIngo Weinhold# Prints usage. 8022fa244SIngo Weinhold# 9022fa244SIngo Weinholdusage() 10022fa244SIngo Weinhold{ 11022fa244SIngo Weinhold cat << EOF 12022fa244SIngo Weinhold 13022fa244SIngo WeinholdUsage: $0 <options> 14022fa244SIngo Weinholdoptions: 156f9587ddSAxel Dörfler --bochs-debug Enables bochs serial debug emulation (activated 166f9587ddSAxel Dörfler via kernel settings file). 17338b8dc3SIngo Weinhold --build-cross-tools <build tools dir> 18338b8dc3SIngo Weinhold Assume cross compilation. <build tools dir> 19338b8dc3SIngo Weinhold defines the location of the build tools sources. 20338b8dc3SIngo Weinhold They will be compiled and placed in the output 21a5b60fa8SOliver Tappe directory under "cross-tools". The HAIKU_* tools 22a5b60fa8SOliver Tappe variables will be set accordingly. 2320ab75e6SIngo Weinhold --build-cross-tools-gcc4 <arch> <build tools dir> 2429ef597dSIngo Weinhold Like "--build-cross-tools" just that gcc 4 will 25a5b60fa8SOliver Tappe be used for cross-compilation. Note, that the 26a5b60fa8SOliver Tappe resulting Haiku installation built with gcc 4 27a5b60fa8SOliver Tappe will not be binary compatible with BeOS R5. 2820ab75e6SIngo Weinhold <arch> specifies the target architecture, either 2920ab75e6SIngo Weinhold "x86" or "ppc". 30eccc7665SIngo Weinhold --cross-tools-prefix <prefix> 31eccc7665SIngo Weinhold Assume cross compilation. <prefix> should be a 32eccc7665SIngo Weinhold path to the directory where the cross 33eccc7665SIngo Weinhold compilation tools are located, plus the platform 340da9c208SIngo Weinhold prefix, e.g. "/path/to/tools/i586-pc-haiku-". 35eccc7665SIngo Weinhold This overrides the HAIKU_* tool variables. 36a66c32ddSIngo Weinhold --distro-compatibility <level> 37a66c32ddSIngo Weinhold The distribution's level of compatibility with 38a66c32ddSIngo Weinhold the official Haiku distribution. The generated 39a66c32ddSIngo Weinhold files will contain the respective trademarks 40a66c32ddSIngo Weinhold accordingly. 41a66c32ddSIngo Weinhold official -- the official Haiku distribution. 42a66c32ddSIngo Weinhold compatible -- a Haiku Compatible (tm) distro. 43a66c32ddSIngo Weinhold default -- any other distro (default value). 44eccc7665SIngo Weinhold --help Prints out this help. 45eccc7665SIngo Weinhold --include-gpl-addons Include GPL licensed add-ons. 461974210fSFrançois Revol --include-3rdparty Include 3rdparty/ in the build system. 47f1b9c086SFrançois Revol --enable-multiuser Enable experimental multiuser support. 48614026d7Sshatty --target=TARGET Select build target platform. [default=${target}] 49a17b9c0cSshatty valid targets=r5,bone,dano,haiku 50eccc7665SIngo Weinhold --use-gcc-pipe Build with GCC option -pipe. Speeds up the build 515a34a443SFrançois Revol process, but uses more memory. 520385b065SIngo Weinhold --use-32bit Use -m32 flag on 64bit host gcc compiler. 534f4e5272SIngo Weinhold --use-xattr Use Linux xattr support for BeOS attribute 544f4e5272SIngo Weinhold emulation. Warning: Make sure your file system 554f4e5272SIngo Weinhold supports sufficient attribute sizes (4 KB per 564f4e5272SIngo Weinhold file for all attributes won't suffice). 57338b8dc3SIngo Weinhold 58338b8dc3SIngo Weinholdenvironment variables: 59338b8dc3SIngo Weinhold HAIKU_AR The static library archiver. Defaults to "ar". 60338b8dc3SIngo Weinhold HAIKU_CC The compiler. Defaults to "gcc". 61338b8dc3SIngo Weinhold HAIKU_LD The linker. Defaults to "ld". 62338b8dc3SIngo Weinhold HAIKU_OBJCOPY The objcopy to be used. Defaults to "objcopy". 63338b8dc3SIngo Weinhold HAIKU_RANLIB The static library indexer. Defaults to "ranlib". 64338b8dc3SIngo Weinhold HAIKU_CPPFLAGS The preprocessor flags. Defaults to "". 65338b8dc3SIngo Weinhold HAIKU_CCFLAGS The C flags. Defaults to "". 66338b8dc3SIngo Weinhold HAIKU_CXXFLAGS The C++ flags. Defaults to "". 67338b8dc3SIngo Weinhold HAIKU_LDFLAGS The linker flags. Defaults to "". 68338b8dc3SIngo Weinhold HAIKU_ARFLAGS The flags passed to HAIKU_AR for archiving. 69338b8dc3SIngo Weinhold Defaults to "ru". 70338b8dc3SIngo Weinhold HAIKU_UNARFLAGS The flags passed to HAIKU_AR for unarchiving. 71338b8dc3SIngo Weinhold Defaults to "x". 72022fa244SIngo WeinholdEOF 73022fa244SIngo Weinhold} 74022fa244SIngo Weinhold 75022fa244SIngo Weinhold# assertparam 76022fa244SIngo Weinhold# 77022fa244SIngo Weinhold# Checks whether at least one parameter is left. 78022fa244SIngo Weinhold# 79022fa244SIngo Weinholdassertparam() 80022fa244SIngo Weinhold{ 8120ab75e6SIngo Weinhold if [ $2 -lt 2 ]; then 82022fa244SIngo Weinhold echo $0: \`$1\': Parameter expected. 83022fa244SIngo Weinhold exit 1 84022fa244SIngo Weinhold fi 85022fa244SIngo Weinhold} 86022fa244SIngo Weinhold 8720ab75e6SIngo Weinhold# assertparams 8820ab75e6SIngo Weinhold# 8920ab75e6SIngo Weinhold# Checks whether at least a certain number of parameters is left. 9020ab75e6SIngo Weinhold# 9120ab75e6SIngo Weinholdassertparams() 9220ab75e6SIngo Weinhold{ 9320ab75e6SIngo Weinhold if [ $3 -le $2 ]; then 9420ab75e6SIngo Weinhold echo $0: \`$1\': Not enough parameters. 9520ab75e6SIngo Weinhold exit 1 9620ab75e6SIngo Weinhold fi 9720ab75e6SIngo Weinhold} 9820ab75e6SIngo Weinhold 9909c5682dSIngo Weinhold# standard_gcc_settings 10009c5682dSIngo Weinhold# 10109c5682dSIngo Weinhold# Sets the variables for a GCC platform. 10209c5682dSIngo Weinhold# 10309c5682dSIngo Weinholdstandard_gcc_settings() 10409c5682dSIngo Weinhold{ 10509c5682dSIngo Weinhold # PLATFORM_LINKLIBS 106338b8dc3SIngo Weinhold gcclib=`$HAIKU_CC -print-libgcc-file-name` 10709c5682dSIngo Weinhold gccdir=`dirname ${gcclib}` 1085b0f7b1bSOliver Tappe 109338b8dc3SIngo Weinhold haikuGCCVersion=`$HAIKU_CC -dumpversion` 110338b8dc3SIngo Weinhold haikuGCCMachine=`$HAIKU_CC -dumpmachine` 111338b8dc3SIngo Weinhold 112338b8dc3SIngo Weinhold HAIKU_GCC_LIB_DIR=${gccdir} 113338b8dc3SIngo Weinhold HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a 114338b8dc3SIngo Weinhold HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o" 115338b8dc3SIngo Weinhold HAIKU_GCC_HEADERS_DIR=${gccdir}/include 1165d978968SIngo Weinhold HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o` 1175d978968SIngo Weinhold # Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and 1185d978968SIngo Weinhold # neither needed nor wanted. 1198b5934c9SIngo Weinhold 1208b5934c9SIngo Weinhold case $haikuGCCVersion in 1218b5934c9SIngo Weinhold 4.*) 1225b0f7b1bSOliver Tappe # for gcc 4 we use the libstdc++ and libsupc++ that come with the 1235b0f7b1bSOliver Tappe # compiler 1248b5934c9SIngo Weinhold haikuStaticLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.a` 1258b5934c9SIngo Weinhold haikuSharedLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.so` 126c89fc875SIngo Weinhold haikuStaticLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.a` 127c89fc875SIngo Weinhold haikuSharedLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.so` 1288b5934c9SIngo Weinhold local headers=$gccdir/../../../../include/c++/$haikuGCCVersion 1298b5934c9SIngo Weinhold haikuCxxHeadersDir=$headers 13029ef597dSIngo Weinhold for d in $haikuGCCMachine backward ext; do 13129ef597dSIngo Weinhold # Note: We need the line break, otherwise the line might become 13229ef597dSIngo Weinhold # too long for jam (512 bytes max). 13329ef597dSIngo Weinhold haikuCxxHeadersDir="$haikuCxxHeadersDir 13429ef597dSIngo Weinhold $headers/$d" 1358b5934c9SIngo Weinhold done 136274b450aSMarcus Overhagen 137dad36002SMarcus Overhagen 138dad36002SMarcus Overhagen # when not building the crosscompiler, to use cpp headers from 139274b450aSMarcus Overhagen # tree first, but fallback to local C++ system headers (like <new>) 140dad36002SMarcus Overhagen # if [ "$buildCrossTools" = "" ]; then 141dad36002SMarcus Overhagen # haikuCxxHeadersDir="headers/cpp $haikuCxxHeadersDir" 142dad36002SMarcus Overhagen # fi 1438b5934c9SIngo Weinhold 1448b5934c9SIngo Weinhold if [ $haikuStaticLibStdCxx = libstdc++.a ]; then 1458b5934c9SIngo Weinhold haikuStaticLibStdCxx= 1468b5934c9SIngo Weinhold fi 1478b5934c9SIngo Weinhold if [ $haikuSharedLibStdCxx = libstdc++.so ]; then 1488b5934c9SIngo Weinhold haikuSharedLibStdCxx= 1498b5934c9SIngo Weinhold fi 150c89fc875SIngo Weinhold if [ $haikuStaticLibSupCxx = libsupc++.a ]; then 151c89fc875SIngo Weinhold haikuStaticLibSupCxx= 152c89fc875SIngo Weinhold fi 153c89fc875SIngo Weinhold if [ $haikuSharedLibSupCxx = libsupc++.so ]; then 154c89fc875SIngo Weinhold haikuSharedLibSupCxx= 155c89fc875SIngo Weinhold fi 1568b5934c9SIngo Weinhold ;; 1576cc8eecfSOliver Tappe 2.9*) 1585b0f7b1bSOliver Tappe # check for correct (most up-to-date) legacy compiler and complain 1595b0f7b1bSOliver Tappe # if an older one is installed 1605b0f7b1bSOliver Tappe if [ $haikuGCCVersion != $haikuRequiredLegacyGCCVersion ]; then 1615b0f7b1bSOliver Tappe echo "GCC version $haikuRequiredLegacyGCCVersion is required!"; 1625b0f7b1bSOliver Tappe echo "Please download it from www.haiku-os.org..."; 1635b0f7b1bSOliver Tappe exit 1; 1645b0f7b1bSOliver Tappe fi 1655b0f7b1bSOliver Tappe ;; 1668b5934c9SIngo Weinhold esac 16709c5682dSIngo Weinhold} 16809c5682dSIngo Weinhold 169338b8dc3SIngo Weinhold# set_default_value 170338b8dc3SIngo Weinhold# 171338b8dc3SIngo Weinhold# Set the value for a variable, if no value is set yet. 172338b8dc3SIngo Weinhold# 173338b8dc3SIngo Weinholdset_default_value() 174338b8dc3SIngo Weinhold{ 1750838a930SJérôme Duval eval "$1=\${$1-$2}" 176338b8dc3SIngo Weinhold} 177338b8dc3SIngo Weinhold 178338b8dc3SIngo Weinhold# get_build_tool_path 179338b8dc3SIngo Weinhold# 180338b8dc3SIngo Weinhold# Gets a usable absolute path of a build tool. 181338b8dc3SIngo Weinhold# 182338b8dc3SIngo Weinholdget_build_tool_path() 183338b8dc3SIngo Weinhold{ 184338b8dc3SIngo Weinhold local var="HAIKU_$1" 185338b8dc3SIngo Weinhold local tool=$2 186338b8dc3SIngo Weinhold local path="${crossToolsPrefix}$tool" 187338b8dc3SIngo Weinhold 188338b8dc3SIngo Weinhold if [ -f "$path" ]; then 189338b8dc3SIngo Weinhold # get absolute path 190*a559f87aSFrançois Revol local oldPwd="`pwd`" 191*a559f87aSFrançois Revol cd "`dirname "$path"`" 192*a559f87aSFrançois Revol path="`pwd`/`basename "$path"`" 193338b8dc3SIngo Weinhold cd $oldPwd 194338b8dc3SIngo Weinhold else 195338b8dc3SIngo Weinhold which "$path" &> /dev/null || { 196338b8dc3SIngo Weinhold echo "Build tool \"$path\" not found." >&2 197338b8dc3SIngo Weinhold exit 1 198338b8dc3SIngo Weinhold } 199338b8dc3SIngo Weinhold fi 200338b8dc3SIngo Weinhold 201338b8dc3SIngo Weinhold eval "$var=$path" 202338b8dc3SIngo Weinhold} 203338b8dc3SIngo Weinhold 204338b8dc3SIngo Weinhold# get cwd and the source directory 205338b8dc3SIngo WeinholdcurrentDir=`pwd` 2066e7c6fe5SIngo Weinholdcd `dirname "$0"` 207338b8dc3SIngo WeinholdsourceDir=`pwd` 2086e7c6fe5SIngo Weinholdcd "$currentDir" 209338b8dc3SIngo Weinhold 210022fa244SIngo Weinhold# default parameter values 211022fa244SIngo Weinhold# 21252a38012Sejakowatzplatform=`uname` 213338b8dc3SIngo WeinholdhaikuGCCVersion= 2140da9c208SIngo WeinholdhaikuGCCMachine=i586-pc-haiku 2158b5934c9SIngo WeinholdhaikuStaticLibStdCxx= 2168b5934c9SIngo WeinholdhaikuSharedLibStdCxx= 217c89fc875SIngo WeinholdhaikuStaticLibSupCxx= 218c89fc875SIngo WeinholdhaikuSharedLibSupCxx= 2198b5934c9SIngo WeinholdhaikuCxxHeadersDir= 220db63fe67SAxel DörflerhostGCCVersion=`gcc -dumpversion` 2212b94bc7bSlillobochs_debug=0 222e91f3ca1Sbeveloperinclude_gpl_addons=0 2231974210fSFrançois Revolinclude_3rdparty=0 224f1b9c086SFrançois Revolenable_multiuser=0 225a66c32ddSIngo WeinholddistroCompatibility=default 22662339647SAxel Dörflertarget=haiku 227eccc7665SIngo Weinholduse_gcc_pipe=0 2280385b065SIngo Weinholduse_32bit=0 2294f4e5272SIngo Weinholduse_xattr=0 230338b8dc3SIngo WeinholdcrossToolsPrefix= 231338b8dc3SIngo WeinholdbuildCrossTools= 23229ef597dSIngo WeinholdbuildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools" 23320ab75e6SIngo WeinholdbuildCrossToolsMachine= 234338b8dc3SIngo Weinhold 235*a559f87aSFrançois RevolhaikuRequiredLegacyGCCVersion="2.95.3-haiku-080323" 236*a559f87aSFrançois Revolexport haikuRequiredLegacyGCCVersion 237af4bf973SOliver Tappe # version of legacy gcc required to build haiku 238af4bf973SOliver Tappe 239338b8dc3SIngo Weinholdset_default_value HAIKU_AR ar 240338b8dc3SIngo Weinholdset_default_value HAIKU_CC gcc 241338b8dc3SIngo Weinholdset_default_value HAIKU_LD ld 242338b8dc3SIngo Weinholdset_default_value HAIKU_OBJCOPY objcopy 243338b8dc3SIngo Weinholdset_default_value HAIKU_RANLIB ranlib 244338b8dc3SIngo Weinholdset_default_value HAIKU_CPPFLAGS "" 245338b8dc3SIngo Weinholdset_default_value HAIKU_CCFLAGS "" 246338b8dc3SIngo Weinholdset_default_value HAIKU_CXXFLAGS "" 247338b8dc3SIngo Weinholdset_default_value HAIKU_LDFLAGS "" 248338b8dc3SIngo Weinholdset_default_value HAIKU_ARFLAGS ru 249338b8dc3SIngo Weinholdset_default_value HAIKU_UNARFLAGS x 25062339647SAxel Dörfler 251022fa244SIngo Weinhold# parse parameters 252022fa244SIngo Weinhold# 25320ab75e6SIngo Weinholdwhile [ $# -gt 0 ] ; do 254022fa244SIngo Weinhold case "$1" in 2552b94bc7bSlillo --bochs-debug) bochs_debug=1; shift 1;; 256a5b60fa8SOliver Tappe --build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;; 25720ab75e6SIngo Weinhold --build-cross-tools-gcc4) assertparams "$1" 2 $#; buildCrossTools=$3; 25829ef597dSIngo Weinhold buildCrossToolsScript="${buildCrossToolsScript}_gcc4"; 25920ab75e6SIngo Weinhold case "$2" in 26020ab75e6SIngo Weinhold x86) haikuGCCMachine=i586-pc-haiku;; 26120ab75e6SIngo Weinhold ppc) haikuGCCMachine=powerpc-apple-haiku;; 2628074e217SFrançois Revol m68k) haikuGCCMachine=m68k-unknown-haiku;; 26320ab75e6SIngo Weinhold *) echo "Unsupported target architecture: $2" 26420ab75e6SIngo Weinhold exit 1;; 26520ab75e6SIngo Weinhold esac 266a5b60fa8SOliver Tappe buildCrossToolsMachine=$haikuGCCMachine 26720ab75e6SIngo Weinhold shift 3;; 268eccc7665SIngo Weinhold --cross-tools-prefix) assertparam "$1" $#; crossToolsPrefix=$2; shift 2;; 269022fa244SIngo Weinhold --help | -h) usage; exit 0;; 270eccc7665SIngo Weinhold --include-gpl-addons) include_gpl_addons=1; shift 1;; 2711974210fSFrançois Revol --include-3rdparty) include_3rdparty=1; shift 1;; 272f1b9c086SFrançois Revol --enable-multiuser) enable_multiuser=1; shift 1;; 273a66c32ddSIngo Weinhold --distro-compatibility) 274a66c32ddSIngo Weinhold assertparam "$1" $#; distroCompatibility=$2; 275a66c32ddSIngo Weinhold case "$distroCompatibility" in 276a66c32ddSIngo Weinhold official) ;; 277a66c32ddSIngo Weinhold compatible) ;; 278a66c32ddSIngo Weinhold default) ;; 279a66c32ddSIngo Weinhold *) echo "Invalid distro compatibility" \ 280a66c32ddSIngo Weinhold "level: $distroCompatibility" 281a66c32ddSIngo Weinhold exit 1;; 282a66c32ddSIngo Weinhold esac 283a66c32ddSIngo Weinhold shift 2;; 284eccc7665SIngo Weinhold --target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;; 285eccc7665SIngo Weinhold --use-gcc-pipe) use_gcc_pipe=1; shift 1;; 2860385b065SIngo Weinhold --use-32bit) use_32bit=1; shift 1;; 2874f4e5272SIngo Weinhold --use-xattr) use_xattr=1; shift 1;; 288022fa244SIngo Weinhold *) echo Invalid argument: \`$1\'; exit 1;; 289022fa244SIngo Weinhold esac 290022fa244SIngo Weinholddone 291022fa244SIngo Weinhold 2920df3cc9cSIngo Weinhold# detect the build platform 293338b8dc3SIngo Weinholdcase "${platform}" in 2940df3cc9cSIngo Weinhold BeOS) revision=`uname -r` 2950df3cc9cSIngo Weinhold case "$revision" in 29614998c8bSIngo Weinhold 6.*) buildPlatform=dano ;; 2970df3cc9cSIngo Weinhold 5.1) buildPlatform=dano ;; 2980df3cc9cSIngo Weinhold 5.0.4) buildPlatform=bone ;; 2990df3cc9cSIngo Weinhold 5.0*) buildPlatform=r5 ;; 3000df3cc9cSIngo Weinhold *) echo Unknown BeOS version: $revision 3010df3cc9cSIngo Weinhold exit 1 ;; 3020df3cc9cSIngo Weinhold esac 3030df3cc9cSIngo Weinhold ;; 3046dcd0ccfSIngo Weinhold Darwin) buildPlatform=darwin ;; 305da0f9ae0SIngo Weinhold FreeBSD) buildPlatform=freebsd ;; 306da0f9ae0SIngo Weinhold Haiku) buildPlatform=haiku_host ;; 307da0f9ae0SIngo Weinhold Linux) buildPlatform=linux ;; 308*a559f87aSFrançois Revol SunOS) buildPlatform=sunos ;; 309338b8dc3SIngo Weinhold *) echo Unsupported platform: ${platform} 3104cbe4925SAxel Dörfler exit 1 ;; 3114cbe4925SAxel Dörfleresac 31252a38012Sejakowatz 313338b8dc3SIngo Weinhold# create output directory 314338b8dc3SIngo Weinholdif [ "$currentDir" = "$sourceDir" ]; then 315338b8dc3SIngo Weinhold outputDir=$currentDir/generated 316338b8dc3SIngo Weinholdelse 317338b8dc3SIngo Weinhold outputDir=$currentDir 318338b8dc3SIngo Weinholdfi 3196e7c6fe5SIngo WeinholdbuildOutputDir="$outputDir/build" 3206e7c6fe5SIngo WeinholdbuildAttributesDir="$outputDir/attributes" 3216e7c6fe5SIngo Weinholdmkdir -p "$buildOutputDir" || exit 1 322338b8dc3SIngo Weinhold 323338b8dc3SIngo Weinhold# build cross tools from sources 324338b8dc3SIngo Weinholdif [ -n "$buildCrossTools" ]; then 32520ab75e6SIngo Weinhold "$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \ 3266e7c6fe5SIngo Weinhold "$buildCrossTools" "$outputDir" || exit 1 327a5b60fa8SOliver Tappe crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-" 328338b8dc3SIngo Weinholdfi 329338b8dc3SIngo Weinhold 330338b8dc3SIngo Weinhold# cross tools 331338b8dc3SIngo Weinholdif [ -n "$crossToolsPrefix" ]; then 332338b8dc3SIngo Weinhold get_build_tool_path AR ar 333338b8dc3SIngo Weinhold get_build_tool_path CC gcc 334338b8dc3SIngo Weinhold get_build_tool_path LD ld 335338b8dc3SIngo Weinhold get_build_tool_path OBJCOPY objcopy 336338b8dc3SIngo Weinhold get_build_tool_path RANLIB ranlib 337338b8dc3SIngo Weinholdfi 338338b8dc3SIngo Weinhold 339338b8dc3SIngo Weinhold# prepare gcc settings 340338b8dc3SIngo Weinholdstandard_gcc_settings 341338b8dc3SIngo Weinhold 342eedc3d0bSIngo Weinhold# check whether the Haiku compiler really targets Haiku or BeOS 343eedc3d0bSIngo Weinholdcase "$haikuGCCMachine" in 344eedc3d0bSIngo Weinhold *-*-haiku) ;; 345eedc3d0bSIngo Weinhold *-*-beos) ;; 346eedc3d0bSIngo Weinhold *) echo The compiler specified as Haiku target compiler is not a valid \ 347eedc3d0bSIngo Weinhold Haiku cross-compiler. Please see ReadMe.cross-compile. >&2 348eedc3d0bSIngo Weinhold echo compiler: $HAIKU_CC 349eedc3d0bSIngo Weinhold echo compiler is configured for target: $haikuGCCMachine 350eedc3d0bSIngo Weinhold exit 1 ;; 351eedc3d0bSIngo Weinholdesac 352eedc3d0bSIngo Weinhold 35352a38012Sejakowatz# Generate BuildConfig 3546e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/BuildConfig" 35552a38012Sejakowatz# BuildConfig 35652a38012Sejakowatz# Note: This file has been automatically generated by configure. 35752a38012Sejakowatz 3586e7c6fe5SIngo WeinholdTARGET_PLATFORM ?= "${target}" ; 3596e7c6fe5SIngo WeinholdHOST_PLATFORM ?= "${buildPlatform}" ; 360338b8dc3SIngo Weinhold 361eccc7665SIngo WeinholdBOCHS_DEBUG_HACK ?= "${bochs_debug}" ; 362eccc7665SIngo WeinholdINCLUDE_GPL_ADDONS ?= "${include_gpl_addons}" ; 3631974210fSFrançois RevolHAIKU_INCLUDE_3RDPARTY ?= "${include_3rdparty}" ; 364f1b9c086SFrançois RevolHAIKU_ENABLE_MULTIUSER ?= "${enable_multiuser}" ; 365a66c32ddSIngo WeinholdHAIKU_DISTRO_COMPATIBILITY ?= "${distroCompatibility}" ; 366eccc7665SIngo WeinholdHAIKU_USE_GCC_PIPE ?= "${use_gcc_pipe}" ; 3670385b065SIngo WeinholdHAIKU_HOST_USE_32BIT ?= "${use_32bit}" ; 3684f4e5272SIngo WeinholdHAIKU_HOST_USE_XATTR ?= "${use_xattr}" ; 369eccc7665SIngo Weinhold 370338b8dc3SIngo WeinholdHAIKU_GCC_RAW_VERSION ?= ${haikuGCCVersion} ; 371338b8dc3SIngo WeinholdHAIKU_GCC_MACHINE ?= ${haikuGCCMachine} ; 372338b8dc3SIngo WeinholdHAIKU_GCC_LIB_DIR ?= ${HAIKU_GCC_LIB_DIR} ; 373338b8dc3SIngo WeinholdHAIKU_GCC_HEADERS_DIR ?= ${HAIKU_GCC_HEADERS_DIR} ; 374338b8dc3SIngo WeinholdHAIKU_GCC_LIBGCC ?= ${HAIKU_GCC_LIBGCC} ; 375338b8dc3SIngo Weinhold 3768b5934c9SIngo WeinholdHAIKU_STATIC_LIBSTDC++ ?= ${haikuStaticLibStdCxx} ; 3778b5934c9SIngo WeinholdHAIKU_SHARED_LIBSTDC++ ?= ${haikuSharedLibStdCxx} ; 378c89fc875SIngo WeinholdHAIKU_STATIC_LIBSUPC++ ?= ${haikuStaticLibSupCxx} ; 379c89fc875SIngo WeinholdHAIKU_SHARED_LIBSUPC++ ?= ${haikuSharedLibSupCxx} ; 3808b5934c9SIngo WeinholdHAIKU_C++_HEADERS_DIR ?= ${haikuCxxHeadersDir} ; 3818b5934c9SIngo Weinhold 382338b8dc3SIngo WeinholdHAIKU_BUILD_ATTRIBUTES_DIR ?= ${buildAttributesDir} ; 383338b8dc3SIngo Weinhold 384338b8dc3SIngo WeinholdHAIKU_AR ?= ${HAIKU_AR} ; 385338b8dc3SIngo WeinholdHAIKU_CC ?= ${HAIKU_CC} ; 386338b8dc3SIngo WeinholdHAIKU_LD ?= ${HAIKU_LD} ; 387338b8dc3SIngo WeinholdHAIKU_OBJCOPY ?= ${HAIKU_OBJCOPY} ; 388338b8dc3SIngo WeinholdHAIKU_RANLIB ?= ${HAIKU_RANLIB} ; 389338b8dc3SIngo WeinholdHAIKU_CPPFLAGS ?= ${HAIKU_CPPFLAGS} ; 390338b8dc3SIngo WeinholdHAIKU_CCFLAGS ?= ${HAIKU_CCFLAGS} ; 391338b8dc3SIngo WeinholdHAIKU_CXXFLAGS ?= ${HAIKU_CXXFLAGS} ; 392338b8dc3SIngo WeinholdHAIKU_LDFLAGS ?= ${HAIKU_LDFLAGS} ; 393338b8dc3SIngo WeinholdHAIKU_ARFLAGS ?= ${HAIKU_ARFLAGS} ; 394338b8dc3SIngo WeinholdHAIKU_UNARFLAGS ?= ${HAIKU_UNARFLAGS} ; 395338b8dc3SIngo Weinhold 3968b5934c9SIngo WeinholdHOST_GCC_RAW_VERSION ?= ${hostGCCVersion} ; 3978b5934c9SIngo Weinhold 398c4786ea6SlilloEOF 399c4786ea6Slillo 400b1e5b60cSAxel Dörfler# Libgcc.a objects 401b1e5b60cSAxel Dörfler 4026e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/libgccObjects" 403b1e5b60cSAxel Dörfler# libgcc.a objects to be linked against libroot.so 404b1e5b60cSAxel Dörfler# Note: This file has been automatically generated by configure. 405b1e5b60cSAxel Dörfler 406338b8dc3SIngo WeinholdHAIKU_GCC_LIBGCC_OBJECTS ?= ${HAIKU_GCC_LIBGCC_OBJECTS} ; 407b1e5b60cSAxel DörflerEOF 408b1e5b60cSAxel Dörfler 4094c74bde8SJérôme Duval# Generate Timezones binaries bindings 4104c74bde8SJérôme Duval 411338b8dc3SIngo WeinholdtimezoneSources="africa antarctica asia australasia europe northamerica 412338b8dc3SIngo Weinhold southamerica pacificnew etcetera factory backward" 413338b8dc3SIngo Weinhold 4146e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/Timezones" 415b1e5b60cSAxel Dörfler# Timezones used for the build 416b1e5b60cSAxel Dörfler# Note: This file has been automatically generated by configure. 417b1e5b60cSAxel Dörfler 418338b8dc3SIngo WeinholdHAIKU_TIME_ZONE_SOURCES = ${timezoneSources} ; 419338b8dc3SIngo Weinhold 420b1e5b60cSAxel DörflerEOF 421b1e5b60cSAxel Dörfler 422338b8dc3SIngo Weinholdfor source in ${timezoneSources}; do 423338b8dc3SIngo Weinhold f=$sourceDir/src/data/etc/timezones/$source 4244c74bde8SJérôme Duval 4256e7c6fe5SIngo WeinholdTZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' "$f" ` 4264c74bde8SJérôme Duval 4276e7c6fe5SIngo Weinholdcat << EOF >> "$buildOutputDir/Timezones" 428338b8dc3SIngo WeinholdTZ_OBJECTS on <timezone-source>${source} ?= $TZOBJECTS ; 4294c74bde8SJérôme DuvalEOF 4304c74bde8SJérôme Duvaldone 431338b8dc3SIngo Weinhold 432338b8dc3SIngo Weinhold# Generate a boot strap Jamfile in the output directory, if it is not in 433338b8dc3SIngo Weinhold# the source dir. 434338b8dc3SIngo Weinhold 435338b8dc3SIngo Weinholdif [ "$currentDir" != "$sourceDir" ]; then 436338b8dc3SIngo Weinhold 437338b8dc3SIngo Weinholdcat << EOF > $outputDir/Jamfile 438338b8dc3SIngo Weinhold# automatically generated Jamfile 439338b8dc3SIngo Weinhold 440338b8dc3SIngo WeinholdHAIKU_TOP = ${sourceDir} ; 441338b8dc3SIngo WeinholdHAIKU_OUTPUT_DIR = ${outputDir} ; 442338b8dc3SIngo Weinhold 443338b8dc3SIngo Weinholdinclude [ FDirName \$(HAIKU_TOP) Jamfile ] ; 444338b8dc3SIngo Weinhold 445338b8dc3SIngo WeinholdEOF 446338b8dc3SIngo Weinhold 447338b8dc3SIngo Weinholdfi 448338b8dc3SIngo Weinhold 449