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