NB. standard j boot script

18!:4 <'z' NB. start in z

NB. =========================================================
3 : 0''
ndx=. ({."1 SYSTEMFOLDERS_j_) i. <'system'
sys=. (> 1 { ndx { SYSTEMFOLDERS_j_), PATHSEP_j_

NB. ---------------------------------------------------------
NB. following assumes DISPLAYLOAD is set in immex, then
NB. the profile loaded. No need for another ijx window
if. 0=4!:0<'DISPLAYLOAD_j_' do.
  DISPLAYLOAD_j_=: 1
  boot=. 3 : ('0!:0 <y.[y. 1!:2[2') @ jhostpath @ (sys&,)
  IFJIJX_j_=: 1 NB. no ijx window
else.
  DISPLAYLOAD_j_=: 0
  boot=. 3 : '0!:0 <y.' @ jhostpath @ (sys&,)
end.

NB. ---------------------------------------------------------
boot 'main\sysenv.ijs'
boot 'main\stdlib.ijs'
boot 'main\colib.ijs'

if. IFCONSOLE do.
  boot 'main\conlib.ijs'
  boot 'extras\util\jadecon.ijs'
else.
  boot 'main\winlib.ijs'
  boot 'extras\util\jadefull.ijs'
  boot 'extras\util\jijs.ijs'
  boot 'extras\util\configur.ijs'
  configure_jcfg_ 0
  if. -. IFJIJX_j_ do. newijx_jijs_ 0 end.
end.

NB. ---------------------------------------------------------
NB. fix up SYSTEMFOLDERS
NB. ensure home is defined (moved to profile.ijs in 504)
sys=. 'binary';_12 }. 1!:45''
if. -. (<'home') e. {."1 SYSTEMFOLDERS_j_ do.
  home=. 2!:5 'HOME'
  if. 0 e. home do.
    home=. jpath '~profile'
  end.
  sys=. sys ,: 'home';home
end.
SYSTEMFOLDERS_j_=: /:~ SYSTEMFOLDERS_j_, sys

NB. ---------------------------------------------------------
NB. JVERSION used in about box
t=. 'none',LF
r=. 'Binary: '
try. r=. r,1!:1 <jpath'~binary/version_bin.txt' catch. r=. r,t end.
r=. r,'Library: '
try. r=. r,1!:1 <jpath'~system/main/version_lib.txt' catch. r=. r,t end.
r=. r,'Help: '
try. r=. r,1!:1 <jpath'~system/extras/help/version_hlp.txt' catch. r=. r,t end.
JVERSION=: toJ r,'Engine: ',(9!:14''),LF

''
)

NB. =========================================================
18!:4 <'base' NB. end in base

NB. =========================================================
NB. process ARGV if provided
3 : 0''
if. (<'-jprofile') e. ARGV do. return. end.
c=. >:IFJIJX_j_ NB. program name and -jijx if present
if. c<#ARGV do.
  if. (<'-js')=c{ARGV do.
    ARGVVERB=: 3 : ((>:c)}.ARGV) NB. define verb in base
    ARGVVERB ''
  else.
    load CRLF -.~ > c{ARGV
  end.
end.
''
)
