1 ! Copyright (C) 2004, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors init namespaces words io
4 kernel.private math memory continuations kernel io.files
5 io.backend system parser vocabs sequences prettyprint
6 vocabs.loader combinators splitting source-files strings
7 definitions assocs compiler.errors compiler.units
8 math.parser generic sets debugger command-line ;
11 SYMBOL: bootstrap-time
13 : default-image-name ( -- string )
14 vm file-name os windows? [ "." split1 drop ] when
15 ".image" append resource-path ;
18 "Cross-referencing..." print flush
19 H{ } clone crossref set-global
24 : load-components ( -- )
26 [ get-global " " split harvest ] bi@
28 [ "bootstrap." prepend require ] each ;
30 : count-words ( pred -- )
31 all-words swap count number>string write ;
33 : print-report ( time -- )
36 "Bootstrap completed in " write number>string write
37 " minutes and " write number>string write " seconds." print
39 [ compiled>> ] count-words " compiled words" print
40 [ symbol? ] count-words " symbol words" print
41 [ ] count-words " words total" print
43 "Bootstrapping is complete." print
44 "Now, you can run Factor:" print
45 vm write " -i=" write "output-image" get print flush ;
51 default-image-name "output-image" set-global
53 "math compiler threads help io tools ui ui.tools random unicode handbook" "include" set-global
54 "" "exclude" set-global
58 "-no-crossref" cli-args member? [ do-crossref ] unless
61 os wince? [ "windows.ce" require ] when
62 os winnt? [ "windows.nt" require ] when
65 "stage2: deployment mode" print
75 ] with-compiler-errors
79 f error-continuation set-global
82 "tools.deploy.shaker" run
91 output-stream get [ stream-flush ] when*
92 ] [ print-error 1 exit ] recover
95 millis r> - dup bootstrap-time set-global
98 "output-image" get save-image-and-exit
102 dup print-error flush
104 [ restarts. vocab-main execute ]