xref: /haiku/src/build/libroot/Jamfile (revision 4796acbc8c8fa3a5325a27722746b999009988d1)
1SubDir HAIKU_TOP src build libroot ;
2
3UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ;
4UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ;
5UseHeaders [ FDirName $(HAIKU_TOP) headers build os app ] : true ;
6UseHeaders [ FDirName $(HAIKU_TOP) headers build os drivers ] : true ;
7UseHeaders [ FDirName $(HAIKU_TOP) headers build os kernel ] : true ;
8UseHeaders [ FDirName $(HAIKU_TOP) headers build os interface ] : true ;
9UseHeaders [ FDirName $(HAIKU_TOP) headers build os storage ] : true ;
10UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ;
11
12UsePrivateBuildHeaders kernel libroot ;
13
14{
15	local defines = [ FDefines
16		HAIKU_BUILD_ATTRIBUTES_DIR="\\\"$(HAIKU_BUILD_ATTRIBUTES_DIR)\\\""
17		_HAIKU_BUILD_DONT_REMAP_FD_FUNCTIONS=1
18	] ;
19	SubDirCcFlags $(defines) ;
20	SubDirC++Flags $(defines) ;
21
22	defines = [ FDefines
23		HAIKU_BUILD_GENERATED_DIRECTORY="\\\"$(HAIKU_OUTPUT_DIR)\\\""
24	] ;
25	ObjectC++Flags find_directory.cpp : $(defines) ;
26
27	defines = [ FDefines BUILDING_HAIKU_ERROR_MAPPER=1 ] ;
28	ObjectC++Flags errors.cpp : $(defines) ;
29
30	defines = [ FDefines KMESSAGE_CONTAINER_ONLY=1 ] ;
31	ObjectC++Flags KMessage.cpp : $(defines) ;
32
33}
34
35# locate the library
36MakeLocate libroot_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ;
37
38# darwin already has strlcpy and strlcat in libSystem
39local strlSources ;
40if $(HOST_PLATFORM) != darwin {
41	strlSources = strlcpy.c strlcat.c ;
42}
43
44if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos {
45	strlSources += stpcpy.c strcasestr.c ;
46}
47
48local hostPlatformSources ;
49if $(HOST_PLATFORM) = freebsd {
50	hostPlatformSources = fs_freebsd.cpp ;
51}
52
53local librootSources =
54	atomic.cpp
55	byteorder.cpp
56	errors.cpp
57	find_directory.cpp
58	fs.cpp
59	fs_attr.cpp
60	fs_descriptors.cpp
61	misc.cpp
62	sem.cpp
63	thread.cpp
64
65	$(hostPlatformSources)
66
67	driver_settings.cpp
68
69	$(strlSources)
70	strnlen.c
71
72	KMessage.cpp
73;
74
75USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ;
76
77BuildPlatformSharedLibrary libroot_build.so :
78	$(librootSources)
79	:
80	$(HOST_LIBSUPC++) $(HOST_LIBSTDC++)
81;
82
83# TODO: This doesn't work with the function remapping.
84#BuildPlatformStaticLibrary libroot_build.a :
85#	:
86#	[ FGristFiles $(librootSources:S=$(SUFOBJ)) ]
87#;
88
89USES_BE_API on [ FGristFiles function_remapper$(SUFOBJ) ] = true ;
90
91BuildPlatformStaticLibraryPIC libroot_build_function_remapper.a :
92	function_remapper.cpp
93;
94
95SEARCH on [ FGristFiles driver_settings.cpp ]
96	= [ FDirName $(HAIKU_TOP) src system libroot os ] ;
97SEARCH on [ FGristFiles $(strlSources) strnlen.c ]
98	= [ FDirName $(HAIKU_TOP) src system libroot posix string ] ;
99SEARCH on [ FGristFiles KMessage.cpp ]
100    = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
101