Solaris/x86 support
parent
85042a83bf
commit
2acb28ae0c
|
@ -4,6 +4,14 @@
|
||||||
<head><title>Factor change log</title></head>
|
<head><title>Factor change log</title></head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<h1>Factor 0.81:</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li>Solaris/x86 is now supported (Patrick Mauritz)</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h1>Factor 0.80:</h1>
|
<h1>Factor 0.80:</h1>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -61,6 +61,7 @@ default:
|
||||||
@echo "linux-ppc"
|
@echo "linux-ppc"
|
||||||
@echo "macosx"
|
@echo "macosx"
|
||||||
@echo "macosx-sdl -- if you wish to use the Factor GUI on Mac OS X"
|
@echo "macosx-sdl -- if you wish to use the Factor GUI on Mac OS X"
|
||||||
|
@echo "solaris"
|
||||||
@echo "windows"
|
@echo "windows"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Also, you might want to set the SITE_CFLAGS environment"
|
@echo "Also, you might want to set the SITE_CFLAGS environment"
|
||||||
|
|
|
@ -368,7 +368,7 @@ SYMBOL: first-arg
|
||||||
|
|
||||||
! Boolean logic tests
|
! Boolean logic tests
|
||||||
: logic-0 ( -- seq )
|
: logic-0 ( -- seq )
|
||||||
{ unix? win32? bootstrapping? f t } ;
|
{ bootstrapping? f t } ;
|
||||||
|
|
||||||
: logic-1 ( -- seq )
|
: logic-1 ( -- seq )
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,8 +33,8 @@ M: alien = ( obj obj -- ? )
|
||||||
] bind ;
|
] bind ;
|
||||||
|
|
||||||
: add-simple-library ( name file -- )
|
: add-simple-library ( name file -- )
|
||||||
win32? ".dll" ".so" ? append
|
os "win32" = ".dll" ".so" ? append
|
||||||
win32? "stdcall" "cdecl" ? add-library ;
|
os "win32" = "stdcall" "cdecl" ? add-library ;
|
||||||
|
|
||||||
: library-abi ( library -- abi )
|
: library-abi ( library -- abi )
|
||||||
library "abi" swap ?hash [ "cdecl" ] unless* ;
|
library "abi" swap ?hash [ "cdecl" ] unless* ;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
! Copyright (C) 2004, 2005 Slava Pestov.
|
! Copyright (C) 2004, 2006 Slava Pestov.
|
||||||
! See http://factor.sf.net/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: compiler compiler-backend io io-internals kernel
|
USING: compiler compiler-backend io io-internals kernel
|
||||||
kernel-internals lists math memory namespaces optimizer parser
|
kernel-internals lists math memory namespaces optimizer parser
|
||||||
sequences sequences-internals words ;
|
sequences sequences-internals words ;
|
||||||
|
|
||||||
"compile" get [
|
"compile" get [
|
||||||
"native-io" get [
|
"native-io" get [
|
||||||
unix? [
|
os { "freebsd" "linux" "macosx" "solaris" } member? [
|
||||||
"/library/unix/load.factor" run-resource
|
"/library/unix/load.factor" run-resource
|
||||||
] when
|
] when
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,3 @@ M: object <=>
|
||||||
: with-datastack ( stack word -- stack )
|
: with-datastack ( stack word -- stack )
|
||||||
datastack >r >r set-datastack r> execute
|
datastack >r >r set-datastack r> execute
|
||||||
datastack r> [ push ] keep set-datastack 2nip ;
|
datastack r> [ push ] keep set-datastack 2nip ;
|
||||||
|
|
||||||
: win32? ( -- ? ) os "win32" = ;
|
|
||||||
|
|
||||||
: unix? ( -- ? ) os { "freebsd" "linux" "macosx" } member? ;
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ HELP: os "( -- os )"
|
||||||
{ $values { "os" "a string" } }
|
{ $values { "os" "a string" } }
|
||||||
{ $description
|
{ $description
|
||||||
"Outputs a string descriptor of the current operating system family. Currently, this set of descriptors is:"
|
"Outputs a string descriptor of the current operating system family. Currently, this set of descriptors is:"
|
||||||
{ $code "freebsd" "linux" "macosx" "win32" "unix" }
|
{ $code "freebsd" "linux" "macosx" "solaris" "win32" "unix" }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
HELP: call "( quot -- )"
|
HELP: call "( quot -- )"
|
||||||
|
|
|
@ -1,19 +1,8 @@
|
||||||
USING: io kernel parser sequences ;
|
USING: io kernel parser sequences ;
|
||||||
|
|
||||||
"/library/unix/types.factor" run-resource
|
"/library/unix/types.factor" run-resource
|
||||||
|
"/library/unix/syscalls-" os ".factor" append3 run-resource
|
||||||
|
|
||||||
os "freebsd" = [
|
|
||||||
"/library/unix/syscalls-freebsd.factor" run-resource
|
|
||||||
] when
|
|
||||||
|
|
||||||
os "linux" = [
|
|
||||||
"/library/unix/syscalls-linux.factor" run-resource
|
|
||||||
] when
|
|
||||||
|
|
||||||
os "macosx" = [
|
|
||||||
"/library/unix/syscalls-macosx.factor" run-resource
|
|
||||||
] when
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"/library/unix/syscalls.factor"
|
"/library/unix/syscalls.factor"
|
||||||
"/library/unix/io.factor"
|
"/library/unix/io.factor"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
! Copyright (C) 2005 Slava Pestov.
|
! Copyright (C) 2005, 2006 Slava Pestov.
|
||||||
! See http://factor.sf.net/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: unix-internals
|
IN: unix-internals
|
||||||
USING: alien ;
|
USING: alien ;
|
||||||
|
|
||||||
|
@ -35,3 +35,7 @@ END-STRUCT
|
||||||
: EINTR HEX: 4 ;
|
: EINTR HEX: 4 ;
|
||||||
: EAGAIN HEX: 23 ;
|
: EAGAIN HEX: 23 ;
|
||||||
: EINPROGRESS HEX: 24 ;
|
: EINPROGRESS HEX: 24 ;
|
||||||
|
|
||||||
|
: AF_INET 2 ;
|
||||||
|
: PF_INET AF_INET ;
|
||||||
|
: SOCK_STREAM 1 ;
|
||||||
|
|
|
@ -35,3 +35,7 @@ END-STRUCT
|
||||||
: EINTR HEX: 4 ;
|
: EINTR HEX: 4 ;
|
||||||
: EAGAIN HEX: b ;
|
: EAGAIN HEX: b ;
|
||||||
: EINPROGRESS HEX: 73 ;
|
: EINPROGRESS HEX: 73 ;
|
||||||
|
|
||||||
|
: AF_INET 2 ;
|
||||||
|
: PF_INET AF_INET ;
|
||||||
|
: SOCK_STREAM 1 ;
|
||||||
|
|
|
@ -35,3 +35,7 @@ END-STRUCT
|
||||||
: EINTR HEX: 4 ;
|
: EINTR HEX: 4 ;
|
||||||
: EAGAIN HEX: 23 ;
|
: EAGAIN HEX: 23 ;
|
||||||
: EINPROGRESS HEX: 24 ;
|
: EINPROGRESS HEX: 24 ;
|
||||||
|
|
||||||
|
: AF_INET 2 ;
|
||||||
|
: PF_INET AF_INET ;
|
||||||
|
: SOCK_STREAM 1 ;
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
! Copyright (C) 2006 Patrick Mauritz.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
IN: unix-internals
|
||||||
|
USING: alien kernel kernel-internals ;
|
||||||
|
|
||||||
|
! Solaris.
|
||||||
|
|
||||||
|
: SOCK_STREAM 2 ;
|
||||||
|
|
||||||
|
: O_RDONLY HEX: 0000 ;
|
||||||
|
: O_WRONLY HEX: 0001 ;
|
||||||
|
: O_RDWR HEX: 0002 ;
|
||||||
|
: O_CREAT HEX: 0100 ;
|
||||||
|
: O_TRUNC HEX: 0200 ;
|
||||||
|
|
||||||
|
: SOL_SOCKET HEX: ffff ;
|
||||||
|
|
||||||
|
: FD_SETSIZE cell 4 = 1024 65536 ? ;
|
||||||
|
|
||||||
|
: SO_REUSEADDR 4 ;
|
||||||
|
: SO_OOBINLINE HEX: 0100 ;
|
||||||
|
: SO_SNDTIMEO HEX: 1005 ;
|
||||||
|
: SO_RCVTIMEO HEX: 1006 ;
|
||||||
|
|
||||||
|
: INADDR_ANY 0 ;
|
||||||
|
|
||||||
|
: F_SETFL 4 ; ! set file status flags
|
||||||
|
: O_NONBLOCK HEX: 80 ; ! no delay
|
||||||
|
|
||||||
|
BEGIN-STRUCT: sockaddr-in
|
||||||
|
FIELD: ushort family
|
||||||
|
FIELD: ushort port
|
||||||
|
FIELD: in_addr_t addr
|
||||||
|
FIELD: longlong unused
|
||||||
|
END-STRUCT
|
||||||
|
|
||||||
|
: EINTR HEX: 4 ;
|
||||||
|
: EAGAIN 11 ;
|
||||||
|
: EINPROGRESS 150 ;
|
|
@ -46,10 +46,6 @@ END-STRUCT
|
||||||
: gethostbyname ( name -- hostent )
|
: gethostbyname ( name -- hostent )
|
||||||
"hostent*" "libc" "gethostbyname" [ "char*" ] alien-invoke ;
|
"hostent*" "libc" "gethostbyname" [ "char*" ] alien-invoke ;
|
||||||
|
|
||||||
: AF_INET 2 ;
|
|
||||||
: PF_INET AF_INET ;
|
|
||||||
: SOCK_STREAM 1 ;
|
|
||||||
|
|
||||||
FUNCTION: int socket ( int domain, int type, int protocol ) ;
|
FUNCTION: int socket ( int domain, int type, int protocol ) ;
|
||||||
FUNCTION: int setsockopt ( int s, int level, int optname, void* optval, socklen_t optlen ) ;
|
FUNCTION: int setsockopt ( int s, int level, int optname, void* optval, socklen_t optlen ) ;
|
||||||
FUNCTION: int connect ( int s, sockaddr-in* name, socklen_t namelen ) ;
|
FUNCTION: int connect ( int s, sockaddr-in* name, socklen_t namelen ) ;
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#define FACTOR_OS_STRING "linux"
|
#define FACTOR_OS_STRING "linux"
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#define FACTOR_OS_STRING "macosx"
|
#define FACTOR_OS_STRING "macosx"
|
||||||
|
#elif defined(__sun)
|
||||||
|
#define FACTOR_OS_STRING "solaris"
|
||||||
#else
|
#else
|
||||||
#define FACTOR_OS_STRING "unix"
|
#define FACTOR_OS_STRING "unix"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue