xref: /haiku/configure (revision 0385b0657b9c255b849c6e6031cd258e041a17ac)
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
34eccc7665SIngo Weinhold                              prefix, e.g. "/path/to/tools/i586-pc-beos-".
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.
46614026d7Sshatty  --target=TARGET             Select build target platform. [default=${target}]
47a17b9c0cSshatty                              valid targets=r5,bone,dano,haiku
48eccc7665SIngo Weinhold  --use-gcc-pipe              Build with GCC option -pipe. Speeds up the build
495a34a443SFrançois Revol                              process, but uses more memory.
50*0385b065SIngo Weinhold  --use-32bit                 Use -m32 flag on 64bit host gcc compiler.
514f4e5272SIngo Weinhold  --use-xattr                 Use Linux xattr support for BeOS attribute
524f4e5272SIngo Weinhold                              emulation. Warning: Make sure your file system
534f4e5272SIngo Weinhold                              supports sufficient attribute sizes (4 KB per
544f4e5272SIngo Weinhold                              file for all attributes won't suffice).
55338b8dc3SIngo Weinhold
56338b8dc3SIngo Weinholdenvironment variables:
57338b8dc3SIngo Weinhold  HAIKU_AR                    The static library archiver. Defaults to "ar".
58338b8dc3SIngo Weinhold  HAIKU_CC                    The compiler. Defaults to "gcc".
59338b8dc3SIngo Weinhold  HAIKU_LD                    The linker. Defaults to "ld".
60338b8dc3SIngo Weinhold  HAIKU_OBJCOPY               The objcopy to be used. Defaults to "objcopy".
61338b8dc3SIngo Weinhold  HAIKU_RANLIB                The static library indexer. Defaults to "ranlib".
62338b8dc3SIngo Weinhold  HAIKU_CPPFLAGS              The preprocessor flags. Defaults to "".
63338b8dc3SIngo Weinhold  HAIKU_CCFLAGS               The C flags. Defaults to "".
64338b8dc3SIngo Weinhold  HAIKU_CXXFLAGS              The C++ flags. Defaults to "".
65338b8dc3SIngo Weinhold  HAIKU_LDFLAGS               The linker flags. Defaults to "".
66338b8dc3SIngo Weinhold  HAIKU_ARFLAGS               The flags passed to HAIKU_AR for archiving.
67338b8dc3SIngo Weinhold                              Defaults to "ru".
68338b8dc3SIngo Weinhold  HAIKU_UNARFLAGS             The flags passed to HAIKU_AR for unarchiving.
69338b8dc3SIngo Weinhold                              Defaults to "x".
70022fa244SIngo WeinholdEOF
71022fa244SIngo Weinhold}
72022fa244SIngo Weinhold
73022fa244SIngo Weinhold# assertparam
74022fa244SIngo Weinhold#
75022fa244SIngo Weinhold# Checks whether at least one parameter is left.
76022fa244SIngo Weinhold#
77022fa244SIngo Weinholdassertparam()
78022fa244SIngo Weinhold{
7920ab75e6SIngo Weinhold	if [ $2 -lt 2 ]; then
80022fa244SIngo Weinhold		echo $0: \`$1\': Parameter expected.
81022fa244SIngo Weinhold		exit 1
82022fa244SIngo Weinhold	fi
83022fa244SIngo Weinhold}
84022fa244SIngo Weinhold
8520ab75e6SIngo Weinhold# assertparams
8620ab75e6SIngo Weinhold#
8720ab75e6SIngo Weinhold# Checks whether at least a certain number of parameters is left.
8820ab75e6SIngo Weinhold#
8920ab75e6SIngo Weinholdassertparams()
9020ab75e6SIngo Weinhold{
9120ab75e6SIngo Weinhold	if [ $3 -le $2 ]; then
9220ab75e6SIngo Weinhold		echo $0: \`$1\': Not enough parameters.
9320ab75e6SIngo Weinhold		exit 1
9420ab75e6SIngo Weinhold	fi
9520ab75e6SIngo Weinhold}
9620ab75e6SIngo Weinhold
9709c5682dSIngo Weinhold# standard_gcc_settings
9809c5682dSIngo Weinhold#
9909c5682dSIngo Weinhold# Sets the variables for a GCC platform.
10009c5682dSIngo Weinhold#
10109c5682dSIngo Weinholdstandard_gcc_settings()
10209c5682dSIngo Weinhold{
10309c5682dSIngo Weinhold	# PLATFORM_LINKLIBS
104338b8dc3SIngo Weinhold	gcclib=`$HAIKU_CC -print-libgcc-file-name`
10509c5682dSIngo Weinhold	gccdir=`dirname ${gcclib}`
1065b0f7b1bSOliver Tappe
107338b8dc3SIngo Weinhold	haikuGCCVersion=`$HAIKU_CC -dumpversion`
108338b8dc3SIngo Weinhold	haikuGCCMachine=`$HAIKU_CC -dumpmachine`
109338b8dc3SIngo Weinhold
110338b8dc3SIngo Weinhold	HAIKU_GCC_LIB_DIR=${gccdir}
111338b8dc3SIngo Weinhold	HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
112338b8dc3SIngo Weinhold	HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
113338b8dc3SIngo Weinhold	HAIKU_GCC_HEADERS_DIR=${gccdir}/include
1145d978968SIngo Weinhold	HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o`
1155d978968SIngo Weinhold		# Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and
1165d978968SIngo Weinhold		# neither needed nor wanted.
1178b5934c9SIngo Weinhold
1188b5934c9SIngo Weinhold	case $haikuGCCVersion in
1198b5934c9SIngo Weinhold		4.*)
1205b0f7b1bSOliver Tappe			# for gcc 4 we use the libstdc++ and libsupc++ that come with the
1215b0f7b1bSOliver Tappe			# compiler
1228b5934c9SIngo Weinhold			haikuStaticLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.a`
1238b5934c9SIngo Weinhold			haikuSharedLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.so`
124c89fc875SIngo Weinhold			haikuStaticLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.a`
125c89fc875SIngo Weinhold			haikuSharedLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.so`
1268b5934c9SIngo Weinhold			local headers=$gccdir/../../../../include/c++/$haikuGCCVersion
1278b5934c9SIngo Weinhold			haikuCxxHeadersDir=$headers
12829ef597dSIngo Weinhold			for d in $haikuGCCMachine backward ext; do
12929ef597dSIngo Weinhold				# Note: We need the line break, otherwise the line might become
13029ef597dSIngo Weinhold				# too long for jam (512 bytes max).
13129ef597dSIngo Weinhold				haikuCxxHeadersDir="$haikuCxxHeadersDir
13229ef597dSIngo Weinhold					$headers/$d"
1338b5934c9SIngo Weinhold			done
134274b450aSMarcus Overhagen
135dad36002SMarcus Overhagen
136dad36002SMarcus Overhagen			# when not building the crosscompiler, to use cpp headers from
137274b450aSMarcus Overhagen			# tree first, but fallback to local C++ system headers (like <new>)
138dad36002SMarcus Overhagen			# if [ "$buildCrossTools" = "" ]; then
139dad36002SMarcus Overhagen			#	haikuCxxHeadersDir="headers/cpp $haikuCxxHeadersDir"
140dad36002SMarcus Overhagen			# fi
1418b5934c9SIngo Weinhold
1428b5934c9SIngo Weinhold			if [ $haikuStaticLibStdCxx = libstdc++.a ]; then
1438b5934c9SIngo Weinhold				haikuStaticLibStdCxx=
1448b5934c9SIngo Weinhold			fi
1458b5934c9SIngo Weinhold			if [ $haikuSharedLibStdCxx = libstdc++.so ]; then
1468b5934c9SIngo Weinhold				haikuSharedLibStdCxx=
1478b5934c9SIngo Weinhold			fi
148c89fc875SIngo Weinhold			if [ $haikuStaticLibSupCxx = libsupc++.a ]; then
149c89fc875SIngo Weinhold				haikuStaticLibSupCxx=
150c89fc875SIngo Weinhold			fi
151c89fc875SIngo Weinhold			if [ $haikuSharedLibSupCxx = libsupc++.so ]; then
152c89fc875SIngo Weinhold				haikuSharedLibSupCxx=
153c89fc875SIngo Weinhold			fi
1548b5934c9SIngo Weinhold		;;
1556cc8eecfSOliver Tappe		2.9*)
1565b0f7b1bSOliver Tappe			# check for correct (most up-to-date) legacy compiler and complain
1575b0f7b1bSOliver Tappe			# if an older one is installed
1585b0f7b1bSOliver Tappe			if [ $haikuGCCVersion != $haikuRequiredLegacyGCCVersion ]; then
1595b0f7b1bSOliver Tappe				echo "GCC version $haikuRequiredLegacyGCCVersion is required!";
1605b0f7b1bSOliver Tappe				echo "Please download it from www.haiku-os.org...";
1615b0f7b1bSOliver Tappe				exit 1;
1625b0f7b1bSOliver Tappe			fi
1635b0f7b1bSOliver Tappe		;;
1648b5934c9SIngo Weinhold	esac
16509c5682dSIngo Weinhold}
16609c5682dSIngo Weinhold
167338b8dc3SIngo Weinhold# set_default_value
168338b8dc3SIngo Weinhold#
169338b8dc3SIngo Weinhold# Set the value for a variable, if no value is set yet.
170338b8dc3SIngo Weinhold#
171338b8dc3SIngo Weinholdset_default_value()
172338b8dc3SIngo Weinhold{
1730838a930SJérôme Duval	eval "$1=\${$1-$2}"
174338b8dc3SIngo Weinhold}
175338b8dc3SIngo Weinhold
176338b8dc3SIngo Weinhold# get_build_tool_path
177338b8dc3SIngo Weinhold#
178338b8dc3SIngo Weinhold# Gets a usable absolute path of a build tool.
179338b8dc3SIngo Weinhold#
180338b8dc3SIngo Weinholdget_build_tool_path()
181338b8dc3SIngo Weinhold{
182338b8dc3SIngo Weinhold	local var="HAIKU_$1"
183338b8dc3SIngo Weinhold	local tool=$2
184338b8dc3SIngo Weinhold	local path="${crossToolsPrefix}$tool"
185338b8dc3SIngo Weinhold
186338b8dc3SIngo Weinhold	if [ -f "$path" ]; then
187338b8dc3SIngo Weinhold		# get absolute path
188338b8dc3SIngo Weinhold		local oldPwd=$(pwd)
189338b8dc3SIngo Weinhold		cd $(dirname "$path")
190338b8dc3SIngo Weinhold		path="$(pwd)/$(basename "$path")"
191338b8dc3SIngo Weinhold		cd $oldPwd
192338b8dc3SIngo Weinhold	else
193338b8dc3SIngo Weinhold		which "$path" &> /dev/null || {
194338b8dc3SIngo Weinhold			echo "Build tool \"$path\" not found." >&2
195338b8dc3SIngo Weinhold			exit 1
196338b8dc3SIngo Weinhold		}
197338b8dc3SIngo Weinhold	fi
198338b8dc3SIngo Weinhold
199338b8dc3SIngo Weinhold	eval "$var=$path"
200338b8dc3SIngo Weinhold}
201338b8dc3SIngo Weinhold
202338b8dc3SIngo Weinhold# get cwd and the source directory
203338b8dc3SIngo WeinholdcurrentDir=`pwd`
2046e7c6fe5SIngo Weinholdcd `dirname "$0"`
205338b8dc3SIngo WeinholdsourceDir=`pwd`
2066e7c6fe5SIngo Weinholdcd "$currentDir"
207338b8dc3SIngo Weinhold
208022fa244SIngo Weinhold# default parameter values
209022fa244SIngo Weinhold#
21052a38012Sejakowatzplatform=`uname`
211338b8dc3SIngo WeinholdhaikuGCCVersion=
2129743fe87SIngo WeinholdhaikuGCCMachine=i586-pc-beos
2138b5934c9SIngo WeinholdhaikuStaticLibStdCxx=
2148b5934c9SIngo WeinholdhaikuSharedLibStdCxx=
215c89fc875SIngo WeinholdhaikuStaticLibSupCxx=
216c89fc875SIngo WeinholdhaikuSharedLibSupCxx=
2178b5934c9SIngo WeinholdhaikuCxxHeadersDir=
218db63fe67SAxel DörflerhostGCCVersion=`gcc -dumpversion`
2192b94bc7bSlillobochs_debug=0
220e91f3ca1Sbeveloperinclude_gpl_addons=0
221a66c32ddSIngo WeinholddistroCompatibility=default
22262339647SAxel Dörflertarget=haiku
223eccc7665SIngo Weinholduse_gcc_pipe=0
224*0385b065SIngo Weinholduse_32bit=0
2254f4e5272SIngo Weinholduse_xattr=0
226338b8dc3SIngo WeinholdcrossToolsPrefix=
227338b8dc3SIngo WeinholdbuildCrossTools=
22829ef597dSIngo WeinholdbuildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
22920ab75e6SIngo WeinholdbuildCrossToolsMachine=
230338b8dc3SIngo Weinhold
231af4bf973SOliver Tappeexport haikuRequiredLegacyGCCVersion="2.95.3-beos-060710"
232af4bf973SOliver Tappe	# version of legacy gcc required to build haiku
233af4bf973SOliver Tappe
234338b8dc3SIngo Weinholdset_default_value HAIKU_AR			ar
235338b8dc3SIngo Weinholdset_default_value HAIKU_CC			gcc
236338b8dc3SIngo Weinholdset_default_value HAIKU_LD			ld
237338b8dc3SIngo Weinholdset_default_value HAIKU_OBJCOPY		objcopy
238338b8dc3SIngo Weinholdset_default_value HAIKU_RANLIB		ranlib
239338b8dc3SIngo Weinholdset_default_value HAIKU_CPPFLAGS	""
240338b8dc3SIngo Weinholdset_default_value HAIKU_CCFLAGS		""
241338b8dc3SIngo Weinholdset_default_value HAIKU_CXXFLAGS	""
242338b8dc3SIngo Weinholdset_default_value HAIKU_LDFLAGS		""
243338b8dc3SIngo Weinholdset_default_value HAIKU_ARFLAGS		ru
244338b8dc3SIngo Weinholdset_default_value HAIKU_UNARFLAGS	x
24562339647SAxel Dörfler
246022fa244SIngo Weinhold# parse parameters
247022fa244SIngo Weinhold#
24820ab75e6SIngo Weinholdwhile [ $# -gt 0 ] ; do
249022fa244SIngo Weinhold	case "$1" in
2502b94bc7bSlillo		--bochs-debug)	bochs_debug=1; shift 1;;
251a5b60fa8SOliver Tappe		--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
25220ab75e6SIngo Weinhold		--build-cross-tools-gcc4) assertparams "$1" 2 $#; buildCrossTools=$3;
25329ef597dSIngo Weinhold						buildCrossToolsScript="${buildCrossToolsScript}_gcc4";
25420ab75e6SIngo Weinhold						case "$2" in
25520ab75e6SIngo Weinhold							x86)	haikuGCCMachine=i586-pc-haiku;;
25620ab75e6SIngo Weinhold							ppc)	haikuGCCMachine=powerpc-apple-haiku;;
25720ab75e6SIngo Weinhold							*)		echo "Unsupported target architecture: $2"
25820ab75e6SIngo Weinhold									exit 1;;
25920ab75e6SIngo Weinhold						esac
260a5b60fa8SOliver Tappe						buildCrossToolsMachine=$haikuGCCMachine
26120ab75e6SIngo Weinhold						shift 3;;
262eccc7665SIngo Weinhold		--cross-tools-prefix) assertparam "$1" $#; crossToolsPrefix=$2; shift 2;;
263022fa244SIngo Weinhold		--help | -h)	usage; exit 0;;
264eccc7665SIngo Weinhold		--include-gpl-addons)	include_gpl_addons=1; shift 1;;
265a66c32ddSIngo Weinhold		--distro-compatibility)
266a66c32ddSIngo Weinhold						assertparam "$1" $#; distroCompatibility=$2;
267a66c32ddSIngo Weinhold						case "$distroCompatibility" in
268a66c32ddSIngo Weinhold							official)	;;
269a66c32ddSIngo Weinhold							compatible)	;;
270a66c32ddSIngo Weinhold							default)	;;
271a66c32ddSIngo Weinhold							*)			echo "Invalid distro compatibility" \
272a66c32ddSIngo Weinhold											"level: $distroCompatibility"
273a66c32ddSIngo Weinhold										exit 1;;
274a66c32ddSIngo Weinhold						esac
275a66c32ddSIngo Weinhold						shift 2;;
276eccc7665SIngo Weinhold		--target=*)     target=`echo $1 | cut -d'=' -f2-`; shift 1;;
277eccc7665SIngo Weinhold		--use-gcc-pipe)	use_gcc_pipe=1; shift 1;;
278*0385b065SIngo Weinhold		--use-32bit)	use_32bit=1; shift 1;;
2794f4e5272SIngo Weinhold		--use-xattr)	use_xattr=1; shift 1;;
280022fa244SIngo Weinhold		*)				echo Invalid argument: \`$1\'; exit 1;;
281022fa244SIngo Weinhold	esac
282022fa244SIngo Weinholddone
283022fa244SIngo Weinhold
2840df3cc9cSIngo Weinhold# detect the build platform
285338b8dc3SIngo Weinholdcase "${platform}" in
2860df3cc9cSIngo Weinhold	BeOS)	revision=`uname -r`
2870df3cc9cSIngo Weinhold			case "$revision" in
28814998c8bSIngo Weinhold				6.*)	buildPlatform=dano ;;
2890df3cc9cSIngo Weinhold				5.1)	buildPlatform=dano ;;
2900df3cc9cSIngo Weinhold				5.0.4)	buildPlatform=bone ;;
2910df3cc9cSIngo Weinhold				5.0*)	buildPlatform=r5 ;;
2920df3cc9cSIngo Weinhold				*)		echo Unknown BeOS version: $revision
2930df3cc9cSIngo Weinhold						exit 1 ;;
2940df3cc9cSIngo Weinhold			esac
2950df3cc9cSIngo Weinhold			;;
2966dcd0ccfSIngo Weinhold	Darwin)	buildPlatform=darwin ;;
297da0f9ae0SIngo Weinhold	FreeBSD) buildPlatform=freebsd ;;
298da0f9ae0SIngo Weinhold	Haiku)	buildPlatform=haiku_host ;;
299da0f9ae0SIngo Weinhold	Linux)	buildPlatform=linux ;;
300338b8dc3SIngo Weinhold	*)		echo Unsupported platform: ${platform}
3014cbe4925SAxel Dörfler			exit 1 ;;
3024cbe4925SAxel Dörfleresac
30352a38012Sejakowatz
304338b8dc3SIngo Weinhold# create output directory
305338b8dc3SIngo Weinholdif [ "$currentDir" = "$sourceDir" ]; then
306338b8dc3SIngo Weinhold	outputDir=$currentDir/generated
307338b8dc3SIngo Weinholdelse
308338b8dc3SIngo Weinhold	outputDir=$currentDir
309338b8dc3SIngo Weinholdfi
3106e7c6fe5SIngo WeinholdbuildOutputDir="$outputDir/build"
3116e7c6fe5SIngo WeinholdbuildAttributesDir="$outputDir/attributes"
3126e7c6fe5SIngo Weinholdmkdir -p "$buildOutputDir" || exit 1
313338b8dc3SIngo Weinhold
314338b8dc3SIngo Weinhold# build cross tools from sources
315338b8dc3SIngo Weinholdif [ -n "$buildCrossTools" ]; then
31620ab75e6SIngo Weinhold	"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
3176e7c6fe5SIngo Weinhold		"$buildCrossTools" "$outputDir" || exit 1
318a5b60fa8SOliver Tappe	crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-"
319338b8dc3SIngo Weinholdfi
320338b8dc3SIngo Weinhold
321338b8dc3SIngo Weinhold# cross tools
322338b8dc3SIngo Weinholdif [ -n "$crossToolsPrefix" ]; then
323338b8dc3SIngo Weinhold	get_build_tool_path AR ar
324338b8dc3SIngo Weinhold	get_build_tool_path CC gcc
325338b8dc3SIngo Weinhold	get_build_tool_path LD ld
326338b8dc3SIngo Weinhold	get_build_tool_path OBJCOPY objcopy
327338b8dc3SIngo Weinhold	get_build_tool_path RANLIB ranlib
328338b8dc3SIngo Weinholdfi
329338b8dc3SIngo Weinhold
330338b8dc3SIngo Weinhold# prepare gcc settings
331338b8dc3SIngo Weinholdstandard_gcc_settings
332338b8dc3SIngo Weinhold
333eedc3d0bSIngo Weinhold# check whether the Haiku compiler really targets Haiku or BeOS
334eedc3d0bSIngo Weinholdcase "$haikuGCCMachine" in
335eedc3d0bSIngo Weinhold	*-*-haiku)	;;
336eedc3d0bSIngo Weinhold	*-*-beos)	;;
337eedc3d0bSIngo Weinhold	*) echo The compiler specified as Haiku target compiler is not a valid \
338eedc3d0bSIngo Weinhold			Haiku cross-compiler. Please see ReadMe.cross-compile. >&2
339eedc3d0bSIngo Weinhold	   echo compiler: $HAIKU_CC
340eedc3d0bSIngo Weinhold	   echo compiler is configured for target: $haikuGCCMachine
341eedc3d0bSIngo Weinhold	   exit 1 ;;
342eedc3d0bSIngo Weinholdesac
343eedc3d0bSIngo Weinhold
34452a38012Sejakowatz# Generate BuildConfig
3456e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/BuildConfig"
34652a38012Sejakowatz# BuildConfig
34752a38012Sejakowatz# Note: This file has been automatically generated by configure.
34852a38012Sejakowatz
3496e7c6fe5SIngo WeinholdTARGET_PLATFORM 			?= "${target}" ;
3506e7c6fe5SIngo WeinholdHOST_PLATFORM				?= "${buildPlatform}" ;
351338b8dc3SIngo Weinhold
352eccc7665SIngo WeinholdBOCHS_DEBUG_HACK			?= "${bochs_debug}" ;
353eccc7665SIngo WeinholdINCLUDE_GPL_ADDONS			?= "${include_gpl_addons}" ;
354a66c32ddSIngo WeinholdHAIKU_DISTRO_COMPATIBILITY	?= "${distroCompatibility}" ;
355eccc7665SIngo WeinholdHAIKU_USE_GCC_PIPE			?= "${use_gcc_pipe}" ;
356*0385b065SIngo WeinholdHAIKU_HOST_USE_32BIT		?= "${use_32bit}" ;
3574f4e5272SIngo WeinholdHAIKU_HOST_USE_XATTR		?= "${use_xattr}" ;
358eccc7665SIngo Weinhold
359338b8dc3SIngo WeinholdHAIKU_GCC_RAW_VERSION		?= ${haikuGCCVersion} ;
360338b8dc3SIngo WeinholdHAIKU_GCC_MACHINE			?= ${haikuGCCMachine} ;
361338b8dc3SIngo WeinholdHAIKU_GCC_LIB_DIR			?= ${HAIKU_GCC_LIB_DIR} ;
362338b8dc3SIngo WeinholdHAIKU_GCC_HEADERS_DIR		?= ${HAIKU_GCC_HEADERS_DIR} ;
363338b8dc3SIngo WeinholdHAIKU_GCC_LIBGCC			?= ${HAIKU_GCC_LIBGCC} ;
364338b8dc3SIngo Weinhold
3658b5934c9SIngo WeinholdHAIKU_STATIC_LIBSTDC++		?= ${haikuStaticLibStdCxx} ;
3668b5934c9SIngo WeinholdHAIKU_SHARED_LIBSTDC++		?= ${haikuSharedLibStdCxx} ;
367c89fc875SIngo WeinholdHAIKU_STATIC_LIBSUPC++		?= ${haikuStaticLibSupCxx} ;
368c89fc875SIngo WeinholdHAIKU_SHARED_LIBSUPC++		?= ${haikuSharedLibSupCxx} ;
3698b5934c9SIngo WeinholdHAIKU_C++_HEADERS_DIR		?= ${haikuCxxHeadersDir} ;
3708b5934c9SIngo Weinhold
371338b8dc3SIngo WeinholdHAIKU_BUILD_ATTRIBUTES_DIR	?= ${buildAttributesDir} ;
372338b8dc3SIngo Weinhold
373338b8dc3SIngo WeinholdHAIKU_AR					?= ${HAIKU_AR} ;
374338b8dc3SIngo WeinholdHAIKU_CC					?= ${HAIKU_CC} ;
375338b8dc3SIngo WeinholdHAIKU_LD					?= ${HAIKU_LD} ;
376338b8dc3SIngo WeinholdHAIKU_OBJCOPY				?= ${HAIKU_OBJCOPY} ;
377338b8dc3SIngo WeinholdHAIKU_RANLIB				?= ${HAIKU_RANLIB} ;
378338b8dc3SIngo WeinholdHAIKU_CPPFLAGS				?= ${HAIKU_CPPFLAGS} ;
379338b8dc3SIngo WeinholdHAIKU_CCFLAGS				?= ${HAIKU_CCFLAGS} ;
380338b8dc3SIngo WeinholdHAIKU_CXXFLAGS				?= ${HAIKU_CXXFLAGS} ;
381338b8dc3SIngo WeinholdHAIKU_LDFLAGS				?= ${HAIKU_LDFLAGS} ;
382338b8dc3SIngo WeinholdHAIKU_ARFLAGS				?= ${HAIKU_ARFLAGS} ;
383338b8dc3SIngo WeinholdHAIKU_UNARFLAGS				?= ${HAIKU_UNARFLAGS} ;
384338b8dc3SIngo Weinhold
3858b5934c9SIngo WeinholdHOST_GCC_RAW_VERSION		?= ${hostGCCVersion} ;
3868b5934c9SIngo Weinhold
387c4786ea6SlilloEOF
388c4786ea6Slillo
389b1e5b60cSAxel Dörfler# Libgcc.a objects
390b1e5b60cSAxel Dörfler
3916e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/libgccObjects"
392b1e5b60cSAxel Dörfler# libgcc.a objects to be linked against libroot.so
393b1e5b60cSAxel Dörfler# Note: This file has been automatically generated by configure.
394b1e5b60cSAxel Dörfler
395338b8dc3SIngo WeinholdHAIKU_GCC_LIBGCC_OBJECTS	?= ${HAIKU_GCC_LIBGCC_OBJECTS} ;
396b1e5b60cSAxel DörflerEOF
397b1e5b60cSAxel Dörfler
3984c74bde8SJérôme Duval# Generate Timezones binaries bindings
3994c74bde8SJérôme Duval
400338b8dc3SIngo WeinholdtimezoneSources="africa antarctica asia australasia europe northamerica
401338b8dc3SIngo Weinhold	southamerica pacificnew etcetera factory backward"
402338b8dc3SIngo Weinhold
4036e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/Timezones"
404b1e5b60cSAxel Dörfler# Timezones used for the build
405b1e5b60cSAxel Dörfler# Note: This file has been automatically generated by configure.
406b1e5b60cSAxel Dörfler
407338b8dc3SIngo WeinholdHAIKU_TIME_ZONE_SOURCES = ${timezoneSources} ;
408338b8dc3SIngo Weinhold
409b1e5b60cSAxel DörflerEOF
410b1e5b60cSAxel Dörfler
411338b8dc3SIngo Weinholdfor source in ${timezoneSources}; do
412338b8dc3SIngo Weinhold	f=$sourceDir/src/data/etc/timezones/$source
4134c74bde8SJérôme Duval
4146e7c6fe5SIngo WeinholdTZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' "$f" `
4154c74bde8SJérôme Duval
4166e7c6fe5SIngo Weinholdcat << EOF >> "$buildOutputDir/Timezones"
417338b8dc3SIngo WeinholdTZ_OBJECTS on <timezone-source>${source} ?= $TZOBJECTS ;
4184c74bde8SJérôme DuvalEOF
4194c74bde8SJérôme Duvaldone
420338b8dc3SIngo Weinhold
421338b8dc3SIngo Weinhold# Generate a boot strap Jamfile in the output directory, if it is not in
422338b8dc3SIngo Weinhold# the source dir.
423338b8dc3SIngo Weinhold
424338b8dc3SIngo Weinholdif [ "$currentDir" != "$sourceDir" ]; then
425338b8dc3SIngo Weinhold
426338b8dc3SIngo Weinholdcat << EOF > $outputDir/Jamfile
427338b8dc3SIngo Weinhold# automatically generated Jamfile
428338b8dc3SIngo Weinhold
429338b8dc3SIngo WeinholdHAIKU_TOP			= ${sourceDir} ;
430338b8dc3SIngo WeinholdHAIKU_OUTPUT_DIR	= ${outputDir} ;
431338b8dc3SIngo Weinhold
432338b8dc3SIngo Weinholdinclude [ FDirName \$(HAIKU_TOP) Jamfile ] ;
433338b8dc3SIngo Weinhold
434338b8dc3SIngo WeinholdEOF
435338b8dc3SIngo Weinhold
436338b8dc3SIngo Weinholdfi
437338b8dc3SIngo Weinhold
438