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