diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index fc5c100317..d9b15a417f 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -466,7 +466,8 @@ SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host : linux freebsd darwin sunos cygwin ; if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd - || $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin { + || $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin + || $(HOST_PLATFORM) = sunos { # don't use lex: otherwise rc will not work correctly if $(LEX) = lex { LEX = flex ; @@ -696,6 +697,10 @@ if $(HOST_PLATFORM_HAIKU_COMPATIBLE) { HOST_NETWORK_LIBS = net ; HOST_NETAPI_LIB = netapi ; HOST_SELECT_UNAME_ETC_LIB = net ; +} else if $(HOST_PLATFORM) = "sunos" { + HOST_NETWORK_LIBS = xnet ; + HOST_NETAPI_LIB = ; + HOST_SELECT_UNAME_ETC_LIB = ; } else { # Linux,... HOST_NETWORK_LIBS = ; @@ -838,7 +843,8 @@ switch $(TARGET_PLATFORM) { case linux : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LINUX ; case freebsd : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_FREEBSD ; case darwin : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_DARWIN ; - case cygwin : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_CYGWIN ; + case cygwin : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_CYGWIN ; + case sunos : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_SUNOS ; case libbe_test : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LIBBE_TEST ; } @@ -851,7 +857,8 @@ switch $(HOST_PLATFORM) { case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ; case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ; case darwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_DARWIN ; - case cygwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_CYGWIN ; + case cygwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_CYGWIN ; + case sunos : HOST_DEFINES += HAIKU_HOST_PLATFORM_SUNOS ; } diff --git a/headers/build/BeOSBuildCompatibility.h b/headers/build/BeOSBuildCompatibility.h index 23d39ce48e..229b1c43a3 100644 --- a/headers/build/BeOSBuildCompatibility.h +++ b/headers/build/BeOSBuildCompatibility.h @@ -5,7 +5,9 @@ #ifndef __addr_t_defined #define __addr_t_defined #endif +#endif +#if defined(HAIKU_HOST_PLATFORM_CYGWIN) || defined(HAIKU_HOST_PLATFORM_SUNOS) #ifndef DEFFILEMODE #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #endif @@ -17,6 +19,13 @@ #include #endif +#ifdef HAIKU_HOST_PLATFORM_SUNOS +# include +# ifndef NAME_MAX +# define NAME_MAX MAXNAMELEN +# endif +#endif + typedef unsigned long haiku_build_addr_t; #define addr_t haiku_build_addr_t @@ -43,7 +52,7 @@ extern size_t strlcat(char *dest, const char *source, size_t length); extern size_t strnlen(const char *string, size_t length); #endif -#if defined(HAIKU_HOST_PLATFORM_CYGWIN) +#if defined(HAIKU_HOST_PLATFORM_CYGWIN) || defined(HAIKU_HOST_PLATFORM_SUNOS) extern char * stpcpy(char *dest, const char *src); extern char * strcasestr(const char *s, const char *find); #endif diff --git a/headers/build/host/sunos/endian.h b/headers/build/host/sunos/endian.h new file mode 100644 index 0000000000..d47d89c404 --- /dev/null +++ b/headers/build/host/sunos/endian.h @@ -0,0 +1,20 @@ +#ifndef _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN +#define _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN + +// There's no in Solaris. + +#include + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __PDP_ENDIAN 3412 + +#if defined(_LITTLE_ENDIAN) +#define BYTE_ORDER __LITTLE_ENDIAN +#elif defined(_BIG_ENDIAN) +#define BYTE_ORDER __BIG_ENDIAN +#else +#error Unable to determine byte order! +#endif + +#endif // _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN diff --git a/src/bin/keymap/main.cpp b/src/bin/keymap/main.cpp index 10e8689d3a..b2b59eb50c 100644 --- a/src/bin/keymap/main.cpp +++ b/src/bin/keymap/main.cpp @@ -15,8 +15,12 @@ #include "Keymap.h" +#ifdef HAIKU_HOST_PLATFORM_SUNOS +static const char *sProgramName = "keymap"; +#else extern char *__progname; static const char *sProgramName = __progname; +#endif static void diff --git a/src/bin/mimeset.cpp b/src/bin/mimeset.cpp index 3b4eb31f7c..38b3d7da0a 100644 --- a/src/bin/mimeset.cpp +++ b/src/bin/mimeset.cpp @@ -12,8 +12,12 @@ #include +#ifdef HAIKU_HOST_PLATFORM_SUNOS +static const char *sProgramName = "mimeset"; +#else extern const char *__progname; static const char *sProgramName = __progname; +#endif // options bool gFiles = true; diff --git a/src/bin/rc/rc.cpp b/src/bin/rc/rc.cpp index 30fcef35d6..cd0ed4cfbc 100644 --- a/src/bin/rc/rc.cpp +++ b/src/bin/rc/rc.cpp @@ -29,10 +29,16 @@ #include "rdef.h" +#ifndef HAIKU_HOST_PLATFORM_SUNOS extern const char *__progname; +#endif static const char *kTitle = "Haiku Resource Compiler 1.1"; +#ifdef HAIKU_HOST_PLATFORM_SUNOS +static const char *kProgramName = "rc"; +#else static const char *kProgramName = __progname; +#endif static bool sQuiet = false; diff --git a/src/bin/setversion.cpp b/src/bin/setversion.cpp index 9b53ca6c97..ab9aa60789 100644 --- a/src/bin/setversion.cpp +++ b/src/bin/setversion.cpp @@ -15,9 +15,13 @@ #include +#ifdef HAIKU_HOST_PLATFORM_SUNOS +const char *kProgramName = "setversion"; +#else extern const char *__progname; const char *kProgramName = __progname; +#endif enum arg_needed { diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile index f57629fbb7..ae9109c872 100644 --- a/src/build/libroot/Jamfile +++ b/src/build/libroot/Jamfile @@ -27,7 +27,7 @@ if $(HOST_PLATFORM) != darwin { strlSources = strlcpy.c strlcat.c ; } -if $(HOST_PLATFORM) = cygwin { +if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos { strlSources += stpcpy.c strcasestr.c ; } diff --git a/src/tools/bfs_shell/Jamfile b/src/tools/bfs_shell/Jamfile index 3b9b4268b1..4783cf02f2 100644 --- a/src/tools/bfs_shell/Jamfile +++ b/src/tools/bfs_shell/Jamfile @@ -24,6 +24,12 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) && ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) { libHaikuCompat = libhaikucompat_build.a ; } +# platform specific libraries +local fsShellCommandLibs ; +if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) { + fsShellCommandLibs = $(HOST_NETWORK_LIBS) ; +} + UsePrivateHeaders fs_shell ; BuildPlatformMain bfs_shell @@ -43,5 +49,5 @@ BuildPlatformMain bfs_shell kernel_interface.cpp : fs_shell.a $(libHaikuCompat) $(HOST_LIBSUPC++) $(HOST_LIBSTDC++) - $(HOST_LIBROOT) + $(HOST_LIBROOT) $(fsShellCommandLibs) ; diff --git a/src/tools/fs_shell/Jamfile b/src/tools/fs_shell/Jamfile index 4e84d63606..72c0e01f4b 100644 --- a/src/tools/fs_shell/Jamfile +++ b/src/tools/fs_shell/Jamfile @@ -18,15 +18,17 @@ local defines = [ FDefines FS_SHELL=1 ] ; SubDirCcFlags $(defines) ; SubDirC++Flags $(defines) ; -# platform specific sources +# platform specific sources/libraries local fsShellCommandSources ; local externalCommandsSources ; +local fsShellCommandLibs ; if $(HOST_PLATFORM_BEOS_COMPATIBLE) { fsShellCommandSources = fs_shell_command_beos.cpp ; externalCommandsSources = external_commands_beos.cpp ; } else { fsShellCommandSources = fs_shell_command_unix.cpp ; externalCommandsSources = external_commands_unix.cpp ; + fsShellCommandLibs = $(HOST_NETWORK_LIBS) ; } BuildPlatformStaticLibrary fs_shell.a : @@ -72,4 +74,5 @@ SEARCH on [ FGristFiles rootfs.cpp ] BuildPlatformMain fs_shell_command : fs_shell_command.cpp $(fsShellCommandSources) - : $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ; + : $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) $(fsShellCommandLibs) ; + diff --git a/src/tools/keymap/Jamfile b/src/tools/keymap/Jamfile index 2f0efc8d4d..af23be6bd2 100644 --- a/src/tools/keymap/Jamfile +++ b/src/tools/keymap/Jamfile @@ -5,7 +5,7 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin keymap ] ; USES_BE_API on keymap = true ; local reSources ; -if $(HOST_PLATFORM) = cygwin { +if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos { reSources = regex.c ; } @@ -19,4 +19,4 @@ BuildPlatformMain keymap : LinkAgainst keymap : $(HOST_LIBBE) ; SEARCH on [ FGristFiles $(reSources) ] - = [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ; \ No newline at end of file + = [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ; diff --git a/src/tools/makebootable/platform/bios_ia32/Jamfile b/src/tools/makebootable/platform/bios_ia32/Jamfile index aab67f8a67..19bba03750 100644 --- a/src/tools/makebootable/platform/bios_ia32/Jamfile +++ b/src/tools/makebootable/platform/bios_ia32/Jamfile @@ -19,7 +19,8 @@ if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd { # Write the stage 1 boot loader into the makebootable resources. On Darwin # resources don't seem to work; there we use an attribute instead. -if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != cygwin { +if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != cygwin + && $(HOST_PLATFORM) != sunos { AddFileDataResource makebootable : RAWT:666:BootCode : stage1.bin ; } @@ -30,6 +31,7 @@ BuildPlatformMain makebootable : ; # on Darwin write the boot loader code into an attribute -if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin { +if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin + || $(HOST_PLATFORM) = sunos { AddFileDataAttribute makebootable : BootCode : raw : stage1.bin ; }