xref: /haiku/src/system/runtime_loader/Jamfile (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1SubDir HAIKU_TOP src system runtime_loader ;
2
3
4if $(TARGET_ARCH) = x86_64
5	&& ( x86 in $(HAIKU_ARCHS[2-]) || x86_gcc2 in $(HAIKU_ARCHS[2-]) ) {
6	DEFINES += _COMPAT_MODE ;
7}
8
9local architectureObject ;
10for architectureObject in [ MultiArchSubDirSetup ] {
11	on $(architectureObject) {
12		local architecture = $(TARGET_PACKAGING_ARCH) ;
13
14		UsePrivateHeaders libroot runtime_loader shared ;
15		UsePrivateHeaders kernel ;
16			# for <util/KMessage.h>
17		UsePrivateHeaders libroot os ;
18			# for "PathBuffer.h"
19		UsePrivateSystemHeaders ;
20
21		ObjectHdrs find_directory.cpp : $(HAIKU_TOP)/src/system/libroot/os ;
22
23		# Don't let gcc inject built-in function code. This will cause
24		# dependencies to libroot, which we don't link against.
25		SubDirCcFlags -fno-builtin ;
26		SubDirC++Flags -fno-builtin -fno-exceptions ;
27
28		DEFINES +=
29			KMESSAGE_CONTAINER_ONLY
30			_LOADER_MODE
31			USING_LIBGCC=1
32		;
33
34		AddResources [ MultiArchDefaultGristFiles runtime_loader ]
35			: runtime_loader.rdef ;
36
37		# needed for "runtime_loader" only
38		StaticLibrary <$(architecture)>libruntime_loader.a :
39			kernel_vsprintf.cpp
40			kernel_cpp.cpp
41			KMessage.cpp
42			find_directory.cpp
43			:
44			<src!system!libroot!os!$(architecture)>mutex.o
45			<src!system!libroot!os!$(architecture)>recursive_lock.o
46			<src!system!libroot!os!$(architecture)>syscalls.o
47			<src!system!libroot!os!$(architecture)>sem.o
48			<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>tls.o
49
50			<src!system!libroot!posix!$(architecture)>errno.o
51			<src!system!libroot!posix!$(architecture)>fcntl.o
52
53			<src!system!libroot!posix!locale!$(architecture)>ctype.o
54			<src!system!libroot!posix!locale!$(architecture)>ctype_loc.o
55			<src!system!libroot!posix!locale!$(architecture)>LocaleData.o
56
57			<src!system!libroot!posix!string!$(architecture)>memchr.o
58			<src!system!libroot!posix!string!$(architecture)>memcmp.o
59			<src!system!libroot!posix!string!$(architecture)>memmove.o
60			<src!system!libroot!posix!string!$(architecture)>strcasecmp.o
61			<src!system!libroot!posix!string!$(architecture)>strcat.o
62			<src!system!libroot!posix!string!$(architecture)>strchr.o
63			<src!system!libroot!posix!string!$(architecture)>strcmp.o
64			<src!system!libroot!posix!string!$(architecture)>strcpy.o
65			<src!system!libroot!posix!string!$(architecture)>strcspn.o
66			<src!system!libroot!posix!string!$(architecture)>strdup.o
67			<src!system!libroot!posix!string!$(architecture)>strerror.o
68			<src!system!libroot!posix!string!$(architecture)>strlcat.o
69			<src!system!libroot!posix!string!$(architecture)>strlcpy.o
70			<src!system!libroot!posix!string!$(architecture)>strlen.o
71			<src!system!libroot!posix!string!$(architecture)>strncmp.o
72			<src!system!libroot!posix!string!$(architecture)>strnlen.o
73			<src!system!libroot!posix!string!$(architecture)>strpbrk.o
74			<src!system!libroot!posix!string!$(architecture)>strrchr.o
75			<src!system!libroot!posix!string!$(architecture)>strspn.o
76			<src!system!libroot!posix!string!$(architecture)>strstr.o
77		;
78
79		SEARCH on [ FGristFiles kernel_cpp.cpp ]
80			= [ FDirName $(HAIKU_TOP) src system kernel util ] ;
81		SEARCH on [ FGristFiles kernel_vsprintf.cpp ]
82			= [ FDirName $(HAIKU_TOP) src system kernel lib ] ;
83		SEARCH on [ FGristFiles KMessage.cpp ]
84			= [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
85		SEARCH on [ FGristFiles find_directory.cpp ]
86			= [ FDirName $(HAIKU_TOP) src system libroot os ] ;
87
88		local sources =
89			add_ons.cpp
90			elf.cpp
91			elf_haiku_version.cpp
92			elf_load_image.cpp
93			elf_symbol_lookup.cpp
94			elf_tls.cpp
95			elf_versioning.cpp
96			pe.cpp
97			errors.cpp
98			export.cpp
99			heap.cpp
100			images.cpp
101			runtime_loader.cpp
102			utility.cpp
103		;
104
105		Objects [ FGristFiles $(sources) ] ;
106
107		Ld [ MultiArchDefaultGristFiles runtime_loader ] :
108			[ FGristFiles $(sources:S=$(SUFOBJ)) ]
109			<$(architecture)>libruntime_loader.a
110			<$(architecture)>libruntime_loader_$(TARGET_ARCH).a
111			[ TargetKernelLibsupc++ ]
112			[ TargetKernelLibgcc ]
113			[ TargetKernelLibgcceh ]
114			:
115			: --no-undefined -shared -Bsymbolic -soname=runtime_loader -entry=runtime_loader
116		;
117	}
118}
119
120
121local arch ;
122for arch in $(TARGET_ARCHS) {
123	HaikuSubInclude arch $(arch) ;
124}
125
126