1#!/bin/sh 2# 3# configure [ <options> ] 4 5# usage 6# 7# Prints usage. 8# 9usage() 10{ 11 cat << EOF 12 13Usage: $0 <options> 14options: 15 --alternative-gcc-output-dir <dir> 16 Build a Haiku installation that supports running 17 executables built with a gcc version incompatible 18 with the primary gcc (e.g. gcc 2 executables under 19 a gcc 4 Haiku or vice versa). <dir> specifies the 20 output directory of the other gcc. The directory 21 must already be fully configured. 22 Note, that a sub-jam will be executed when 23 building Haiku. When using a jam that is not 24 simply invoked by "jam", the JAM build variable 25 needs to be set accordingly. 26 To disable building the alternative libraries 27 the variable HAIKU_ADD_ALTERNATIVE_GCC_LIBS can be 28 unset in the UserBuildConfig file. 29 --build-cross-tools <build tools dir> 30 Assume cross compilation. <build tools dir> 31 defines the location of the build tools sources. 32 They will be compiled and placed in the output 33 directory under "cross-tools". The HAIKU_* tools 34 variables will be set accordingly. 35 --build-cross-tools-gcc4 <arch> <build tools dir> 36 Like "--build-cross-tools" just that gcc 4 will 37 be used for cross-compilation. Note, that the 38 resulting Haiku installation built with gcc 4 39 will not be binary compatible with BeOS R5. 40 <arch> specifies the target architecture, either 41 "x86", "ppc", "m68k", "arm" or "mipsel". 42 --cross-tools-prefix <prefix> 43 Assume cross compilation. <prefix> should be a 44 path to the directory where the cross 45 compilation tools are located, plus the platform 46 prefix, e.g. "/path/to/tools/i586-pc-haiku-". 47 This overrides the HAIKU_* tool variables. 48 --distro-compatibility <level> 49 The distribution's level of compatibility with 50 the official Haiku distribution. The generated 51 files will contain the respective trademarks 52 accordingly. 53 official -- the official Haiku distribution. 54 compatible -- a Haiku Compatible (tm) distro. 55 default -- any other distro (default value). 56 --enable-multiuser Enable experimental multiuser support. 57 --help Prints out this help. 58 --include-gpl-addons Include GPL licensed add-ons. 59 --include-patented-code Enable code that is known to implemented patented 60 ideas and techniques. If this option is not 61 specified, the resulting distribution may still 62 implement patented ideas and techniques. This 63 option only disables code that is currently known 64 to be problematic. 65 --include-3rdparty Include 3rdparty/ in the build system. 66 -j<n> Only relevant for --build-cross-tools and 67 --build-cross-tools-gcc4. Is passed on to the 68 make building the build tools. 69 --target=TARGET Select build target platform. 70 [default=${TARGET_PLATFORM}] 71 valid targets=r5,bone,dano,haiku 72 --update re-runs last configure invocation [must be given 73 as first option!] 74 --use-gcc-pipe Build with GCC option -pipe. Speeds up the build 75 process, but uses more memory. 76 --use-32bit Use -m32 flag on 64bit host gcc compiler. 77 --use-xattr Use Linux xattr support for BeOS attribute 78 emulation. Warning: Make sure your file system 79 supports sufficient attribute sizes (4 KB per 80 file for all attributes won't suffice). 81 82environment variables: 83 HAIKU_AR The static library archiver. Defaults to "ar". 84 HAIKU_CC The compiler. Defaults to "gcc". 85 HAIKU_LD The linker. Defaults to "ld". 86 HAIKU_OBJCOPY The objcopy to be used. Defaults to "objcopy". 87 HAIKU_RANLIB The static library indexer. Defaults to "ranlib". 88 HAIKU_YASM The yasm assembler (x86 only). 89 HAIKU_CPPFLAGS The preprocessor flags. Defaults to "". 90 HAIKU_CCFLAGS The C flags. Defaults to "". 91 HAIKU_CXXFLAGS The C++ flags. Defaults to "". 92 HAIKU_LDFLAGS The linker flags. Defaults to "". 93 HAIKU_ARFLAGS The flags passed to HAIKU_AR for archiving. 94 Defaults to "cru". 95 HAIKU_UNARFLAGS The flags passed to HAIKU_AR for unarchiving. 96 Defaults to "x". 97 98Non-standard output directories: 99 By default all objects, build configuration, and other related files are 100 stored in /path/to/haiku_source/generated. To store objects in a non-default 101 location, run "../../relative/path/to/haiku_source/configure <options>" from 102 within your non-default location. "jam [ options ] targets" can then be run 103 directly inside your non-default location. Another option is to invoke "jam 104 [ options ] targets" from within haiku_source. This can be accomplished by 105 either "export HAIKU_OUTPUT_DIR=your non-default location" before invoking 106 jam or by creating a symlink of haiku_source/generated pointing to your 107 non-default location and running jam. 108 109 110EOF 111} 112 113# assertparam 114# 115# Checks whether at least one parameter is left. 116# 117assertparam() 118{ 119 if [ $2 -lt 2 ]; then 120 echo $0: \`$1\': Parameter expected. 121 exit 1 122 fi 123} 124 125# assertparams 126# 127# Checks whether at least a certain number of parameters is left. 128# 129assertparams() 130{ 131 if [ $3 -le $2 ]; then 132 echo $0: \`$1\': Not enough parameters. 133 exit 1 134 fi 135} 136 137# standard_gcc_settings 138# 139# Sets the variables for a GCC platform. 140# 141standard_gcc_settings() 142{ 143 # PLATFORM_LINKLIBS 144 gcclib=`$HAIKU_CC -print-libgcc-file-name` 145 gccdir=`dirname ${gcclib}` 146 147 HAIKU_GCC_RAW_VERSION=`$HAIKU_CC -dumpversion` 148 HAIKU_GCC_MACHINE=`$HAIKU_CC -dumpmachine` 149 150 HAIKU_GCC_LIB_DIR=${gccdir} 151 HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a 152 HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o" 153 HAIKU_GCC_HEADERS_DIR="${gccdir}/include 154 ${gccdir}/include-fixed" 155 HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o` 156 # Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and 157 # neither needed nor wanted. 158 159 case $HAIKU_GCC_RAW_VERSION in 160 4.*) 161 # for gcc 4 we use the libstdc++ and libsupc++ that come with the 162 # compiler 163 HAIKU_STATIC_LIBSTDCXX=`$HAIKU_CC -print-file-name=libstdc++.a` 164 HAIKU_SHARED_LIBSTDCXX=`$HAIKU_CC -print-file-name=libstdc++.so` 165 HAIKU_STATIC_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++.a` 166 HAIKU_SHARED_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++.so` 167 168 local headers 169 if [ -d $gccdir/../../../../$HAIKU_GCC_MACHINE/include/c++/$HAIKU_GCC_RAW_VERSION ]; then 170 headers=$gccdir/../../../../$HAIKU_GCC_MACHINE/include/c++/$HAIKU_GCC_RAW_VERSION 171 else 172 headers=$gccdir/../../../../include/c++/$HAIKU_GCC_RAW_VERSION 173 fi 174 175 HAIKU_CXX_HEADERS_DIR=$headers 176 for d in $HAIKU_GCC_MACHINE backward ext; do 177 # Note: We need the line break, otherwise the line might become 178 # too long for jam (512 bytes max). 179 HAIKU_CXX_HEADERS_DIR="$HAIKU_CXX_HEADERS_DIR 180 $headers/$d" 181 done 182 183 184 # when not building the crosscompiler, to use cpp headers from 185 # tree first, but fallback to local C++ system headers (like <new>) 186 # if [ "$buildCrossTools" = "" ]; then 187 # HAIKU_CXX_HEADERS_DIR="headers/cpp $HAIKU_CXX_HEADERS_DIR" 188 # fi 189 190 if [ $HAIKU_STATIC_LIBSTDCXX = libstdc++.a ]; then 191 HAIKU_STATIC_LIBSTDCXX= 192 fi 193 # we build libstdc++.so ourselves, so we can leave it as is 194 # if [ $HAIKU_SHARED_LIBSTDCXX = libstdc++.so ]; then 195 # HAIKU_SHARED_LIBSTDCXX= 196 # fi 197 if [ $HAIKU_STATIC_LIBSUPCXX = libsupc++.a ]; then 198 HAIKU_STATIC_LIBSUPCXX= 199 fi 200 # we build libsupc++.so ourselves, so we can leave it as is 201 # if [ $HAIKU_SHARED_LIBSUPCXX = libsupc++.so ]; then 202 # HAIKU_SHARED_LIBSUPCXX= 203 # fi 204 ;; 205 2.9*) 206 # check for correct (most up-to-date) legacy compiler and complain 207 # if an older one is installed 208 if [ $HAIKU_GCC_RAW_VERSION != $haikuRequiredLegacyGCCVersion ]; then 209 echo "GCC version $haikuRequiredLegacyGCCVersion is required!"; 210 echo "Please download it from www.haiku-os.org..."; 211 exit 1; 212 fi 213 ;; 214 esac 215} 216 217# set_default_value 218# 219# Set the value for a variable, if no value is set yet. 220# 221set_default_value() 222{ 223 eval "$1=\${$1-$2}" 224} 225 226# get_build_tool_path 227# 228# Gets a usable absolute path of a build tool. 229# 230get_build_tool_path() 231{ 232 local var="HAIKU_$1" 233 local tool=$2 234 local path="${crossToolsPrefix}$tool" 235 236 if [ -f "$path" ]; then 237 # get absolute path 238 local oldPwd="`pwd`" 239 cd "`dirname "$path"`" 240 path="`pwd`/`basename "$path"`" 241 cd $oldPwd 242 else 243 which "$path" &> /dev/null || { 244 echo "Build tool \"$path\" not found." >&2 245 exit 1 246 } 247 fi 248 249 eval "$var=$path" 250} 251 252# get cwd and the source directory 253currentDir=`pwd` 254cd `dirname "$0"` 255sourceDir=`pwd` 256cd "$currentDir" 257 258# backup the passed arguments 259configureArgs="$@" 260 261# internal default parameter values 262# 263platform=`uname` 264platformMachine=`uname -m` 265targetArch=x86 266crossToolsPrefix= 267buildCrossTools= 268buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools" 269buildCrossToolsMachine= 270buildCrossToolsJobs= 271 272# exported (BuildSetup) default parameter values 273# 274HAIKU_GCC_RAW_VERSION= 275HAIKU_GCC_MACHINE=i586-pc-haiku 276HAIKU_STATIC_LIBSTDCXX= 277HAIKU_SHARED_LIBSTDCXX= 278HAIKU_STATIC_LIBSUPCXX= 279HAIKU_SHARED_LIBSUPCXX= 280HAIKU_CXX_HEADERS_DIR= 281HOST_GCC_RAW_VERSION=`gcc -dumpversion` 282HOST_GCC_MACHINE=`gcc -dumpmachine` 283HAIKU_INCLUDE_GPL_ADDONS=0 284HAIKU_INCLUDE_PATENTED_CODE=0 285HAIKU_INCLUDE_3RDPARTY=0 286HAIKU_ENABLE_MULTIUSER=0 287HAIKU_DISTRO_COMPATIBILITY=default 288TARGET_PLATFORM=haiku 289HAIKU_USE_GCC_PIPE=0 290HAIKU_USE_32BIT=0 291HAIKU_USE_XATTR=0 292HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR= 293HAIKU_ADD_ALTERNATIVE_GCC_LIBS= 294HOST_GCC_LD=`gcc -print-prog-name=ld` 295HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy` 296SFDISK_BINARY=sfdisk 297HOST_SFDISK=$SFDISK_BINARY 298 299haikuRequiredLegacyGCCVersion="2.95.3-haiku-090629" 300export haikuRequiredLegacyGCCVersion 301 # version of legacy gcc required to build haiku 302 303set_default_value HAIKU_AR ar 304set_default_value HAIKU_CC gcc 305set_default_value HAIKU_LD ld 306set_default_value HAIKU_OBJCOPY objcopy 307set_default_value HAIKU_RANLIB ranlib 308set_default_value HAIKU_YASM yasm 309set_default_value HAIKU_CPPFLAGS "" 310set_default_value HAIKU_CCFLAGS "" 311set_default_value HAIKU_CXXFLAGS "" 312set_default_value HAIKU_LDFLAGS "" 313set_default_value HAIKU_ARFLAGS cru 314set_default_value HAIKU_UNARFLAGS x 315 316# determine output directory 317if [ "$currentDir" = "$sourceDir" ]; then 318 outputDir=$currentDir/generated 319else 320 outputDir=$currentDir 321fi 322buildOutputDir="$outputDir/build" 323HAIKU_BUILD_ATTRIBUTES_DIR="$outputDir/attributes" 324buildConfigFile="$buildOutputDir/BuildConfig" 325 326# check for update request 327if [ "$1" = "--update" ]; then 328 if ! [ -e "$buildConfigFile" ]; then 329 echo $0 --update: \'$buildConfigFile\' not found - updating not possible. 330 exit 1 331 fi 332 if ! type perl >/dev/null 2>&1; then 333 echo $0 --update: \'perl\' not found - updating not possible. 334 exit 1 335 fi 336 # convert BuildConfig from jam format to shell format and evaluate it 337 shellConfigFile="${buildConfigFile}.shell" 338 perl "$sourceDir/build/scripts/convert_build_config_to_shell_format.pl" \ 339 <"$buildConfigFile" >"$shellConfigFile" 340 . "$shellConfigFile" 341 rm "$shellConfigFile" 342 shift 343fi 344 345# parse parameters 346# 347while [ $# -gt 0 ] ; do 348 case "$1" in 349 --alternative-gcc-output-dir) 350 assertparam "$1" $# 351 cd $2 || exit 1 352 HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR=`pwd` 353 HAIKU_ADD_ALTERNATIVE_GCC_LIBS=1 354 cd $currentDir 355 shift 2 356 ;; 357 --build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;; 358 --build-cross-tools-gcc4) 359 assertparams "$1" 2 $# 360 buildCrossTools=$3 361 buildCrossToolsScript="${buildCrossToolsScript}_gcc4" 362 case "$2" in 363 x86) HAIKU_GCC_MACHINE=i586-pc-haiku;; 364 ppc) HAIKU_GCC_MACHINE=powerpc-apple-haiku; targetArch=ppc;; 365 m68k) HAIKU_GCC_MACHINE=m68k-unknown-haiku; targetArch=m86k;; 366 arm) HAIKU_GCC_MACHINE=arm-unknown-haiku; targetArch=arm;; 367 mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku; targetArch=mips;; 368 *) echo "Unsupported target architecture: $2" 369 exit 1;; 370 esac 371 buildCrossToolsMachine=$HAIKU_GCC_MACHINE 372 shift 3 373 ;; 374 --cross-tools-prefix) 375 assertparam "$1" $# 376 crossToolsPrefix=$2 377 shift 2 378 ;; 379 --distro-compatibility) 380 assertparam "$1" $# 381 HAIKU_DISTRO_COMPATIBILITY=$2 382 case "$HAIKU_DISTRO_COMPATIBILITY" in 383 official) ;; 384 compatible) ;; 385 default) ;; 386 *) echo "Invalid distro compatibility" \ 387 "level: $HAIKU_DISTRO_COMPATIBILITY" 388 exit 1;; 389 esac 390 shift 2 391 ;; 392 --enable-multiuser) HAIKU_ENABLE_MULTIUSER=1; shift 1;; 393 --help | -h) usage; exit 0;; 394 --include-gpl-addons) HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;; 395 --include-patented-code) HAIKU_INCLUDE_PATENTED_CODE=1; shift 1;; 396 --include-3rdparty) HAIKU_INCLUDE_3RDPARTY=1; shift 1;; 397 -j*) buildCrossToolsJobs="$1"; shift 1;; 398 --target=*) TARGET_PLATFORM=`echo $1 | cut -d'=' -f2-`; shift 1;; 399 --use-gcc-pipe) HAIKU_USE_GCC_PIPE=1; shift 1;; 400 --use-32bit) HAIKU_USE_32BIT=1; shift 1;; 401 --use-xattr) HAIKU_USE_XATTR=1; shift 1;; 402 *) echo Invalid argument: \`$1\'; exit 1;; 403 esac 404done 405 406# detect the build platform 407case "${platform}" in 408 BeOS) revision=`uname -r` 409 case "$revision" in 410 6.*) HOST_PLATFORM=dano ;; 411 5.1) HOST_PLATFORM=dano ;; 412 5.0.4) HOST_PLATFORM=bone ;; 413 5.0*) HOST_PLATFORM=r5 ;; 414 *) echo Unknown BeOS version: $revision 415 exit 1 ;; 416 esac 417 ;; 418 Darwin) HOST_PLATFORM=darwin ;; 419 FreeBSD) HOST_PLATFORM=freebsd 420 SFDISK_BINARY=sfdisk-linux 421 if [ "$HAIKU_USE_32BIT" = 1 ] ; then 422 echo Unsupported platform: FreeBSD ${platformMachine} 423 exit 1 424 fi ;; 425 Haiku) HOST_PLATFORM=haiku_host ;; 426 Linux) HOST_PLATFORM=linux ;; 427 OpenBSD) HOST_PLATFORM=openbsd ;; 428 SunOS) HOST_PLATFORM=sunos ;; 429 CYGWIN_NT-*) HOST_PLATFORM=cygwin ;; 430 *) echo Unsupported platform: ${platform} 431 exit 1 ;; 432esac 433 434# check yasm version 435if [ $targetArch = "x86" ]; then 436 $HAIKU_YASM --version > /dev/null || { 437 echo "The yasm assembler version 0.7.0 or later must be installed." 438 echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download" 439 exit 1 440 } 441 442 set -- $($HAIKU_YASM --version | head -n 1) 443 versionOK=0 444 case $2 in 445 0.[0-6].*) ;; 446 *) versionOK=1 ;; 447 esac 448 449 if [ $versionOK = 0 ]; then 450 echo "The yasm assembler version 0.7.0 or later must be installed." 451 echo "The installed version is $2." 452 echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download" 453 exit 1 454 fi 455fi 456 457# check common locations for sfdisk 458for sfdiskDir in /sbin /usr/sbin /usr/local/sbin ; do 459 if [ -e ${sfdiskDir}/${SFDISK_BINARY} ]; then 460 HOST_SFDISK=${sfdiskDir}/${SFDISK_BINARY} 461 fi 462done 463 464# check for case-sensitive filesystem if on darwin 465if [ $HOST_PLATFORM = "darwin" ]; then 466 diskutil info $(pwd) | grep -i "case-sensitive" > /dev/null 467 if [ $? != 0 ]; then 468 echo "You need a case-sensitive file-system to build Haiku." 469 echo "Please see the following guide on how to set one up:" 470 echo "http://haiku-os.org/documents/dev/how_to_build_haiku_on_mac_os_x" 471 exit 1 472 fi 473fi 474 475# create output directory 476mkdir -p "$buildOutputDir" || exit 1 477 478# build cross tools from sources 479if [ -n "$buildCrossTools" ]; then 480 "$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \ 481 "$buildCrossTools" "$outputDir" $buildCrossToolsJobs || exit 1 482 crossToolsPrefix="$outputDir/cross-tools/bin/${HAIKU_GCC_MACHINE}-" 483fi 484 485# cross tools 486if [ -n "$crossToolsPrefix" ]; then 487 get_build_tool_path AR ar 488 get_build_tool_path CC gcc 489 get_build_tool_path LD ld 490 get_build_tool_path OBJCOPY objcopy 491 get_build_tool_path RANLIB ranlib 492fi 493 494# prepare gcc settings 495standard_gcc_settings 496 497# check whether the Haiku compiler really targets Haiku or BeOS 498case "$HAIKU_GCC_MACHINE" in 499 *-*-haiku) ;; 500 *-*-beos) ;; 501 *) echo The compiler specified as Haiku target compiler is not a valid \ 502 Haiku cross-compiler. Please see ReadMe.cross-compile. >&2 503 echo compiler: $HAIKU_CC 504 echo compiler is configured for target: $HAIKU_GCC_MACHINE 505 exit 1 ;; 506esac 507 508# Generate BuildConfig 509cat << EOF > "$buildConfigFile" 510# BuildConfig 511# Note: This file has been automatically generated by configure with the following arguments: 512# ${configureArgs} 513 514TARGET_PLATFORM ?= "${TARGET_PLATFORM}" ; 515HOST_PLATFORM ?= "${HOST_PLATFORM}" ; 516 517HAIKU_INCLUDE_GPL_ADDONS ?= "${HAIKU_INCLUDE_GPL_ADDONS}" ; 518HAIKU_INCLUDE_PATENTED_CODE ?= "${HAIKU_INCLUDE_PATENTED_CODE}" ; 519HAIKU_INCLUDE_3RDPARTY ?= "${HAIKU_INCLUDE_3RDPARTY}" ; 520HAIKU_ENABLE_MULTIUSER ?= "${HAIKU_ENABLE_MULTIUSER}" ; 521HAIKU_DISTRO_COMPATIBILITY ?= "${HAIKU_DISTRO_COMPATIBILITY}" ; 522HAIKU_USE_GCC_PIPE ?= "${HAIKU_USE_GCC_PIPE}" ; 523HAIKU_HOST_USE_32BIT ?= "${HAIKU_USE_32BIT}" ; 524HAIKU_HOST_USE_XATTR ?= "${HAIKU_USE_XATTR}" ; 525HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR ?= ${HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR} ; 526HAIKU_ADD_ALTERNATIVE_GCC_LIBS ?= ${HAIKU_ADD_ALTERNATIVE_GCC_LIBS} ; 527 528HAIKU_GCC_RAW_VERSION ?= ${HAIKU_GCC_RAW_VERSION} ; 529HAIKU_GCC_MACHINE ?= ${HAIKU_GCC_MACHINE} ; 530HAIKU_GCC_LIB_DIR ?= ${HAIKU_GCC_LIB_DIR} ; 531HAIKU_GCC_HEADERS_DIR ?= ${HAIKU_GCC_HEADERS_DIR} ; 532HAIKU_GCC_LIBGCC ?= ${HAIKU_GCC_LIBGCC} ; 533 534HAIKU_STATIC_LIBSTDC++ ?= ${HAIKU_STATIC_LIBSTDCXX} ; 535HAIKU_SHARED_LIBSTDC++ ?= ${HAIKU_SHARED_LIBSTDCXX} ; 536HAIKU_STATIC_LIBSUPC++ ?= ${HAIKU_STATIC_LIBSUPCXX} ; 537HAIKU_SHARED_LIBSUPC++ ?= ${HAIKU_SHARED_LIBSUPCXX} ; 538HAIKU_C++_HEADERS_DIR ?= ${HAIKU_CXX_HEADERS_DIR} ; 539 540HAIKU_BUILD_ATTRIBUTES_DIR ?= ${HAIKU_BUILD_ATTRIBUTES_DIR} ; 541 542HAIKU_AR ?= ${HAIKU_AR} ; 543HAIKU_CC ?= ${HAIKU_CC} ; 544HAIKU_LD ?= ${HAIKU_LD} ; 545HAIKU_OBJCOPY ?= ${HAIKU_OBJCOPY} ; 546HAIKU_RANLIB ?= ${HAIKU_RANLIB} ; 547HAIKU_YASM ?= ${HAIKU_YASM} ; 548HAIKU_CPPFLAGS ?= ${HAIKU_CPPFLAGS} ; 549HAIKU_CCFLAGS ?= ${HAIKU_CCFLAGS} ; 550HAIKU_CXXFLAGS ?= ${HAIKU_CXXFLAGS} ; 551HAIKU_LDFLAGS ?= ${HAIKU_LDFLAGS} ; 552HAIKU_ARFLAGS ?= ${HAIKU_ARFLAGS} ; 553HAIKU_UNARFLAGS ?= ${HAIKU_UNARFLAGS} ; 554 555HOST_GCC_RAW_VERSION ?= ${HOST_GCC_RAW_VERSION} ; 556HOST_GCC_MACHINE ?= ${HOST_GCC_MACHINE} ; 557HOST_LD ?= ${HOST_GCC_LD} ; 558HOST_OBJCOPY ?= ${HOST_GCC_OBJCOPY} ; 559HOST_SFDISK ?= ${HOST_SFDISK} ; 560 561EOF 562 563# Libgcc.a objects 564 565cat << EOF > "$buildOutputDir/libgccObjects" 566# libgcc.a objects to be linked against libroot.so 567# Note: This file has been automatically generated by configure. 568 569HAIKU_GCC_LIBGCC_OBJECTS ?= ${HAIKU_GCC_LIBGCC_OBJECTS} ; 570EOF 571 572# Generate Timezones binaries bindings 573 574timezoneSources="africa antarctica asia australasia europe northamerica 575 southamerica pacificnew etcetera factory backward" 576 577cat << EOF > "$buildOutputDir/Timezones" 578# Timezones used for the build 579# Note: This file has been automatically generated by configure. 580 581HAIKU_TIME_ZONE_SOURCES = ${timezoneSources} ; 582 583EOF 584 585for source in ${timezoneSources}; do 586 f=$sourceDir/src/data/timezones/$source 587 588TZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' "$f" ` 589 590cat << EOF >> "$buildOutputDir/Timezones" 591TZ_OBJECTS on <timezone-source>${source} ?= $TZOBJECTS ; 592EOF 593done 594 595# Generate a boot strap Jamfile in the output directory. 596 597cat << EOF > $outputDir/Jamfile 598# automatically generated Jamfile 599 600HAIKU_TOP = ${sourceDir} ; 601HAIKU_OUTPUT_DIR = ${outputDir} ; 602 603include [ FDirName \$(HAIKU_TOP) Jamfile ] ; 604 605EOF 606