xref: /haiku/configure (revision 76fa0be374dd0b9b66c7e1845d6ea0a79c84d231)
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	# PLATFORM_LINKLIBS
148	gcclib=`$HAIKU_CC -print-libgcc-file-name`
149	gccdir=`dirname ${gcclib}`
150
151	HAIKU_GCC_RAW_VERSION=`$HAIKU_CC -dumpversion`
152	HAIKU_GCC_MACHINE=`$HAIKU_CC -dumpmachine`
153
154	HAIKU_GCC_LIB_DIR=${gccdir}
155	HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
156	HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
157	HAIKU_GCC_HEADERS_DIR="${gccdir}/include
158		${gccdir}/include-fixed"
159	HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o`
160		# Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and
161		# neither needed nor wanted.
162
163	case $HAIKU_GCC_RAW_VERSION in
164		4.*)
165			# for gcc 4 we use the libstdc++ and libsupc++ that come with the
166			# compiler
167			HAIKU_STATIC_LIBSTDCXX=`$HAIKU_CC -print-file-name=libstdc++.a`
168			HAIKU_SHARED_LIBSTDCXX=`$HAIKU_CC -print-file-name=libstdc++.so`
169			HAIKU_STATIC_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++.a`
170			HAIKU_SHARED_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++.so`
171
172			local headers
173			if [ -d $gccdir/../../../../$HAIKU_GCC_MACHINE/include/c++/$HAIKU_GCC_RAW_VERSION ]; then
174				headers=$gccdir/../../../../$HAIKU_GCC_MACHINE/include/c++/$HAIKU_GCC_RAW_VERSION
175			else
176				headers=$gccdir/../../../../include/c++/$HAIKU_GCC_RAW_VERSION
177			fi
178
179			HAIKU_CXX_HEADERS_DIR=$headers
180			for d in $HAIKU_GCC_MACHINE backward ext; do
181				# Note: We need the line break, otherwise the line might become
182				# too long for jam (512 bytes max).
183				HAIKU_CXX_HEADERS_DIR="$HAIKU_CXX_HEADERS_DIR
184					$headers/$d"
185			done
186
187			# when not building the crosscompiler, to use cpp headers from
188			# tree first, but fallback to local C++ system headers (like <new>)
189			# if [ "$buildCrossTools" = "" ]; then
190			#	HAIKU_CXX_HEADERS_DIR="headers/cpp $HAIKU_CXX_HEADERS_DIR"
191			# fi
192
193			if [ $HAIKU_STATIC_LIBSTDCXX = libstdc++.a ]; then
194				HAIKU_STATIC_LIBSTDCXX=
195			fi
196			if [ $HAIKU_SHARED_LIBSTDCXX = libstdc++.so ]; then
197				HAIKU_SHARED_LIBSTDCXX=
198			fi
199			if [ $HAIKU_STATIC_LIBSUPCXX = libsupc++.a ]; then
200				HAIKU_STATIC_LIBSUPCXX=
201			fi
202			if [ $HAIKU_SHARED_LIBSUPCXX = libsupc++.so ]; then
203				HAIKU_SHARED_LIBSUPCXX=
204			fi
205		;;
206		2.9*)
207			# check for correct (most up-to-date) legacy compiler and complain
208			# if an older one is installed
209			if [ $HAIKU_GCC_RAW_VERSION != $haikuRequiredLegacyGCCVersion ]; then
210				echo "GCC version $haikuRequiredLegacyGCCVersion is required!";
211				echo "Please download it from www.haiku-os.org...";
212				exit 1;
213			fi
214		;;
215	esac
216}
217
218# set_default_value
219#
220# Set the value for a variable, if no value is set yet.
221#
222set_default_value()
223{
224	eval "$1=\${$1-$2}"
225}
226
227# get_build_tool_path
228#
229# Gets a usable absolute path of a build tool.
230#
231get_build_tool_path()
232{
233	local var="HAIKU_$1"
234	local tool=$2
235	local path="${crossToolsPrefix}$tool"
236
237	if [ -f "$path" ]; then
238		# get absolute path
239		local oldPwd="`pwd`"
240		cd "`dirname "$path"`"
241		path="`pwd`/`basename "$path"`"
242		cd $oldPwd
243	else
244		which "$path" &> /dev/null || {
245			echo "Build tool \"$path\" not found." >&2
246			exit 1
247		}
248	fi
249
250	eval "$var=$path"
251}
252
253# get cwd and the source directory
254currentDir=`pwd`
255cd `dirname "$0"`
256sourceDir=`pwd`
257cd "$currentDir"
258
259# backup the passed arguments
260configureArgs="$@"
261
262# internal default parameter values
263#
264platform=`uname`
265platformMachine=`uname  -m`
266targetArch=x86
267crossToolsPrefix=
268buildCrossTools=
269buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
270buildCrossToolsMachine=
271buildCrossToolsJobs=
272
273# exported (BuildSetup) default parameter values
274#
275HAIKU_GCC_RAW_VERSION=
276HAIKU_GCC_MACHINE=i586-pc-haiku
277HAIKU_STATIC_LIBSTDCXX=
278HAIKU_SHARED_LIBSTDCXX=
279HAIKU_STATIC_LIBSUPCXX=
280HAIKU_SHARED_LIBSUPCXX=
281HAIKU_CXX_HEADERS_DIR=
282HOST_GCC_RAW_VERSION=`gcc -dumpversion`
283HOST_GCC_MACHINE=`gcc -dumpmachine`
284HAIKU_INCLUDE_GPL_ADDONS=0
285HAIKU_INCLUDE_PATENTED_CODE=0
286HAIKU_INCLUDE_SOURCES=0
287HAIKU_INCLUDE_3RDPARTY=0
288HAIKU_ENABLE_MULTIUSER=0
289HAIKU_DISTRO_COMPATIBILITY=default
290TARGET_PLATFORM=haiku
291HAIKU_USE_GCC_PIPE=0
292HAIKU_HOST_USE_32BIT=0
293HAIKU_HOST_USE_XATTR=0
294HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR=
295HAIKU_ADD_ALTERNATIVE_GCC_LIBS=
296HOST_GCC_LD=`gcc -print-prog-name=ld`
297HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
298SFDISK_BINARY=sfdisk
299HOST_SFDISK=$SFDISK_BINARY
300
301haikuRequiredLegacyGCCVersion="2.95.3-haiku-090629"
302export haikuRequiredLegacyGCCVersion
303	# version of legacy gcc required to build haiku
304
305set_default_value HAIKU_AR			ar
306set_default_value HAIKU_CC			gcc
307set_default_value HAIKU_LD			ld
308set_default_value HAIKU_OBJCOPY		objcopy
309set_default_value HAIKU_RANLIB		ranlib
310set_default_value HAIKU_YASM		yasm
311set_default_value HAIKU_CPPFLAGS	""
312set_default_value HAIKU_CCFLAGS		""
313set_default_value HAIKU_CXXFLAGS	""
314set_default_value HAIKU_LDFLAGS		""
315set_default_value HAIKU_ARFLAGS		cru
316set_default_value HAIKU_UNARFLAGS	x
317
318# determine output directory
319if [ "$currentDir" = "$sourceDir" ]; then
320	outputDir=$currentDir/generated
321else
322	outputDir=$currentDir
323fi
324buildOutputDir="$outputDir/build"
325HAIKU_BUILD_ATTRIBUTES_DIR="$outputDir/attributes"
326buildConfigFile="$buildOutputDir/BuildConfig"
327
328# check for update request
329if [ "$1" = "--update" ]; then
330	if ! [ -e "$buildConfigFile" ]; then
331		echo $0 --update: \'$buildConfigFile\' not found - updating not possible.
332		exit 1
333	fi
334	if ! type perl >/dev/null 2>&1; then
335		echo $0 --update: \'perl\' not found - updating not possible.
336		exit 1
337	fi
338	# convert BuildConfig from jam format to shell format and evaluate it
339	shellConfigFile="${buildConfigFile}.shell"
340	perl "$sourceDir/build/scripts/convert_build_config_to_shell_format.pl" \
341		<"$buildConfigFile" >"$shellConfigFile"
342	. "$shellConfigFile"
343	rm "$shellConfigFile"
344	shift
345fi
346
347# parse parameters
348#
349while [ $# -gt 0 ] ; do
350	case "$1" in
351		--alternative-gcc-output-dir)
352			assertparam "$1" $#
353			cd $2 || exit 1
354			HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR=`pwd`
355			HAIKU_ADD_ALTERNATIVE_GCC_LIBS=1
356			cd $currentDir
357			shift 2
358			;;
359		--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
360		--build-cross-tools-gcc4)
361			assertparams "$1" 2 $#
362			buildCrossTools=$3
363			buildCrossToolsScript="${buildCrossToolsScript}_gcc4"
364			case "$2" in
365				x86)	HAIKU_GCC_MACHINE=i586-pc-haiku;;
366				ppc)	HAIKU_GCC_MACHINE=powerpc-apple-haiku; targetArch=ppc;;
367				m68k)	HAIKU_GCC_MACHINE=m68k-unknown-haiku; targetArch=m86k;;
368				arm)	HAIKU_GCC_MACHINE=arm-unknown-haiku; targetArch=arm;;
369				mipsel)	HAIKU_GCC_MACHINE=mipsel-unknown-haiku; targetArch=mips;;
370				*)		echo "Unsupported target architecture: $2"
371						exit 1;;
372			esac
373			buildCrossToolsMachine=$HAIKU_GCC_MACHINE
374			shift 3
375			;;
376		--cross-tools-prefix)
377			assertparam "$1" $#
378			crossToolsPrefix=$2
379			shift 2
380			;;
381		--distro-compatibility)
382			assertparam "$1" $#
383			HAIKU_DISTRO_COMPATIBILITY=$2
384			case "$HAIKU_DISTRO_COMPATIBILITY" in
385				official)	;;
386				compatible)	;;
387				default)	;;
388				*)			echo "Invalid distro compatibility" \
389								"level: $HAIKU_DISTRO_COMPATIBILITY"
390							exit 1;;
391			esac
392			shift 2
393			;;
394		--enable-multiuser)	HAIKU_ENABLE_MULTIUSER=1; shift 1;;
395		--help | -h)	usage; exit 0;;
396		--include-gpl-addons)	HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;;
397		--include-patented-code)	HAIKU_INCLUDE_PATENTED_CODE=1; shift 1;;
398		--include-sources)	HAIKU_INCLUDE_SOURCES=1; shift 1;;
399		--include-3rdparty)	HAIKU_INCLUDE_3RDPARTY=1; shift 1;;
400        -j*)				buildCrossToolsJobs="$1"; shift 1;;
401		--target=*)     TARGET_PLATFORM=`echo $1 | cut -d'=' -f2-`; shift 1;;
402		--use-gcc-pipe)	HAIKU_USE_GCC_PIPE=1; shift 1;;
403		--use-32bit)	HAIKU_HOST_USE_32BIT=1; shift 1;;
404		--use-xattr)	HAIKU_HOST_USE_XATTR=1; shift 1;;
405		*)				echo Invalid argument: \`$1\'; exit 1;;
406	esac
407done
408
409# detect the build platform
410case "${platform}" in
411	BeOS)	revision=`uname -r`
412			case "$revision" in
413				6.*)	HOST_PLATFORM=dano ;;
414				5.1)	HOST_PLATFORM=dano ;;
415				5.0.4)	HOST_PLATFORM=bone ;;
416				5.0*)	HOST_PLATFORM=r5 ;;
417				*)		echo Unknown BeOS version: $revision
418						exit 1 ;;
419			esac
420			;;
421	Darwin)	HOST_PLATFORM=darwin ;;
422	FreeBSD)	HOST_PLATFORM=freebsd
423				SFDISK_BINARY=sfdisk-linux
424				if [ "$HAIKU_HOST_USE_32BIT" = 1 ] ; then
425					echo Unsupported platform: FreeBSD ${platformMachine}
426					exit 1
427				fi	;;
428	Haiku)	HOST_PLATFORM=haiku_host ;;
429	Linux)	HOST_PLATFORM=linux ;;
430	OpenBSD) HOST_PLATFORM=openbsd ;;
431	SunOS)	HOST_PLATFORM=sunos ;;
432	CYGWIN_NT-*) HOST_PLATFORM=cygwin ;;
433	*)		echo Unsupported platform: ${platform}
434			exit 1 ;;
435esac
436
437# check yasm version
438if [ $targetArch = "x86" ]; then
439	$HAIKU_YASM --version > /dev/null || {
440		echo "The yasm assembler version 0.7.0 or later must be installed."
441		echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download"
442		exit 1
443	}
444
445	set -- $($HAIKU_YASM --version | head -n 1)
446	versionOK=0
447	case $2 in
448		0.[0-6].*)		;;
449		*)				versionOK=1 ;;
450	esac
451
452	if [ $versionOK = 0 ]; then
453		echo "The yasm assembler version 0.7.0 or later must be installed."
454		echo "The installed version is $2."
455		echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download"
456		exit 1
457	fi
458fi
459
460# check common locations for sfdisk
461for sfdiskDir in /sbin /usr/sbin /usr/local/sbin ; do
462	if [ -e ${sfdiskDir}/${SFDISK_BINARY} ]; then
463		HOST_SFDISK=${sfdiskDir}/${SFDISK_BINARY}
464	fi
465done
466
467# check for case-sensitive filesystem if on darwin
468if [ $HOST_PLATFORM = "darwin" ]; then
469	diskutil info $(pwd) | grep -i "case-sensitive" > /dev/null
470	if [ $? != 0 ]; then
471		echo "You need a case-sensitive file-system to build Haiku."
472		echo "Please see the following guide on how to set one up:"
473		echo "http://haiku-os.org/documents/dev/how_to_build_haiku_on_mac_os_x"
474		exit 1
475	fi
476fi
477
478# create output directory
479mkdir -p "$buildOutputDir" || exit 1
480
481# build cross tools from sources
482if [ -n "$buildCrossTools" ]; then
483	"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
484		"$buildCrossTools" "$outputDir" $buildCrossToolsJobs || exit 1
485	crossToolsPrefix="$outputDir/cross-tools/bin/${HAIKU_GCC_MACHINE}-"
486fi
487
488# cross tools
489if [ -n "$crossToolsPrefix" ]; then
490	get_build_tool_path AR ar
491	get_build_tool_path CC gcc
492	get_build_tool_path LD ld
493	get_build_tool_path OBJCOPY objcopy
494	get_build_tool_path RANLIB ranlib
495fi
496
497# prepare gcc settings
498standard_gcc_settings
499
500# check whether the Haiku compiler really targets Haiku or BeOS
501case "$HAIKU_GCC_MACHINE" in
502	*-*-haiku)	;;
503	*-*-beos)	;;
504	*) echo The compiler specified as Haiku target compiler is not a valid \
505			Haiku cross-compiler. Please see ReadMe.cross-compile. >&2
506	   echo compiler: $HAIKU_CC
507	   echo compiler is configured for target: $HAIKU_GCC_MACHINE
508	   exit 1 ;;
509esac
510
511# Generate BuildConfig
512cat << EOF > "$buildConfigFile"
513# BuildConfig
514# Note: This file has been automatically generated by configure with the
515# following arguments:
516# ${configureArgs}
517
518TARGET_PLATFORM 			?= "${TARGET_PLATFORM}" ;
519HOST_PLATFORM				?= "${HOST_PLATFORM}" ;
520
521HAIKU_INCLUDE_GPL_ADDONS			?= "${HAIKU_INCLUDE_GPL_ADDONS}" ;
522HAIKU_INCLUDE_PATENTED_CODE			?= "${HAIKU_INCLUDE_PATENTED_CODE}" ;
523HAIKU_INCLUDE_SOURCES				?= "${HAIKU_INCLUDE_SOURCES}" ;
524HAIKU_INCLUDE_3RDPARTY				?= "${HAIKU_INCLUDE_3RDPARTY}" ;
525HAIKU_ENABLE_MULTIUSER				?= "${HAIKU_ENABLE_MULTIUSER}" ;
526HAIKU_DISTRO_COMPATIBILITY			?= "${HAIKU_DISTRO_COMPATIBILITY}" ;
527HAIKU_USE_GCC_PIPE					?= "${HAIKU_USE_GCC_PIPE}" ;
528HAIKU_HOST_USE_32BIT				?= "${HAIKU_HOST_USE_32BIT}" ;
529HAIKU_HOST_USE_XATTR				?= "${HAIKU_HOST_USE_XATTR}" ;
530HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR	?= ${HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR} ;
531HAIKU_ADD_ALTERNATIVE_GCC_LIBS		?= ${HAIKU_ADD_ALTERNATIVE_GCC_LIBS} ;
532
533HAIKU_GCC_RAW_VERSION		?= ${HAIKU_GCC_RAW_VERSION} ;
534HAIKU_GCC_MACHINE			?= ${HAIKU_GCC_MACHINE} ;
535HAIKU_GCC_LIB_DIR			?= ${HAIKU_GCC_LIB_DIR} ;
536HAIKU_GCC_HEADERS_DIR		?= ${HAIKU_GCC_HEADERS_DIR} ;
537HAIKU_GCC_LIBGCC			?= ${HAIKU_GCC_LIBGCC} ;
538
539HAIKU_STATIC_LIBSTDC++		?= ${HAIKU_STATIC_LIBSTDCXX} ;
540HAIKU_SHARED_LIBSTDC++		?= ${HAIKU_SHARED_LIBSTDCXX} ;
541HAIKU_STATIC_LIBSUPC++		?= ${HAIKU_STATIC_LIBSUPCXX} ;
542HAIKU_SHARED_LIBSUPC++		?= ${HAIKU_SHARED_LIBSUPCXX} ;
543HAIKU_C++_HEADERS_DIR		?= ${HAIKU_CXX_HEADERS_DIR} ;
544
545HAIKU_BUILD_ATTRIBUTES_DIR	?= ${HAIKU_BUILD_ATTRIBUTES_DIR} ;
546
547HAIKU_AR					?= ${HAIKU_AR} ;
548HAIKU_CC					?= ${HAIKU_CC} ;
549HAIKU_LD					?= ${HAIKU_LD} ;
550HAIKU_OBJCOPY				?= ${HAIKU_OBJCOPY} ;
551HAIKU_RANLIB				?= ${HAIKU_RANLIB} ;
552HAIKU_YASM					?= ${HAIKU_YASM} ;
553HAIKU_CPPFLAGS				?= ${HAIKU_CPPFLAGS} ;
554HAIKU_CCFLAGS				?= ${HAIKU_CCFLAGS} ;
555HAIKU_CXXFLAGS				?= ${HAIKU_CXXFLAGS} ;
556HAIKU_LDFLAGS				?= ${HAIKU_LDFLAGS} ;
557HAIKU_ARFLAGS				?= ${HAIKU_ARFLAGS} ;
558HAIKU_UNARFLAGS				?= ${HAIKU_UNARFLAGS} ;
559
560HOST_GCC_RAW_VERSION		?= ${HOST_GCC_RAW_VERSION} ;
561HOST_GCC_MACHINE			?= ${HOST_GCC_MACHINE} ;
562HOST_LD						?= ${HOST_GCC_LD} ;
563HOST_OBJCOPY				?= ${HOST_GCC_OBJCOPY} ;
564HOST_SFDISK					?= ${HOST_SFDISK} ;
565
566EOF
567
568# Libgcc.a objects
569
570cat << EOF > "$buildOutputDir/libgccObjects"
571# libgcc.a objects to be linked against libroot.so
572# Note: This file has been automatically generated by configure.
573
574HAIKU_GCC_LIBGCC_OBJECTS	?= ${HAIKU_GCC_LIBGCC_OBJECTS} ;
575EOF
576
577# Generate Timezones binaries bindings
578
579timezoneSources="africa antarctica asia australasia europe northamerica
580	southamerica pacificnew etcetera factory backward"
581
582cat << EOF > "$buildOutputDir/Timezones"
583# Timezones used for the build
584# Note: This file has been automatically generated by configure.
585
586HAIKU_TIME_ZONE_SOURCES = ${timezoneSources} ;
587
588EOF
589
590for source in ${timezoneSources}; do
591	f=$sourceDir/src/data/timezones/$source
592
593TZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' "$f" `
594
595cat << EOF >> "$buildOutputDir/Timezones"
596TZ_OBJECTS on <timezone-source>${source} ?= $TZOBJECTS ;
597EOF
598done
599
600# Generate a boot strap Jamfile in the output directory.
601
602cat << EOF > $outputDir/Jamfile
603# automatically generated Jamfile
604
605HAIKU_TOP			= ${sourceDir} ;
606HAIKU_OUTPUT_DIR	= ${outputDir} ;
607
608include [ FDirName \$(HAIKU_TOP) Jamfile ] ;
609
610EOF
611