From b9a5b9a6ee494261f2882bfc0ee9fde92282bef6 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Thu, 14 Jun 2007 05:17:59 +0000 Subject: [PATCH] fix the build on darwin: -fs_shell was using weak aliases, which is apparently not supported on the darwin toolchain (or it's supported in some different way) -remove building strl* routines for some of the host tools, since that already exists in libSystem git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21407 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/build/libroot/Jamfile | 8 ++++++-- src/tools/fs_shell/driver_settings.cpp | 11 ++++++++++- src/tools/rc/Jamfile | 8 ++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile index 174d4b6c1f..b5b81bfe3a 100644 --- a/src/build/libroot/Jamfile +++ b/src/build/libroot/Jamfile @@ -21,6 +21,11 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers build private kernel ] : true ; # locate the library MakeLocate libroot_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ; +# darwin already has strlcpy and strlcat in libSystem +if $(HOST_PLATFORM) != darwin { +STRLSRC = strlcpy.c strlcat.c ; +} + BuildPlatformSharedLibrary libroot_build.so : atomic.cpp byteorder.cpp @@ -32,8 +37,7 @@ BuildPlatformSharedLibrary libroot_build.so : sem.cpp thread.cpp - strlcpy.c - strlcat.c + $(STRLSRC) strnlen.c : diff --git a/src/tools/fs_shell/driver_settings.cpp b/src/tools/fs_shell/driver_settings.cpp index b92090983e..7798c93c51 100644 --- a/src/tools/fs_shell/driver_settings.cpp +++ b/src/tools/fs_shell/driver_settings.cpp @@ -869,9 +869,18 @@ fssh_get_driver_settings(void *handle) return &((settings_handle *)handle)->settings; } - +#ifndef HAIKU_HOST_PLATFORM_DARWIN // this creates an alias of the above function // unload_driver_settings() is the same as delete_driver_settings() extern "C" __typeof(fssh_unload_driver_settings) fssh_delete_driver_settings __attribute__ ((alias ("fssh_unload_driver_settings"))); +#else +// can't use weak aliases on darwin apparently +fssh_status_t +fssh_delete_driver_settings(void *handle) +{ + return fssh_unload_driver_settings(handle); +} +#endif + diff --git a/src/tools/rc/Jamfile b/src/tools/rc/Jamfile index 7382aa3fba..adeb7991c8 100644 --- a/src/tools/rc/Jamfile +++ b/src/tools/rc/Jamfile @@ -13,12 +13,16 @@ SubDirC++Flags -include $(r5Compatibility) ; BuildPlatformStaticLibrary librdef.a : compile.cpp decompile.cpp lexer.l parser.y rdef.cpp ; +# these platforms do not need a second copy of the strl routines +if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != linux && $(HOST_PLATFORM) != freebsd { +STRLSRC = strlcpy.c strlcat.c ; +} + BuildPlatformMain rc : rc.cpp # these two are needed for R5 only - strlcpy.c - strlcat.c + $(STRLSRC) ; LinkAgainst rc : librdef.a $(HOST_LIBSTDC++) $(HOST_LIBBE) $(HOST_LIBSUPC++) ;