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