diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index b700349b8c..f99193474c 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -788,13 +788,6 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) HOST_DEFINES += $(HOST_ARCH_MACRO_DEFINE) ; HOST_DEFINES += _NO_INLINE_ASM ; -if $(HOST_PLATFORM_BEOS_COMPATIBLE) { - # TODO: That's obviously not correct, but in the way the COMPILE_FOR_R5 - # macro is used, it actually seems to mean r5/bone/dano. - # TODO: Deprecated. Remove! - HOST_DEFINES += COMPILE_FOR_R5 ; -} - # for builds of tools in the current environment HOST_BUILD_COMPATIBILITY_LIB_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) lib ] ; @@ -814,8 +807,9 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) { HOST_LIBROOT = root ; HOST_STATIC_LIBROOT = $(HOST_LIBROOT) ; - HOST_LIBBE = be ; - HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR = "export LIBRARY_PATH=$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ; + HOST_LIBBE = libbe_build.so ; + HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR + = "export LIBRARY_PATH=$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ; HOST_LIBRARY_NAME_MAP_input_server = /system/servers/input_server ; HOST_DEFINES += __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS ; @@ -951,31 +945,26 @@ HOST_BE_API_HEADERS = ; HOST_BE_API_CCFLAGS = ; HOST_BE_API_C++FLAGS = ; -if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) { - HOST_BE_API_HEADERS = - [ FDirName $(HAIKU_TOP) headers build ] - [ FDirName $(HAIKU_TOP) headers build os ] - [ FDirName $(HAIKU_TOP) headers build os app ] - [ FDirName $(HAIKU_TOP) headers build os drivers ] - [ FDirName $(HAIKU_TOP) headers build os kernel ] - [ FDirName $(HAIKU_TOP) headers build os interface ] - [ FDirName $(HAIKU_TOP) headers build os locale ] - [ FDirName $(HAIKU_TOP) headers build os opengl ] - [ FDirName $(HAIKU_TOP) headers build os storage ] - [ FDirName $(HAIKU_TOP) headers build os support ] - [ FDirName $(HAIKU_TOP) headers build private ] - ; - HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ; - HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ; -} - # Add directory with system headers we need when building something for the host # platform, e.g. containing missing POSIX/GNU headers. HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host $(HOST_PLATFORM) ] ; -# For all versions of BeOS also add the common beos directory. -if $(HOST_PLATFORM) in r5 bone dano { - HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host beos_common ] ; +HOST_BE_API_HEADERS = + [ FDirName $(HAIKU_TOP) headers build ] + [ FDirName $(HAIKU_TOP) headers build os ] + [ FDirName $(HAIKU_TOP) headers build os app ] + [ FDirName $(HAIKU_TOP) headers build os drivers ] + [ FDirName $(HAIKU_TOP) headers build os kernel ] + [ FDirName $(HAIKU_TOP) headers build os interface ] + [ FDirName $(HAIKU_TOP) headers build os locale ] + [ FDirName $(HAIKU_TOP) headers build os opengl ] + [ FDirName $(HAIKU_TOP) headers build os storage ] + [ FDirName $(HAIKU_TOP) headers build os support ] + [ FDirName $(HAIKU_TOP) headers build private ] +; +if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) { + HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ; + HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ; } diff --git a/headers/build/host/haiku_host/Errors.h b/headers/build/host/haiku_host/Errors.h new file mode 100644 index 0000000000..5daeeaeddd --- /dev/null +++ b/headers/build/host/haiku_host/Errors.h @@ -0,0 +1 @@ +#include "/boot/system/develop/headers/os/support/Errors.h" diff --git a/headers/build/host/haiku_host/config_build/HaikuConfig.h b/headers/build/host/haiku_host/config_build/HaikuConfig.h new file mode 100644 index 0000000000..723c2bb194 --- /dev/null +++ b/headers/build/host/haiku_host/config_build/HaikuConfig.h @@ -0,0 +1 @@ +#include "/boot/system/develop/headers/config/HaikuConfig.h" diff --git a/headers/build/host/haiku_host/config_build/types.h b/headers/build/host/haiku_host/config_build/types.h new file mode 100644 index 0000000000..423a4d9330 --- /dev/null +++ b/headers/build/host/haiku_host/config_build/types.h @@ -0,0 +1 @@ +#include "/boot/system/develop/headers/config/types.h" diff --git a/src/bin/copyattr.cpp b/src/bin/copyattr.cpp index c7b9aa30c9..f1c9ac8378 100644 --- a/src/bin/copyattr.cpp +++ b/src/bin/copyattr.cpp @@ -439,7 +439,7 @@ copy_entry(const char *sourcePath, const char *destPath, destNode->SetOwner(sourceStat.st_uid); destNode->SetGroup(sourceStat.st_gid); destNode->SetPermissions(sourceStat.st_mode); - #if (defined(__BEOS__) || defined(__HAIKU__)) + #ifdef HAIKU_TARGET_PLATFORM_HAIKU destNode->SetCreationTime(sourceStat.st_crtime); #endif destNode->SetModificationTime(sourceStat.st_mtime); diff --git a/src/bin/keymap/Keymap.cpp b/src/bin/keymap/Keymap.cpp index c90fce03bf..bb2bec31e8 100644 --- a/src/bin/keymap/Keymap.cpp +++ b/src/bin/keymap/Keymap.cpp @@ -491,7 +491,7 @@ Keymap::LoadSource(FILE* file) status_t Keymap::SaveAsCurrent() { -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU BPath path; status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path, true); if (status != B_OK) @@ -564,7 +564,7 @@ Keymap::SaveAsSource(const char* name) if (file == NULL) return errno; -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU text_run_array* textRuns; _SaveSourceText(file, &textRuns); @@ -718,7 +718,7 @@ Keymap::SaveAsCppHeader(const char* fileName, const char* mapName) status_t Keymap::Use() { -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU return _restore_key_map_(); #else // ! __BEOS__ @@ -731,7 +731,7 @@ Keymap::Use() void Keymap::RestoreSystemDefault() { -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU // work-around to get rid of this stupid find_directory_r() on Zeta # ifdef find_directory # undef find_directory @@ -790,7 +790,7 @@ Keymap::GetKey(const char* chars, int32 offset, char* buffer, size_t bufferSize) } -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU void Keymap::_SaveSourceText(FILE* file, text_run_array** _textRuns) { @@ -808,7 +808,7 @@ Keymap::_SaveSourceText(FILE* file) static const rgb_color kCommentColor = (rgb_color){200, 92, 92, 255}; static const rgb_color kTextColor = (rgb_color){0, 0, 0, 255}; -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU BFont font = *be_fixed_font; if (runs != NULL) { @@ -822,7 +822,7 @@ Keymap::_SaveSourceText(FILE* file) "#\n" "#\tRaw key numbering for 102-key keyboard...\n"); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[1].offset = bytes; runs->runs[1].font = font; @@ -851,7 +851,7 @@ Keymap::_SaveSourceText(FILE* file) "# [ ctrl ] [ cmd ] [ space ] [ cmd ] [ ctrl ] [lft] [dwn] [rgt] [ 0 ] [ . ]\n" "# 0x5c 0x5d 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65\n"); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[2].offset = bytes; runs->runs[2].font = font; @@ -871,7 +871,7 @@ Keymap::_SaveSourceText(FILE* file) "#\t\t\tkeypad '=' = 0x6a\n" "#\t\t\tpower key = 0x6b\n"); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[3].offset = bytes; runs->runs[3].font = *be_fixed_font; @@ -898,7 +898,7 @@ Keymap::_SaveSourceText(FILE* file) fKeys.left_control_key, fKeys.right_control_key, fKeys.left_option_key, fKeys.right_option_key, fKeys.menu_key); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[4].offset = bytes; runs->runs[4].font = *be_fixed_font; @@ -915,7 +915,7 @@ Keymap::_SaveSourceText(FILE* file) "# LockSettings = CapsLock NumLock ScrollLock\n" "#\n"); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[5].offset = bytes; runs->runs[5].font = *be_fixed_font; @@ -932,7 +932,7 @@ Keymap::_SaveSourceText(FILE* file) bytes += fprintf(file, "ScrollLock "); bytes += fprintf(file, "\n"); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[6].offset = bytes; runs->runs[6].font = *be_fixed_font; @@ -950,7 +950,7 @@ Keymap::_SaveSourceText(FILE* file) "C Cs Co Cos \n", file); -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (runs != NULL) { runs->runs[7].offset = bytes; runs->runs[7].font = *be_fixed_font; diff --git a/src/bin/keymap/Keymap.h b/src/bin/keymap/Keymap.h index 00545d459e..218e3271e5 100644 --- a/src/bin/keymap/Keymap.h +++ b/src/bin/keymap/Keymap.h @@ -12,7 +12,7 @@ #include -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU # include #endif @@ -43,7 +43,7 @@ public: char* buffer, size_t bufferSize); private: -#if (defined(__BEOS__) || defined(__HAIKU__)) +#ifdef HAIKU_TARGET_PLATFORM_HAIKU void _SaveSourceText(FILE* file, text_run_array** _textRuns = NULL); #else diff --git a/src/bin/makebootable/platform/bios_ia32/makebootable.cpp b/src/bin/makebootable/platform/bios_ia32/makebootable.cpp index 7208b3e7a7..4428e2dce6 100644 --- a/src/bin/makebootable/platform/bios_ia32/makebootable.cpp +++ b/src/bin/makebootable/platform/bios_ia32/makebootable.cpp @@ -43,7 +43,7 @@ # define USE_PARTITION_MAP 1 #endif -#ifdef __HAIKU__ +#ifdef HAIKU_TARGET_PLATFORM_HAIKU # include # include @@ -197,7 +197,7 @@ write_boot_code_part(const char *fileName, int fd, off_t imageOffset, } -#ifdef __HAIKU__ +#ifdef HAIKU_TARGET_PLATFORM_HAIKU static status_t find_own_image(image_info *info) @@ -297,7 +297,7 @@ main(int argc, const char *const *argv) // read the boot code uint8 *bootCodeData = NULL; -#ifndef __HAIKU__ +#ifndef HAIKU_TARGET_PLATFORM_HAIKU bootCodeData = read_boot_code_data(argv[0]); #else image_info info; @@ -334,7 +334,7 @@ main(int argc, const char *const *argv) int64 partitionOffset = 0; fs_info info; // needs to be here (we use the device name later) if (S_ISDIR(st.st_mode)) { - #if defined(__BEOS__) || defined(__HAIKU__) + #ifdef HAIKU_TARGET_PLATFORM_HAIKU // a directory: get the device error = fs_stat_dev(st.st_dev, &info); @@ -361,7 +361,8 @@ main(int argc, const char *const *argv) } else if (S_ISCHR(st.st_mode)) { // character special: a device or partition under BeOS // or under FreeBSD - #if !(defined(__BEOS__) || defined(__HAIKU__)) && !defined(HAIKU_HOST_PLATFORM_FREEBSD) + #if !defined(HAIKU_TARGET_PLATFORM_HAIKU) \ + && !defined(HAIKU_HOST_PLATFORM_FREEBSD) fprintf(stderr, "Error: Character special devices not " "supported on this platform.\n"); @@ -612,11 +613,11 @@ main(int argc, const char *const *argv) partitionOffset = partition->Offset(); #else // partitions are block devices under Haiku, but not under BeOS - #ifndef __HAIKU__ + #ifdef HAIKU_TARGET_PLATFORM_HAIKU fprintf(stderr, "Error: Block devices not supported on this " "platform!\n"); exit(1); - #endif // __HAIKU__ + #endif // HAIKU_TARGET_PLATFORM_HAIKU #endif } else { @@ -633,7 +634,7 @@ main(int argc, const char *const *argv) exit(1); } - #if (defined(__BEOS__) || defined(__HAIKU__)) + #ifdef HAIKU_TARGET_PLATFORM_HAIKU // get a partition info if (!noPartition @@ -668,7 +669,7 @@ main(int argc, const char *const *argv) kSecondBootCodePartOffset, kSecondBootCodePartSize, dryRun); -#ifdef __HAIKU__ +#ifdef HAIKU_TARGET_PLATFORM_HAIKU // check if this partition is mounted BDiskDeviceRoster roster; BPartition* partition; @@ -703,7 +704,7 @@ main(int argc, const char *const *argv) "partition is mounted!\n"); } } -#endif // __HAIKU__ +#endif // HAIKU_TARGET_PLATFORM_HAIKU close(fd); } diff --git a/src/build/libpackage/Jamfile b/src/build/libpackage/Jamfile index d3f8dfcfc8..9cd255bf7e 100644 --- a/src/build/libpackage/Jamfile +++ b/src/build/libpackage/Jamfile @@ -1,14 +1,5 @@ SubDir HAIKU_TOP src build libpackage ; -# TODO: Hack to make things build on Haiku. The right solution is to build -# libbe_build and friends on Haiku as well and use the exact same build -# environment as on other systems. -if $(HOST_PLATFORM) = haiku_host { - UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; - UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ; - UsePrivateBuildHeaders . ; -} - UsePrivateBuildHeaders kernel package shared ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package ] ; diff --git a/src/build/libshared/Jamfile b/src/build/libshared/Jamfile index 94e74a5d9d..44984b7097 100644 --- a/src/build/libshared/Jamfile +++ b/src/build/libshared/Jamfile @@ -2,7 +2,6 @@ SubDir HAIKU_TOP src build libshared ; USES_BE_API on libshared_build.a = true ; -UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; UsePrivateBuildHeaders shared ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits shared ] ; diff --git a/src/tools/Jamfile b/src/tools/Jamfile index 8e9e08724a..23877f62c1 100644 --- a/src/tools/Jamfile +++ b/src/tools/Jamfile @@ -1,6 +1,5 @@ SubDir HAIKU_TOP src tools ; -UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; UsePrivateBuildHeaders app storage ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src/bin ] ; @@ -22,16 +21,6 @@ local tools = USES_BE_API on $(tools) = true ; -# TODO: temporary kludge -local libHaikuCompat ; -if $(HOST_PLATFORM) in r5 bone dano { - ObjectC++Flags database_support.cpp UpdateMimeInfoThread.cpp - MimeUpdateThread.cpp - : -include [ FDirName $(HAIKU_TOP) headers build - HaikuBuildCompatibility.h ] ; - libHaikuCompat = libhaikucompat_build.a ; -} - BuildPlatformMain catattr : catattr.cpp : $(HOST_LIBBE) ; UsePrivateObjectHeaders copyattr.cpp : shared : : true ; @@ -55,34 +44,11 @@ BuildPlatformMain generate_boot_screen : BuildPlatformMain listattr : listattr.cpp : $(HOST_LIBBE) ; -if $(HOST_PLATFORM_BEOS_COMPATIBLE) { - AddResources mimeset : mimeset.rdef ; -} - -local mimesetSources = - mimeset.cpp -# Mime.cpp -# UpdateMimeInfoThread.cpp -# MimeUpdateThread.cpp -; - -if $(HOST_PLATFORM) = haiku_host { - mimesetSources += AppFileInfo.cpp ; -} - BuildPlatformMain mimeset : - $(mimesetSources) - : $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) $(libHaikuCompat) + mimeset.cpp + : $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ; -if $(HOST_PLATFORM_BEOS_COMPATIBLE) { - SEARCH on [ FGristFiles AppFileInfo.cpp ] - = [ FDirName $(HAIKU_TOP) src build libbe storage ] ; - - SourceSysHdrs AppFileInfo.cpp UpdateMimeInfoThread.cpp - : [ FDirName $(HAIKU_TOP) headers build os storage ] ; -} - BuildPlatformMain mkindex : mkindex.cpp : $(HOST_LIBBE) ; BuildPlatformMain rm_attrs_tmp : rm_attrs.cpp @@ -101,7 +67,7 @@ BuildPlatformMain settype : settype.cpp : $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ; BuildPlatformMain setversion : setversion.cpp : $(HOST_LIBBE) - $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) $(libHaikuCompat) ; + $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ; BuildPlatformMain xres : xres.cpp : $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ; diff --git a/src/tools/keymap/Jamfile b/src/tools/keymap/Jamfile index 7336270139..b14ee7e2f2 100644 --- a/src/tools/keymap/Jamfile +++ b/src/tools/keymap/Jamfile @@ -1,6 +1,5 @@ SubDir HAIKU_TOP src tools keymap ; -UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; UsePrivateBuildHeaders shared storage ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin keymap ] ; @@ -8,23 +7,17 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin keymap ] ; USES_BE_API on keymap = true ; local regexSources ; -local storageSources ; if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos { UseHeaders [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ; SubDirCcFlags -D__USE_GNU -DHAVE_STDBOOL_H ; regexSources = regex.c ; } -if $(HOST_PLATFORM) = haiku_host { - # those are missing from early Haiku builds - storageSources = FileIO.cpp ; -} BuildPlatformMain keymap : main.cpp Keymap.cpp $(regexSources) - $(storageSources) : libshared_build.a $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ; @@ -32,6 +25,3 @@ LinkAgainst keymap : $(HOST_LIBBE) ; SEARCH on [ FGristFiles $(regexSources) ] = [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ; - -SEARCH on [ FGristFiles $(storageSources) ] - = [ FDirName $(HAIKU_TOP) src kits storage ] ; diff --git a/src/tools/package/Jamfile b/src/tools/package/Jamfile index 8c72d378fa..771e6a2bbf 100644 --- a/src/tools/package/Jamfile +++ b/src/tools/package/Jamfile @@ -1,13 +1,5 @@ SubDir HAIKU_TOP src tools package ; -# TODO: Hack to make things build on Haiku. The right solution is to build -# libbe_build and friends on Haiku as well and use the exact same build -# environment as on other systems. -if $(HOST_PLATFORM) = haiku_host { - UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; - UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ; -} - UsePrivateBuildHeaders shared kernel ; SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin package ] ; diff --git a/src/tools/rc/Jamfile b/src/tools/rc/Jamfile index 0ed8df8c62..3c36683254 100644 --- a/src/tools/rc/Jamfile +++ b/src/tools/rc/Jamfile @@ -15,19 +15,9 @@ SubDirC++Flags -include $(r5Compatibility) ; BuildPlatformStaticLibrary librdef.a : compile.cpp decompile.cpp lexer.l parser.y rdef.cpp ; -# On BeOS incompatible platforms we implicitly link against libroot_build.so, -# which does already include the strl*() routines. -local strlSources ; -if $(HOST_PLATFORM_BEOS_COMPATIBLE) { - strlSources = strlcpy.c strlcat.c ; -} - BuildPlatformMain rc : rc.cpp - # these two are needed for R5 only - $(strlSources) - : librdef.a $(HOST_LIBSTDC++) $(HOST_LIBBE) $(HOST_LIBSUPC++) ;