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  --help                      Prints out this help.
16  --update                    Re-runs last configure invocation [must be given
17                              as first option!]
18  --bootstrap <haikuporter> <HaikuPorts cross repo> <HaikuPorts repo>
19                              Prepare for a bootstrap build. No pre-built
20                              packages will be used, instead they will be built
21                              from the sources (in several phases).
22                              <haikuporter> is the path to the haikuporter tool
23                              suitable for the host platform.
24                              <HaikuPorts cross repo> is the path to a checked
25                              out HaikuPorts cross-compilation repository.
26                              <HaikuPorts repo> is the path to a checked out
27                              HaikuPorts repository.
28  --build-cross-tools <arch>
29                              Assume cross compilation.
30                              Toolchain will be compiled and placed in the
31                              output directory under "cross-tools". The
32                              HAIKU_* tools variables will be set accordingly.
33                              <arch> specifies the target architecture, either
34                              "x86_gcc2", "x86", "x86_64", "ppc", "m68k",
35                              "arm", "arm64", "riscv64", "sparc"
36                              This option and --cross-tools-prefix can be
37                              specified multiple times. The first cross tools
38                              specify the primary tools, the subsequent ones the
39                              secondary tools (for "hybrid" images).
40  --cross-tools-prefix <prefix>
41                              Assume cross compilation. <prefix> should be a
42                              path to the directory where the cross
43                              compilation tools are located, plus the platform
44                              prefix, e.g. "/path/to/tools/i586-pc-haiku-".
45                              This overrides the HAIKU_* tool variables.
46  --cross-tools-source <buildtools dir>
47                              Toolchain sources for cross compilation.
48                              <buildtools dir> defines the location of the
49                              buildtools sources.
50  --distro-compatibility <level>
51                              The distribution's level of compatibility with
52                              the official Haiku distribution. The generated
53                              files will contain the respective trademarks
54                              accordingly.
55                              official -- the official Haiku distribution.
56                              compatible -- a Haiku Compatible (tm) distro.
57                              default -- any other distro (default value).
58  --host-only                 Configure for building tools for the build host
59                              only. Haiku cannot be built when configured like
60                              this.
61  --include-sources           Includes the source code of projects that require
62                              either an offer of source code or a copy of the
63                              patched sources. This is preferable when
64                              distributing on physical mediums.
65  --include-3rdparty          Include 3rdparty/ in the build system.
66  -j<n>                       Only relevant for --build-cross-tools. Is passed
67                              on to the make building the build tools.
68  --no-downloads              Do not download anything. Useful when trying to
69                              bootstrap and build Haiku from source only.
70  --sysroot                   The location of the cross-compiler sysroot,
71                              primarily for CI environments or cross-compilers
72                              used outside of the Haiku build system.
73  --target-arch <arch>        Haiku only: Specify the target architecture to
74                              build for. Must be one of the architectures of the
75                              host system. The installed build tools for that
76                              architecture will be used.
77                              This option can be specified multiple times. The
78                              first occurrence specifies the primary
79                              architecture of the Haiku to build, subsequent
80                              ones the secondary architectures.
81  --use-clang <arch>          Build with host Clang instead of GCC cross
82                              compiler, targeting <arch>
83  --use-gcc-pipe              Build with GCC option -pipe. Speeds up the build
84                              process, but uses more memory.
85  --use-gcc-graphite          Build with GCC Graphite engine for loop
86                              optimizations. (Only for GCC 4+.)
87  --use-32bit                 Use -m32 flag on 64bit host gcc compiler.
88  --no-full-xattr             Do not use Linux/*BSD/Darwin's native extended file
89                              attributes as Haiku attributes. If they are still
90                              available, they will be used to store hashes for
91                              the attribute emulation layer.
92  --no-xattr                  Do not use Linux/*BSD/Darwin's native extended file
93                              attributes for Haiku extended attributes at all,
94                              even if they are available.
95  --with-gdb <gdb sources dir>
96                              specify the path to a GDB source dir, to build
97                              GDB for each arch we build the cross-tools for.
98  --use-stack-protector       Build with stack protection enabled
99  --efi-signing-key           Private keyfile to sign any EFI bootloaders
100
101environment variables:
102  CC                          The host compiler. Defaults to "gcc".
103  HAIKU_AR_<arch>             The static library archiver for <arch>.
104                              Defaults to "ar".
105  HAIKU_CC_<arch>             The compiler for <arch>. Defaults to "gcc".
106  HAIKU_LD_<arch>             The <arch> linker. Defaults to "ld".
107  HAIKU_OBJCOPY_<arch>        The <arch> objcopy to be used. Defaults to
108                              "objcopy".
109  HAIKU_RANLIB_<arch>         The static library indexer for <arch>. Defaults
110                              to "ranlib".
111  HAIKU_STRIP_<arch>          The <arch> strip command. Defaults to "strip".
112  HAIKU_NASM                  The nasm assembler (x86 and x86_64 only).
113  HAIKU_CPPFLAGS_<arch>       The preprocessor flags for target architecture
114                              <arch>. Defaults to "".
115  HAIKU_CCFLAGS_<arch>        The C flags for target architecture <arch>.
116                              Defaults to "".
117  HAIKU_CXXFLAGS_<arch>       The C++ flags for target architecture <arch>.
118                              Defaults to "".
119  HAIKU_LINKFLAGS_<arch>      The flags passed to the compiler when linking for
120                              target architecture <arch>. Defaults to "".
121  HAIKU_LDFLAGS_<arch>        The linker flags for target architecture <arch>.
122                              Defaults to "".
123  HAIKU_ARFLAGS_<arch>        The flags passed to HAIKU_AR for target
124                              architecture <arch> for archiving. Defaults to
125                              "cru".
126  HAIKU_UNARFLAGS_<arch>      The flags passed to HAIKU_AR for target
127                              architecture <arch> for unarchiving. Defaults to
128                              "x".
129
130Non-default output directories:
131  By default all objects, build configuration, and other related files are
132  stored in /path/to/haiku_source/generated.  To store objects in a non-default
133  location, run "../../relative/path/to/haiku_source/configure <options>" from
134  within your non-default location.  "jam [ options ] targets" can then be run
135  directly inside your non-default location.  Another option is to invoke "jam
136  [ options ] targets" from within haiku_source.  This can be accomplished by
137  either "export HAIKU_OUTPUT_DIR=your non-default location" before invoking
138  jam or by creating a symlink of haiku_source/generated pointing to your
139  non-default location and running jam.
140
141
142EOF
143}
144
145# assertparam
146#
147# Checks whether at least one parameter is left.
148#
149assertparam()
150{
151	if [ $2 -lt 2 ]; then
152		echo $0: \`$1\': Parameter expected.
153		exit 1
154	fi
155}
156
157# assertparams
158#
159# Checks whether at least a certain number of parameters is left.
160#
161assertparams()
162{
163	if [ $3 -le $2 ]; then
164		echo $0: \`$1\': Not enough parameters.
165		exit 1
166	fi
167}
168
169# absolute_path
170#
171# returns the absolute path of a given path.
172#
173absolute_path()
174{
175	if [ "x$1" != "x${1#/}" ]; then
176		echo "$1"
177	else
178		echo "`pwd`/$1"
179	fi
180}
181
182# check_dir_exists
183#
184# check if a directory exists or not
185#
186check_dir_exists()
187{
188	if [ -d "$1" ]; then
189		return 0
190	else
191		return 1
192	fi
193}
194
195# check_file_exists
196#
197# check if a file exists or not
198#
199check_file_exists()
200{
201	if [ -f "$1" ]; then
202		return 0
203	else
204		return 1
205	fi
206}
207
208# real_path
209#
210# returns the realpath of a symbolic link.
211#
212real_path()
213{
214	perl -MCwd=realpath -e'print realpath($ARGV[0]), "\n"' "$1"
215}
216
217# relative_to
218#
219# returns $1 relative to $2
220#
221relative_to()
222{
223	perl -e 'use File::Spec; print File::Spec->abs2rel(@ARGV) . "\n"' \
224		"$1" "$2"
225}
226
227# valid_toolchain
228#
229# check if a toolchain is valid
230#
231valid_toolchain()
232{
233	TRIPLET="$1"
234	BASE="$2"
235	SOURCE="$3"
236	if [ ! -d "$BASE" ]; then
237		return 1
238	fi
239	if [ -f "$BASE/bin/$TRIPLET-gcc" ]; then
240		[ "$BASE/bin/$TRIPLET-gcc" -nt "$SOURCE/legacy/gcc/configure" ] && \
241			[ "$BASE/bin/$TRIPLET-gcc" -nt "$SOURCE/gcc/gcc/configure" ]
242		return $?
243	fi
244	return 1
245}
246
247# is_legacy_gcc
248#
249# Determines if the specified GCC version is a "legacy" (i.e. GCC < 4) one.
250#
251is_legacy_gcc()
252{
253	if [ `echo $1 | cut -d'.' -f1` -lt 4 ]; then
254		echo 1
255	else
256		echo 0
257	fi
258}
259
260# standard_gcc_settings
261#
262# Sets the variables for a GCC platform.
263#
264standard_gcc_settings()
265{
266	local gcc="$1"
267
268	if which greadlink > /dev/null 2>&1; then
269		readlink="greadlink -e"
270	elif which realpath > /dev/null 2>&1; then
271		readlink=realpath
272	elif readlink -e / > /dev/null 2>&1; then
273		readlink="readlink -e"
274	else
275		readlink=real_path
276	fi
277
278	# PLATFORM_LINKLIBS
279	local gcclib=`$gcc -print-libgcc-file-name`
280	local gccdir=`dirname ${gcclib}`
281
282	local gccRawVersion=`$gcc -dumpversion`
283	local gccMachine=`$gcc -dumpmachine`
284
285	# determine architecture from machine triple
286	case $gccMachine in
287		arm-*)		targetCpu=arm;;
288		aarch64-*)	targetCpu=arm64;;
289		i?86-*)		targetCpu=x86;;
290		m68k-*)		targetCpu=m68k;;
291		powerpc-*)	targetCpu=ppc;;
292		riscv64-*)	targetCpu=riscv64;;
293		sparc64-*)	targetCpu=sparc;;
294		x86_64-*)	targetCpu=x86_64;;
295		*)
296			echo "Unsupported gcc target machine: $gccMachine" >&2
297			exit 1
298			;;
299	esac
300
301	local targetArch=$targetCpu
302
303	case $gccRawVersion in
304		2.9*)
305			# check for correct (most up-to-date) legacy compiler and complain
306			# if an older one is installed
307			if [ $gccRawVersion != $haikuRequiredLegacyGCCVersion ]; then
308				echo "GCC version $haikuRequiredLegacyGCCVersion is required!";
309				echo "Please download it from www.haiku-os.org...";
310				exit 1;
311			fi
312
313			targetArch=x86_gcc2
314			;;
315	esac
316
317	local bootLibgcc
318	local bootLibSupCxx
319	local bootCxxHeaders
320	local boot32Libgcc
321	local boot32LibSupCxx
322	local boot32CxxHeaders
323	case $gccMachine in
324		x86_64-*)
325			# Boot loader is 32-bit, need the 32-bit libs and c++ config
326			boot32Libgcc=`$gcc -m32 -print-file-name=libgcc.a`
327			boot32LibSupCxx=`$gcc -m32 -print-file-name=libsupc++.a`
328			bootLibgcc=`$gcc -print-file-name=libgcc.a`
329			bootLibSupCxx=`$gcc -print-file-name=libsupc++.a`
330
331			local headersBase=$gccdir/../../../..
332			local headers=$headersBase/$gccMachine/include/c++/$gccRawVersion
333			if [ ! -d $headers ]; then
334				headers=$headersBase/include/c++/$gccRawVersion
335			fi
336			boot32CxxHeaders="$headers/$gccMachine/32"
337			bootCxxHeaders="$headers/$gccMachine"
338			;;
339	esac
340
341	# determine whether graphite loop optimization should/can be used
342	local useGraphite=`get_variable HAIKU_USE_GCC_GRAPHITE_$targetCpu`
343	if [ -z "$useGraphite" ]; then
344		useGraphite=$useGccGraphiteDefault
345	fi
346
347	if [ "$useGraphite" != 0 ]; then
348		UNUSED=`echo "int main() {}" | $gcc -xc -c -floop-block - 2>&1`
349		if [ $? != 0 ]; then
350			echo "GCC Graphite loop optimizations cannot be used on $targetArch"
351			useGraphite=0
352		fi
353	fi
354
355	set_variable HAIKU_CPU_$targetArch $targetCpu
356
357	get_build_tool_path CC_$targetArch "$gcc"
358	set_variable HAIKU_CC_IS_LEGACY_GCC_$targetArch \
359		`is_legacy_gcc $gccRawVersion`
360	set_variable HAIKU_CC_IS_CLANG_$targetArch $useClang
361	set_variable HAIKU_GCC_RAW_VERSION_$targetArch $gccRawVersion
362	set_variable HAIKU_GCC_MACHINE_$targetArch $gccMachine
363	set_variable HAIKU_GCC_LIB_DIR_$targetArch $gccdir
364	set_variable HAIKU_BOOT_CXX_HEADERS_DIR_$targetArch "$bootCxxHeaders"
365	set_variable HAIKU_BOOT_LIBSUPCXX_$targetArch "$bootLibSupCxx"
366	set_variable HAIKU_BOOT_LIBGCC_$targetArch $bootLibgcc
367	set_variable HAIKU_BOOT_32_CXX_HEADERS_DIR_$targetArch "$boot32CxxHeaders"
368	set_variable HAIKU_BOOT_32_LIBSUPCXX_$targetArch "$boot32LibSupCxx"
369	set_variable HAIKU_BOOT_32_LIBGCC_$targetArch $boot32Libgcc
370	set_variable HAIKU_USE_GCC_GRAPHITE_$targetArch $useGraphite
371
372	standard_gcc_settings_targetArch=$targetArch
373}
374
375# set_variable
376#
377# Set the value of a variable.
378#
379set_variable()
380{
381	eval "$1=\"$2\""
382}
383
384# get_variable
385#
386# Echo the value of a variable.
387#
388get_variable()
389{
390	eval "echo \${$1}"
391}
392
393# set_default_value
394#
395# Set the value for a variable, if no value is set yet.
396#
397set_default_value()
398{
399	eval "$1=\${$1-$2}"
400}
401
402# get_build_tool_path
403#
404# Gets a usable absolute path of a build tool.
405#
406get_build_tool_path()
407{
408	local var="HAIKU_$1"
409	local varval="`get_variable $var`"
410	local cmd="$2"
411
412	if [ ! -z "$varval" ]; then
413		# this variable is already set (probably by user) so grab its contents
414		cmd=$varval
415	fi
416
417	local path=${cmd%% *}
418
419	if [ -f "$path" ]; then
420		# get absolute path from relative path
421		local oldPwd="`pwd`"
422		cd "`dirname "$path"`"
423		path="`pwd`/`basename "$path"`"
424		cd $oldPwd
425	else
426		which "$path" > /dev/null 2>&1 || {
427			echo "Build tool \"$path\" not found (maybe specify it in $var?)" >&2
428			exit 1
429		}
430	fi
431
432	if test "${cmd#* }" != "$cmd"; then
433		# $cmd contains arguments, so preserve them (and only them)
434		cmd=${cmd#* }
435	else
436		# $cmd does not contain arguments, so unset it
437		cmd=
438	fi
439	eval "$var=\"$path $cmd\""
440}
441
442# check_native_xattrs
443#
444# Checks the host platform's support for extended attributes.
445# 0: no support, 1: only enough for xattr-ref, 2: full support
446#
447check_native_xattrs()
448{
449	local xattr_set=
450	local xattr_set_args=
451	local xattr_get=
452	local xattr_get_args=
453	case $HOST_PLATFORM in
454		haiku_host)
455			xattr_set="addattr"; xattr_set_args="\$NAME \"\$VALUE\""
456			xattr_get="catattr"; xattr_get_args="\$NAME"
457			;;
458		darwin)
459			xattr_set="xattr"; xattr_set_args="-w \$NAME \"\$VALUE\""
460			xattr_get="xattr"; xattr_get_args="-p \$NAME"
461			;;
462		freebsd)
463			xattr_set="setextattr"; xattr_set_args="user \$NAME \"\$VALUE\""
464			xattr_get="getextattr"; xattr_get_args="user \$NAME"
465			;;
466		linux)
467			xattr_set="setfattr"; xattr_set_args="-n user.\$NAME -v \"\$VALUE\""
468			xattr_get="getfattr"; xattr_get_args="-n user.\$NAME"
469			;;
470		*)
471			return 0
472			;;
473	esac
474	if ! type $xattr_set >/dev/null 2>&1; then
475		echo "$0: could not find $xattr_set, assuming host has no extended attributes"
476		return 0
477	elif ! type $xattr_get >/dev/null 2>&1; then
478		echo "$0: could not find $xattr_get, assuming host has no extended attributes"
479		return 0
480	fi
481
482	mkdir -p "$outputDir"
483	echo "xattr test file" >"$outputDir/xattrtest"
484	local i=0
485	# on round 0, we test if we can set 3 attrs of 1K each (enough for xattr-ref)
486	# on round 1, we test if we can set 3 attrs of 45K each (enough for full xattr)
487	while [ $i -lt 2 ]; do
488		local j=0
489		while [ $j -lt 3 ]; do
490			NAME=attr$j
491			VALUE=`printf '%*s' $((1024 + $i * 45056)) "" | tr ' ' x`
492			if [ `echo -n $VALUE | wc -c` -lt $((1024 + $i * 45056)) ]; then
493				echo "$0: warning: could not generate test data for extended attributes"
494				rm "$outputDir/xattrtest"
495				return $i
496			elif ! $xattr_set `eval echo \"$xattr_set_args\"` \
497					"$outputDir/xattrtest" >/dev/null 2>&1 ; then
498				rm "$outputDir/xattrtest"
499				return $i
500			fi
501			j=$((j+1))
502		done
503		i=$((i+1))
504	done
505	rm "$outputDir/xattrtest"
506	return 2
507}
508
509is_in_list()
510{
511	local element
512	for element in $2; do
513		if [ "$1" = "$element" ]; then
514			return 0
515		fi
516	done
517	return 1
518}
519
520# check for --help or -h and show usage immediately
521if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
522	usage; exit 0;
523fi
524
525# get cwd and the source directory
526currentDir=`pwd`
527cd `dirname "$0"`
528sourceDir=`pwd`
529cd "$currentDir"
530
531# determine output directory
532if [ "$currentDir" = "$sourceDir" ]; then
533	outputDir=$currentDir/generated
534else
535	outputDir=$currentDir
536fi
537buildOutputDir="$outputDir/build"
538HAIKU_BUILD_ATTRIBUTES_DIR="$outputDir/attributes"
539buildConfigFile="$buildOutputDir/BuildConfig"
540
541# check for update request
542if [ "$1" = "--update" ]; then
543	if ! [ -e "$buildConfigFile" ]; then
544		echo $0 --update: \'$buildConfigFile\' not found - updating not possible.
545		exit 1
546	fi
547	# get last configure invocation and flags from BuildConfig and call ourselves with it
548	lastPwd=`grep "#d " "$buildConfigFile" | cut -c 4-`
549	lastConfig=`grep "#c " "$buildConfigFile" | cut -c 4-`
550	lastEnv=`grep "#e " "$buildConfigFile" | cut -c 4-`
551	lastArgs=`grep "#a " "$buildConfigFile" | cut -c 4-`
552	if [ -z "$lastConfig" ]; then
553		echo "$0 --update: The previous configure invocation was not properly" \
554			"encoded into '$buildConfigFile' - updating not possible."
555		exit 1
556	fi
557	cd "$lastPwd"
558	if [ -n "$lastEnv" ]; then
559		export $lastEnv
560	fi
561	$lastConfig $lastArgs
562	exit $?
563fi
564
565# backup the passed arguments
566configureArgs="$@"
567configurePath=$0
568configureDir=`dirname $configurePath`
569
570# backup relevant environs
571configureEnvirons=
572for var in `env`; do
573	case "$var" in
574		CC\=*|HAIKU*\=*|JAMSHELL\=*)
575			configureEnvirons="$configureEnvirons $var"
576			;;
577	esac
578done
579
580# ensure umask is not too restrictive
581if [ `umask` -gt 22 ]; then
582	echo Your umask is too restrictive "(should be <= 0022;" is actually `umask`")"
583	echo
584	echo Additionally, if the source tree was cloned with a too-restrictive umask,
585	echo you will need to run \"git checkout\" again to fix this.
586	exit 1
587fi
588
589# internal default parameter values
590#
591platform=`uname`
592platformMachine=`uname  -m`
593targetArchs=
594buildCrossTools=
595buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
596buildCrossToolsJobs=
597useClang=0
598useGccGraphiteDefault=0
599unknownArchIndex=1
600haikuTargetArchs=
601gdbSources=
602
603if [ -z "$CC" ]; then
604	CC=gcc
605fi
606
607# detect the build platform
608case "${platform}" in
609	Darwin)  HOST_PLATFORM=darwin ;;
610	FreeBSD) HOST_PLATFORM=freebsd
611	         if [ "$HAIKU_HOST_USE_32BIT" = 1 ] ; then
612	         	echo Unsupported platform: FreeBSD ${platformMachine}
613	         	exit 1
614	         fi ;;
615	Haiku)   HOST_PLATFORM=haiku_host ;;
616	Linux)   HOST_PLATFORM=linux ;;
617	OpenBSD) HOST_PLATFORM=openbsd ;;
618	*)       echo Unsupported platform: ${platform}
619	         exit 1 ;;
620esac
621
622case $HOST_PLATFORM in
623	darwin|freebsd|openbsd) statCmd='stat -f' ;;
624	*)                      statCmd='stat -c' ;;
625esac
626
627# ensure git checkout was not done with a restrictive umask
628if [ `$statCmd '%a' "$sourceDir/data/system/boot/SetupEnvironment"` -lt 644 ]; then
629	echo "The source tree was cloned with a umask > 0022. It seems you"
630	echo have already corrected your umask, but not re-checked-out the
631	echo source tree. Try running:
632	echo "	git checkout --force"
633	echo to fix this problem.
634	exit 1
635fi
636
637# exported (BuildSetup) default parameter values
638#
639GIT_DIR=`git -C "$configureDir" rev-parse --git-dir | sed 's/^gitdir: //'`
640HOST_GCC_RAW_VERSION=`$CC -dumpversion`
641HOST_CC_IS_LEGACY_GCC=`is_legacy_gcc $HOST_GCC_RAW_VERSION`
642HOST_GCC_MACHINE=`$CC -dumpmachine`
643HAIKU_INCLUDE_SOURCES=0
644HAIKU_INCLUDE_3RDPARTY=0
645HAIKU_DISTRO_COMPATIBILITY=default
646TARGET_PLATFORM=haiku
647HAIKU_USE_GCC_PIPE=0
648HAIKU_HOST_USE_32BIT=0
649HAIKU_HOST_USE_XATTR=
650HAIKU_HOST_USE_XATTR_REF=
651HAIKU_HOST_BUILD_ONLY=0
652HOST_EXTENDED_REGEX_SED="sed -r"
653HOST_GCC_LD=`$CC -print-prog-name=ld`
654HOST_GCC_OBJCOPY=`$CC -print-prog-name=objcopy`
655HOST_SHA256=
656HOST_HAIKU_PORTER=
657HAIKU_PORTS=
658HAIKU_PORTS_CROSS=
659HAIKU_IS_BOOTSTRAP=0
660HAIKU_NO_DOWNLOADS=0
661
662HAIKU_PACKAGING_ARCHS=
663
664set_default_value HAIKU_NASM		nasm
665
666if sha256sum < /dev/null > /dev/null 2>&1; then
667	HOST_SHA256=sha256sum
668elif sha256 < /dev/null > /dev/null 2>&1; then
669	HOST_SHA256="sha256 -q"
670elif shasum < /dev/null > /dev/null 2>&1; then
671	HOST_SHA256="shasum -a 256"
672else
673	echo "Error: Neither sha256sum nor sha256 seem to be available!" >&2
674	exit 1
675fi
676
677haikuRequiredLegacyGCCVersion="2.95.3-haiku-2017_07_20"
678export haikuRequiredLegacyGCCVersion
679	# version of legacy gcc required to build haiku
680supportedTargetArchs="
681	arm
682	arm64
683	m68k
684	ppc
685	riscv64
686	sparc
687	x86
688	x86_64
689	x86_gcc2
690	"
691
692# parse parameters
693#
694while [ $# -gt 0 ] ; do
695	case "$1" in
696		--sysroot)
697			assertparam "$1" $#
698			crossToolsSysroot=$2
699			shift 2
700			;;
701		--bootstrap)
702			assertparams "$1" 3 $#
703			HOST_HAIKU_PORTER="`absolute_path $2`"
704			HAIKU_PORTS_CROSS="`absolute_path $3`"
705			HAIKU_PORTS="`absolute_path $4`"
706			HAIKU_IS_BOOTSTRAP=1
707			HAIKU_NO_DOWNLOADS=1
708			check_file_exists "$HOST_HAIKU_PORTER" || (
709				echo "Invalid path to haikuporter: $HOST_HAIKU_PORTER" >&2
710				exit 1
711			)
712			check_dir_exists "$HAIKU_PORTS" || (
713				echo "Non-existent directory $HAIKU_PORTS" >&2
714				exit 1
715			)
716			check_dir_exists "$HAIKU_PORTS_CROSS" || (
717				echo "Non-existent directory $HAIKU_PORTS_CROSS" >&2
718				exit 1
719			)
720			shift 4
721			;;
722		--cross-tools-source)
723			assertparam "$1" $#
724			buildCrossTools=$2
725			shift 2
726			;;
727		--build-cross-tools)
728			assertparam "$1" $#
729			targetArch=$2
730			shift 2
731			case "$targetArch" in
732				x86_gcc2)	targetMachine=i586-pc-haiku;;
733				x86)		targetMachine=i586-pc-haiku;;
734				x86_64)		targetMachine=x86_64-unknown-haiku;;
735				ppc)		targetMachine=powerpc-apple-haiku;;
736				m68k)		targetMachine=m68k-unknown-haiku;;
737				arm)		targetMachine=arm-unknown-haiku;;
738				arm64)		targetMachine=aarch64-unknown-haiku;;
739				riscv64)	targetMachine=riscv64-unknown-haiku;;
740				sparc)		targetMachine=sparc64-unknown-haiku;;
741				*)
742					echo "Unsupported target architecture: $targetArch" >&2
743					exit 1
744					;;
745			esac
746			set_variable buildCrossToolsMachine_$targetArch $targetMachine
747			targetArchs="$targetArchs $targetArch"
748			;;
749		--cross-tools-prefix)
750			assertparam "$1" $#
751			targetArch=unknown${unknownArchIndex}
752			set_variable crossToolsPrefix_$targetArch "$2"
753			targetArchs="$targetArchs $targetArch"
754			unknownArchIndex=$(($unknownArchIndex + 1))
755			shift 2
756			;;
757		--distro-compatibility)
758			assertparam "$1" $#
759			HAIKU_DISTRO_COMPATIBILITY=$2
760			case "$HAIKU_DISTRO_COMPATIBILITY" in
761				official)	;;
762				compatible)	;;
763				default)	;;
764				*)			echo "Invalid distro compatibility" \
765								"level: $HAIKU_DISTRO_COMPATIBILITY"
766							exit 1;;
767			esac
768			shift 2
769			;;
770		--host-only)	HAIKU_HOST_BUILD_ONLY=1; shift 1;;
771		--include-sources)	HAIKU_INCLUDE_SOURCES=1; shift 1;;
772		--include-3rdparty)	HAIKU_INCLUDE_3RDPARTY=1; shift 1;;
773        -j*)				buildCrossToolsJobs="$1"; shift 1;;
774		--no-downloads)	HAIKU_NO_DOWNLOADS=1; shift 1;;
775		--target-arch)
776			assertparam "$1" $#
777			targetArch=$2
778			shift 2
779			if [ ! "$platform" = Haiku ]; then
780				echo "--target-arch can only be specified on Haiku." >&2
781				exit 1
782			fi
783			is_in_list "$targetArch" "$supportedTargetArchs" || (
784				echo "Unsupported target architecture: \"$targetArch\"" >&2
785				exit 1
786			)
787			haikuTargetArchs="$haikuTargetArchs $targetArch"
788			;;
789		--use-clang)
790			assertparam "$1" $#
791			targetArch=$2
792			useClang=1
793			case "$targetArch" in
794				x86)		targetMachine=i586-pc-haiku;;
795				x86_64)		targetMachine=x86_64-unknown-haiku;;
796				ppc)		targetMachine=powerpc-apple-haiku;;
797				arm)		targetMachine=arm-unknown-haiku;;
798				arm64)		targetMachine=aarch64-unknown-haiku;;
799				riscv64)	targetMachine=riscv64-unknown-haiku;;
800				sparc)		targetMachine=sparc64-unknown-haiku;;
801				*)
802					echo "Unsupported target architecture: $2" >&2
803					exit 1
804					;;
805			esac
806			get_build_tool_path clang clang
807			if [ -z `get_variable "crossToolsPrefix_$targetArch"` ] \
808					&& [ -z `get_variable buildCrossToolsMachine_$targetArch` ]; then
809				set_variable crossToolsPrefix_$targetArch llvm-
810			fi
811			clangVersion=`$HAIKU_clang -v 2>&1 | head -1 | cut -d " " -f3`
812			if [ `echo $clangVersion | cut -d'.' -f1` -lt 7 ]; then
813				echo "Haiku requires Clang 7 or better to build, but you have $clangVersion."
814				echo "Please install a newer version."
815				exit 1
816			fi
817			targetArchs="$targetArchs $targetArch"
818			shift 2
819			;;
820		--use-gcc-pipe)	HAIKU_USE_GCC_PIPE=1; shift 1;;
821		--use-gcc-graphite)	useGccGraphiteDefault=1; shift 1;;
822		--use-32bit)	HAIKU_HOST_USE_32BIT=1; shift 1;;
823		--no-full-xattr)HAIKU_HOST_USE_XATTR=0; shift 1;;
824		--no-xattr)		HAIKU_HOST_USE_XATTR_REF=0; shift 1;;
825		--with-gdb)	gdbSources=$2; shift 2;;
826		--use-stack-protector)	HAIKU_USE_STACK_PROTECTOR=1; shift 1;;
827		--efi-signing-key)
828			assertparam "$1" $#
829			HAIKU_EFI_SIGNING_KEY="$2"
830			shift 2
831			;;
832		*)				echo Invalid argument: \`$1\'; exit 1;;
833	esac
834done
835
836# check for case-sensitive filesystem
837mkdir haikuCaseTest 2>/dev/null
838mkdir haikucasetest 2>/dev/null
839caseInsensitive=$?
840rmdir haikuCaseTest haikucasetest 2>/dev/null
841if [ $caseInsensitive != 0 ]; then
842	echo "You need a case-sensitive file-system to build Haiku."
843	if [ $HOST_PLATFORM = "darwin" ]; then
844		echo "You can create a case-sensitive disk image using Disk Utility."
845	fi
846	exit 1
847fi
848
849# check xattr support
850if [ -z $HAIKU_HOST_USE_XATTR_REF ]; then
851	check_native_xattrs
852	attrSupport=$?
853	if [ $attrSupport = 2 ] && [ -z $HAIKU_HOST_USE_XATTR ]; then
854		HAIKU_HOST_USE_XATTR=1
855	elif [ $attrSupport = 1 ]; then
856		HAIKU_HOST_USE_XATTR_REF=1
857	fi
858fi
859if [ -z $HAIKU_HOST_USE_XATTR ]; then HAIKU_HOST_USE_XATTR=0; fi
860if [ -z $HAIKU_HOST_USE_XATTR_REF ]; then HAIKU_HOST_USE_XATTR_REF=0; fi
861
862# determine how to invoke sed with extended regexp support for non-GNU sed
863if [ $HOST_PLATFORM = "darwin" ]; then
864	HOST_EXTENDED_REGEX_SED="sed -E"
865fi
866
867# pick a JAMSHELL
868if [ "$JAMSHELL" = "" ]; then
869	if check_file_exists /bin/dash; then
870		JAMSHELL=/bin/dash
871	else
872		JAMSHELL=/bin/sh
873	fi
874fi
875if ! $JAMSHELL -c true; then
876	echo "$JAMSHELL does not work! Please specify a working JAMSHELL."
877	exit 1
878fi
879
880# locate python
881if python3 --version < /dev/null > /dev/null 2>&1; then
882	HOST_PYTHON="python3"
883elif python --version < /dev/null > /dev/null 2>&1; then
884	HOST_PYTHON="python"
885else
886	echo "a python interpreter is required"
887	exit 1
888fi
889
890# check if nasm can actually output ELF files
891# (the stock version in OSX can't)
892# XXX: should probably only test for x86* arch
893if [ "$("$HAIKU_NASM" -hf | grep -c elf'[36][24] ')" -ne "2" ]; then
894	echo "$HAIKU_NASM cannot generate ELF files. Please install a working version."
895	if [ $HOST_PLATFORM = "darwin" ]; then
896		echo "You can install it from Mac Ports."
897		echo "Mac Ports is available at: http://www.macports.org/"
898	fi
899	exit 1
900fi
901
902# create output directory
903mkdir -p "$buildOutputDir" || exit 1
904
905if [ "$HAIKU_HOST_BUILD_ONLY" = 1 ]; then
906	invalidCommand=$sourceDir/build/scripts/host_build_only
907	HAIKU_AR=$invalidCommand
908	HAIKU_CC=$invalidCommand
909	HAIKU_LD=$invalidCommand
910	HAIKU_OBJCOPY=$invalidCommand
911	HAIKU_RANLIB=$invalidCommand
912	HAIKU_ELFEDIT=$invalidCommand
913	HAIKU_NASM=$invalidCommand
914	HAIKU_STRIP=$invalidCommand
915else
916	# On Haiku determine target architectures and tools automatically.
917	if [ -z "$targetArchs" ]; then
918		if [ $HOST_PLATFORM != haiku_host ]; then
919			echo "Please specify the build tools to use or build (via" \
920				"--cross-tools-prefix or --build-cross-tools) or specify a" \
921				"host-only build (--host-only)." >&2
922			echo "For more info, invoke $0 --help"
923			exit 1
924		fi
925
926		# determine primary architecture
927		targetArch=`package list -i /system/packages/haiku-*.hpkg \
928			| sed '/^\s*architecture:/!d; s,^\s*architecture:\s*,,'`
929		is_in_list "$targetArch" "$supportedTargetArchs" || (
930			echo "Unsupported target architecture: \"$targetArch\"" >&2
931			exit 1
932		)
933		targetArchs=$targetArch
934
935		set_default_value HAIKU_AR_$targetArch			ar
936		set_default_value HAIKU_CC_$targetArch			gcc
937		set_default_value HAIKU_LD_$targetArch			ld
938		set_default_value HAIKU_OBJCOPY_$targetArch		objcopy
939		set_default_value HAIKU_RANLIB_$targetArch		ranlib
940		set_default_value HAIKU_ELFEDIT_$targetArch		elfedit
941		set_default_value HAIKU_STRIP_$targetArch		strip
942
943		# determine secondary architectures
944		for targetArch in $supportedTargetArchs; do
945			if [ -e /system/packages/haiku_$targetArch-*.hpkg ]; then
946				targetArchs="$targetArchs $targetArch"
947				set_default_value HAIKU_AR_$targetArch		ar-$targetArch
948				set_default_value HAIKU_CC_$targetArch		gcc-$targetArch
949				set_default_value HAIKU_LD_$targetArch		ld-$targetArch
950				set_default_value HAIKU_OBJCOPY_$targetArch	objcopy-$targetArch
951				set_default_value HAIKU_RANLIB_$targetArch	ranlib-$targetArch
952				set_default_value HAIKU_ELFEDIT_$targetArch	elfedit-$targetArch
953				set_default_value HAIKU_STRIP_$targetArch	strip-$targetArch
954			fi
955		done
956
957		# The target architectures might have been specified explicitly.
958		if [ -n "$haikuTargetArchs" ]; then
959			for targetArch in $haikuTargetArchs; do
960				is_in_list "$targetArch" "$targetArchs" || (
961					echo "Unsupported target architecture: \"$targetArch\"." \
962						"Only native architectures of the host platform can" \
963						"be specified." >&2
964					exit 1
965				)
966			done
967			targetArchs="$haikuTargetArchs"
968		fi
969	fi
970
971	if [ "$targetArchs" = " x86_gcc2" ]; then
972		echo "Building a GCC2-only Haiku is no longer supported."
973		echo "Please configure the secondary architecture."
974		exit 1
975	fi
976
977	isPrimaryArch=1
978	for targetArch in $targetArchs; do
979		# Note: targetArch is "unknown<n>" at this point if a cross-tools
980		# prefix was specified. The standard_gcc_settings call below will get
981		# the actual architecture.
982
983		if test "${HAIKU_PACKAGING_ARCHS#*$targetArch\b}" != "$HAIKU_PACKAGING_ARCHS"; then
984			# somehow we wound up with a duplicate arch; skip this one
985			continue
986		fi
987
988		crossToolsPrefix=`get_variable crossToolsPrefix_$targetArch`
989
990		# build cross tools from sources
991		if [ -n "$buildCrossTools" -a -z "$crossToolsPrefix" ]; then
992			crossToolsDir="$outputDir/cross-tools-$targetArch"
993			targetMachine=`get_variable buildCrossToolsMachine_$targetArch`
994			script="$buildCrossToolsScript"
995			scriptArgs=
996			if [ $targetArch != x86_gcc2 ]; then
997				script="${script}_gcc4"
998				scriptArgs="$targetMachine"
999				set_default_value HAIKU_USE_GCC_GRAPHITE_$targetArch	\
1000					$useGccGraphiteDefault
1001			fi
1002			secondaryArch=
1003			if [ -z "$isPrimaryArch" ]; then
1004				secondaryArch=$targetArch
1005			fi
1006
1007			case $HOST_PLATFORM in
1008				freebsd|openbsd)	MAKE=gmake;;
1009				*)					MAKE=make;;
1010			esac
1011
1012			if ! valid_toolchain "${targetMachine}" "${crossToolsDir}" "${buildCrossTools}"; then
1013				MAKE=$MAKE \
1014				SECONDARY_ARCH=$secondaryArch \
1015				HAIKU_USE_GCC_GRAPHITE=`get_variable \
1016					HAIKU_USE_GCC_GRAPHITE_$targetArch` \
1017				HAIKU_USE_GCC_PIPE=$HAIKU_USE_GCC_PIPE \
1018				HAIKU_USE_GDB="$gdbSources" \
1019				HAIKU_USE_SYSROOT="$crossToolsSysroot" \
1020				"$script" $scriptArgs "$sourceDir" "$buildCrossTools" \
1021					"$crossToolsDir" $buildCrossToolsJobs || exit 1
1022			else
1023				echo "$targetArch crosstools already exist in $crossToolsDir; skipping build"
1024			fi
1025			crossToolsPrefix="$crossToolsDir/bin/${targetMachine}-"
1026		fi
1027
1028		# prepare gcc settings and get the actual target architecture
1029		if [ $useClang = 1 ]; then
1030			gcc="$HAIKU_clang -target ${targetMachine}"
1031			if [ ! -z "${crossToolsPrefix}" ]; then
1032				gcc="$gcc -B ${crossToolsPrefix}"
1033			fi
1034
1035			# Clang's compiler intrinsics are not compatible with GCC's or even
1036			# across versions of Clang, so we must collect them for use in the build.
1037			mkdir -p "$outputDir/clang_headers" || exit 1
1038			clangHeadersDir=`$gcc -print-resource-dir`/include/
1039			case $targetArch in
1040				x86*) cp $clangHeadersDir/*intrin* $clangHeadersDir/mm3* "$outputDir/clang_headers" || exit 1 ;;
1041				ppc*) cp $clangHeadersDir/*altivec* "$outputDir/clang_headers" || exit 1 ;;
1042				arm*) cp $clangHeadersDir/*arm* "$outputDir/clang_headers" || exit 1 ;;
1043			esac
1044		elif [ -z "${crossToolsPrefix}" ]; then
1045			gcc=`get_variable HAIKU_CC_$targetArch`
1046		else
1047			gcc="${crossToolsPrefix}gcc"
1048		fi
1049		standard_gcc_settings "$gcc"
1050		targetArch=$standard_gcc_settings_targetArch
1051
1052		# set default values for flags
1053		set_default_value HAIKU_CPPFLAGS_$targetArch	""
1054		set_default_value HAIKU_CCFLAGS_$targetArch		""
1055		set_default_value HAIKU_CXXFLAGS_$targetArch	""
1056		set_default_value HAIKU_LINKFLAGS_$targetArch	""
1057		set_default_value HAIKU_LDFLAGS_$targetArch		""
1058		set_default_value HAIKU_ARFLAGS_$targetArch		cru
1059		set_default_value HAIKU_UNARFLAGS_$targetArch	x
1060
1061		# Override the cross tools variables, if the tools were built or a
1062		# prefix was specified.
1063		if [ $useClang = 1 ]; then
1064			get_build_tool_path LD_$targetArch ld.lld
1065			get_build_tool_path ELFEDIT_$targetArch elfedit
1066		elif [ -n "$crossToolsPrefix" ]; then
1067			get_build_tool_path LD_$targetArch ${crossToolsPrefix}ld
1068			if [ `get_variable HAIKU_CC_IS_LEGACY_GCC_$targetArch` -eq 0 ]; then
1069				get_build_tool_path ELFEDIT_$targetArch ${crossToolsPrefix}elfedit
1070			fi
1071		fi
1072		if [ -n "$crossToolsPrefix" ]; then
1073			get_build_tool_path AR_$targetArch ${crossToolsPrefix}ar
1074			get_build_tool_path OBJCOPY_$targetArch ${crossToolsPrefix}objcopy
1075			get_build_tool_path RANLIB_$targetArch ${crossToolsPrefix}ranlib
1076			get_build_tool_path STRIP_$targetArch ${crossToolsPrefix}strip
1077		fi
1078
1079		# check whether the Haiku compiler really targets Haiku
1080		targetMachine=`get_variable HAIKU_GCC_MACHINE_$targetArch`
1081		case "$targetMachine" in
1082			*-*-haiku)	;;
1083			*)
1084				echo The compiler specified as Haiku target compiler is not a \
1085				valid Haiku cross-compiler. Please see ReadMe.cross-compile. >&2
1086				echo compiler: $HAIKU_CC
1087				echo compiler is configured for target: $targetMachine
1088				exit 1 ;;
1089		esac
1090
1091		HAIKU_PACKAGING_ARCHS="$HAIKU_PACKAGING_ARCHS $targetArch"
1092		isPrimaryArch=
1093	done
1094fi
1095
1096# Generate BuildConfig
1097cat << EOF > "$buildConfigFile"
1098# -- WARNING --
1099# This file was AUTOMATICALLY GENERATED by configure, and will be completely
1100# overwritten the next time configure is run.
1101#
1102#d ${currentDir}
1103#c ${configurePath}
1104#e ${configureEnvirons}
1105#a ${configureArgs}
1106
1107GIT_DIR						?= "${GIT_DIR}" ;
1108
1109HOST_PLATFORM				?= "${HOST_PLATFORM}" ;
1110TARGET_PLATFORM 			?= "${TARGET_PLATFORM}" ;
1111HAIKU_PACKAGING_ARCHS		?= ${HAIKU_PACKAGING_ARCHS} ;
1112
1113HAIKU_NO_DOWNLOADS			?= "${HAIKU_NO_DOWNLOADS}" ;
1114HAIKU_INCLUDE_SOURCES		?= "${HAIKU_INCLUDE_SOURCES}" ;
1115HAIKU_INCLUDE_3RDPARTY		?= "${HAIKU_INCLUDE_3RDPARTY}" ;
1116HAIKU_DISTRO_COMPATIBILITY	?= "${HAIKU_DISTRO_COMPATIBILITY}" ;
1117
1118HAIKU_USE_GCC_PIPE			?= "${HAIKU_USE_GCC_PIPE}" ;
1119HAIKU_HOST_USE_32BIT		?= "${HAIKU_HOST_USE_32BIT}" ;
1120HAIKU_HOST_USE_XATTR		?= "${HAIKU_HOST_USE_XATTR}" ;
1121HAIKU_HOST_USE_XATTR_REF	?= "${HAIKU_HOST_USE_XATTR_REF}" ;
1122HAIKU_HOST_BUILD_ONLY		?= "${HAIKU_HOST_BUILD_ONLY}" ;
1123
1124JAMSHELL					?= ${JAMSHELL} -e -c ;
1125
1126HOST_CC						?= ${CC} ;
1127HOST_CC_IS_LEGACY_GCC		?= ${HOST_CC_IS_LEGACY_GCC} ;
1128HOST_GCC_MACHINE			?= ${HOST_GCC_MACHINE} ;
1129HOST_LD						?= ${HOST_GCC_LD} ;
1130HOST_OBJCOPY				?= ${HOST_GCC_OBJCOPY} ;
1131HOST_EXTENDED_REGEX_SED		?= ${HOST_EXTENDED_REGEX_SED} ;
1132HOST_SHA256					?= ${HOST_SHA256} ;
1133HOST_PYTHON					?= ${HOST_PYTHON} ;
1134HAIKU_NASM					?= ${HAIKU_NASM} ;
1135
1136HAIKU_BUILD_ATTRIBUTES_DIR	?= "${HAIKU_BUILD_ATTRIBUTES_DIR}" ;
1137
1138HOST_HAIKU_PORTER			?= ${HOST_HAIKU_PORTER} ;
1139HAIKU_PORTS					?= ${HAIKU_PORTS} ;
1140HAIKU_PORTS_CROSS			?= ${HAIKU_PORTS_CROSS} ;
1141HAIKU_IS_BOOTSTRAP			?= ${HAIKU_IS_BOOTSTRAP} ;
1142
1143HAIKU_BOOT_EFI_PRIVATE_KEYFILE	?= ${HAIKU_EFI_SIGNING_KEY} ;
1144EOF
1145
1146for targetArch in $HAIKU_PACKAGING_ARCHS; do
1147	variables="
1148		HAIKU_CC					HAIKU_CC
1149		HAIKU_CC_IS_LEGACY_GCC		HAIKU_CC_IS_LEGACY_GCC
1150		HAIKU_CC_IS_CLANG			HAIKU_CC_IS_CLANG
1151		HAIKU_USE_GCC_GRAPHITE		HAIKU_USE_GCC_GRAPHITE
1152		HAIKU_CPU					HAIKU_CPU
1153		HAIKU_GCC_MACHINE			HAIKU_GCC_MACHINE
1154		HAIKU_GCC_LIB_DIR			HAIKU_GCC_LIB_DIR
1155		HAIKU_BOOT_LIBGCC			HAIKU_BOOT_LIBGCC
1156		HAIKU_BOOT_LIBSUPC++		HAIKU_BOOT_LIBSUPCXX
1157		HAIKU_BOOT_32_LIBGCC		HAIKU_BOOT_32_LIBGCC
1158		HAIKU_BOOT_32_LIBSUPC++		HAIKU_BOOT_32_LIBSUPCXX
1159		HAIKU_AR					HAIKU_AR
1160		HAIKU_LD					HAIKU_LD
1161		HAIKU_OBJCOPY				HAIKU_OBJCOPY
1162		HAIKU_RANLIB				HAIKU_RANLIB
1163		HAIKU_ELFEDIT				HAIKU_ELFEDIT
1164		HAIKU_STRIP					HAIKU_STRIP
1165		HAIKU_CPPFLAGS				HAIKU_CPPFLAGS
1166		HAIKU_CCFLAGS				HAIKU_CCFLAGS
1167		HAIKU_C++FLAGS				HAIKU_CXXFLAGS
1168		HAIKU_LINKFLAGS				HAIKU_LINKFLAGS
1169		HAIKU_LDFLAGS				HAIKU_LDFLAGS
1170		HAIKU_ARFLAGS				HAIKU_ARFLAGS
1171		HAIKU_UNARFLAGS				HAIKU_UNARFLAGS
1172		"
1173	set -- $variables
1174	while [ $# -ge 2 ]; do
1175		value=`get_variable ${2}_$targetArch`
1176		echo "${1}_${targetArch} ?= $value ;" >> "$buildConfigFile"
1177		shift 2
1178	done
1179
1180	# For variables that may have long values, distribute them over multiple
1181	# lines so that jam doesn't hit the maximum line length.
1182	variables="
1183		HAIKU_BOOT_C++_HEADERS_DIR	HAIKU_BOOT_CXX_HEADERS_DIR
1184		HAIKU_BOOT_32_C++_HEADERS_DIR	HAIKU_BOOT_32_CXX_HEADERS_DIR
1185		"
1186	set -- $variables
1187	while [ $# -ge 2 ]; do
1188		echo "${1}_${targetArch} ?= " >> "$buildConfigFile"
1189		get_variable ${2}_$targetArch | xargs -n 1 echo "   " \
1190			>> "$buildConfigFile"
1191		echo "    ;" >> "$buildConfigFile"
1192		shift 2
1193	done
1194done
1195
1196
1197# Generate a Jamfile in the output directory.
1198
1199cat << EOF > $outputDir/Jamfile
1200# -- WARNING --
1201# This file was AUTOMATICALLY GENERATED by configure, and will be completely
1202# overwritten the next time configure is run.
1203
1204HAIKU_TOP			= $(relative_to "${sourceDir}" "${outputDir}") ;
1205HAIKU_OUTPUT_DIR	= . ;
1206
1207include [ FDirName \$(HAIKU_TOP) Jamfile ] ;
1208
1209EOF
1210
1211echo "Configured successfully!"
1212