xref: /haiku/build/jam/BuildSetup (revision 4d978eea2f9530892046f3344341ed85c9e0b1cf)
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#pragma mark - container settings
15
16# Haiku image
17HAIKU_IMAGE_CONTAINER_NAME = haiku-image-container ;
18HAIKU_CONTAINER_GRIST on $(HAIKU_IMAGE_CONTAINER_NAME) = HaikuImage ;
19HAIKU_INCLUDE_IN_CONTAINER_VAR on $(HAIKU_IMAGE_CONTAINER_NAME)
20	= HAIKU_INCLUDE_IN_IMAGE ;
21HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_IMAGE_CONTAINER_NAME)
22	= HAIKU_IMAGE_INSTALL_TARGETS ;
23
24# network boot archive
25HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME = haiku-netboot-archive-container ;
26HAIKU_CONTAINER_GRIST on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
27	= NetBootArchive ;
28# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
29HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
30	= HAIKU_NET_BOOT_ARCHIVE_INSTALL_TARGETS ;
31
32# alternative gcc archive
33HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME
34	= haiku-alternative-gcc-archive-container ;
35HAIKU_CONTAINER_GRIST on $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
36	= AlternativeGCCArchive ;
37# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
38HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
39	= HAIKU_ALTERNATIVE_GCC_ARCHIVE_INSTALL_TARGETS ;
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 ;
48
49# boot CD image
50HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-cd-container ;
51HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) = CDBootImage ;
52# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
53HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME)
54	= HAIKU_CD_BOOT_IMAGE_INSTALL_TARGETS ;
55
56# boot CD for PPC image
57HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME = haiku-boot-cd-ppc-container ;
58HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME) = CDBootPPCImage ;
59# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
60HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME)
61	= HAIKU_CD_BOOT_PPC_IMAGE_INSTALL_TARGETS ;
62
63# Haiku image/install defaults
64HAIKU_DEFAULT_IMAGE_NAME = haiku.image ;
65HAIKU_DEFAULT_IMAGE_DIR = $(HAIKU_OUTPUT_DIR) ;
66HAIKU_DEFAULT_VMWARE_IMAGE_NAME = haiku.vmdk ;
67HAIKU_DEFAULT_INSTALL_DIR = /Haiku ;
68HAIKU_DEFAULT_IMAGE_SIZE ?= 220 ; # 220 MB
69HAIKU_DEFAULT_IMAGE_LABEL ?= Haiku ;
70
71# Haiku CD defaults
72HAIKU_DEFAULT_CD_NAME = haiku-cd.iso ;
73HAIKU_DEFAULT_CD_DIR = $(HAIKU_OUTPUT_DIR) ;
74HAIKU_DEFAULT_CD_LABEL = Haiku ;
75
76# Haiku Anyboot defaults
77HAIKU_DEFAULT_ANYBOOT_NAME = haiku-anyboot.image ;
78HAIKU_DEFAULT_ANYBOOT_DIR = $(HAIKU_OUTPUT_DIR) ;
79HAIKU_DEFAULT_ANYBOOT_LABEL ?= Haiku ;
80
81# analyze and optionally replace jam's target parameters
82ProcessCommandLineArguments ;
83
84
85# include libgccObjects
86{
87	local libgccObjects = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : libgccObjects ] ;
88
89	if ! $(libgccObjects) {
90		ECHO "No `libgccObjects' found in"
91			"$(HAIKU_BUILD_OUTPUT_DIR)!" ;
92		EXIT "Please run ./configure in the source tree's root directory"
93			"again!" ;
94	}
95
96	LOCATE on libgccObjects = $(HAIKU_BUILD_OUTPUT_DIR) ;
97
98	include libgccObjects ;
99}
100
101
102# supported debug levels
103HAIKU_DEBUG_LEVELS = 0 1 2 3 4 5 ;
104
105# BeOS, BONE, Dan0 compatible platforms
106HAIKU_BEOS_COMPATIBLE_PLATFORMS = haiku r5 bone dano haiku_host ;
107HAIKU_BONE_COMPATIBLE_PLATFORMS = haiku bone dano haiku_host ;
108HAIKU_DANO_COMPATIBLE_PLATFORMS = haiku dano haiku_host ;
109HAIKU_HAIKU_COMPATIBLE_PLATFORMS = haiku haiku_host ;
110
111# configuration header directories
112HAIKU_CONFIG_HEADERS = [ FDirName $(HAIKU_TOP) build user_config_headers ]
113	[ FDirName $(HAIKU_TOP) build config_headers ] ;
114
115
116#pragma mark -
117
118# haiku target platform settings
119
120# analyze GCC version
121HAIKU_GCC_VERSION = [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION ] ;
122
123# enable GCC -pipe option, if requested
124if $(HAIKU_USE_GCC_PIPE) = 1 {
125	HAIKU_GCC_BASE_FLAGS = -pipe ;
126}
127
128# disable strict aliasing on anything newer than gcc 2 as it may lead to
129# unexpected results. also disable the tree-vrp (value range propagation)
130# optimization for now as with the current gcc4 version we are using this
131# results in some broken code.
132# TODO: remove the -fno-strict-aliasing option when all code has been
133#		analyzed/fixed with regard to aliasing.
134# TODO: retest/remove the -fno-tree-vrp option as soon as we have updated our
135#		gcc4 compiler.
136if $(HAIKU_GCC_VERSION[1]) >= 3 {
137	HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
138}
139# TODO: With Haiku as the host platform, this does not appear to be set up
140# correctly, at least when compiling the libbe_test target platform. When
141# enabling the lines below, these flags suddenly appear as link flags passed
142# to ld as well.
143#if $(HOST_GCC_VERSION[1]) >= 3 {
144#	HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
145#}
146
147# override gcc 2.95.3's header directory -- strictly necessary only when using
148# the BeOS native compiler (since its headers are incompatible), but it doesn't
149# harm for the cross-compiler either.
150if $(HAIKU_GCC_VERSION[1]) = 2 {
151	HAIKU_GCC_HEADERS_DIR = [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ;
152}
153
154# the subdirectory into which the alternative GCC libraries are to be installed
155if $(HAIKU_GCC_VERSION[1]) = 2 {
156	HAIKU_ALTERNATIVE_GCC_LIB_SUBDIR = gcc2 ;
157} else {
158	HAIKU_ALTERNATIVE_GCC_LIB_SUBDIR = gcc4 ;
159}
160
161# initial state for flags etc.
162HAIKU_C++ ?= $(HAIKU_CC) ;
163HAIKU_LINK = $(HAIKU_CC) ;
164HAIKU_LINKFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
165
166HAIKU_HDRS = [ FStandardHeaders ] ;
167HAIKU_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
168HAIKU_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
169HAIKU_KERNEL_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
170HAIKU_KERNEL_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
171HAIKU_DEFINES = __HAIKU__ ;
172HAIKU_NO_WERROR ?= 0 ;
173
174# distro compatibility level defines
175HAIKU_DISTRO_COMPATIBILITY ?= "default" ;
176switch $(HAIKU_DISTRO_COMPATIBILITY) {
177	case official	: {
178		HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_OFFICIAL ;
179		HAIKU_INCLUDE_TRADEMARKS = "" ;
180	}
181	case compatible	: {
182		HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_COMPATIBLE ;
183		HAIKU_INCLUDE_TRADEMARKS = "" ;
184	}
185	case "default"	: {
186		HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_DEFAULT ;
187		HAIKU_INCLUDE_TRADEMARKS = ;
188	}
189	case *			: Exit "Invalid value for HAIKU_DISTRO_COMPATIBILITY:"
190						$(HAIKU_DISTRO_COMPATIBILITY) ;
191}
192
193# analyze the gcc machine spec to determine HAIKU_CPU
194switch $(HAIKU_GCC_MACHINE) {
195	case i?86-*		: HAIKU_CPU = x86 ;
196	case x86_64-*		: HAIKU_CPU = x86_64 ;
197	case powerpc-*	: HAIKU_CPU = ppc ;
198	case m68k-*		: HAIKU_CPU = m68k ;
199	case mipsel-*	: HAIKU_CPU = mipsel ;
200	case arm-*		: HAIKU_CPU = arm ;
201	case *			: Exit "Unsupported gcc target machine:"
202						$(HAIKU_GCC_MACHINE) ;
203}
204
205# determine the endianness of the host
206switch $(HOST_GCC_MACHINE) {
207	case amd64-*	: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
208	case i?86-*		: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
209	case powerpc-*	: HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
210	case x86_64-*	: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
211
212	# the following are rather unlikely as hosts ...
213	case arm-*		: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
214	case m68k-*		: HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
215	case mipsel-*	: HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
216	case *			: Exit "Unsupported gcc host machine:" $(HOST_GCC_MACHINE) ;
217}
218
219switch $(HAIKU_CPU) {
220	case ppc :
221	{
222		HAIKU_DEFINES += __POWERPC__ ;
223		HAIKU_BOOT_PLATFORM = openfirmware ;
224		HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
225		# offset in floppy image (>= sizeof(haiku_loader))
226		HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
227	}
228	case arm :
229	{
230		HAIKU_DEFINES += __ARM__ ;
231		HAIKU_BOOT_PLATFORM = u-boot ;
232		HAIKU_BOOT_BOARD ?= verdex ;
233		HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
234			# in kB (there is not really a floppy on the gumstix ;) )
235		# offset in floppy image (>= sizeof(haiku_loader))
236		HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
237		HAIKU_NO_WERROR = 1 ;
238			# we use #warning as placeholders for things to write...
239	}
240	case x86 :
241	{
242		HAIKU_DEFINES += __INTEL__ ;
243		HAIKU_BOOT_PLATFORM = bios_ia32 ;
244		HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
245		# offset in floppy image (>= sizeof(haiku_loader))
246		HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
247
248		# yasm is required for target arch x86
249		if ! $(HAIKU_YASM) {
250			Exit "HAIKU_YASM not set. Please re-run configure." ;
251		}
252	}
253	case x86_64 :
254	{
255		HAIKU_DEFINES += __x86_64__ ;
256		HAIKU_BOOT_PLATFORM = bios_ia32 ;
257		HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
258		# offset in floppy image (>= sizeof(haiku_loader))
259		HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
260
261		# yasm is required for target arch x86_64
262		if ! $(HAIKU_YASM) {
263			Exit "HAIKU_YASM not set. Please re-run configure." ;
264		}
265	}
266	case m68k :
267	{
268		HAIKU_DEFINES += __M68K__ ;
269		HAIKU_BOOT_PLATFORM = atari_m68k ;
270		HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
271		# offset in floppy image (>= sizeof(haiku_loader))
272		HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 150 ; # in kB
273		HAIKU_NO_WERROR = 1 ;
274			# we use #warning as placeholders for things to write...
275	}
276	case mipsel :
277	{
278		HAIKU_DEFINES += __MIPSEL__ ;
279		# RouterBOARD firmware (ELF image over TFTP)
280		HAIKU_BOOT_PLATFORM = routerboard_mipsel ;
281		# offset in floppy image (>= sizeof(haiku_loader))
282		HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB
283		HAIKU_NO_WERROR = 1 ;
284			# we use #warning as placeholders for things to write...
285	}
286	case * :
287		Exit "Currently unsupported target CPU:" $(HAIKU_CPU) ;
288}
289HAIKU_ARCH ?= $(HAIKU_CPU) ;
290HAIKU_ARCH_MACRO_DEFINE = ARCH_$(HAIKU_ARCH) ;
291HAIKU_DEFINES += $(HAIKU_ARCH_MACRO_DEFINE) ;
292HAIKU_DEFINES += BOOT_ARCHIVE_IMAGE_OFFSET=$(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ;
293HAIKU_ATA_STACK ?= 1 ;
294
295# directories
296HAIKU_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) haiku ] ;
297HAIKU_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) common ] ;
298HAIKU_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) $(HAIKU_ARCH) ] ;
299HAIKU_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) common ] ;
300HAIKU_DEBUG_0_OBJECT_DIR = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) release ] ;
301
302local level ;
303for level in $(HAIKU_DEBUG_LEVELS[2-]) {
304	HAIKU_DEBUG_$(level)_OBJECT_DIR
305		= [ FDirName $(HAIKU_ARCH_OBJECT_DIR) debug_$(level) ] ;
306}
307
308# set variables for gcc header options
309SetIncludePropertiesVariables HAIKU ;
310
311# assembler flags
312HAIKU_ASFLAGS = ;
313
314# C/C++ flags
315HAIKU_KERNEL_CCFLAGS += -finline -fno-builtin ;
316HAIKU_KERNEL_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
317HAIKU_KERNEL_DEFINES += _KERNEL_MODE ;
318
319if $(HAIKU_GCC_VERSION[1]) >= 3 {
320	HAIKU_KERNEL_C++FLAGS += -fno-use-cxa-atexit ;
321}
322
323if $(HAIKU_GCC_VERSION[1]) >= 4 {
324	HAIKU_C++FLAGS += -Wno-deprecated ;
325
326	if $(HAIKU_GCC_VERSION[2]) >= 3 {
327		HAIKU_KERNEL_CCFLAGS += -ffreestanding ;
328		HAIKU_KERNEL_C++FLAGS += -ffreestanding ;
329	}
330}
331
332HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ;
333HAIKU_KERNEL_PIC_LINKFLAGS = ;
334
335switch $(HAIKU_ARCH) {
336	case ppc :
337	{
338		# Build a position independent PPC kernel. We need to be able to
339		# relocate the kernel, since the virtual address space layout at boot
340		# time is not fixed.
341		HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
342		HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
343	}
344
345	case m68k :
346	{
347		# We don't want to have to handle emulating missing FPU opcodes for 040
348		# and 060 in the kernel.
349		HAIKU_KERNEL_CCFLAGS += -m68020-60 ;
350		HAIKU_KERNEL_C++FLAGS += -m68020-60 ;
351	}
352	case x86 :
353	{
354		HAIKU_CCFLAGS += -march=pentium ;
355		HAIKU_C++FLAGS += -march=pentium ;
356		HAIKU_KERNEL_CCFLAGS += -march=pentium ;
357		HAIKU_KERNEL_C++FLAGS += -march=pentium ;
358
359		# Enable use of the gcc built-in atomic functions instead of atomic_*().
360		# The former are inlined and have thus less overhead. They are not
361		# available with gcc 2, but the header will take care of that.
362		HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
363	}
364	case x86_64 :
365	{
366		# Enable use of the gcc built-in atomic functions instead of atomic_*().
367		# The former are inlined and have thus less overhead.
368		HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
369	}
370}
371
372# If the environment variable HAIKU_INCLUDE_PATENTED_CODE is defined, we
373# define an equally named macro to the variable value. Some components use the
374# macro to allow compilation of code known to implemented patented ideas and/or
375# techniques, for example the Freetype bytecode hinter or sub-pixel rendering
376# as well as some problematic media codecs.
377if $(HAIKU_INCLUDE_PATENTED_CODE) {
378	HAIKU_DEFINES
379		+= HAIKU_INCLUDE_PATENTED_CODE=$(HAIKU_INCLUDE_PATENTED_CODE) ;
380}
381
382# warning flags
383HAIKU_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
384	-Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar ;
385HAIKU_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy
386	-Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare
387	-Wno-multichar ;
388
389HAIKU_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
390	-Wno-multichar ;
391HAIKU_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-multichar ;
392
393# debug flags
394HAIKU_DEBUG_FLAGS ?= -ggdb ;
395
396# debug 0: suppress asserts
397HAIKU_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
398HAIKU_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
399
400HAIKU_KERNEL_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
401HAIKU_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
402
403local level ;
404for level in $(HAIKU_DEBUG_LEVELS[2-]) {
405	local flags = $(HAIKU_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
406	HAIKU_DEBUG_$(level)_CCFLAGS			= $(flags) ;
407	HAIKU_DEBUG_$(level)_C++FLAGS			= $(flags) ;
408	HAIKU_KERNEL_DEBUG_$(level)_CCFLAGS		= $(flags) ;
409	HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS	= $(flags) ;
410}
411
412if $(HAIKU_GCC_VERSION[1]) >= 3 {
413	# TODO: Temporary work-around. Should be defined in the compiler specs
414	HAIKU_LINKFLAGS += -Xlinker --no-undefined ;
415} else {
416	HAIKU_DEFINES += _BEOS_R5_COMPATIBLE_ ;
417}
418
419# private shared kernel/libroot headers
420HAIKU_PRIVATE_SYSTEM_HEADERS =
421	[ PrivateHeaders $(DOT) system system/arch/$(HAIKU_ARCH) ]
422;
423
424# private kernel headers to be used when compiling kernel code
425HAIKU_PRIVATE_KERNEL_HEADERS =
426	[ PrivateHeaders $(DOT) kernel libroot shared
427		kernel/boot/platform/$(HAIKU_BOOT_PLATFORM) ]
428	[ ArchHeaders $(HAIKU_ARCH) ]
429	[ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR) system kernel ]
430	$(HAIKU_PRIVATE_SYSTEM_HEADERS)
431;
432
433# Add some grist to the libgcc objects
434HAIKU_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS:G=libgcc) ;
435
436# the C++ standard library
437HAIKU_BUILD_SHARED_LIBSTDC++ = ;
438if $(HAIKU_SHARED_LIBSTDC++) {
439	HAIKU_LIBSTDC++ = $(HAIKU_SHARED_LIBSTDC++) ;
440} else {
441	# no shared library available with the compiler -- build it
442	if $(HAIKU_GCC_VERSION[1]) = 2 {
443		HAIKU_LIBSTDC++ = libstdc++.r4.so ;
444	} else {
445		HAIKU_LIBSTDC++ = libstdc++.so ;
446	}
447	HAIKU_SHARED_LIBSTDC++ = $(HAIKU_LIBSTDC++) ;
448	HAIKU_BUILD_SHARED_LIBSTDC++ = 1 ;
449}
450
451# the C++ support (runtime) library
452HAIKU_BUILD_SHARED_LIBSUPC++ = ;
453if $(HAIKU_SHARED_LIBSUPC++) {
454	HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
455} else {
456	# no shared library available with the compiler -- build it for gcc 4
457	if $(HAIKU_GCC_VERSION[1]) != 2 {
458		HAIKU_SHARED_LIBSUPC++ = libsupc++.so ;
459		HAIKU_BUILD_SHARED_LIBSUPC++ = 1 ;
460	}
461
462	HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
463}
464
465
466# network libraries
467HAIKU_NETWORK_LIBS = network ;
468HAIKU_NETAPI_LIB = bnetapi ;
469HAIKU_SELECT_UNAME_ETC_LIB = ;	# libroot, against which we link anyway
470
471
472# locale libraries
473HAIKU_LOCALE_LIBS = liblocale.so liblocalestub.a ;
474
475
476# library and executable glue code
477local commonGlueCode =
478	<src!system!glue>init_term_dyn.o
479	<src!system!glue!arch!$(HAIKU_ARCH)>crti.o
480	<src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
481;
482HAIKU_LIBRARY_BEGIN_GLUE_CODE =
483	<src!system!glue!arch!$(HAIKU_ARCH)>crti.o
484	crtbegin.o
485	<src!system!glue>init_term_dyn.o
486;
487HAIKU_LIBRARY_END_GLUE_CODE =
488	crtend.o
489	<src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
490;
491HAIKU_EXECUTABLE_BEGIN_GLUE_CODE =
492	<src!system!glue!arch!$(HAIKU_ARCH)>crti.o
493	crtbegin.o
494	<src!system!glue>start_dyn.o
495	<src!system!glue>init_term_dyn.o
496;
497HAIKU_EXECUTABLE_END_GLUE_CODE = $(HAIKU_LIBRARY_END_GLUE_CODE) ;
498HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = crtbegin.o
499	<src!system!glue>haiku_version_glue.o ;
500HAIKU_KERNEL_ADDON_END_GLUE_CODE = $(HAIKU_GCC_LIBGCC) crtend.o ;
501
502SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
503
504HAIKU_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
505
506# TODO: The version stuff should probably go into a separate file and be made
507# available as macro, too.
508# Set our version number if not already set and mark it as a developer build
509if ! $(HAIKU_BUILD_VERSION) {
510	HAIKU_BUILD_VERSION ?= "1 0 0 a 1" ;
511	HAIKU_BUILD_DESCRIPTION ?= "Developer Build" ;
512}
513
514# If HAIKU_BUILD_VERSION is set, but HAIKU_BUILD_DESCRIPTION isn't, mark it as
515# an unknown build.
516HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
517
518# init library name map
519{
520	local i ;
521	for i in be bnetapi debug game GL locale mail media midi midi2 network
522			opengl root screensaver textencoding tracker translation z {
523		HAIKU_LIBRARY_NAME_MAP_$(i) = lib$(i).so ;
524	}
525	HAIKU_LIBRARY_NAME_MAP_libstdc++ = $(HAIKU_LIBSTDC++) ;
526	HAIKU_LIBRARY_NAME_MAP_libsupc++ = $(HAIKU_LIBSUPC++) ;
527	HAIKU_LIBRARY_NAME_MAP_input_server = <nogrist>input_server ;
528}
529
530
531#pragma mark -
532
533# host platform settings
534
535# analyze the host gcc machine spec to find out about 64-bitness
536HOST_PLATFORM_IS_64_BIT = ;
537if $(HAIKU_HOST_USE_32BIT) = 1 {
538	# enable GCC -m32 option
539	HOST_GCC_BASE_FLAGS = -m32 ;
540} else {
541	switch $(HOST_GCC_MACHINE) {
542		case amd64-* :				HOST_PLATFORM_IS_64_BIT = 1 ;
543		case i686-apple-darwin10 :	HOST_PLATFORM_IS_64_BIT = 1 ;
544		case x86_64-* :				HOST_PLATFORM_IS_64_BIT = 1 ;
545	}
546}
547
548
549# save jam's variables for the build platform
550HOST_AR				?= $(AR) ;
551HOST_CC				?= $(CC) ;
552HOST_C++			?= $(C++) ;
553HOST_LINK			?= $(LINK) ;
554HOST_RANLIB			?= $(RANLIB) ;
555HOST_CPPFLAGS		?= $(CPPFLAGS) ;
556HOST_CCFLAGS		?= $(HOST_GCC_BASE_FLAGS) $(CCFLAGS) ;
557HOST_C++FLAGS		?= $(HOST_GCC_BASE_FLAGS) $(C++FLAGS) ;
558HOST_LDFLAGS		?= $(HOST_GCC_BASE_FLAGS) $(LDFLAGS) ;
559HOST_LINKFLAGS		?= $(HOST_GCC_BASE_FLAGS) $(LINKFLAGS) ;
560HOST_DEFINES		?= $(DEFINES) ;
561HOST_HDRS			?= $(HDRS) ;
562
563
564# split up HOST_AR into the command name and flags
565HOST_AR				= [ Match "([^ ]*) *(.*)" : $(HOST_AR[1]) ]
566					  $(HOST_AR[2-]) ;
567HOST_ARFLAGS		= $(HOST_AR[2-]) ;
568HOST_AR				= $(HOST_AR[1]) ;
569HOST_UNARFLAGS		?= x ;
570
571# check the host platform compatibility
572SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
573	: linux openbsd freebsd darwin sunos cygwin ;
574
575if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
576	|| $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin
577	|| $(HOST_PLATFORM) = sunos || $(HOST_PLATFORM) = openbsd {
578	# don't use lex: otherwise rc will not work correctly
579	if $(LEX) = lex {
580		LEX = flex ;
581	}
582}
583
584if $(HOST_PLATFORM) = cygwin {
585	HOST_LINKFLAGS += -Xlinker --allow-multiple-definition -Xlinker
586		--enable-auto-import ;
587}
588
589HOST_CPU	?= $(OSPLAT:L) ;
590
591HOST_ARCH				?= $(HOST_CPU) ;
592HOST_ARCH_MACRO_DEFINE	= ARCH_$(HOST_CPU) ;
593
594
595# directories
596HOST_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) ] ;
597HOST_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) common ] ;
598HOST_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) $(HOST_ARCH) ] ;
599HOST_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) common ] ;
600HOST_DEBUG_0_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) release ] ;
601
602local level ;
603for level in $(HAIKU_DEBUG_LEVELS[2-]) {
604	HOST_DEBUG_$(level)_OBJECT_DIR
605		= [ FDirName $(HOST_ARCH_OBJECT_DIR) debug_$(level) ] ;
606}
607
608# analyze GCC version
609HOST_GCC_VERSION = [ FAnalyzeGCCVersion HOST_GCC_RAW_VERSION ] ;
610
611# set variables for gcc header options
612SetIncludePropertiesVariables HOST ;
613
614# assembler flags
615HOST_ASFLAGS = ;
616
617# C/C++ flags
618HOST_CCFLAGS += -Wno-multichar ;
619HOST_C++FLAGS += -Wno-multichar ;
620
621if $(HOST_PLATFORM) != cygwin {
622	HOST_PIC_CCFLAGS += -fPIC ;
623	HOST_PIC_C++FLAGS += -fPIC ;
624}
625
626HOST_KERNEL_CCFLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
627	-D_KERNEL_MODE ;
628HOST_KERNEL_C++FLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
629	-fno-exceptions -D_KERNEL_MODE ;
630HOST_KERNEL_DEFINES += _KERNEL_MODE ;
631
632HOST_KERNEL_PIC_CCFLAGS = -fno-pic ;
633HOST_KERNEL_PIC_LINKFLAGS = ;
634if $(HOST_ARCH) = ppc {
635	# Build a position independent PPC kernel. We need to be able to relocate
636	# the kernel, since the virtual address space layout at boot time is not
637	# fixed.
638	HOST_KERNEL_PIC_CCFLAGS = -fPIE ;
639	HOST_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
640}
641if $(HOST_ARCH) = m68k {
642	# Build a position independent M68K kernel. We need to be able to relocate
643	# the kernel, since the virtual address space layout at boot time is not
644	# fixed.
645	HOST_KERNEL_PIC_CCFLAGS = $(HAIKU_KERNEL_PIC_CCFLAGS) ;
646	HOST_KERNEL_PIC_LINKFLAGS = $(HAIKU_KERNEL_PIC_LINKFLAGS) ;
647}
648
649# warning flags
650HOST_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes -Wpointer-arith
651	-Wcast-align -Wsign-compare ;
652HOST_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy
653	-Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare ;
654
655HOST_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes ;
656HOST_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs ;
657
658# debug flags
659switch $(HOST_PLATFORM) {
660	case haiku	: HOST_DEBUG_FLAGS ?= -ggdb ;
661	case haiku_host	: HOST_DEBUG_FLAGS ?= -ggdb ;
662	case linux	: HOST_DEBUG_FLAGS ?= -ggdb ;
663	case freebsd	: HOST_DEBUG_FLAGS ?= -ggdb ;
664	case darwin	: HOST_DEBUG_FLAGS ?= -ggdb ;
665	case *		: HOST_DEBUG_FLAGS ?= -g ;
666}
667
668# debug 0: suppress asserts
669HOST_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
670HOST_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
671
672HOST_KERNEL_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
673HOST_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
674
675local level ;
676for level in $(HAIKU_DEBUG_LEVELS[2-]) {
677	local flags = $(HOST_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
678	HOST_DEBUG_$(level)_CCFLAGS			= $(flags) ;
679	HOST_DEBUG_$(level)_C++FLAGS		= $(flags) ;
680	HOST_KERNEL_DEBUG_$(level)_CCFLAGS	= $(flags) ;
681	HOST_KERNEL_DEBUG_$(level)_C++FLAGS	= $(flags) ;
682}
683
684# ld flags
685if $(HOST_ARCH) = x86 && $(HAIKU_HOST_USE_32BIT) = 1 {
686	HOST_LDFLAGS += -melf_i386 ;
687}
688
689# private kernel headers do be used when compiling kernel code
690HOST_PRIVATE_KERNEL_HEADERS = ;
691
692# private shared kernel/libroot headers
693HOST_PRIVATE_SYSTEM_HEADERS = ;
694
695# under BeOS use copyattr instead of cp
696if $(HOST_PLATFORM_BEOS_COMPATIBLE)
697{
698	CP = copyattr --data ;
699}
700
701HOST_DEFINES += $(HOST_ARCH_MACRO_DEFINE) ;
702HOST_DEFINES += _NO_INLINE_ASM ;
703
704if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
705	# TODO: That's obviously not correct, but in the way the COMPILE_FOR_R5
706	# macro is used, it actually seems to mean r5/bone/dano.
707	# TODO: Deprecated. Remove!
708	HOST_DEFINES += COMPILE_FOR_R5 ;
709}
710
711# for builds of tools in the current environment
712HOST_BUILD_COMPATIBILITY_LIB_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) lib ] ;
713
714# For the generic attributes emulation: Target rm_attrs -- rm replacement that
715# also removes the attributes.
716HOST_RM_ATTRS_TARGET = ;
717
718if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
719	# the C++ standard and support libraries
720	if $(HOST_GCC_VERSION[1]) < 3 {
721		HOST_LIBSTDC++ = stdc++.r4 ;
722		HOST_LIBSUPC++ = ;
723	} else {
724		HOST_LIBSTDC++ = stdc++ ;
725		HOST_LIBSUPC++ = supc++ ;
726	}
727
728	HOST_LIBROOT = root ;
729	HOST_STATIC_LIBROOT = $(HOST_LIBROOT) ;
730	HOST_LIBBE = be ;
731	HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR = "export LIBRARY_PATH=$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)"  ;
732	HOST_LIBRARY_NAME_MAP_input_server = /system/servers/input_server ;
733	HOST_DEFINES += __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS ;
734
735	local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
736		HaikuBuildCompatibility.h ] ;
737	HOST_CCFLAGS += $(compatibilityHeader) ;
738	HOST_C++FLAGS += $(compatibilityHeader) ;
739
740	# compatibility library
741	HOST_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
742} else {
743	HOST_LIBSTDC++ = stdc++ ;
744	HOST_LIBROOT = libroot_build.so ;
745	HOST_STATIC_LIBROOT = libroot_build.a ;
746	HOST_LIBBE = libbe_build.so ;
747	if $(HOST_PLATFORM) = cygwin {
748		HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
749			= "export PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
750	} else if $(HOST_PLATFORM) = darwin {
751		HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
752			= "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
753	} else {
754		HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
755			= "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
756	}
757
758	# the C++ support library
759	if $(HOST_GCC_VERSION[1]) < 3 {
760		HOST_LIBSUPC++ = ;
761	} else {
762		HOST_LIBSUPC++ = supc++ ;
763	}
764
765	if $(HOST_PLATFORM) = darwin {
766		# part of the C++ runtime lives in libstdc++ on Darwin
767		HOST_LIBSUPC++ = gcc_s.1 stdc++ ;
768		HOST_LIBSTDC++ = ;
769	} else if $(HOST_PLATFORM) = freebsd {
770		if $(HOST_CPU) = x86 && $(HOST_PLATFORM_IS_64_BIT) = 1 {
771			# amd64 FreeBSD 8 doesn't come without a shared libsupc++, and the
772			# static one prevents us from building shared libraries. So we have
773			# to work around by using the shared libstdc++.
774			HOST_LIBSUPC++ = stdc++ ;
775			HOST_LIBSTDC++ = ;
776		}
777	}
778
779	# Unlike glibc FreeBSD's libc doesn't have built-in regex support.
780	if $(HOST_PLATFORM) = freebsd {
781		HOST_LIBROOT += /usr/lib/libgnuregex.so ;
782		HOST_STATIC_LIBROOT += /usr/lib/libgnuregex.so ;
783	} else if $(HOST_PLATFORM) = darwin {
784		HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
785		HOST_STATIC_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
786	}
787
788	# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
789	# build platform we need to make sure, this is also defined.
790	if $(HOST_CPU) = x86 {
791		HOST_DEFINES += __INTEL__ ;
792	} else if $(HOST_CPU) = ppc {
793		HOST_DEFINES += __POWERPC__ ;
794	} else if $(HOST_CPU) = m68k {
795		HOST_DEFINES += __M68K__ ;
796	} else if $(HOST_CPU) = mipsel {
797		HOST_DEFINES += __MIPSEL__ ;
798	}
799
800	# Supposing this is a glibc platform, let's try to get features like large
801	# file support, ISO C 99 definitions, etc. On some platforms we need to
802	# request 64 bit off_t support explicitely.
803	HOST_DEFINES += _GNU_SOURCE _FILE_OFFSET_BITS=64 __STDC_FORMAT_MACROS
804		__STDC_LIMIT_MACROS ;
805
806	# On Linux with xattr support we can use it for our attribute emulation,
807	# which is somewhat more robust.
808	if $(HAIKU_HOST_USE_XATTR) = 1 {
809		HOST_DEFINES += HAIKU_HOST_USE_XATTR ;
810	} else {
811		# Otherwise the generic attribute emulation is used, which uses a
812		# directory per file to store its attribute. We need to redefine RM so
813		# that the attributes are removed as well. We use a wrapper script,
814		# which invokes a build tool. If the build tool hasn't been built yet,
815		# the normal "rm" is used and the attributes are leaked (likely there
816		# aren't any yet).
817		RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";"
818			[ FDirName $(HAIKU_TOP) build scripts rm_attrs ]
819			[ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release
820				tools rm_attrs ] -f ;
821			# assumes that rm_attrs is built with debugging disabled
822		HOST_RM_ATTRS_TARGET = <build>rm_attrs ;
823	}
824}
825
826# network libraries
827if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
828	HOST_NETWORK_LIBS = network ;
829	HOST_NETAPI_LIB = bnetapi ;
830	HOST_SELECT_UNAME_ETC_LIB = ;	# libroot
831} else if $(HOST_PLATFORM_BONE_COMPATIBLE) {
832	HOST_NETWORK_LIBS = socket bind ;
833	HOST_NETAPI_LIB = bnetapi ;
834	HOST_SELECT_UNAME_ETC_LIB = ;	# libroot
835} else if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
836	HOST_NETWORK_LIBS = net ;
837	HOST_NETAPI_LIB = netapi ;
838	HOST_SELECT_UNAME_ETC_LIB = net ;
839} else if $(HOST_PLATFORM) = "sunos" {
840	HOST_NETWORK_LIBS = xnet ;
841	HOST_NETAPI_LIB = ;
842	HOST_SELECT_UNAME_ETC_LIB = ;
843} else {
844	# Linux,...
845	HOST_NETWORK_LIBS = ;
846	HOST_NETAPI_LIB = ;
847	HOST_SELECT_UNAME_ETC_LIB = ;
848}
849
850# define the executable MIME type
851HOST_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
852
853if $(METROWERKS) {
854	# at least parts of Haiku still can be compiled with
855	# the Metrowerks compiler on BeOS/PPC
856	HOST_EXECUTABLE_MIME_TYPE = "application/x-be-executable" ;
857}
858
859# Be API compatibility
860HOST_BE_API_HEADERS = ;
861HOST_BE_API_CCFLAGS = ;
862HOST_BE_API_C++FLAGS = ;
863
864if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
865	HOST_BE_API_HEADERS =
866		[ FDirName $(HAIKU_TOP) headers build ]
867		[ FDirName $(HAIKU_TOP) headers build os ]
868		[ FDirName $(HAIKU_TOP) headers build os app ]
869		[ FDirName $(HAIKU_TOP) headers build os drivers ]
870		[ FDirName $(HAIKU_TOP) headers build os kernel ]
871		[ FDirName $(HAIKU_TOP) headers build os interface ]
872		[ FDirName $(HAIKU_TOP) headers build os opengl ]
873		[ FDirName $(HAIKU_TOP) headers build os storage ]
874		[ FDirName $(HAIKU_TOP) headers build os support ]
875	;
876	HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ;
877	HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ;
878}
879
880# Add directory with system headers we need when building something for the host
881# platform, e.g. containing missing POSIX/GNU headers.
882HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host $(HOST_PLATFORM) ] ;
883
884# For all versions of BeOS also add the common beos directory.
885if $(HOST_PLATFORM) in r5 bone dano {
886	HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host beos_common ] ;
887}
888
889
890#pragma mark -
891
892# target platform settings
893
894# check the target platform compatibility
895SetPlatformCompatibilityFlagVariables TARGET_PLATFORM : TARGET : target ;
896
897# check the compatibility between host and target platform
898if $(TARGET_PLATFORM) != haiku {
899	if ! $(HOST_PLATFORM_($(TARGET_PLATFORM))_COMPATIBLE) {
900		Exit ERROR: The host platform is not compatible with target platform
901			$(TARGET_PLATFORM). ;
902	}
903}
904
905# Set TARGET_* variables either from HAIKU_* or HOST_* depending on the
906# specified TARGET_PLATFORM.
907
908local buildVars =
909	ARCH CPU GCC_VERSION
910
911	AR CC C++ LD OBJCOPY RANLIB
912
913	INCLUDES_SEPARATOR LOCAL_INCLUDES_OPTION SYSTEM_INCLUDES_OPTION
914
915	HDRS CPPFLAGS CCFLAGS C++FLAGS LDFLAGS LINK LINKFLAGS DEFINES
916	ARFLAGS UNARFLAGS
917	KERNEL_DEFINES
918
919	KERNEL_CCFLAGS KERNEL_C++FLAGS
920	KERNEL_PIC_CCFLAGS KERNEL_PIC_LINKFLAGS
921	WARNING_CCFLAGS WARNING_C++FLAGS
922
923	KERNEL_WARNING_CCFLAGS KERNEL_WARNING_C++FLAGS
924
925	DEBUG_FLAGS
926
927	DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
928
929	KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS
930	KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
931
932	PRIVATE_KERNEL_HEADERS
933	PRIVATE_SYSTEM_HEADERS
934
935	LIBSTDC++ LIBSUPC++
936	STATIC_LIBSTDC++ STATIC_LIBSUPC++
937
938	NETWORK_LIBS NETAPI_LIB SELECT_UNAME_ETC_LIB
939
940	ARCH_MACRO_DEFINE EXECUTABLE_MIME_TYPE
941
942	OBJECT_BASE_DIR COMMON_ARCH_OBJECT_DIR COMMON_DEBUG_OBJECT_DIR
943	DEBUG_$(HAIKU_DEBUG_LEVELS)_OBJECT_DIR
944;
945
946if $(TARGET_PLATFORM) = haiku {
947	local var ;
948	for var in $(buildVars) {
949		TARGET_$(var) = $(HAIKU_$(var)) ;
950	}
951
952	TARGET_GCC_LIB_DIR			= $(HAIKU_GCC_LIB_DIR) ;
953	TARGET_GCC_HEADERS_DIR		= $(HAIKU_GCC_HEADERS_DIR) ;
954	TARGET_GCC_LIBGCC			= $(HAIKU_GCC_LIBGCC) ;
955	TARGET_GCC_LIBGCC_OBJECTS	= $(HAIKU_GCC_LIBGCC_OBJECTS) ;
956
957	TARGET_BOOT_PLATFORM		?= $(HAIKU_BOOT_PLATFORM) ;
958	TARGET_BOOT_BOARD			?= $(HAIKU_BOOT_BOARD) ;
959
960	TARGET_LIBRARY_NAME_MAP		= HAIKU_LIBRARY_NAME_MAP ;
961
962} else {
963	local var ;
964	for var in $(buildVars) {
965		TARGET_$(var) = $(HOST_$(var)) ;
966	}
967
968	TARGET_GCC_LIB_DIR			= ;
969	TARGET_GCC_HEADERS_DIR		= ;
970	TARGET_GCC_LIBGCC			= ;
971	TARGET_GCC_LIBGCC_OBJECTS	= ;
972
973	TARGET_BOOT_PLATFORM		= ;
974	TARGET_BOOT_BOARD			= ;
975
976	TARGET_LIBRARY_NAME_MAP		= HOST_LIBRARY_NAME_MAP ;
977}
978
979# define macro, for identifying the platform
980switch $(TARGET_PLATFORM) {
981	case r5			: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_BEOS ;
982	case bone		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_BONE ;
983	case dano		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_DANO ;
984	case haiku_host	: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_HAIKU ;
985	case haiku		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_HAIKU ;
986	case linux		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_LINUX ;
987	case freebsd	: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_FREEBSD ;
988	case darwin		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_DARWIN ;
989	case cygwin		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_CYGWIN ;
990	case sunos		: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_SUNOS ;
991	case libbe_test	: TARGET_DEFINES	+= HAIKU_TARGET_PLATFORM_LIBBE_TEST ;
992}
993
994# define macro, for identifying the host platform
995switch $(HOST_PLATFORM) {
996	case r5			: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_BEOS ;
997	case bone		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_BONE ;
998	case dano		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_DANO ;
999	case haiku_host	: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_HAIKU ;
1000	case linux		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_LINUX ;
1001	case freebsd	: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_FREEBSD ;
1002	case darwin		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_DARWIN ;
1003	case cygwin		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_CYGWIN ;
1004	case sunos		: HOST_DEFINES	+= HAIKU_HOST_PLATFORM_SUNOS ;
1005}
1006
1007# define host platform 64 bit macro
1008if $(HOST_PLATFORM_IS_64_BIT) {
1009	HOST_DEFINES += HAIKU_HOST_PLATFORM_64_BIT ;
1010}
1011
1012#pragma mark -
1013
1014# In case we build for a BeOS compatible platform, but not for Haiku, we
1015# include the HaikuBuildCompatibility.h header and link against
1016# libhaikucompat.a.
1017
1018if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) && $(TARGET_PLATFORM_BEOS_COMPATIBLE) {
1019	# headers and flags
1020	local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
1021		HaikuBuildCompatibility.h ] ;
1022	TARGET_CCFLAGS += $(compatibilityHeader) ;
1023	TARGET_C++FLAGS += $(compatibilityHeader) ;
1024
1025	# compatibility library
1026	TARGET_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
1027}
1028
1029# special target libbe_test
1030
1031if $(TARGET_PLATFORM) = libbe_test {
1032	# headers and flags
1033	TARGET_HDRS +=
1034		[ PublicHeaders $(DOT) app drivers game interface kernel storage
1035			support ]
1036		[ PrivateHeaders $(DOT) ] ;
1037	TARGET_DEFINES += __HAIKU__ ;
1038
1039	TARGET_PRIVATE_SYSTEM_HEADERS =
1040		[ PrivateHeaders $(DOT) system system/arch/$(TARGET_ARCH) ] ;
1041
1042	# directories
1043	TARGET_OBJECT_BASE_DIR
1044		= [ FDirName $(HAIKU_OBJECT_DIR) $(TARGET_PLATFORM) ] ;
1045	TARGET_COMMON_ARCH_OBJECT_DIR
1046		= [ FDirName $(TARGET_OBJECT_BASE_DIR) common ] ;
1047	TARGET_ARCH_OBJECT_DIR
1048		= [ FDirName $(TARGET_OBJECT_BASE_DIR) $(TARGET_ARCH) ] ;
1049	TARGET_COMMON_DEBUG_OBJECT_DIR
1050		= [ FDirName $(TARGET_ARCH_OBJECT_DIR) common ] ;
1051	TARGET_DEBUG_0_OBJECT_DIR
1052		= [ FDirName $(TARGET_ARCH_OBJECT_DIR) release ] ;
1053
1054	local level ;
1055	for level in $(HAIKU_DEBUG_LEVELS[2-]) {
1056		TARGET_DEBUG_$(level)_OBJECT_DIR
1057			= [ FDirName $(TARGET_ARCH_OBJECT_DIR) debug_$(level) ] ;
1058	}
1059
1060	# library name map
1061	TARGET_LIBRARY_NAME_MAP = LIBBE_LIBRARY_NAME_MAP ;
1062	LIBBE_LIBRARY_NAME_MAP_be = libbe_test.so ;
1063}
1064
1065
1066#pragma mark -
1067
1068# common stuff
1069
1070# start with a clean state
1071CCFLAGS = ;
1072C++FLAGS = ;
1073DEFINES = ;
1074
1075# Set CC, C++, LINK to invalid values, so that we realize early, that we use
1076# the wrong compiler.
1077CC = bad-cc ;
1078C++ = bad-c++ ;
1079LINK = bad-link ;
1080
1081# Allow compiling unit tests on Zeta. Instead of fixing the PostMessage()
1082# issues, they deprecated that nice function. This will enable it again:
1083C++FLAGS += -D_ZETA_USING_DEPRECATED_API_=1 ;
1084# Same for buggy find_directory threadsafety fixes
1085C++FLAGS += -D_ZETA_TS_FIND_DIR_=1 ;
1086	# TODO: Doesn't really belong here.
1087
1088
1089# Defaults for warnings, optimization, and debugging.
1090#
1091WARNINGS ?= 1 ;
1092OPTIM ?= -O2 ;
1093DEBUG ?= 0 ;
1094
1095
1096# Set the defaults for PLATFORM and SUPPORTED_PLATFORMS. PLATFORM is only
1097# overridden for targets to be built for the host platform. SUPPORTED_PLATFORMS
1098# can be overridden by the author of a component.
1099PLATFORM = $(TARGET_PLATFORM) ;
1100SUPPORTED_PLATFORMS = haiku ;
1101
1102
1103# Instructs the Library rule to not make its object files temporary.
1104# This is needed as some objects are used in a static library and for an
1105# executable.
1106KEEPOBJS = true ;
1107
1108
1109# Set permissions to how they should be on the image.
1110EXEMODE		= 755 ;
1111FILEMODE	= 644 ;
1112SHELLMODE	= 755 ;
1113
1114
1115# output directories
1116# TODO: Review this.
1117HAIKU_DOCUMENTATION_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) documentation ] ;
1118HAIKU_DOCUMENTATION_OBJECT_DIR ?= [ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR)
1119	documentation ] ;
1120
1121# TODO: Rethink test stuff.
1122HAIKU_TEST_DIR			?= [ FDirName $(HAIKU_OUTPUT_DIR) tests
1123	$(TARGET_PLATFORM) $(HAIKU_ARCH) ] ;
1124HAIKU_APP_TEST_DIR		?= [ FDirName $(HAIKU_TEST_DIR) apps ] ;
1125HAIKU_APP_TEST_LIB_DIR 	?= [ FDirName $(HAIKU_APP_TEST_DIR) lib ] ;
1126HAIKU_TMP_DIR			?= [ FDirName $(HAIKU_OUTPUT_DIR) tmp ] ;
1127
1128HAIKU_PACKAGE_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) packages ] ;
1129HAIKU_PACKAGE_OBJECT_DIR ?= [ FDirName $(HAIKU_OBJECT_DIR) packages ] ;
1130
1131TARGET_TEST_DIR				?= [ FDirName $(HAIKU_TEST_DIR)
1132									$(TARGET_PLATFORM) ] ;
1133TARGET_UNIT_TEST_DIR		?= [ FDirName $(TARGET_TEST_DIR) unittests ] ;
1134TARGET_UNIT_TEST_LIB_DIR	?= [ FDirName $(TARGET_UNIT_TEST_DIR) lib ] ;
1135
1136# automatically setup the objects directory per subdirectory
1137SUBDIRRULES += SetupObjectsDir ;
1138
1139# Add the standard (userland) warning flags variables to the ones restored in
1140# every subdirectory. Thus we can easily meddle with them in subdirectories
1141# with imported sources.
1142AUTO_SET_UP_CONFIG_VARIABLES +=
1143	HOST_WARNING_CCFLAGS HOST_WARNING_C++FLAGS
1144	TARGET_WARNING_CCFLAGS TARGET_WARNING_C++FLAGS
1145
1146	# also add PLATFORM and SUPPORTED_PLATFORMS
1147	PLATFORM SUPPORTED_PLATFORMS
1148;
1149
1150
1151# enable -Werror for certain parts of the source tree
1152
1153if $(HAIKU_GCC_VERSION[1]) = 2 {
1154	rule EnableWerror dirTokens : scope {
1155		AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens) : -Werror
1156			: $(scope) ;
1157		AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens) : -Werror
1158			: $(scope) ;
1159	}
1160} else {
1161	# -Wuninitialized gives too many false positives.
1162	rule EnableWerror dirTokens : scope {
1163		AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens)
1164			: -Werror -Wno-error=uninitialized : $(scope) ;
1165		AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens)
1166			: -Werror -Wno-error=uninitialized : $(scope) ;
1167	}
1168}
1169
1170# Work-around for GCC 2 problem -- despite -Wno-multichar it reports
1171# multichar warnings in headers/private/kernel/debugger_keymaps.h included by
1172# src/system/kernel/arch/x86/arch_debug_console.cpp.
1173if $(HAIKU_GCC_VERSION[1]) = 2 {
1174	local file = <src!system!kernel!arch!x86>arch_debug_console.o ;
1175	C++FLAGS on $(file) = [ on $(file) return $(C++FLAGS) ] ;
1176}
1177
1178if $(HAIKU_NO_WERROR) != 1 {
1179	EnableWerror src add-ons accelerants 3dfx ;
1180	EnableWerror src add-ons accelerants ati ;
1181	EnableWerror src add-ons accelerants common ;
1182	EnableWerror src add-ons accelerants et6x00 ;
1183#	EnableWerror src add-ons accelerants intel_extreme ;
1184#	EnableWerror src add-ons accelerants matrox ;
1185	EnableWerror src add-ons accelerants neomagic ;
1186#	EnableWerror src add-ons accelerants nvidia ;
1187	EnableWerror src add-ons accelerants nvidia_gpgpu ;
1188#	EnableWerror src add-ons accelerants radeon ;
1189	EnableWerror src add-ons accelerants radeon_hd ;
1190	EnableWerror src add-ons accelerants s3 ;
1191	EnableWerror src add-ons accelerants skeleton ;
1192	EnableWerror src add-ons accelerants vesa ;
1193	EnableWerror src add-ons accelerants via ;
1194	EnableWerror src add-ons accelerants vmware ;
1195	EnableWerror src add-ons bluetooth ;
1196	EnableWerror src add-ons decorators ;
1197	EnableWerror src add-ons disk_systems ;
1198	EnableWerror src add-ons input_server devices ;
1199#	EnableWerror src add-ons input_server filters ;
1200#	EnableWerror src add-ons input_server methods ;
1201#	EnableWerror src add-ons kernel bus_managers acpi ;
1202	EnableWerror src add-ons kernel bus_managers agp_gart ;
1203	EnableWerror src add-ons kernel bus_managers ata ;
1204	EnableWerror src add-ons kernel bus_managers config_manager ;
1205	EnableWerror src add-ons kernel bus_managers firewire ;
1206	EnableWerror src add-ons kernel bus_managers isa ;
1207	EnableWerror src add-ons kernel bus_managers pci ;
1208#	EnableWerror src add-ons kernel bus_managers ps2 ; # gcc2
1209	EnableWerror src add-ons kernel bus_managers scsi ;
1210	EnableWerror src add-ons kernel bus_managers usb ;
1211	EnableWerror src add-ons kernel busses agp_gart ;
1212	EnableWerror src add-ons kernel busses ata ;
1213	EnableWerror src add-ons kernel busses scsi ;
1214	EnableWerror src add-ons kernel busses usb ;
1215	EnableWerror src add-ons kernel console ;
1216	EnableWerror src add-ons kernel cpu ;
1217#	EnableWerror src add-ons kernel debugger ; # gcc2
1218#	EnableWerror src add-ons kernel drivers audio ;
1219	EnableWerror src add-ons kernel drivers bluetooth ;
1220	EnableWerror src add-ons kernel drivers bus ;
1221	EnableWerror src add-ons kernel drivers common ;
1222	EnableWerror src add-ons kernel drivers disk ;
1223	EnableWerror src add-ons kernel drivers dvb ;
1224#	EnableWerror src add-ons kernel drivers graphics ;
1225#	EnableWerror src add-ons kernel drivers input ;
1226	EnableWerror src add-ons kernel drivers joystick ;
1227	EnableWerror src add-ons kernel drivers midi ;
1228	EnableWerror src add-ons kernel drivers misc ;
1229#	EnableWerror src add-ons kernel drivers network ;
1230	EnableWerror src add-ons kernel drivers ports ;
1231#	EnableWerror src add-ons kernel drivers power ;
1232	EnableWerror src add-ons kernel drivers printer ;
1233	EnableWerror src add-ons kernel drivers random ;
1234	EnableWerror src add-ons kernel drivers tty ;
1235	EnableWerror src add-ons kernel drivers video ;
1236	EnableWerror src add-ons kernel file_systems bfs ;
1237	EnableWerror src add-ons kernel file_systems cdda ;
1238#	EnableWerror src add-ons kernel file_systems ext2 ;
1239#	EnableWerror src add-ons kernel file_systems fat ;
1240#	EnableWerror src add-ons kernel file_systems googlefs ;
1241	EnableWerror src add-ons kernel file_systems iso9660 ;
1242	EnableWerror src add-ons kernel file_systems layers ;
1243	EnableWerror src add-ons kernel file_systems netfs ;
1244	EnableWerror src add-ons kernel file_systems nfs ;
1245#	EnableWerror src add-ons kernel file_systems ntfs ;
1246	EnableWerror src add-ons kernel file_systems packagefs ;
1247	EnableWerror src add-ons kernel file_systems ramfs ;
1248#	EnableWerror src add-ons kernel file_systems reiserfs ;
1249	EnableWerror src add-ons kernel file_systems udf ;
1250	EnableWerror src add-ons kernel file_systems userlandfs ;
1251	EnableWerror src add-ons kernel generic ;
1252	EnableWerror src add-ons kernel network atalink_protocols ;
1253	EnableWerror src add-ons kernel network devices ;
1254	EnableWerror src add-ons kernel network notifications ;
1255	EnableWerror src add-ons kernel network ppp ;
1256#	EnableWerror src add-ons kernel network protocols ;
1257#	EnableWerror src add-ons kernel network stack ;
1258	EnableWerror src add-ons kernel partitioning_systems ;
1259	EnableWerror src add-ons locale ;
1260	EnableWerror src add-ons mail_daemon ;
1261	EnableWerror src add-ons media media-add-ons demultiplexer ;
1262	EnableWerror src add-ons media media-add-ons dvb ;
1263	EnableWerror src add-ons media media-add-ons esound_sink ;
1264	EnableWerror src add-ons media media-add-ons finepix_webcam ;
1265	EnableWerror src add-ons media media-add-ons firewire_dv ;
1266	EnableWerror src add-ons media media-add-ons legacy ;
1267	EnableWerror src add-ons media media-add-ons mixer ;
1268	EnableWerror src add-ons media media-add-ons multi_audio ;
1269	EnableWerror src add-ons media media-add-ons opensound ;
1270	EnableWerror src add-ons media media-add-ons radeon ;
1271	EnableWerror src add-ons media media-add-ons reader ;
1272	EnableWerror src add-ons media media-add-ons tone_producer_demo ;
1273	EnableWerror src add-ons media media-add-ons usb_vision ;
1274#	EnableWerror src add-ons media media-add-ons usb_webcam ;
1275	EnableWerror src add-ons media media-add-ons video_mixer ;
1276#	EnableWerror src add-ons media media-add-ons video_producer_demo ;
1277	EnableWerror src add-ons media media-add-ons videowindow ;
1278	EnableWerror src add-ons media media-add-ons writer ;
1279	EnableWerror src add-ons media plugins ac3_decoder ;
1280	EnableWerror src add-ons media plugins aiff_reader ;
1281	EnableWerror src add-ons media plugins ape_reader ;
1282#	EnableWerror src add-ons media plugins asf_reader ;
1283	EnableWerror src add-ons media plugins au_reader ;
1284#	EnableWerror src add-ons media plugins avi_reader ;
1285#	EnableWerror src add-ons media plugins ffmpeg ;
1286#	EnableWerror src add-ons media plugins matroska ;
1287#	EnableWerror src add-ons media plugins mov_reader ;
1288	EnableWerror src add-ons media plugins mp3_decoder ;
1289#	EnableWerror src add-ons media plugins mp3_reader ;
1290	EnableWerror src add-ons media plugins mp4_reader ;
1291	EnableWerror src add-ons media plugins musepack ;
1292#	EnableWerror src add-ons media plugins ogg ;
1293#	EnableWerror src add-ons media plugins raw_decoder ;
1294#	EnableWerror src add-ons media plugins speex ;
1295	EnableWerror src add-ons media plugins theora ;
1296	EnableWerror src add-ons media plugins vorbis ;
1297#	EnableWerror src add-ons media plugins wav_reader ;
1298	EnableWerror src add-ons media plugins xvid_decoder ;
1299	EnableWerror src add-ons opengl ;
1300	EnableWerror src add-ons print ;
1301	EnableWerror src add-ons screen_savers ;
1302	EnableWerror src add-ons tracker ;
1303	EnableWerror src add-ons translators bmp ;
1304#	EnableWerror src add-ons translators exr ;
1305	EnableWerror src add-ons translators gif ;
1306	EnableWerror src add-ons translators hpgs ;
1307	EnableWerror src add-ons translators hvif ;
1308	EnableWerror src add-ons translators ico ;
1309#	EnableWerror src add-ons translators jpeg ; # gcc2
1310	EnableWerror src add-ons translators jpeg2000 ;
1311	EnableWerror src add-ons translators pcx ;
1312#	EnableWerror src add-ons translators png ; # gcc2
1313	EnableWerror src add-ons translators ppm ;
1314	EnableWerror src add-ons translators raw ;
1315	EnableWerror src add-ons translators rtf ;
1316	EnableWerror src add-ons translators sgi ;
1317	EnableWerror src add-ons translators shared ;
1318	EnableWerror src add-ons translators stxt ;
1319	EnableWerror src add-ons translators tga ;
1320	EnableWerror src add-ons translators tiff ;
1321#	EnableWerror src add-ons translators wonderbrush ;
1322#	EnableWerror src add-ons print ;
1323	EnableWerror src bin package ;
1324	EnableWerror src apps aboutsystem ;
1325	EnableWerror src apps activitymonitor ;
1326	EnableWerror src apps bootman ;
1327	EnableWerror src apps bsnow ;
1328	EnableWerror src apps cdplayer ;
1329#	EnableWerror src apps charactermap ;
1330	EnableWerror src apps clock ;
1331	EnableWerror src apps codycam ;
1332	EnableWerror src apps cortex ;
1333	EnableWerror src apps deskbar ;
1334	EnableWerror src apps deskcalc ;
1335	EnableWerror src apps devices ;
1336	EnableWerror src apps diskprobe ;
1337#	EnableWerror src apps diskusage ;
1338	EnableWerror src apps drivesetup ;
1339	EnableWerror src apps expander ;
1340	EnableWerror src apps fontdemo ;
1341	EnableWerror src apps glteapot ;
1342	EnableWerror src apps haiku3d ;
1343#	EnableWerror src apps icon-o-matic ;
1344	EnableWerror src apps installer ;
1345	EnableWerror src apps launchbox ;
1346	EnableWerror src apps magnify ;
1347#	EnableWerror src apps mail ;
1348	EnableWerror src apps mandelbrot ;
1349	EnableWerror src apps mediaconverter ;
1350#	EnableWerror src apps mediaplayer ;
1351	EnableWerror src apps midiplayer ;
1352	EnableWerror src apps networkstatus ;
1353	EnableWerror src apps packageinstaller ;
1354	EnableWerror src apps pairs ;
1355	EnableWerror src apps people ;
1356#	EnableWerror src apps poorman ;
1357	EnableWerror src apps powerstatus ;
1358	EnableWerror src apps processcontroller ;
1359	EnableWerror src apps pulse ;
1360	EnableWerror src apps readonlybootprompt ;
1361	EnableWerror src apps screenshot ;
1362	EnableWerror src apps showimage ;
1363	EnableWerror src apps soundrecorder ;
1364	EnableWerror src apps stylededit ;
1365	EnableWerror src apps sudoku ;
1366	EnableWerror src apps terminal ;
1367	EnableWerror src apps text_search ;
1368	EnableWerror src apps tracker ;
1369	EnableWerror src apps tv ;
1370	EnableWerror src apps workspaces ;
1371	EnableWerror src kits app ;
1372	EnableWerror src kits bluetooth ;
1373	EnableWerror src kits debug ;
1374	EnableWerror src kits device ;
1375	EnableWerror src kits game ;
1376	EnableWerror src kits interface ;
1377	EnableWerror src kits locale ;
1378	EnableWerror src kits mail ;
1379#	EnableWerror src kits media ; # gcc2
1380	EnableWerror src kits midi ;
1381	EnableWerror src kits midi2 ;
1382	EnableWerror src kits network ;
1383	EnableWerror src kits notification ;
1384	EnableWerror src kits opengl ;
1385	EnableWerror src kits print ;
1386	EnableWerror src kits screensaver ;
1387	EnableWerror src kits shared ;
1388	EnableWerror src kits storage ;
1389	EnableWerror src kits support ;
1390	EnableWerror src kits textencoding ;
1391#	EnableWerror src kits tracker ;
1392	EnableWerror src kits translation ;
1393	EnableWerror src preferences appearance ;
1394	EnableWerror src preferences backgrounds ;
1395	EnableWerror src preferences bluetooth ;
1396	EnableWerror src preferences cpufrequency ;
1397	EnableWerror src preferences datatranslations ;
1398	EnableWerror src preferences deskbar ;
1399#	EnableWerror src preferences filetypes ;
1400	EnableWerror src preferences fonts ;
1401	EnableWerror src preferences joysticks ;
1402	EnableWerror src preferences keyboard ;
1403#	EnableWerror src preferences keymap ;
1404	EnableWerror src preferences locale ;
1405	EnableWerror src preferences mail ;
1406	EnableWerror src preferences media ;
1407	EnableWerror src preferences mouse ;
1408	EnableWerror src preferences network ;
1409#	EnableWerror src preferences notifications ;
1410	EnableWerror src preferences opengl ;
1411	EnableWerror src preferences print ;
1412	EnableWerror src preferences screen ;
1413	EnableWerror src preferences screensaver ;
1414#	EnableWerror src preferences shortcuts ;
1415	EnableWerror src preferences sounds ;
1416	EnableWerror src preferences time ;
1417	EnableWerror src preferences touchpad ;
1418	EnableWerror src preferences tracker ;
1419	EnableWerror src preferences virtualmemory ;
1420	EnableWerror src servers app ;
1421#	EnableWerror src servers bluetooth ;
1422	EnableWerror src servers cddb_daemon ;
1423	EnableWerror src servers debug ;
1424	EnableWerror src servers input ;
1425	EnableWerror src servers mail ;
1426	EnableWerror src servers media ;
1427	EnableWerror src servers media_addon ;
1428	EnableWerror src servers midi ;
1429	EnableWerror src servers mount ;
1430	EnableWerror src servers net ;
1431	EnableWerror src servers notification ;
1432	EnableWerror src servers power ;
1433	EnableWerror src servers print ;
1434	EnableWerror src servers registrar ;
1435	EnableWerror src servers services_daemon ;
1436	EnableWerror src servers syslog_daemon ;
1437	EnableWerror src system kernel ;
1438	EnableWerror src system runtime_loader ;
1439}
1440
1441