xref: /haiku/build/jam/BuildSetup (revision 37fedaf8494b34aad811abcc49e79aa32943f880)
1# Variable naming conventions:
2# TARGET_*:	A build system variable specifying a property for building for
3#			the target platform (usually Haiku). E.g. TARGET_CC specifies the
4#			compiler when building a target for the target platform.
5# HOST_*:	A build system variable specifying a property of the platform
6#			hosting the build. E.g. HOST_CC specifies the compiler when
7#			building a target for the host platform (a build tool for
8#			instance).
9# HAIKU_*:	A build system variable specifying a build system property. Usually
10#			directory paths and the like.
11
12
13# The Haiku (base) version. For development builds the revision will be
14# attached.
15HAIKU_VERSION = r1~alpha4_pm ;
16
17
18#pragma mark - container settings
19
20# Haiku image
21HAIKU_IMAGE_CONTAINER_NAME = haiku-image-container ;
22HAIKU_CONTAINER_GRIST on $(HAIKU_IMAGE_CONTAINER_NAME) = HaikuImage ;
23HAIKU_INCLUDE_IN_CONTAINER_VAR on $(HAIKU_IMAGE_CONTAINER_NAME)
24	= HAIKU_INCLUDE_IN_IMAGE ;
25HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_IMAGE_CONTAINER_NAME)
26	= HAIKU_IMAGE_INSTALL_TARGETS ;
27HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(HAIKU_IMAGE_CONTAINER_NAME)
28	= system non-packaged ;
29
30# network boot archive
31HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME = haiku-netboot-archive-container ;
32HAIKU_CONTAINER_GRIST on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
33	= NetBootArchive ;
34# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
35HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
36	= HAIKU_NET_BOOT_ARCHIVE_INSTALL_TARGETS ;
37HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
38	= system ;
39
40# boot floppy
41HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-floppy-container ;
42HAIKU_CONTAINER_GRIST on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
43	= FloppyBootImage ;
44# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
45HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
46	= HAIKU_FLOPPY_BOOT_IMAGE_INSTALL_TARGETS ;
47HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
48	= system ;
49
50# boot CD image
51HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-cd-container ;
52HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) = CDBootImage ;
53# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
54HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME)
55	= HAIKU_CD_BOOT_IMAGE_INSTALL_TARGETS ;
56HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME)
57	= system ;
58
59# boot CD for PPC image
60HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME = haiku-boot-cd-ppc-container ;
61HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME)
62	= CDBootPPCImage ;
63# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
64HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME)
65	= HAIKU_CD_BOOT_PPC_IMAGE_INSTALL_TARGETS ;
66HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME)
67	= system ;
68
69# Haiku image/install defaults
70HAIKU_DEFAULT_IMAGE_NAME = haiku.image ;
71HAIKU_DEFAULT_IMAGE_DIR = $(HAIKU_OUTPUT_DIR) ;
72HAIKU_DEFAULT_VMWARE_IMAGE_NAME = haiku.vmdk ;
73HAIKU_DEFAULT_INSTALL_DIR = /Haiku ;
74HAIKU_DEFAULT_IMAGE_SIZE ?= 300 ; # 300 MB
75HAIKU_DEFAULT_IMAGE_LABEL ?= Haiku ;
76
77# Haiku CD defaults
78HAIKU_DEFAULT_CD_NAME = haiku-cd.iso ;
79HAIKU_DEFAULT_CD_DIR = $(HAIKU_OUTPUT_DIR) ;
80HAIKU_DEFAULT_CD_LABEL = Haiku ;
81
82# Haiku Anyboot defaults
83HAIKU_DEFAULT_ANYBOOT_NAME = haiku-anyboot.image ;
84HAIKU_DEFAULT_ANYBOOT_DIR = $(HAIKU_OUTPUT_DIR) ;
85HAIKU_DEFAULT_ANYBOOT_LABEL ?= Haiku ;
86
87# analyze and optionally replace jam's target parameters
88ProcessCommandLineArguments ;
89
90
91# supported debug levels
92HAIKU_DEBUG_LEVELS = 0 1 2 3 4 5 ;
93
94# BeOS, BONE, Dan0 compatible platforms
95HAIKU_BEOS_COMPATIBLE_PLATFORMS = haiku r5 bone dano haiku_host ;
96HAIKU_BONE_COMPATIBLE_PLATFORMS = haiku bone dano haiku_host ;
97HAIKU_DANO_COMPATIBLE_PLATFORMS = haiku dano haiku_host ;
98HAIKU_HAIKU_COMPATIBLE_PLATFORMS = haiku haiku_host ;
99
100# configuration header directories
101HAIKU_CONFIG_HEADERS = [ FDirName $(HAIKU_TOP) build user_config_headers ]
102	[ FDirName $(HAIKU_TOP) build config_headers ] ;
103
104
105# object directories common to all architectures
106HAIKU_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) haiku ] ;
107HAIKU_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) common ] ;
108
109
110#pragma mark - haiku target platform settings
111
112
113local architecture ;
114for architecture in $(HAIKU_PACKAGING_ARCHS) {
115	ArchitectureSetup $(architecture) ;
116}
117
118# TODO: Might not be needed anymore.
119if $(HAIKU_HOST_BUILD_ONLY) = 1 {
120	HAIKU_GCC_VERSION = 0 0 0 ;
121}
122
123if $(HAIKU_PACKAGING_ARCH) {
124	KernelArchitectureSetup $(HAIKU_PACKAGING_ARCH) ;
125}
126
127# define primary packaging architecture macro
128HAIKU_DEFINES = __HAIKU_PRIMARY_PACKAGING_ARCH=\\\"$(HAIKU_PACKAGING_ARCH)\\\" ;
129
130HAIKU_LIBSUPC++ = $(HAIKU_LIBSUPC++_$(HAIKU_PACKAGING_ARCH)) ;
131HAIKU_LIBSTDC++ = $(HAIKU_LIBSTDC++_$(HAIKU_PACKAGING_ARCH)) ;
132
133
134# distro compatibility level defines
135HAIKU_DISTRO_COMPATIBILITY ?= "default" ;
136switch $(HAIKU_DISTRO_COMPATIBILITY) {
137	case official :
138		HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_OFFICIAL ;
139		HAIKU_INCLUDE_TRADEMARKS = "" ;
140	case compatible :
141		HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_COMPATIBLE ;
142		HAIKU_INCLUDE_TRADEMARKS = "" ;
143	case "default" :
144		HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_DEFAULT ;
145		HAIKU_INCLUDE_TRADEMARKS = ;
146	case * :
147		Exit "Invalid value for HAIKU_DISTRO_COMPATIBILITY:"
148			$(HAIKU_DISTRO_COMPATIBILITY) ;
149}
150
151# If the environment variable HAIKU_INCLUDE_PATENTED_CODE is defined, we define
152# an equally named macro to the variable value. Some components use the macro
153# to allow compilation of code known to implemented patented ideas and/or
154# techniques, for example the Freetype bytecode hinter or sub-pixel rendering as
155# well as some problematic media codecs.
156if $(HAIKU_INCLUDE_PATENTED_CODE) {
157	HAIKU_DEFINES
158		+= HAIKU_INCLUDE_PATENTED_CODE=$(HAIKU_INCLUDE_PATENTED_CODE) ;
159}
160
161HAIKU_ATA_STACK ?= 1 ;
162
163# network libraries
164HAIKU_NETWORK_LIBS = network ;
165HAIKU_NETAPI_LIB = bnetapi ;
166HAIKU_SELECT_UNAME_ETC_LIB = ;	# libroot, against which we link anyway
167
168
169HAIKU_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
170
171# TODO: The version stuff should probably go into a separate file and be made
172# available as macro, too.
173# Set our version number if not already set and mark it as a developer build
174if ! $(HAIKU_BUILD_VERSION) {
175	HAIKU_BUILD_VERSION ?= "1 0 0 a 1" ;
176	HAIKU_BUILD_DESCRIPTION ?= "Developer Build" ;
177}
178
179# If HAIKU_BUILD_VERSION is set, but HAIKU_BUILD_DESCRIPTION isn't, mark it as
180# an unknown build.
181HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
182
183
184#pragma mark - host platform settings
185
186
187# determine the endianness of the host
188switch $(HOST_GCC_MACHINE) {
189	case amd64-*	: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
190	case i?86-*		: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
191	case powerpc-*	: HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
192	case x86_64-*	: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
193
194	# the following are rather unlikely as hosts ...
195	case arm-*		: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
196	case armv7l-*	: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
197	case armv7b-*	: HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
198	case m68k-*		: HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
199	case *			: Exit "Unsupported gcc host machine:" $(HOST_GCC_MACHINE) ;
200}
201
202# analyze the host gcc machine spec to find out about 64-bitness
203HOST_PLATFORM_IS_64_BIT = ;
204switch $(HOST_GCC_MACHINE) {
205	case amd64-* :				HOST_PLATFORM_IS_64_BIT = 1 ;
206	case i686-apple-darwin10 :	HOST_PLATFORM_IS_64_BIT = 1 ;
207	case i686-apple-darwin11 :	HOST_PLATFORM_IS_64_BIT = 1 ;
208	case x86_64-* :				HOST_PLATFORM_IS_64_BIT = 1 ;
209}
210
211# If HAIKU_HOST_USE_32BIT is set, add the required gcc base flag (the LD flag
212# is set later), or, if the architecture isn't actually 64 bit, clear
213# HAIKU_HOST_USE_32BIT.
214# Afterwards HOST_PLATFORM_IS_64_BIT will indicate whether the architecture is
215# effectively (i.e. when using the compiler/linker flags) 64 bit and
216# HAIKU_HOST_USE_32BIT will be set, iff the architecture is really 64 bit and
217# 32 bit mode was requested.
218if $(HAIKU_HOST_USE_32BIT) = 1 {
219	if $(HOST_PLATFORM_IS_64_BIT) {
220		# enable GCC -m32 option
221		HOST_GCC_BASE_FLAGS = -m32 ;
222		HOST_PLATFORM_IS_64_BIT = ;
223	} else {
224		HAIKU_HOST_USE_32BIT = 0 ;
225	}
226}
227
228
229# save jam's variables for the build platform
230HOST_AR				?= $(AR) ;
231HOST_CC				?= $(CC) ;
232HOST_C++			?= $(C++) ;
233HOST_LINK			?= $(LINK) ;
234HOST_RANLIB			?= $(RANLIB) ;
235HOST_CPPFLAGS		?= $(CPPFLAGS) ;
236HOST_CCFLAGS		?= $(HOST_GCC_BASE_FLAGS) $(CCFLAGS) ;
237HOST_C++FLAGS		?= $(HOST_GCC_BASE_FLAGS) $(C++FLAGS) ;
238HOST_LDFLAGS		?= $(LDFLAGS) ;
239HOST_LINKFLAGS		?= $(HOST_GCC_BASE_FLAGS) $(LINKFLAGS) ;
240HOST_DEFINES		?= $(DEFINES) ;
241HOST_HDRS			?= $(HDRS) ;
242
243
244# split up HOST_AR into the command name and flags
245HOST_AR				= [ Match "([^ ]*) *(.*)" : $(HOST_AR[1]) ]
246					  $(HOST_AR[2-]) ;
247HOST_ARFLAGS		= $(HOST_AR[2-]) ;
248HOST_AR				= $(HOST_AR[1]) ;
249HOST_UNARFLAGS		?= x ;
250
251# check the host platform compatibility
252SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
253	: linux openbsd freebsd darwin sunos cygwin ;
254HOST_PLATFORM_(host)_COMPATIBLE = 1 ;
255
256if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
257	|| $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin
258	|| $(HOST_PLATFORM) = sunos || $(HOST_PLATFORM) = openbsd {
259	# don't use lex: otherwise rc will not work correctly
260	if $(LEX) = lex {
261		LEX = flex ;
262	}
263}
264
265if $(HOST_PLATFORM) = cygwin {
266	HOST_LINKFLAGS += -Xlinker --allow-multiple-definition -Xlinker
267		--enable-auto-import ;
268}
269
270HOST_CPU ?= $(OSPLAT:L) ;
271
272# Jam doesn't know x86_64, so override HOST_CPU, if 64 bit.
273if $(HOST_CPU) = x86 && $(HOST_PLATFORM_IS_64_BIT) {
274	HOST_CPU = x86_64 ;
275}
276
277HOST_ARCH ?= $(HOST_CPU) ;
278HOST_ARCHS = $(HOST_ARCH) ;
279HOST_KERNEL_ARCH = host ;
280
281# analyze GCC version
282HOST_GCC_VERSION = [ FAnalyzeGCCVersion HOST_GCC_RAW_VERSION ] ;
283
284# set packaging architecture
285HOST_PACKAGING_ARCH		?= $(HOST_CPU) ;
286if $(HOST_PACKAGING_ARCH) = x86 && $(HOST_GCC_VERSION[1]) = 2 {
287	HOST_PACKAGING_ARCH = x86_gcc2 ;
288}
289HOST_PACKAGING_ARCHS = $(HOST_PACKAGING_ARCH) ;
290
291# directories
292HOST_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) ] ;
293HOST_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) common ] ;
294HOST_ARCH_OBJECT_DIR
295	= [ FDirName $(HOST_OBJECT_BASE_DIR) $(HOST_PACKAGING_ARCH) ] ;
296HOST_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) common ] ;
297HOST_DEBUG_0_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) release ] ;
298
299local level ;
300for level in $(HAIKU_DEBUG_LEVELS[2-]) {
301	HOST_DEBUG_$(level)_OBJECT_DIR
302		= [ FDirName $(HOST_ARCH_OBJECT_DIR) debug_$(level) ] ;
303}
304
305# set variables for gcc header options
306SetIncludePropertiesVariables HOST ;
307
308# assembler flags
309HOST_ASFLAGS = ;
310
311# C/C++ flags
312HOST_CCFLAGS += -Wno-multichar ;
313HOST_C++FLAGS += -Wno-multichar ;
314
315if $(HOST_PLATFORM) != cygwin {
316	HOST_PIC_CCFLAGS += -fPIC ;
317	HOST_PIC_C++FLAGS += -fPIC ;
318}
319
320if $(HOST_GCC_VERSION[1]) >= 3 {
321	HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
322}
323
324HOST_KERNEL_CCFLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
325	-D_KERNEL_MODE ;
326HOST_KERNEL_C++FLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
327	-fno-exceptions -D_KERNEL_MODE ;
328HOST_KERNEL_DEFINES += _KERNEL_MODE ;
329
330HOST_KERNEL_PIC_CCFLAGS = -fno-pic ;
331HOST_KERNEL_PIC_LINKFLAGS = ;
332if $(HOST_ARCH) = ppc {
333	# Build a position independent PPC kernel. We need to be able to relocate
334	# the kernel, since the virtual address space layout at boot time is not
335	# fixed.
336	HOST_KERNEL_PIC_CCFLAGS = -fPIE ;
337	HOST_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
338}
339if $(HOST_ARCH) = m68k {
340	# Build a position independent M68K kernel. We need to be able to relocate
341	# the kernel, since the virtual address space layout at boot time is not
342	# fixed.
343	HOST_KERNEL_PIC_CCFLAGS = $(HAIKU_KERNEL_PIC_CCFLAGS) ;
344	HOST_KERNEL_PIC_LINKFLAGS = $(HAIKU_KERNEL_PIC_LINKFLAGS) ;
345}
346
347if $(HOST_PLATFORM) != darwin {
348	# fix for new changes to DSO linking policies
349	HOST_LINKFLAGS += -Xlinker --no-as-needed ;
350}
351
352
353# warning flags
354HOST_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes -Wpointer-arith
355	-Wcast-align -Wsign-compare ;
356HOST_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy
357	-Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare ;
358
359HOST_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes ;
360HOST_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs ;
361
362HOST_WERROR_FLAGS = ;
363
364# debug flags
365local hostDebugFlags ;
366switch $(HOST_PLATFORM) {
367	case haiku		: hostDebugFlags ?= -ggdb ;
368	case haiku_host	: hostDebugFlags ?= -ggdb ;
369	case linux		: hostDebugFlags ?= -ggdb ;
370	case freebsd	: hostDebugFlags ?= -ggdb ;
371	case darwin		: hostDebugFlags ?= -ggdb ;
372	case *			: hostDebugFlags ?= -g ;
373}
374
375# debug 0: suppress asserts
376HOST_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
377HOST_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
378
379HOST_KERNEL_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
380HOST_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
381
382local level ;
383for level in $(HAIKU_DEBUG_LEVELS[2-]) {
384	local flags = $(hostDebugFlags) [ FDefines DEBUG=$(level) ] ;
385	HOST_DEBUG_$(level)_CCFLAGS			= $(flags) ;
386	HOST_DEBUG_$(level)_C++FLAGS		= $(flags) ;
387	HOST_KERNEL_DEBUG_$(level)_CCFLAGS	= $(flags) ;
388	HOST_KERNEL_DEBUG_$(level)_C++FLAGS	= $(flags) ;
389}
390
391# ld flags
392if $(HAIKU_HOST_USE_32BIT) = 1 {
393	HOST_LDFLAGS += -melf_i386 ;
394}
395
396# private kernel headers do be used when compiling kernel code
397HOST_PRIVATE_KERNEL_HEADERS = ;
398
399# private shared kernel/libroot headers
400HOST_PRIVATE_SYSTEM_HEADERS = ;
401
402# under BeOS use copyattr instead of cp
403if $(HOST_PLATFORM_BEOS_COMPATIBLE)
404{
405	CP = copyattr --data ;
406}
407
408HOST_DEFINES += ARCH_$(HOST_CPU) ;
409HOST_DEFINES += _NO_INLINE_ASM ;
410
411# for builds of tools in the current environment
412HOST_BUILD_COMPATIBILITY_LIB_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) lib ] ;
413
414# For the generic attributes emulation: Target rm_attrs -- rm replacement that
415# also removes the attributes.
416HOST_RM_ATTRS_TARGET = ;
417
418if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
419	# the C++ standard and support libraries
420	if $(HOST_GCC_VERSION[1]) < 3 {
421		HOST_LIBSTDC++ = stdc++.r4 ;
422		HOST_LIBSUPC++ = ;
423	} else {
424		HOST_LIBSTDC++ = stdc++ ;
425		HOST_LIBSUPC++ = supc++ ;
426	}
427
428	HOST_LIBROOT = root ;
429	HOST_STATIC_LIBROOT = $(HOST_LIBROOT) ;
430	HOST_LIBBE = libbe_build.so ;
431	HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
432		= "export LIBRARY_PATH=$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
433	HOST_PTHREAD_LINKFLAGS = ;
434	HOST_LIBRARY_NAME_MAP_input_server = /system/servers/input_server ;
435	HOST_DEFINES += __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS ;
436
437	local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
438		HaikuBuildCompatibility.h ] ;
439	HOST_CCFLAGS += $(compatibilityHeader) ;
440	HOST_C++FLAGS += $(compatibilityHeader) ;
441
442	# compatibility library
443	HOST_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
444} else {
445	HOST_LINKFLAGS += -lm ;
446	HOST_LIBSTDC++ = stdc++ ;
447	HOST_LIBROOT = libroot_build_function_remapper.a libroot_build.so ;
448	HOST_STATIC_LIBROOT = libroot_build_function_remapper.a libroot_build.a ;
449	HOST_LIBBE = libbe_build.so ;
450	if $(HOST_PLATFORM) = cygwin {
451		HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
452			= "export PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
453	} else if $(HOST_PLATFORM) = darwin {
454		HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
455			= "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
456	} else {
457		HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
458			= "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
459	}
460
461	if $(HOST_PLATFORM) = cygwin {
462		# not needed
463		HOST_PTHREAD_LINKFLAGS = ;
464	} else if $(HOST_PLATFORM) = freebsd {
465		HOST_PTHREAD_LINKFLAGS = -pthread ;
466	} else {
467		HOST_PTHREAD_LINKFLAGS = -pthread ;
468	}
469
470	# the C++ support library
471	if $(HOST_GCC_VERSION[1]) < 3 {
472		HOST_LIBSUPC++ = ;
473	} else {
474		HOST_LIBSUPC++ = supc++ ;
475	}
476
477	if $(HOST_PLATFORM) = darwin {
478		# part of the C++ runtime lives in libstdc++ on Darwin
479		HOST_LIBSUPC++ = gcc_s.1 stdc++ ;
480		HOST_LIBSTDC++ = ;
481	} else if $(HOST_PLATFORM) = freebsd {
482		if $(HOST_CPU) = x86_64 {
483			# amd64 FreeBSD 8 doesn't come without a shared libsupc++, and the
484			# static one prevents us from building shared libraries. So we have
485			# to work around by using the shared libstdc++.
486			HOST_LIBSUPC++ = stdc++ ;
487			HOST_LIBSTDC++ = ;
488		}
489	}
490
491	# Unlike glibc FreeBSD's libc doesn't have built-in regex support.
492	if $(HOST_PLATFORM) = freebsd {
493		HOST_LIBROOT += /usr/lib/libgnuregex.so ;
494		HOST_STATIC_LIBROOT += /usr/lib/libgnuregex.so ;
495	} else if $(HOST_PLATFORM) = darwin {
496		HOST_LIBROOT += libgnuregex_build.a ;
497		HOST_STATIC_LIBROOT += libgnuregex_build.a ;
498	}
499
500	# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
501	# build platform we need to make sure, this is also defined.
502	if $(HOST_CPU) = x86 {
503		HOST_DEFINES += __INTEL__ ;
504	} else if $(HOST_CPU) = x86_64 {
505		HOST_DEFINES += __x86_64__ ;
506	} else if $(HOST_CPU) = ppc {
507		HOST_DEFINES += __POWERPC__ ;
508	} else if $(HOST_CPU) = m68k {
509		HOST_DEFINES += __M68K__ ;
510	}
511
512	# Supposing this is a glibc platform, let's try to get features like large
513	# file support, ISO C 99 definitions, etc. On some platforms we need to
514	# request 64 bit off_t support explicitely.
515	HOST_DEFINES += _GNU_SOURCE _FILE_OFFSET_BITS=64 __STDC_FORMAT_MACROS
516		__STDC_LIMIT_MACROS ;
517
518	# On Linux with xattr support we can use it for our attribute emulation,
519	# which is somewhat more robust.
520	if $(HAIKU_HOST_USE_XATTR) = 1 {
521		HOST_DEFINES += HAIKU_HOST_USE_XATTR ;
522	} else {
523		# Otherwise the generic attribute emulation is used, which uses a
524		# directory per file to store its attribute. We need to redefine RM so
525		# that the attributes are removed as well. We use a wrapper script,
526		# which invokes a build tool. If the build tool hasn't been built yet,
527		# the normal "rm" is used and the attributes are leaked (likely there
528		# aren't any yet).
529		RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";"
530			[ FDirName $(HAIKU_TOP) build scripts rm_attrs ]
531			[ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release
532				tools rm_attrs ] -f ;
533			# assumes that rm_attrs is built with debugging disabled
534		HOST_RM_ATTRS_TARGET = <build>rm_attrs ;
535
536		# If specified, use xattr support to tag files with unique IDs.
537		if $(HAIKU_HOST_USE_XATTR_REF) = 1 {
538			HOST_DEFINES += HAIKU_HOST_USE_XATTR_REF ;
539		}
540	}
541}
542
543# network libraries
544if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
545	HOST_NETWORK_LIBS = network ;
546	HOST_NETAPI_LIB = bnetapi ;
547	HOST_SELECT_UNAME_ETC_LIB = ;	# libroot
548} else if $(HOST_PLATFORM_BONE_COMPATIBLE) {
549	HOST_NETWORK_LIBS = socket bind ;
550	HOST_NETAPI_LIB = bnetapi ;
551	HOST_SELECT_UNAME_ETC_LIB = ;	# libroot
552} else if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
553	HOST_NETWORK_LIBS = net ;
554	HOST_NETAPI_LIB = netapi ;
555	HOST_SELECT_UNAME_ETC_LIB = net ;
556} else if $(HOST_PLATFORM) = "sunos" {
557	HOST_NETWORK_LIBS = xnet ;
558	HOST_NETAPI_LIB = ;
559	HOST_SELECT_UNAME_ETC_LIB = ;
560} else {
561	# Linux,...
562	HOST_NETWORK_LIBS = ;
563	HOST_NETAPI_LIB = ;
564	HOST_SELECT_UNAME_ETC_LIB = ;
565}
566
567# define the executable MIME type
568HOST_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
569
570if $(METROWERKS) {
571	# at least parts of Haiku still can be compiled with
572	# the Metrowerks compiler on BeOS/PPC
573	HOST_EXECUTABLE_MIME_TYPE = "application/x-be-executable" ;
574}
575
576# Be API compatibility
577HOST_BE_API_HEADERS = ;
578HOST_BE_API_CCFLAGS = ;
579HOST_BE_API_C++FLAGS = ;
580
581# Add directory with system headers we need when building something for the host
582# platform, e.g. containing missing POSIX/GNU headers.
583HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host $(HOST_PLATFORM) ] ;
584
585if $(HOST_PLATFORM) = freebsd {
586	# FreeBSD's gcc doesn't include /usr/local/* in its search paths,
587	# though that's where most things from ports wind up being installed.
588	HOST_HDRS += /usr/local/include ;
589	HOST_LINKFLAGS += -L/usr/local/lib ;
590}
591
592if $(HOST_PLATFORM) = darwin {
593	HOST_HDRS += [ FDirName $(HAIKU_TOP) src build libgnuregex ] ;
594}
595
596HOST_BE_API_HEADERS =
597	[ FDirName $(HAIKU_TOP) headers build ]
598	[ FDirName $(HAIKU_TOP) headers build os ]
599	[ FDirName $(HAIKU_TOP) headers build os add-ons registrar ]
600	[ FDirName $(HAIKU_TOP) headers build os app ]
601	[ FDirName $(HAIKU_TOP) headers build os drivers ]
602	[ FDirName $(HAIKU_TOP) headers build os kernel ]
603	[ FDirName $(HAIKU_TOP) headers build os interface ]
604	[ FDirName $(HAIKU_TOP) headers build os locale ]
605	[ FDirName $(HAIKU_TOP) headers build os storage ]
606	[ FDirName $(HAIKU_TOP) headers build os support ]
607	[ FDirName $(HAIKU_TOP) headers build private ]
608;
609if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
610	HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ;
611	HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ;
612}
613
614
615#pragma mark - target platform settings
616
617
618# check the target platform compatibility
619SetPlatformCompatibilityFlagVariables TARGET_PLATFORM : TARGET : target ;
620
621# check the compatibility between host and target platform
622if $(TARGET_PLATFORM) != haiku {
623	if ! $(HOST_PLATFORM_($(TARGET_PLATFORM))_COMPATIBLE) {
624		Exit ERROR: The host platform is not compatible with target platform
625			$(TARGET_PLATFORM). ;
626	}
627}
628
629# Set TARGET_* variables either from HAIKU_* or HOST_* depending on the
630# specified TARGET_PLATFORM. Some variables are package architecture dependent
631# and their name gets a respective suffix. A few variables exist both with and
632# without suffix. The latter is either equivalent to the variable with the
633# primary architecture suffix (e.g. TARGET_ARCH) or is (additionally) applicable
634# for all architectures (e.g. TARGET_DEFINES).
635
636local buildVars =
637	ARCH ARCHS KERNEL_ARCH PACKAGING_ARCH PACKAGING_ARCHS
638
639	DEFINES
640	KERNEL_DEFINES
641
642	KERNEL_CCFLAGS KERNEL_C++FLAGS
643	KERNEL_PIC_CCFLAGS KERNEL_PIC_LINKFLAGS KERNEL_ADDON_LINKFLAGS
644	BOOT_CCFLAGS BOOT_C++FLAGS BOOT_LINKFLAGS
645
646	KERNEL_WARNING_CCFLAGS KERNEL_WARNING_C++FLAGS
647
648	KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS
649	KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
650
651	PRIVATE_KERNEL_HEADERS
652
653	LIBSTDC++ LIBSUPC++
654
655	NETWORK_LIBS NETAPI_LIB SELECT_UNAME_ETC_LIB
656
657	EXECUTABLE_MIME_TYPE
658
659	OBJECT_BASE_DIR COMMON_ARCH_OBJECT_DIR
660	;
661
662local archDependentBuildVars =
663	ARCH CPU GCC_VERSION
664
665	AR CC C++ ELFEDIT LD OBJCOPY RANLIB STRIP
666
667	ARFLAGS ASFLAGS UNARFLAGS CPPFLAGS CCFLAGS C++FLAGS HDRS LDFLAGS
668	LINK LINKFLAGS
669
670	WARNING_CCFLAGS WARNING_C++FLAGS WERROR_FLAGS
671
672	DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
673
674	INCLUDES_SEPARATOR LOCAL_INCLUDES_OPTION SYSTEM_INCLUDES_OPTION
675
676	PRIVATE_SYSTEM_HEADERS
677
678	LIBSTDC++ LIBSUPC++
679
680	ARCH_OBJECT_DIR COMMON_DEBUG_OBJECT_DIR
681	DEBUG_$(HAIKU_DEBUG_LEVELS)_OBJECT_DIR
682	;
683
684if $(TARGET_PLATFORM) = haiku {
685	local var ;
686	for var in $(buildVars) {
687		TARGET_$(var) = $(HAIKU_$(var)) ;
688	}
689
690	for var in $(archDependentBuildVars)_$(TARGET_PACKAGING_ARCHS) {
691		TARGET_$(var) = $(HAIKU_$(var)) ;
692	}
693
694	TARGET_KERNEL_LIBGCC
695		= $(HAIKU_KERNEL_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
696	TARGET_KERNEL_LIBSUPC++
697		= $(HAIKU_KERNEL_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
698	TARGET_BOOT_LIBGCC
699		= $(HAIKU_BOOT_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
700	TARGET_BOOT_LIBSUPC++
701		= $(HAIKU_BOOT_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
702
703	TARGET_BOOT_PLATFORM		?= $(HAIKU_BOOT_PLATFORM) ;
704	TARGET_BOOT_BOARD			?= $(HAIKU_BOOT_BOARD) ;
705
706	local architecture ;
707	for architecture in $(TARGET_PACKAGING_ARCHS) {
708		TARGET_DEFINES_$(architecture) = $(HAIKU_DEFINES_$(architecture)) ;
709		TARGET_LIBRARY_NAME_MAP_$(architecture)
710			= HAIKU_LIBRARY_NAME_MAP_$(architecture) ;
711	}
712} else {
713	local var ;
714	for var in $(buildVars) {
715		TARGET_$(var) = $(HOST_$(var)) ;
716	}
717
718	for var in $(archDependentBuildVars) {
719		TARGET_$(var)_$(TARGET_PACKAGING_ARCH) = $(HOST_$(var)) ;
720	}
721
722	TARGET_KERNEL_LIBGCC		= ;
723	TARGET_KERNEL_LIBSUPC++		= ;
724	TARGET_BOOT_LIBGCC			= ;
725	TARGET_BOOT_LIBSUPC++		= ;
726
727	TARGET_BOOT_PLATFORM		= ;
728	TARGET_BOOT_BOARD			= ;
729
730	TARGET_DEFINES_$(TARGET_PACKAGING_ARCH) = ;
731		# all flags are in TARGET_DEFINES
732
733	TARGET_LIBRARY_NAME_MAP_$(TARGET_PACKAGING_ARCH) = HOST_LIBRARY_NAME_MAP ;
734}
735
736# define macro, for identifying the platform
737switch $(TARGET_PLATFORM) {
738	case r5			: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_BEOS ;
739	case bone		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_BONE ;
740	case dano		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_DANO ;
741	case haiku_host	: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_HAIKU ;
742	case haiku		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_HAIKU ;
743	case linux		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_LINUX ;
744	case freebsd	: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_FREEBSD ;
745	case darwin		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_DARWIN ;
746	case cygwin		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_CYGWIN ;
747	case sunos		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_SUNOS ;
748	case libbe_test	: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_LIBBE_TEST ;
749}
750
751# define macro, for identifying the host platform
752switch $(HOST_PLATFORM) {
753	case r5			: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_BEOS ;
754	case bone		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_BONE ;
755	case dano		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_DANO ;
756	case haiku_host	: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_HAIKU ;
757	case linux		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_LINUX ;
758	case freebsd	: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_FREEBSD ;
759	case darwin		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_DARWIN ;
760	case cygwin		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_CYGWIN ;
761	case sunos		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_SUNOS ;
762}
763
764# define host platform 64 bit macro
765if $(HOST_PLATFORM_IS_64_BIT) {
766	HOST_DEFINES += HAIKU_HOST_PLATFORM_64_BIT ;
767}
768
769# define Haiku packaging architecture macro for host build
770HOST_DEFINES += HAIKU_PACKAGING_ARCH=\\\"$(HAIKU_PACKAGING_ARCH)\\\" ;
771
772
773#pragma mark -
774
775# In case we build for a BeOS compatible platform, but not for Haiku, we
776# include the HaikuBuildCompatibility.h header and link against
777# libhaikucompat.a.
778
779if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) && $(TARGET_PLATFORM_BEOS_COMPATIBLE) {
780	# headers and flags
781	local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
782		HaikuBuildCompatibility.h ] ;
783	TARGET_CCFLAGS_$(TARGET_PACKAGING_ARCH) += $(compatibilityHeader) ;
784	TARGET_C++FLAGS_$(TARGET_PACKAGING_ARCH) += $(compatibilityHeader) ;
785
786	# compatibility library
787	TARGET_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
788}
789
790# special target libbe_test
791
792if $(TARGET_PLATFORM) = libbe_test {
793	# headers and flags
794	TARGET_HDRS_$(TARGET_PACKAGING_ARCH) +=
795		[ PublicHeaders $(DOT) app drivers game interface kernel locale storage
796			support ]
797		[ PrivateHeaders $(DOT) ] ;
798	TARGET_DEFINES += __HAIKU__ ;
799
800	TARGET_PRIVATE_SYSTEM_HEADERS_$(TARGET_PACKAGING_ARCH) =
801		[ PrivateHeaders $(DOT) system system/arch/$(TARGET_ARCH) ] ;
802
803	# directories
804	TARGET_OBJECT_BASE_DIR
805		= [ FDirName $(HAIKU_OBJECT_DIR) $(TARGET_PLATFORM) ] ;
806	TARGET_COMMON_ARCH_OBJECT_DIR
807		= [ FDirName $(TARGET_OBJECT_BASE_DIR) common ] ;
808	TARGET_ARCH_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)
809		= [ FDirName $(TARGET_OBJECT_BASE_DIR) $(TARGET_ARCH) ] ;
810	TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)
811		= [ FDirName $(TARGET_ARCH_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
812			common ] ;
813	TARGET_DEBUG_0_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)
814		= [ FDirName $(TARGET_ARCH_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
815			release ] ;
816
817	local level ;
818	for level in $(HAIKU_DEBUG_LEVELS[2-]) {
819		TARGET_DEBUG_$(level)_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)
820			= [ FDirName $(TARGET_ARCH_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
821				debug_$(level) ] ;
822	}
823
824	# library name map
825	TARGET_LIBRARY_NAME_MAP_$(TARGET_PACKAGING_ARCH) = LIBBE_LIBRARY_NAME_MAP ;
826	LIBBE_LIBRARY_NAME_MAP_be = libbe_test.so ;
827}
828
829
830#pragma mark - common stuff
831
832
833# start with a clean state
834CCFLAGS = ;
835C++FLAGS = ;
836DEFINES = ;
837
838# Set CC, C++, LINK to invalid values, so that we realize early, that we use
839# the wrong compiler.
840CC = bad-cc ;
841C++ = bad-c++ ;
842LINK = bad-link ;
843
844
845# Defaults for warnings, optimization, and debugging.
846#
847WARNINGS ?= 1 ;
848OPTIM ?= -O2 ;
849DEBUG ?= 0 ;
850
851
852# Set the defaults for PLATFORM and SUPPORTED_PLATFORMS. PLATFORM is only
853# overridden for targets to be built for the host platform. SUPPORTED_PLATFORMS
854# can be overridden by the author of a component.
855PLATFORM = $(TARGET_PLATFORM) ;
856SUPPORTED_PLATFORMS = haiku ;
857
858
859# Instructs the Library rule to not make its object files temporary.
860# This is needed as some objects are used in a static library and for an
861# executable.
862KEEPOBJS = true ;
863
864
865# Set permissions to how they should be on the image.
866EXEMODE		= 755 ;
867FILEMODE	= 644 ;
868SHELLMODE	= 755 ;
869
870
871# output directories
872# TODO: Review this.
873HAIKU_DOCUMENTATION_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) documentation ] ;
874HAIKU_DOCUMENTATION_OBJECT_DIR ?= [ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR)
875	documentation ] ;
876
877# TODO: Rethink test stuff.
878HAIKU_TEST_DIR			?= [ FDirName $(HAIKU_OUTPUT_DIR) tests
879	$(TARGET_PLATFORM) $(HAIKU_ARCH) ] ;
880HAIKU_APP_TEST_DIR		?= [ FDirName $(HAIKU_TEST_DIR) apps ] ;
881HAIKU_APP_TEST_LIB_DIR 	?= [ FDirName $(HAIKU_APP_TEST_DIR) lib ] ;
882HAIKU_TMP_DIR			?= [ FDirName $(HAIKU_OUTPUT_DIR) tmp ] ;
883
884local architecture ;
885for architecture in $(HAIKU_PACKAGING_ARCHS) {
886	local baseDir
887		= [ FDirName $(TARGET_OBJECT_BASE_DIR) $(architecture) packaging ] ;
888	HAIKU_PACKAGES_DIR_$(architecture) = [ FDirName $(baseDir) packages ] ;
889	HAIKU_PACKAGES_BUILD_DIR_$(architecture)
890		= [ FDirName $(baseDir) packages_build ] ;
891	HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)
892		= [ FDirName $(baseDir) repositories ] ;
893}
894
895
896HAIKU_PACKAGE_INFOS_DIR			= [ FDirName $(HAIKU_TOP) src data
897									package_infos ] ;
898
899TARGET_TEST_DIR				?= [ FDirName $(HAIKU_TEST_DIR)
900									$(TARGET_PLATFORM) ] ;
901TARGET_UNIT_TEST_DIR		?= [ FDirName $(TARGET_TEST_DIR) unittests ] ;
902TARGET_UNIT_TEST_LIB_DIR	?= [ FDirName $(TARGET_UNIT_TEST_DIR) lib ] ;
903
904# automatically setup the objects directory per subdirectory
905SUBDIRRULES += SetupObjectsDir ;
906
907# Add the standard (userland) warning flags variables to the ones restored in
908# every subdirectory. Thus we can easily meddle with them in subdirectories
909# with imported sources.
910AUTO_SET_UP_CONFIG_VARIABLES +=
911	HOST_WARNING_CCFLAGS HOST_WARNING_C++FLAGS
912	TARGET_WARNING_CCFLAGS_$(TARGET_PACKAGING_ARCHS)
913	TARGET_WARNING_C++FLAGS_$(TARGET_PACKAGING_ARCHS)
914	;
915
916# also add PLATFORM and SUPPORTED_PLATFORMS
917AUTO_SET_UP_CONFIG_VARIABLES += PLATFORM SUPPORTED_PLATFORMS ;
918
919
920# set up warnings
921local architecture ;
922for architecture in $(TARGET_PACKAGING_ARCHS) {
923	ArchitectureSetupWarnings $(architecture) ;
924}
925
926
927# set up architecture build features
928local architecture ;
929for architecture in $(TARGET_PACKAGING_ARCHS) {
930	InitArchitectureBuildFeatures $(architecture) ;
931}
932
933
934# The following directories cannot currently be compiled with DEBUG=1
935SetConfigVar DEBUG : HAIKU_TOP src add-ons disk_systems bfs : 0 : local ;
936SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio hda : 0 : local ;
937SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio ac97 auich : 0 : local ; # fails with gcc4 only
938SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio ac97 auvia : 0 : local ; # fails with gcc4 only
939SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio ac97 sis7018 : 0 : local ;
940SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems btrfs : 0 : local ;
941SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems ntfs libntfs : 0 : local ;
942SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems udf : 0 : local ;
943SetConfigVar DEBUG : HAIKU_TOP src add-ons media media-add-ons dvb : 0 : local ;
944SetConfigVar DEBUG : HAIKU_TOP src add-ons print drivers gutenprint : 0 : local ;
945SetConfigVar DEBUG : HAIKU_TOP src servers input : 0 : local ;
946SetConfigVar DEBUG : HAIKU_TOP src servers media_addon : 0 : local ;
947SetConfigVar DEBUG : HAIKU_TOP src system boot loader file_systems bfs : 0 : local ;
948