SubDir TOP haiku-on-genode sys-libroot librootbuild-variant ;



SubDirHdrs  $(TOP)/haiku-on-genode/headers/private/system ;
	# for syscalls.h

SubDirHdrs $(GenodeRepos)/../contrib/$(Contrib_libc)/src/lib/libc/sys ;
	# for sys/extattrs.h


SubDirC++Flags
	-D_HAIKU_BUILD_DONT_REMAP_FD_FUNCTIONS=1
		#-DHAIKU_BUILD_GENERATED_DIRECTORY=\\"/tmp/not-sure-of-contents-here\\"
	#	-DHAIKU_BUILD_ATTRIBUTES_DIR=\\\"/tmp/not-sure-of-contents-here/attrs\\\"
	-DHAIKU_HOST_PLATFORM_FREEBSD
	-DHAIKU_HOST_PLATFORM_64_BIT
	-DHAIKU_HOST_USE_XATTR  # => use fs_attr_untyped.cpp and FreeBSD attrs
	;

if $(GE_XATTR_DISABLED) >= 1
{
	# Do NOT use "path_for_genode_fd()". This completely disables things like BNode.ReadAttr(),
	# but allows building against vanilla, unpatched, Genode and SculptOS:
	SubDirC++Flags
		-DHAVE_GENODE_XAttr_SUPPORT=0
		;
}


# Make the code part of haiku.lib.so (instead of a
# separate libroot.so like in upstream)
#
if $(LayerLevel) >= 5
{
	SolibFromObjects haiku.lib.so :
		fs_attr.o
		fs_descriptors.o
		fs_freebsd.o
		fs.o
		misc.o
		;
	Library haiku.lib.a :
		fs_attr.cpp  # compilation will #include (!) file <fs_attr_untyped.cpp>
		fs_descriptors.cpp
		fs_freebsd.cpp
		fs.cpp
		misc.cpp
		;
}


#xxxx check value ?
#xxxx check where to define this instead of this jamfile ?
#ObjectDefines find_directory.cpp :
#	HAIKU_BUILD_GENERATED_DIRECTORY=""
#	;

#xx still needed, now that we pass the global -include GCC switch ?
# Find Haiku-Compatibility.h
ObjectHdrs misc.cpp :
	haiku-on-genode/headers/build
	;



