Patch by Andreas Faerber with changes by myself: Work towards Solaris
build platform support. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26899 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8c57f7ed08
commit
4d121ec067
@ -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 ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAIKU_HOST_PLATFORM_SUNOS
|
||||
# include <limits.h>
|
||||
# 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
|
||||
|
20
headers/build/host/sunos/endian.h
Normal file
20
headers/build/host/sunos/endian.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN
|
||||
#define _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN
|
||||
|
||||
// There's no <endian.h> in Solaris.
|
||||
|
||||
#include <sys/byteorder.h>
|
||||
|
||||
#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
|
@ -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
|
||||
|
@ -12,8 +12,12 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#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;
|
||||
|
@ -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;
|
||||
|
@ -15,9 +15,13 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifdef HAIKU_HOST_PLATFORM_SUNOS
|
||||
const char *kProgramName = "setversion";
|
||||
#else
|
||||
extern const char *__progname;
|
||||
|
||||
const char *kProgramName = __progname;
|
||||
#endif
|
||||
|
||||
|
||||
enum arg_needed {
|
||||
|
@ -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 ;
|
||||
}
|
||||
|
||||
|
@ -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 <build>bfs_shell
|
||||
@ -43,5 +49,5 @@ BuildPlatformMain <build>bfs_shell
|
||||
kernel_interface.cpp
|
||||
|
||||
: <build>fs_shell.a $(libHaikuCompat) $(HOST_LIBSUPC++) $(HOST_LIBSTDC++)
|
||||
$(HOST_LIBROOT)
|
||||
$(HOST_LIBROOT) $(fsShellCommandLibs)
|
||||
;
|
||||
|
@ -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 <build>fs_shell.a :
|
||||
@ -72,4 +74,5 @@ SEARCH on [ FGristFiles rootfs.cpp ]
|
||||
|
||||
BuildPlatformMain <build>fs_shell_command
|
||||
: fs_shell_command.cpp $(fsShellCommandSources)
|
||||
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) $(fsShellCommandLibs) ;
|
||||
|
||||
|
@ -5,7 +5,7 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin keymap ] ;
|
||||
USES_BE_API on <build>keymap = true ;
|
||||
|
||||
local reSources ;
|
||||
if $(HOST_PLATFORM) = cygwin {
|
||||
if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos {
|
||||
reSources = regex.c ;
|
||||
}
|
||||
|
||||
@ -19,4 +19,4 @@ BuildPlatformMain <build>keymap :
|
||||
LinkAgainst <build>keymap : $(HOST_LIBBE) ;
|
||||
|
||||
SEARCH on [ FGristFiles $(reSources) ]
|
||||
= [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ;
|
||||
= [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ;
|
||||
|
@ -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 <build>makebootable : RAWT:666:BootCode : stage1.bin ;
|
||||
}
|
||||
|
||||
@ -30,6 +31,7 @@ BuildPlatformMain <build>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 <build>makebootable : BootCode : raw : stage1.bin ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user