diff --git a/core/bootstrap/compiler/compiler.factor b/core/bootstrap/compiler/compiler.factor index 7d4db3c473..ab09279a7b 100755 --- a/core/bootstrap/compiler/compiler.factor +++ b/core/bootstrap/compiler/compiler.factor @@ -14,7 +14,7 @@ IN: bootstrap.compiler "alien.remote-control" require ] unless -"cpu." cpu append require +"cpu." cpu word-name append require : enable-compiler ( -- ) [ optimized-recompile-hook ] recompile-hook set-global ; diff --git a/core/bootstrap/image/image.factor b/core/bootstrap/image/image.factor index fc963683b6..e2fa5833eb 100755 --- a/core/bootstrap/image/image.factor +++ b/core/bootstrap/image/image.factor @@ -12,7 +12,8 @@ io.encodings.binary ; IN: bootstrap.image : 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." swap ".image" 3append ; diff --git a/core/system/system.factor b/core/system/system.factor index 87bbcfdc3f..5a0faeece9 100755 --- a/core/system/system.factor +++ b/core/system/system.factor @@ -2,12 +2,40 @@ ! See http://factorcode.org/license.txt for BSD license. IN: system 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 +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 ; : vm ( -- path ) 14 getenv ;