* 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:
Ingo Weinhold
2005-11-07 16:07:25 +00:00
parent 948d1276e6
commit ca9e5772c3
79 changed files with 328 additions and 312 deletions
+15 -6
View File
@@ -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) ;
}