cpu is now a singleton
parent
7ec68e0aa7
commit
d736a8660d
|
@ -14,7 +14,7 @@ IN: bootstrap.compiler
|
||||||
"alien.remote-control" require
|
"alien.remote-control" require
|
||||||
] unless
|
] unless
|
||||||
|
|
||||||
"cpu." cpu append require
|
"cpu." cpu word-name append require
|
||||||
|
|
||||||
: enable-compiler ( -- )
|
: enable-compiler ( -- )
|
||||||
[ optimized-recompile-hook ] recompile-hook set-global ;
|
[ optimized-recompile-hook ] recompile-hook set-global ;
|
||||||
|
|
|
@ -12,7 +12,8 @@ io.encodings.binary ;
|
||||||
IN: bootstrap.image
|
IN: bootstrap.image
|
||||||
|
|
||||||
: my-arch ( -- arch )
|
: my-arch ( -- arch )
|
||||||
cpu dup "ppc" = [ >r os "-" r> 3append ] when ;
|
cpu word-name
|
||||||
|
dup "ppc" = [ >r os "-" r> 3append ] when ;
|
||||||
|
|
||||||
: boot-image-name ( arch -- string )
|
: boot-image-name ( arch -- string )
|
||||||
"boot." swap ".image" 3append ;
|
"boot." swap ".image" 3append ;
|
||||||
|
|
|
@ -2,12 +2,40 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: system
|
IN: system
|
||||||
USING: kernel kernel.private sequences math namespaces
|
USING: kernel kernel.private sequences math namespaces
|
||||||
splitting assocs system.private layouts ;
|
init splitting assocs system.private layouts words ;
|
||||||
|
|
||||||
: cpu ( -- cpu ) 8 getenv ; foldable
|
! : cpu ( -- cpu ) 8 getenv ; foldable
|
||||||
|
|
||||||
: os ( -- os ) 9 getenv ; foldable
|
: os ( -- os ) 9 getenv ; foldable
|
||||||
|
|
||||||
|
SINGLETON: x86.32
|
||||||
|
SINGLETON: x86.64
|
||||||
|
SINGLETON: arm
|
||||||
|
SINGLETON: ppc
|
||||||
|
|
||||||
|
: cpu ( -- class ) \ cpu get ;
|
||||||
|
|
||||||
|
! SINGLETON: winnt
|
||||||
|
! SINGLETON: wince
|
||||||
|
|
||||||
|
! MIXIN: windows
|
||||||
|
! INSTANCE: winnt windows
|
||||||
|
! INSTANCE: wince windows
|
||||||
|
|
||||||
|
! SINGLETON: freebsd
|
||||||
|
! SINGLETON: netbsd
|
||||||
|
! SINGLETON: openbsd
|
||||||
|
! SINGLETON: solaris
|
||||||
|
! SINGLETON: macosx
|
||||||
|
! SINGLETON: linux
|
||||||
|
|
||||||
|
! : os ( -- class ) \ os get ;
|
||||||
|
|
||||||
|
[
|
||||||
|
8 getenv "system" lookup \ cpu set-global
|
||||||
|
! 9 getenv "system" lookup \ os set-global
|
||||||
|
] "system" add-init-hook
|
||||||
|
|
||||||
: image ( -- path ) 13 getenv ;
|
: image ( -- path ) 13 getenv ;
|
||||||
|
|
||||||
: vm ( -- path ) 14 getenv ;
|
: vm ( -- path ) 14 getenv ;
|
||||||
|
|
Loading…
Reference in New Issue