More robust bootstrap, fix X11 typo
parent
fa48c9f1f5
commit
9ca8b2a448
|
@ -1,81 +1,86 @@
|
||||||
! Copyright (C) 2004, 2006 Slava Pestov.
|
! Copyright (C) 2004, 2006 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: compiler generic help io io-internals kernel
|
USING: compiler errors generic help io io-internals kernel
|
||||||
kernel-internals math memory namespaces optimizer parser
|
kernel-internals listener math memory namespaces optimizer
|
||||||
sequences sequences-internals words ;
|
parser sequences sequences-internals words ;
|
||||||
|
|
||||||
"Cross-referencing..." print flush
|
! Wrap everything in a catch which starts a listener so you can
|
||||||
H{ } clone crossref set-global xref-words
|
! see what went wrong, instead of dealing with a fep
|
||||||
H{ } clone help-graph set-global xref-articles
|
[
|
||||||
|
"Cross-referencing..." print flush
|
||||||
"compile" get [
|
H{ } clone crossref set-global xref-words
|
||||||
"native-io" get [
|
H{ } clone help-graph set-global xref-articles
|
||||||
unix? [
|
|
||||||
"/library/unix/load.factor" run-resource
|
"compile" get [
|
||||||
|
"native-io" get [
|
||||||
|
unix? [
|
||||||
|
"/library/unix/load.factor" run-resource
|
||||||
|
] when
|
||||||
|
] when
|
||||||
|
|
||||||
|
windows? [
|
||||||
|
"/library/windows/load.factor" run-resource
|
||||||
|
] when
|
||||||
|
|
||||||
|
parse-command-line
|
||||||
|
|
||||||
|
"Compiling base..." print flush
|
||||||
|
|
||||||
|
[
|
||||||
|
\ + compile
|
||||||
|
\ = compile
|
||||||
|
{ "kernel" "sequences" "assembler" } compile-vocabs
|
||||||
|
|
||||||
|
"Compiling system..." print flush
|
||||||
|
compile-all
|
||||||
|
] with-class<cache
|
||||||
|
|
||||||
|
terpri
|
||||||
|
"Unless you're working on the compiler, ignore the errors above." print
|
||||||
|
"Not every word compiles, by design." print
|
||||||
|
terpri flush
|
||||||
|
|
||||||
|
"Initializing native I/O..." print flush
|
||||||
|
"native-io" get [ init-io ] when
|
||||||
|
|
||||||
|
"cocoa" get [
|
||||||
|
"/library/ui/cocoa/load.factor" run-resource
|
||||||
|
] when
|
||||||
|
|
||||||
|
"x11" get [
|
||||||
|
"/library/ui/x11/load.factor" run-resource
|
||||||
|
] when
|
||||||
|
|
||||||
|
windows? "native-io" get and [
|
||||||
|
"/library/windows/ui.factor" run-resource
|
||||||
|
"/library/windows/clipboard.factor" run-resource
|
||||||
|
compile-all
|
||||||
] when
|
] when
|
||||||
] when
|
] when
|
||||||
|
|
||||||
windows? [
|
|
||||||
"/library/windows/load.factor" run-resource
|
|
||||||
] when
|
|
||||||
|
|
||||||
parse-command-line
|
|
||||||
|
|
||||||
"Compiling base..." print flush
|
|
||||||
|
|
||||||
[
|
[
|
||||||
\ + compile
|
boot
|
||||||
\ = compile
|
run-user-init
|
||||||
{ "kernel" "sequences" "assembler" } compile-vocabs
|
"shell" get "shells" lookup execute
|
||||||
|
0 exit
|
||||||
|
] set-boot
|
||||||
|
|
||||||
"Compiling system..." print flush
|
[ compiled? ] word-subset length
|
||||||
compile-all
|
number>string write " compiled words" print
|
||||||
] with-class<cache
|
|
||||||
|
|
||||||
terpri
|
[ symbol? ] word-subset length
|
||||||
"Unless you're working on the compiler, ignore the errors above." print
|
number>string write " symbol words" print
|
||||||
"Not every word compiles, by design." print
|
|
||||||
terpri flush
|
|
||||||
|
|
||||||
"Initializing native I/O..." print flush
|
all-words length
|
||||||
"native-io" get [ init-io ] when
|
number>string write " words total" print
|
||||||
|
|
||||||
"cocoa" get [
|
"Total bootstrap GC time: " write gc-time
|
||||||
"/library/ui/cocoa/load.factor" run-resource
|
number>string write " ms" print
|
||||||
] when
|
|
||||||
|
|
||||||
"x11" get [
|
"Bootstrapping is complete." print
|
||||||
"/library/ui/x11/load.factor" run-resource
|
"Now, you can run ./f factor.image" print flush
|
||||||
] when
|
|
||||||
|
"factor.image" resource-path save-image
|
||||||
|
] catch [ print-error listener ] when*
|
||||||
|
|
||||||
windows? "native-io" get and [
|
|
||||||
"/library/windows/ui.factor" run-resource
|
|
||||||
"/library/windows/clipboard.factor" run-resource
|
|
||||||
compile-all
|
|
||||||
] when
|
|
||||||
] when
|
|
||||||
|
|
||||||
[
|
|
||||||
boot
|
|
||||||
run-user-init
|
|
||||||
"shell" get "shells" lookup execute
|
|
||||||
0 exit
|
|
||||||
] set-boot
|
|
||||||
|
|
||||||
[ compiled? ] word-subset length
|
|
||||||
number>string write " compiled words" print
|
|
||||||
|
|
||||||
[ symbol? ] word-subset length
|
|
||||||
number>string write " symbol words" print
|
|
||||||
|
|
||||||
all-words length
|
|
||||||
number>string write " words total" print
|
|
||||||
|
|
||||||
"Total bootstrap GC time: " write gc-time
|
|
||||||
number>string write " ms" print
|
|
||||||
|
|
||||||
"Bootstrapping is complete." print
|
|
||||||
"Now, you can run ./f factor.image" print flush
|
|
||||||
|
|
||||||
"factor.image" resource-path save-image
|
|
||||||
0 exit
|
0 exit
|
||||||
|
|
|
@ -26,7 +26,7 @@ SYMBOL: root
|
||||||
|
|
||||||
: with-x ( display-string quot -- )
|
: with-x ( display-string quot -- )
|
||||||
[
|
[
|
||||||
reset-views
|
reset-windows
|
||||||
swap initialize-x
|
swap initialize-x
|
||||||
[ close-x ] cleanup
|
[ close-x ] cleanup
|
||||||
] with-scope ;
|
] with-scope ;
|
||||||
|
|
Loading…
Reference in New Issue