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
6 vocabs.loader combinators splitting source-files strings
7 definitions assocs compiler.errors compiler.units
8 math.parser generic sets command-line ;
11 SYMBOL: core-bootstrap-time
13 SYMBOL: bootstrap-time
15 : default-image-name ( -- string )
16 vm file-name os windows? [ "." split1 drop ] when
17 ".image" append resource-path ;
20 "Cross-referencing..." print flush
21 H{ } clone crossref set-global
26 : load-components ( -- )
28 [ get-global " " split harvest ] bi@
30 [ "bootstrap." prepend require ] each ;
32 : count-words ( pred -- )
33 all-words swap count number>string write ;
35 : print-time ( ms -- )
39 " minutes and " write number>string write " seconds." print ;
42 "Core bootstrap completed in " write core-bootstrap-time get print-time
43 "Bootstrap completed in " write bootstrap-time get print-time
45 [ compiled>> ] count-words " compiled words" print
46 [ symbol? ] count-words " symbol words" print
47 [ ] count-words " words total" print
49 "Bootstrapping is complete." print
50 "Now, you can run Factor:" print
51 vm write " -i=" write "output-image" get print flush ;
57 default-image-name "output-image" set-global
59 "math compiler threads help io tools ui ui.tools unicode handbook" "include" set-global
60 "" "exclude" set-global
62 (command-line) parse-command-line
67 os wince? [ "windows.ce" require ] when
68 os winnt? [ "windows.nt" require ] when
70 "staging" get "deploy-vocab" get or [
71 "stage2: deployment mode" print
80 millis over - core-bootstrap-time set-global
83 ] with-compiler-errors
87 f error-continuation set-global
89 millis swap - bootstrap-time set-global
93 "tools.deploy.shaker" run
96 "resource:basis/bootstrap/finish-staging.factor" run-file
98 "resource:basis/bootstrap/finish-bootstrap.factor" run-file
101 "output-image" get save-image-and-exit
107 "resource:basis/bootstrap/bootstrap-error.factor" run-file