* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for "haiku") -- added one more level of indirection to achieve that. (TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*). * Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h (auto-included when compiling something that uses the Be API for platform "host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h, which can be included when compiling something that can be built for both, Haiku and BeOS compatible platforms. * Introduced libhaikucompat.a, a library that adds a few functions existing under Haiku, but not under BeOS. * New rule AddSubDirSupportedPlatforms. * Renamed libopenbeos.so to libbe_haiku.so. * Introduced new target platform "libbe_test", which is basically equivalent to a BeOS compatible host platform target, with the exception, that instead of the host platform's libbe.so a special build of Haiku's libbe.so (libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore Haiku's public app, interface, storage, and support kit headers are used when compiling. This replaces the less nice way in which the test app server and applications for this test environment were built. When building for platform "libbe_test", the library name "be" is autotranslated to "libbe_haiku.so". Thus most applications don't need special fiddling when them building them for the app server test environment; usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice. * Reduced the dependencies of <syscalls.h> and fixed problems caused by this (e.g. source files not including the needed headers directly). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+60
-6
@@ -409,7 +409,7 @@ if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
||||
[ FDirName $(HAIKU_TOP) headers build os storage ]
|
||||
[ FDirName $(HAIKU_TOP) headers build os support ]
|
||||
;
|
||||
HOST_BE_API_CCFLAGS = -include HaikuBuildCompatibility.h ;
|
||||
HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ;
|
||||
HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ;
|
||||
}
|
||||
|
||||
@@ -492,6 +492,8 @@ if $(TARGET_PLATFORM) = haiku {
|
||||
|
||||
TARGET_BOOT_PLATFORM = $(HAIKU_BOOT_PLATFORM) ;
|
||||
|
||||
TARGET_LIBRARY_NAME_MAP = HAIKU_LIBRARY_NAME_MAP ;
|
||||
|
||||
} else {
|
||||
local var ;
|
||||
for var in $(buildVars) {
|
||||
@@ -504,15 +506,67 @@ if $(TARGET_PLATFORM) = haiku {
|
||||
TARGET_GCC_LIBGCC_OBJECTS = ;
|
||||
|
||||
TARGET_BOOT_PLATFORM = ;
|
||||
|
||||
TARGET_LIBRARY_NAME_MAP = ;
|
||||
}
|
||||
|
||||
# define macro, for identifying the platform
|
||||
switch $(TARGET_PLATFORM) {
|
||||
case r5 : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_BEOS ;
|
||||
case bone : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_BONE ;
|
||||
case dano : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_DANO ;
|
||||
case haiku : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_HAIKU ;
|
||||
case linux : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LINUX ;
|
||||
case r5 : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_BEOS ;
|
||||
case bone : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_BONE ;
|
||||
case dano : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_DANO ;
|
||||
case haiku : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_HAIKU ;
|
||||
case linux : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LINUX ;
|
||||
case libbe_test : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LIBBE_TEST ;
|
||||
}
|
||||
|
||||
# define macro, for identifying the host platform
|
||||
switch $(HOST_PLATFORM) {
|
||||
case r5 : TARGET_DEFINES += HAIKU_HOST_PLATFORM_BEOS ;
|
||||
case bone : TARGET_DEFINES += HAIKU_HOST_PLATFORM_BONE ;
|
||||
case dano : TARGET_DEFINES += HAIKU_HOST_PLATFORM_DANO ;
|
||||
case haiku : TARGET_DEFINES += HAIKU_HOST_PLATFORM_HAIKU ;
|
||||
case linux : TARGET_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
# special target libbe_test
|
||||
|
||||
if $(TARGET_PLATFORM) = libbe_test {
|
||||
# headers and flags
|
||||
TARGET_HDRS += [ PublicHeaders app interface storage support ]
|
||||
[ PrivateHeaders $(DOT) ] ;
|
||||
local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
|
||||
HaikuBuildCompatibility.h ] ;
|
||||
TARGET_CCFLAGS += $(compatibilityHeader) ;
|
||||
TARGET_C++FLAGS += $(compatibilityHeader) ;
|
||||
|
||||
# compatibility library
|
||||
TARGET_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
|
||||
|
||||
# directories
|
||||
TARGET_OBJECT_BASE_DIR
|
||||
= [ FDirName $(HAIKU_OBJECT_DIR) $(TARGET_PLATFORM) ] ;
|
||||
TARGET_COMMON_ARCH_OBJECT_DIR
|
||||
= [ FDirName $(TARGET_OBJECT_BASE_DIR) common ] ;
|
||||
TARGET_ARCH_OBJECT_DIR
|
||||
= [ FDirName $(TARGET_OBJECT_BASE_DIR) $(TARGET_ARCH) ] ;
|
||||
TARGET_COMMON_DEBUG_OBJECT_DIR
|
||||
= [ FDirName $(TARGET_ARCH_OBJECT_DIR) common ] ;
|
||||
TARGET_DEBUG_0_OBJECT_DIR
|
||||
= [ FDirName $(TARGET_ARCH_OBJECT_DIR) release ] ;
|
||||
|
||||
local level ;
|
||||
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
||||
TARGET_DEBUG_$(level)_OBJECT_DIR
|
||||
= [ FDirName $(TARGET_ARCH_OBJECT_DIR) debug_$(level) ] ;
|
||||
}
|
||||
|
||||
# library name map
|
||||
TARGET_LIBRARY_NAME_MAP = LIBBE_LIBRARY_NAME_MAP ;
|
||||
LIBBE_LIBRARY_NAME_MAP_be = libbe_haiku.so ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,6 +126,11 @@ rule SetPlatformCompatibilityFlagVariables
|
||||
EXIT "specify it manually." ;
|
||||
}
|
||||
|
||||
# special case: Haiku libbe.so built for testing under BeOS
|
||||
if $(platform) = libbe_test {
|
||||
platform = haiku ;
|
||||
}
|
||||
|
||||
$(varPrefix)_PLATFORM_BEOS_COMPATIBLE = ;
|
||||
$(varPrefix)_PLATFORM_BONE_COMPATIBLE = ;
|
||||
$(varPrefix)_PLATFORM_DANO_COMPATIBLE = ;
|
||||
@@ -178,6 +183,9 @@ rule SetPlatformCompatibilityFlagVariables
|
||||
?= $($(varPrefix)_PLATFORM_BONE_COMPATIBLE) ;
|
||||
$(varPrefix)_PLATFORM_(r5)_COMPATIBLE
|
||||
?= $($(varPrefix)_PLATFORM_BEOS_COMPATIBLE) ;
|
||||
|
||||
$(varPrefix)_PLATFORM_(libbe_test)_COMPATIBLE
|
||||
?= $($(varPrefix)_PLATFORM_BEOS_COMPATIBLE) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,6 +219,13 @@ rule SetSubDirSupportedPlatforms
|
||||
SUPPORTED_PLATFORMS = $(1) ;
|
||||
}
|
||||
|
||||
rule AddSubDirSupportedPlatforms
|
||||
{
|
||||
# AddSubDirSupportedPlatforms <platforms> ;
|
||||
|
||||
SUPPORTED_PLATFORMS += $(1) ;
|
||||
}
|
||||
|
||||
rule SetSubDirSupportedPlatformsBeOSCompatible
|
||||
{
|
||||
# SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||
|
||||
@@ -5,7 +5,8 @@ rule AddSharedObjectGlueCode
|
||||
|
||||
# we link with -nostdlib and add the required libs manually, when building
|
||||
# for Haiku
|
||||
if [ on $(1) return $(PLATFORM) ] = haiku {
|
||||
local platform = [ on $(1) return $(PLATFORM) ] ;
|
||||
if $(platform) = haiku {
|
||||
local stdLibs = libroot.so ;
|
||||
local beginGlue ;
|
||||
local endGlue ;
|
||||
@@ -29,6 +30,11 @@ rule AddSharedObjectGlueCode
|
||||
Depends $(1) : $(stdLibs) $(beginGlue) $(endGlue) ;
|
||||
LINKFLAGS on $(1) = [ on $(1) return $(LINKFLAGS) ] -nostdlib ;
|
||||
}
|
||||
|
||||
# link against the compatibility libraries needed for the target
|
||||
if $(platform) != host && $(TARGET_HAIKU_COMPATIBILITY_LIBS) {
|
||||
LinkAgainst $(1) : $(TARGET_HAIKU_COMPATIBILITY_LIBS) ;
|
||||
}
|
||||
}
|
||||
|
||||
rule Executable
|
||||
@@ -256,26 +262,29 @@ rule SharedLibrary
|
||||
|
||||
rule LinkAgainst
|
||||
{
|
||||
# LinkAgainst <name> : <libs> ;
|
||||
# Valid elements for <libs> are e.g. "be" or "libopenbeos.so" or
|
||||
# LinkAgainst <name> : <libs> [ : <mapLibs> ] ;
|
||||
# Valid elements for <libs> are e.g. "be" or "libtranslation.so" or
|
||||
# "/boot/.../libfoo.so". If the basename starts with "lib" or the thingy
|
||||
# has a dirname or grist, it is added to the NEEDLIBS variable (i.e. the
|
||||
# file will be bound!), otherwise it is prefixed "-l" and added to
|
||||
# LINKLIBS. If you want to specify a target that isn't a library and
|
||||
# also has neither grist nor a dirname, you can prepend "<nogrist>" as
|
||||
# grist; it will be stripped by this rule.
|
||||
# <mapLibs> specifies whether the to translate library names (e.g. "be"
|
||||
# to "libbe.so" in case of target platform "haiku"). Defaults to "true".
|
||||
#
|
||||
local target = $(1) ;
|
||||
local libs = $(2) ;
|
||||
local mapLibs = $(3) ;
|
||||
local mapLibs = $(3:E=true) ;
|
||||
|
||||
on $(target) {
|
||||
# map libraries, if desired and target platform is Haiku
|
||||
if $(PLATFORM) = haiku {
|
||||
if $(PLATFORM) != host && $(mapLibs) = true
|
||||
&& $(TARGET_LIBRARY_NAME_MAP) {
|
||||
local mappedLibs ;
|
||||
|
||||
for i in $(libs) {
|
||||
local mapped = $(HAIKU_LIBRARY_NAME_MAP_$(i)) ;
|
||||
local mapped = $($(TARGET_LIBRARY_NAME_MAP)_$(i)) ;
|
||||
mapped ?= $(i) ;
|
||||
mappedLibs += $(mapped) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user