(linenum→info "unix/slp.c:2238")

gauche/0.8.12/HACKING

    1: This file is for those who wants to hack the cutting-edge
    2: Gauche sources from the CVS repository.  If you just want to
    3: compile from the distribution, you don't need to read any further.
    4: 
    5: 
    6: [TOOLS REQUIRED FOR BUILDING]
    7: 
    8: On Unix platforms
    9: -----------------
   10: 
   11: In order to build Gauche from the CVS sources, instead of from
   12: the distribution, you need to have autoconf 2.54 or higher.
   13: The author using autoconf 2.57.
   14: 
   15: You also need to have the latest Gauche installed on your
   16: machine, for it is required to generate some C files.
   17: (see also CHANGING VM INSTRUCTIONS below).
   18: 
   19: The CVS source tree doesn't include "configure" scripts.
   20: You can use the DIST script like the following to generate them.
   21: 
   22:   % ./DIST gen
   23: 
   24: Note for seasoned libtool/automake users: the CVS source tree
   25: includes files that are usually generated automatically by
   26: autotools, such as aclocal.m4, ltmain.sh, src/gauche/config.h.in,
   27: etc.  Be careful not to clobber these files.  First, if your
   28: autotools version doesn't match mine, it tends to break.
   29: Second, those files are likely to be edited after generated,
   30: in order to fix some build problem on certain platform.
   31: 
   32: 
   33: On Windows/VisualC
   34: ------------------
   35: 
   36: Gauche build process largely relies on the code generation
   37: during building, and it is lots of pain to adapt it for VC.
   38: So we chose a hybrid approach; the source tree needs to be
   39: prepaired on the Unix platform (or Cygwin) with pre-installed
   40: Gauche so that the machine-generated files are included.
   41: To prepare source tree, run 'DIST' command as the following:
   42: 
   43:   % ./DIST winvc
   44: 
   45: Once preparation is done, look for the VC solution file under
   46: winnt/ subdirectory.  
   47: 
   48: 
   49: 
   50: [CHANGING VM INSTRUCTIONS]
   51: 
   52: As of 0.8.4, Gauche's compiler is written in Scheme and should
   53: be compiled using the installed Gauche (host) itself.   If you
   54: change VM instructions of the source tree (target), you may 
   55: require extra step of compilation, since the host compiler's
   56: output may not run on the target Gauche.
   57: 
   58: Generally, whenever you added new VM instructions, defined in
   59: src/vminsn.scm, you need to take the following steps to get
   60: the new version of working gosh:
   61: 
   62:    % cd src
   63:    % gosh -ftest -fno-inline-globals ./gencomp compile.scm
   64:    % gosh -ftest -fno-inline-globals ./gencomp scmlib.scm
   65:    % gosh -ftest -fno-inline-globals ./gencomp objlib.scm
   66:    % make
   67:    % ./gosh -ftest ./gencomp compile.scm
   68:    % ./gosh -ftest ./gencomp scmlib.scm
   69:    % ./gosh -ftest ./gencomp objlib.scm
   70:    % make
   71: 
   72: The first series of gencomp generates compiled Scheme files
   73: that do not include code piece from host gosh.  If you allow
   74: inlining globals, some built-in procedures are expanded in-line
   75: using pre-compiled code vector stored in host gosh, whose
   76: instruction set may differ from the target's.
   77: 
   78: The second series of gencomp re-generates compiled Scheme files
   79: using the target gosh, enabling all optimizations.
   80: 
   81: 
   82: Removing VM instructions is even more cumbersome.  Suppose you want to
   83: remove a VM instruction WHATEVER.  First, you change compile.scm
   84: so that it will never generate WHATEVER, then 'make' to build
   85: an intermediate version of Gauche.   After that, you remove WHATEVER
   86: from vminsn.scm and follow the above steps, but make sure you use
   87: the intermediate version of Gauche in the steps [3] and [4]----if you
   88: skip this intermediate steps, you'll get an error in the step [3]
   89: since the host Gauche generates WHATEVER instruction, but cannot
   90: dump it since it can't find the instruction in the target's
   91: lib/gauche/vm/insn.scm.
   92: 
   93: 
   94: Renaming VM instruction is equally cumbersome.  You have to take
   95: two stages: Add the new instruction under the new name, first, then
   96: remove the old instruction.
   97: 
   98: 
   99: Maybe I could automate these steps later, for they are error-prone.
  100: 
  101: 
  102: [DEPENDENCIES]
  103: 
  104: Quite a few files are generated by Gauche itself if you build
  105: Gauche from scratch.  Consequently, there are qute a few nasty
  106: dependency issues:
  107: 
  108: - The compiler (compile.scm) shouldn't depend on anything that
  109:   are not compiled into the libgauche core.
  110: 
  111: - gencomp, genstub, geninsn shouldn't depend on the extension
  112:   modules except the 'pre-loaded' ones in HOSTGOSH.  
  113: 
  114: - An extension compiled by gencomp shouldn't depend on other
  115:   extension compiled by gencomp.  This is because gencomp is
  116:   run by HOSTGOSH and it may not be able to load the other
  117:   extension compiled for the target gosh.
  118: 
  119: - ext/xlink shouldn't depend on anything that requires loading
  120:   extension modules, since it is called before all the extension
  121:   modules are generated.
  122: 
Syntax (Markdown)