xref: /haiku/configure (revision 274b450ab86118d59d862e0ef40c4c9a943469fb)
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:
15022fa244SIngo Weinhold  --floppy <floppy location>  Specifies the location of the floppy
16022fa244SIngo Weinhold                              (device or image).
176f9587ddSAxel Dörfler  --bochs-debug               Enables bochs serial debug emulation (activated 
186f9587ddSAxel Dörfler                              via kernel settings file).
19338b8dc3SIngo Weinhold  --cross-tools-prefix <prefix>
20338b8dc3SIngo Weinhold                              Assume cross compilation. <prefix> should be a
21338b8dc3SIngo Weinhold                              path to the directory where the cross
22338b8dc3SIngo Weinhold                              compilation tools are located, plus the platform
23338b8dc3SIngo Weinhold                              prefix, e.g. "/path/to/tools/i586-pc-beos-".
24338b8dc3SIngo Weinhold                              This overrides the HAIKU_* tool variables.
25338b8dc3SIngo Weinhold  --build-cross-tools <build tools dir>
26338b8dc3SIngo Weinhold                              Assume cross compilation. <build tools dir>
27338b8dc3SIngo Weinhold                              defines the location of the build tools sources.
28338b8dc3SIngo Weinhold                              They will be compiled and placed in the output
29338b8dc3SIngo Weinhold                              directory under "cross-tools". The HAIKU_* tools
30338b8dc3SIngo Weinhold                              variables will be set accordingly.
3120ab75e6SIngo Weinhold  --build-cross-tools-gcc4 <arch> <build tools dir>
3229ef597dSIngo Weinhold                              Like "--build-cross-tools" just that gcc 4 will
3329ef597dSIngo Weinhold                              be used for cross-compilation. Note, that the
3429ef597dSIngo Weinhold                              resulting Haiku installation built with gcc 4
3529ef597dSIngo Weinhold                              will not be binary compatible with BeOS R5.
3620ab75e6SIngo Weinhold                              <arch> specifies the target architecture, either
3720ab75e6SIngo Weinhold                              "x86" or "ppc".
38614026d7Sshatty  --target=TARGET             Select build target platform. [default=${target}]
39a17b9c0cSshatty                              valid targets=r5,bone,dano,haiku
40e91f3ca1Sbeveloper  --include-gpl-addons        Include GPL licensed add-ons.
41022fa244SIngo Weinhold  --help                      Prints out this help.
42338b8dc3SIngo Weinhold
43338b8dc3SIngo Weinholdenvironment variables:
44338b8dc3SIngo Weinhold  HAIKU_AR                    The static library archiver. Defaults to "ar".
45338b8dc3SIngo Weinhold  HAIKU_CC                    The compiler. Defaults to "gcc".
46338b8dc3SIngo Weinhold  HAIKU_LD                    The linker. Defaults to "ld".
47338b8dc3SIngo Weinhold  HAIKU_OBJCOPY               The objcopy to be used. Defaults to "objcopy".
48338b8dc3SIngo Weinhold  HAIKU_RANLIB                The static library indexer. Defaults to "ranlib".
49338b8dc3SIngo Weinhold  HAIKU_CPPFLAGS              The preprocessor flags. Defaults to "".
50338b8dc3SIngo Weinhold  HAIKU_CCFLAGS               The C flags. Defaults to "".
51338b8dc3SIngo Weinhold  HAIKU_CXXFLAGS              The C++ flags. Defaults to "".
52338b8dc3SIngo Weinhold  HAIKU_LDFLAGS               The linker flags. Defaults to "".
53338b8dc3SIngo Weinhold  HAIKU_ARFLAGS               The flags passed to HAIKU_AR for archiving.
54338b8dc3SIngo Weinhold                              Defaults to "ru".
55338b8dc3SIngo Weinhold  HAIKU_UNARFLAGS             The flags passed to HAIKU_AR for unarchiving.
56338b8dc3SIngo Weinhold                              Defaults to "x".
57022fa244SIngo WeinholdEOF
58022fa244SIngo Weinhold}
59022fa244SIngo Weinhold
60022fa244SIngo Weinhold# assertparam
61022fa244SIngo Weinhold#
62022fa244SIngo Weinhold# Checks whether at least one parameter is left.
63022fa244SIngo Weinhold#
64022fa244SIngo Weinholdassertparam()
65022fa244SIngo Weinhold{
6620ab75e6SIngo Weinhold	if [ $2 -lt 2 ]; then
67022fa244SIngo Weinhold		echo $0: \`$1\': Parameter expected.
68022fa244SIngo Weinhold		exit 1
69022fa244SIngo Weinhold	fi
70022fa244SIngo Weinhold}
71022fa244SIngo Weinhold
7220ab75e6SIngo Weinhold# assertparams
7320ab75e6SIngo Weinhold#
7420ab75e6SIngo Weinhold# Checks whether at least a certain number of parameters is left.
7520ab75e6SIngo Weinhold#
7620ab75e6SIngo Weinholdassertparams()
7720ab75e6SIngo Weinhold{
7820ab75e6SIngo Weinhold	if [ $3 -le $2 ]; then
7920ab75e6SIngo Weinhold		echo $0: \`$1\': Not enough parameters.
8020ab75e6SIngo Weinhold		exit 1
8120ab75e6SIngo Weinhold	fi
8220ab75e6SIngo Weinhold}
8320ab75e6SIngo Weinhold
8409c5682dSIngo Weinhold# standard_gcc_settings
8509c5682dSIngo Weinhold#
8609c5682dSIngo Weinhold# Sets the variables for a GCC platform.
8709c5682dSIngo Weinhold#
8809c5682dSIngo Weinholdstandard_gcc_settings()
8909c5682dSIngo Weinhold{
9009c5682dSIngo Weinhold	# PLATFORM_LINKLIBS
91338b8dc3SIngo Weinhold	gcclib=`$HAIKU_CC -print-libgcc-file-name`
9209c5682dSIngo Weinhold	gccdir=`dirname ${gcclib}`
935b0f7b1bSOliver Tappe
94338b8dc3SIngo Weinhold	haikuGCCVersion=`$HAIKU_CC -dumpversion`
95338b8dc3SIngo Weinhold	haikuGCCMachine=`$HAIKU_CC -dumpmachine`
96338b8dc3SIngo Weinhold
97338b8dc3SIngo Weinhold	HAIKU_GCC_LIB_DIR=${gccdir}
98338b8dc3SIngo Weinhold	HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
99338b8dc3SIngo Weinhold	HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
100338b8dc3SIngo Weinhold	HAIKU_GCC_HEADERS_DIR=${gccdir}/include
1015d978968SIngo Weinhold	HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o`
1025d978968SIngo Weinhold		# Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and
1035d978968SIngo Weinhold		# neither needed nor wanted.
1048b5934c9SIngo Weinhold
1058b5934c9SIngo Weinhold	case $haikuGCCVersion in
1068b5934c9SIngo Weinhold		4.*)
1075b0f7b1bSOliver Tappe			# for gcc 4 we use the libstdc++ and libsupc++ that come with the
1085b0f7b1bSOliver Tappe			# compiler
1098b5934c9SIngo Weinhold			haikuStaticLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.a`
1108b5934c9SIngo Weinhold			haikuSharedLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.so`
111c89fc875SIngo Weinhold			haikuStaticLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.a`
112c89fc875SIngo Weinhold			haikuSharedLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.so`
1138b5934c9SIngo Weinhold			local headers=$gccdir/../../../../include/c++/$haikuGCCVersion
1148b5934c9SIngo Weinhold			haikuCxxHeadersDir=$headers
11529ef597dSIngo Weinhold			for d in $haikuGCCMachine backward ext; do
11629ef597dSIngo Weinhold				# Note: We need the line break, otherwise the line might become
11729ef597dSIngo Weinhold				# too long for jam (512 bytes max).
11829ef597dSIngo Weinhold				haikuCxxHeadersDir="$haikuCxxHeadersDir
11929ef597dSIngo Weinhold					$headers/$d"
1208b5934c9SIngo Weinhold			done
121*274b450aSMarcus Overhagen
122*274b450aSMarcus Overhagen			if [ "$buildCrossTools" = "" ]; then
123*274b450aSMarcus Overhagen				# when not building the crosscompiler, we use cpp headers from
124*274b450aSMarcus Overhagen				# tree first, but fallback to local C++ system headers (like <new>)
125*274b450aSMarcus Overhagen				haikuCxxHeadersDir="headers/cpp $haikuCxxHeadersDir"
126e3c3c198SMarcus Overhagen			fi
1278b5934c9SIngo Weinhold
1288b5934c9SIngo Weinhold			if [ $haikuStaticLibStdCxx = libstdc++.a ]; then
1298b5934c9SIngo Weinhold				haikuStaticLibStdCxx=
1308b5934c9SIngo Weinhold			fi
1318b5934c9SIngo Weinhold			if [ $haikuSharedLibStdCxx = libstdc++.so ]; then
1328b5934c9SIngo Weinhold				haikuSharedLibStdCxx=
1338b5934c9SIngo Weinhold			fi
134c89fc875SIngo Weinhold			if [ $haikuStaticLibSupCxx = libsupc++.a ]; then
135c89fc875SIngo Weinhold				haikuStaticLibSupCxx=
136c89fc875SIngo Weinhold			fi
137c89fc875SIngo Weinhold			if [ $haikuSharedLibSupCxx = libsupc++.so ]; then
138c89fc875SIngo Weinhold				haikuSharedLibSupCxx=
139c89fc875SIngo Weinhold			fi
1408b5934c9SIngo Weinhold		;;
1415b0f7b1bSOliver Tappe		2.95*)
1425b0f7b1bSOliver Tappe			# check for correct (most up-to-date) legacy compiler and complain
1435b0f7b1bSOliver Tappe			# if an older one is installed
1445b0f7b1bSOliver Tappe			if [ $haikuGCCVersion != $haikuRequiredLegacyGCCVersion ]; then
1455b0f7b1bSOliver Tappe				echo "GCC version $haikuRequiredLegacyGCCVersion is required!";
1465b0f7b1bSOliver Tappe				echo "Please download it from www.haiku-os.org...";
1475b0f7b1bSOliver Tappe				exit 1;
1485b0f7b1bSOliver Tappe			fi
1495b0f7b1bSOliver Tappe		;;
1508b5934c9SIngo Weinhold	esac
15109c5682dSIngo Weinhold}
15209c5682dSIngo Weinhold
153338b8dc3SIngo Weinhold# set_default_value
154338b8dc3SIngo Weinhold#
155338b8dc3SIngo Weinhold# Set the value for a variable, if no value is set yet.
156338b8dc3SIngo Weinhold#
157338b8dc3SIngo Weinholdset_default_value()
158338b8dc3SIngo Weinhold{
1590838a930SJérôme Duval	eval "$1=\${$1-$2}"
160338b8dc3SIngo Weinhold}
161338b8dc3SIngo Weinhold
162338b8dc3SIngo Weinhold# get_build_tool_path
163338b8dc3SIngo Weinhold#
164338b8dc3SIngo Weinhold# Gets a usable absolute path of a build tool.
165338b8dc3SIngo Weinhold#
166338b8dc3SIngo Weinholdget_build_tool_path()
167338b8dc3SIngo Weinhold{
168338b8dc3SIngo Weinhold	local var="HAIKU_$1"
169338b8dc3SIngo Weinhold	local tool=$2
170338b8dc3SIngo Weinhold	local path="${crossToolsPrefix}$tool"
171338b8dc3SIngo Weinhold
172338b8dc3SIngo Weinhold	if [ -f "$path" ]; then
173338b8dc3SIngo Weinhold		# get absolute path
174338b8dc3SIngo Weinhold		local oldPwd=$(pwd)
175338b8dc3SIngo Weinhold		cd $(dirname "$path")
176338b8dc3SIngo Weinhold		path="$(pwd)/$(basename "$path")"
177338b8dc3SIngo Weinhold		cd $oldPwd
178338b8dc3SIngo Weinhold	else
179338b8dc3SIngo Weinhold		which "$path" &> /dev/null || {
180338b8dc3SIngo Weinhold			echo "Build tool \"$path\" not found." >&2
181338b8dc3SIngo Weinhold			exit 1
182338b8dc3SIngo Weinhold		}
183338b8dc3SIngo Weinhold	fi
184338b8dc3SIngo Weinhold
185338b8dc3SIngo Weinhold	eval "$var=$path"
186338b8dc3SIngo Weinhold}
187338b8dc3SIngo Weinhold
188338b8dc3SIngo Weinhold# get cwd and the source directory
189338b8dc3SIngo WeinholdcurrentDir=`pwd`
1906e7c6fe5SIngo Weinholdcd `dirname "$0"`
191338b8dc3SIngo WeinholdsourceDir=`pwd`
1926e7c6fe5SIngo Weinholdcd "$currentDir"
193338b8dc3SIngo Weinhold
194022fa244SIngo Weinhold# default parameter values
195022fa244SIngo Weinhold#
19652a38012Sejakowatzplatform=`uname`
197338b8dc3SIngo WeinholdhaikuGCCVersion=
1989743fe87SIngo WeinholdhaikuGCCMachine=i586-pc-beos
1998b5934c9SIngo WeinholdhaikuStaticLibStdCxx=
2008b5934c9SIngo WeinholdhaikuSharedLibStdCxx=
201c89fc875SIngo WeinholdhaikuStaticLibSupCxx=
202c89fc875SIngo WeinholdhaikuSharedLibSupCxx=
2038b5934c9SIngo WeinholdhaikuCxxHeadersDir=
204db63fe67SAxel DörflerhostGCCVersion=`gcc -dumpversion`
205022fa244SIngo Weinholdfloppy=
2062b94bc7bSlillobochs_debug=0
207e91f3ca1Sbeveloperinclude_gpl_addons=0
20862339647SAxel Dörflertarget=haiku
209338b8dc3SIngo WeinholdcrossToolsPrefix=
210338b8dc3SIngo WeinholdbuildCrossTools=
21129ef597dSIngo WeinholdbuildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
21220ab75e6SIngo WeinholdbuildCrossToolsMachine=
213338b8dc3SIngo Weinhold
214af4bf973SOliver Tappeexport haikuRequiredLegacyGCCVersion="2.95.3-beos-060710"
215af4bf973SOliver Tappe	# version of legacy gcc required to build haiku
216af4bf973SOliver Tappe
217338b8dc3SIngo Weinholdset_default_value HAIKU_AR			ar
218338b8dc3SIngo Weinholdset_default_value HAIKU_CC			gcc
219338b8dc3SIngo Weinholdset_default_value HAIKU_LD			ld
220338b8dc3SIngo Weinholdset_default_value HAIKU_OBJCOPY		objcopy
221338b8dc3SIngo Weinholdset_default_value HAIKU_RANLIB		ranlib
222338b8dc3SIngo Weinholdset_default_value HAIKU_CPPFLAGS	""
223338b8dc3SIngo Weinholdset_default_value HAIKU_CCFLAGS		""
224338b8dc3SIngo Weinholdset_default_value HAIKU_CXXFLAGS	""
225338b8dc3SIngo Weinholdset_default_value HAIKU_LDFLAGS		""
226338b8dc3SIngo Weinholdset_default_value HAIKU_ARFLAGS		ru
227338b8dc3SIngo Weinholdset_default_value HAIKU_UNARFLAGS	x
22862339647SAxel Dörfler
229022fa244SIngo Weinhold# parse parameters
230022fa244SIngo Weinhold#
23120ab75e6SIngo Weinholdwhile [ $# -gt 0 ] ; do
232022fa244SIngo Weinhold	case "$1" in
233e91f3ca1Sbeveloper		--include-gpl-addons)	include_gpl_addons=1; shift 1;;
234022fa244SIngo Weinhold		--floppy)		assertparam "$1" $#; floppy=$2; shift 2;;
2352b94bc7bSlillo		--bochs-debug)	bochs_debug=1; shift 1;;
2367c8bb86fSIngo Weinhold		--target=*)     target=`echo $1 | cut -d'=' -f2-`; shift 1;;
237338b8dc3SIngo Weinhold		--cross-tools-prefix) assertparam "$1" $#; crossToolsPrefix=$2; shift 2;;
238338b8dc3SIngo Weinhold		--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
23920ab75e6SIngo Weinhold		--build-cross-tools-gcc4) assertparams "$1" 2 $#; buildCrossTools=$3;
24029ef597dSIngo Weinhold						buildCrossToolsScript="${buildCrossToolsScript}_gcc4";
24120ab75e6SIngo Weinhold						case "$2" in
24220ab75e6SIngo Weinhold							x86)	haikuGCCMachine=i586-pc-haiku;;
24320ab75e6SIngo Weinhold							ppc)	haikuGCCMachine=powerpc-apple-haiku;;
24420ab75e6SIngo Weinhold							*)		echo "Unsupported target architecture: $2"
24520ab75e6SIngo Weinhold									exit 1;;
24620ab75e6SIngo Weinhold						esac
24720ab75e6SIngo Weinhold						buildCrossToolsMachine=$haikuGCCMachine
24820ab75e6SIngo Weinhold						shift 3;;
249022fa244SIngo Weinhold		--help | -h)	usage; exit 0;;
250022fa244SIngo Weinhold		*)				echo Invalid argument: \`$1\'; exit 1;;
251022fa244SIngo Weinhold	esac
252022fa244SIngo Weinholddone
253022fa244SIngo Weinhold
254022fa244SIngo Weinhold# check parameters
255022fa244SIngo Weinhold#
256022fa244SIngo Weinholdif [ -n "$floppy" ]; then
257022fa244SIngo Weinhold	case "$floppy" in
258022fa244SIngo Weinhold		/*)	;;
259022fa244SIngo Weinhold		*)	echo "Warning: non-absolute floppy path. Parameter ignored.";
260022fa244SIngo Weinhold			floppy=;;
261022fa244SIngo Weinhold	esac
262022fa244SIngo Weinholdfi
26352a38012Sejakowatz
2640df3cc9cSIngo Weinhold# detect the build platform
265338b8dc3SIngo Weinholdcase "${platform}" in
2660df3cc9cSIngo Weinhold	BeOS)	revision=`uname -r`
2670df3cc9cSIngo Weinhold			case "$revision" in
26814998c8bSIngo Weinhold				6.*)	buildPlatform=dano ;;
2690df3cc9cSIngo Weinhold				5.1)	buildPlatform=dano ;;
2700df3cc9cSIngo Weinhold				5.0.4)	buildPlatform=bone ;;
2710df3cc9cSIngo Weinhold				5.0*)	buildPlatform=r5 ;;
2721213a0dbSStephan Aßmus				6.*)	buildPlatform=dano ;;
2730df3cc9cSIngo Weinhold				*)		echo Unknown BeOS version: $revision
2740df3cc9cSIngo Weinhold						exit 1 ;;
2750df3cc9cSIngo Weinhold			esac
2760df3cc9cSIngo Weinhold			;;
277338b8dc3SIngo Weinhold	Linux)	buildPlatform=linux ;;
278307807f2SNathan Whitehorn	FreeBSD) buildPlatform=freebsd ;;
279338b8dc3SIngo Weinhold	*)		echo Unsupported platform: ${platform}
2804cbe4925SAxel Dörfler			exit 1 ;;
2814cbe4925SAxel Dörfleresac
28252a38012Sejakowatz
283338b8dc3SIngo Weinhold# create output directory
284338b8dc3SIngo Weinholdif [ "$currentDir" = "$sourceDir" ]; then
285338b8dc3SIngo Weinhold	outputDir=$currentDir/generated
286338b8dc3SIngo Weinholdelse
287338b8dc3SIngo Weinhold	outputDir=$currentDir
288338b8dc3SIngo Weinholdfi
2896e7c6fe5SIngo WeinholdbuildOutputDir="$outputDir/build"
2906e7c6fe5SIngo WeinholdbuildAttributesDir="$outputDir/attributes"
2916e7c6fe5SIngo Weinholdmkdir -p "$buildOutputDir" || exit 1
292338b8dc3SIngo Weinhold
293338b8dc3SIngo Weinhold# build cross tools from sources
294338b8dc3SIngo Weinholdif [ -n "$buildCrossTools" ]; then
29520ab75e6SIngo Weinhold	"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
2966e7c6fe5SIngo Weinhold		"$buildCrossTools" "$outputDir" || exit 1
2976e7c6fe5SIngo Weinhold	crossToolsPrefix="$outputDir/cross-tools/bin/${haikuGCCMachine}-"
298338b8dc3SIngo Weinholdfi
299338b8dc3SIngo Weinhold
300338b8dc3SIngo Weinhold# cross tools
301338b8dc3SIngo Weinholdif [ -n "$crossToolsPrefix" ]; then
302338b8dc3SIngo Weinhold	get_build_tool_path AR ar
303338b8dc3SIngo Weinhold	get_build_tool_path CC gcc
304338b8dc3SIngo Weinhold	get_build_tool_path LD ld
305338b8dc3SIngo Weinhold	get_build_tool_path OBJCOPY objcopy
306338b8dc3SIngo Weinhold	get_build_tool_path RANLIB ranlib
307338b8dc3SIngo Weinholdfi
308338b8dc3SIngo Weinhold
309338b8dc3SIngo Weinhold# prepare gcc settings
310338b8dc3SIngo Weinholdstandard_gcc_settings
311338b8dc3SIngo Weinhold
31252a38012Sejakowatz# Generate BuildConfig
3136e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/BuildConfig"
31452a38012Sejakowatz# BuildConfig
31552a38012Sejakowatz# Note: This file has been automatically generated by configure.
31652a38012Sejakowatz
31709c5682dSIngo WeinholdFLOPPY_PATH			?= "${floppy}" ;
3186e7c6fe5SIngo WeinholdBOCHS_DEBUG_HACK	?= "${bochs_debug}" ;
3196e7c6fe5SIngo WeinholdINCLUDE_GPL_ADDONS	?= "${include_gpl_addons}" ;
3206e7c6fe5SIngo WeinholdTARGET_PLATFORM 	?= "${target}" ;
3216e7c6fe5SIngo WeinholdHOST_PLATFORM		?= "${buildPlatform}" ;
322338b8dc3SIngo Weinhold
323338b8dc3SIngo WeinholdHAIKU_GCC_RAW_VERSION	?= ${haikuGCCVersion} ;
324338b8dc3SIngo WeinholdHAIKU_GCC_MACHINE		?= ${haikuGCCMachine} ;
325338b8dc3SIngo WeinholdHAIKU_GCC_LIB_DIR		?= ${HAIKU_GCC_LIB_DIR} ;
326338b8dc3SIngo WeinholdHAIKU_GCC_HEADERS_DIR	?= ${HAIKU_GCC_HEADERS_DIR} ;
327338b8dc3SIngo WeinholdHAIKU_GCC_LIBGCC		?= ${HAIKU_GCC_LIBGCC} ;
328338b8dc3SIngo Weinhold
3298b5934c9SIngo WeinholdHAIKU_STATIC_LIBSTDC++	?= ${haikuStaticLibStdCxx} ;
3308b5934c9SIngo WeinholdHAIKU_SHARED_LIBSTDC++	?= ${haikuSharedLibStdCxx} ;
331c89fc875SIngo WeinholdHAIKU_STATIC_LIBSUPC++	?= ${haikuStaticLibSupCxx} ;
332c89fc875SIngo WeinholdHAIKU_SHARED_LIBSUPC++	?= ${haikuSharedLibSupCxx} ;
3338b5934c9SIngo WeinholdHAIKU_C++_HEADERS_DIR	?= ${haikuCxxHeadersDir} ;
3348b5934c9SIngo Weinhold
335338b8dc3SIngo WeinholdHAIKU_BUILD_ATTRIBUTES_DIR	?= ${buildAttributesDir} ;
336338b8dc3SIngo Weinhold
337338b8dc3SIngo WeinholdHAIKU_AR			?= ${HAIKU_AR} ;
338338b8dc3SIngo WeinholdHAIKU_CC			?= ${HAIKU_CC} ;
339338b8dc3SIngo WeinholdHAIKU_LD			?= ${HAIKU_LD} ;
340338b8dc3SIngo WeinholdHAIKU_OBJCOPY		?= ${HAIKU_OBJCOPY} ;
341338b8dc3SIngo WeinholdHAIKU_RANLIB		?= ${HAIKU_RANLIB} ;
342338b8dc3SIngo WeinholdHAIKU_CPPFLAGS		?= ${HAIKU_CPPFLAGS} ;
343338b8dc3SIngo WeinholdHAIKU_CCFLAGS		?= ${HAIKU_CCFLAGS} ;
344338b8dc3SIngo WeinholdHAIKU_CXXFLAGS		?= ${HAIKU_CXXFLAGS} ;
345338b8dc3SIngo WeinholdHAIKU_LDFLAGS		?= ${HAIKU_LDFLAGS} ;
346338b8dc3SIngo WeinholdHAIKU_ARFLAGS		?= ${HAIKU_ARFLAGS} ;
347338b8dc3SIngo WeinholdHAIKU_UNARFLAGS		?= ${HAIKU_UNARFLAGS} ;
348338b8dc3SIngo Weinhold
3498b5934c9SIngo WeinholdHOST_GCC_RAW_VERSION	?= ${hostGCCVersion} ;
3508b5934c9SIngo Weinhold
351c4786ea6SlilloEOF
352c4786ea6Slillo
353b1e5b60cSAxel Dörfler# Libgcc.a objects
354b1e5b60cSAxel Dörfler
3556e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/libgccObjects"
356b1e5b60cSAxel Dörfler# libgcc.a objects to be linked against libroot.so
357b1e5b60cSAxel Dörfler# Note: This file has been automatically generated by configure.
358b1e5b60cSAxel Dörfler
359338b8dc3SIngo WeinholdHAIKU_GCC_LIBGCC_OBJECTS	?= ${HAIKU_GCC_LIBGCC_OBJECTS} ;
360b1e5b60cSAxel DörflerEOF
361b1e5b60cSAxel Dörfler
3624c74bde8SJérôme Duval# Generate Timezones binaries bindings
3634c74bde8SJérôme Duval
364338b8dc3SIngo WeinholdtimezoneSources="africa antarctica asia australasia europe northamerica
365338b8dc3SIngo Weinhold	southamerica pacificnew etcetera factory backward"
366338b8dc3SIngo Weinhold
3676e7c6fe5SIngo Weinholdcat << EOF > "$buildOutputDir/Timezones"
368b1e5b60cSAxel Dörfler# Timezones used for the build
369b1e5b60cSAxel Dörfler# Note: This file has been automatically generated by configure.
370b1e5b60cSAxel Dörfler
371338b8dc3SIngo WeinholdHAIKU_TIME_ZONE_SOURCES = ${timezoneSources} ;
372338b8dc3SIngo Weinhold
373b1e5b60cSAxel DörflerEOF
374b1e5b60cSAxel Dörfler
375338b8dc3SIngo Weinholdfor source in ${timezoneSources}; do
376338b8dc3SIngo Weinhold	f=$sourceDir/src/data/etc/timezones/$source
3774c74bde8SJérôme Duval
3786e7c6fe5SIngo WeinholdTZOBJECTS=`gawk '/^Zone/ { print $2 } /^Link/ { print $3 } ' "$f" `
3794c74bde8SJérôme Duval
3806e7c6fe5SIngo Weinholdcat << EOF >> "$buildOutputDir/Timezones"
381338b8dc3SIngo WeinholdTZ_OBJECTS on <timezone-source>${source} ?= $TZOBJECTS ;
3824c74bde8SJérôme DuvalEOF
3834c74bde8SJérôme Duvaldone
384338b8dc3SIngo Weinhold
385338b8dc3SIngo Weinhold# Generate a boot strap Jamfile in the output directory, if it is not in
386338b8dc3SIngo Weinhold# the source dir.
387338b8dc3SIngo Weinhold
388338b8dc3SIngo Weinholdif [ "$currentDir" != "$sourceDir" ]; then
389338b8dc3SIngo Weinhold
390338b8dc3SIngo Weinholdcat << EOF > $outputDir/Jamfile
391338b8dc3SIngo Weinhold# automatically generated Jamfile
392338b8dc3SIngo Weinhold
393338b8dc3SIngo WeinholdHAIKU_TOP			= ${sourceDir} ;
394338b8dc3SIngo WeinholdHAIKU_OUTPUT_DIR	= ${outputDir} ;
395338b8dc3SIngo Weinhold
396338b8dc3SIngo Weinholdinclude [ FDirName \$(HAIKU_TOP) Jamfile ] ;
397338b8dc3SIngo Weinhold
398338b8dc3SIngo WeinholdEOF
399338b8dc3SIngo Weinhold
400338b8dc3SIngo Weinholdfi
401338b8dc3SIngo Weinhold
402