/[cmucl]/src/BUILDING
ViewVC logotype

Diff of /src/BUILDING

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by rtoy, Tue May 17 16:14:05 2005 UTC revision 1.20 by agoncharov, Tue Mar 25 15:16:36 2008 UTC
# Line 1  Line 1 
1  -*- Mode: text -*-  -*- Mode: text -*-
2    
3  Building CMU CL  Building CMU CL
4  ===============  ===============
5    
# Line 68  Setting up a build environment Line 69  Setting up a build environment
69    
70  That's it, you are now ready to build CMU CL.  That's it, you are now ready to build CMU CL.
71    
72    A quick guide for simple builds
73    -------------------------------
74    
75    We recommend that you read all of this document, but in case you don't
76    want to do that and in case you know, somehow, that the version of
77    CMUCL you are building from will build the sources you have, here is a
78    quick guide.
79    
80    a) Simple builds
81    
82       Use this to build from a version of CMUCL that is very close to the
83       sources you are trying to build now:
84    
85       src/tools/build.sh -C "" -o "<name-of-old-lisp> <options-to-lisp>"
86    
87       This will build CMUCL 3 times, each time with the result of the
88       previous build.  The last time, the additional libraries like CLX,
89       CLM, and Hemlock are built.  The final result will be in the
90       directory build-4.
91    
92       This script basically runs create-target.sh, build-world.sh,
93       load-world.sh three times.  See below for descriptions of these
94       scripts.
95    
96    b) Slightly more complicated builds
97    
98       For slightly more complicated builds, you may need to use some
99       bootstrap files.  See below for more information about these
100       bootstrap files.
101    
102       For these, you can use this:
103    
104       src/tools/build.sh -C "" -o "<old-lisp>" -B boot1.lisp -B boot2.lisp
105    
106       The bootstrap files listed with the -B option (as many as needed)
107       are loaded in order, so be sure to get them right.
108    
109       As in a) above, three builds are done, and the result is in the
110       directory build-4.
111    
112    c) More complicated builds
113    
114       If you have more complicated builds, this script probably will not
115       work, and definitely does not handle cross-compiles.  In this case,
116       you will have to invoke the individual scripts by hand, as
117       described below.
118    
119    How do you know which of the three options above apply?  The easiest
120    way is to look in src/bootfiles/<version>/* for boot files.  If the
121    file date of a boot file is later than the version of CMUCL you are
122    building from, then you need to use b) or c) above.  You may need to
123    read the bootfiles for additional instructions, if any.
124    
125    If there are no bootfiles, then you can use a) above.
126    
127    The build.sh script supports other options, and src/tools/build.sh -?
128    will give a quick summary.  Read src/tools/build.sh for more
129    information.
130    
131  A general outline of the build process  A general outline of the build process
132  --------------------------------------  --------------------------------------
# Line 555  again.  Just follow the directions for a Line 614  again.  Just follow the directions for a
614  xtarget/lisp/lisp as your compiler.  Be sure to use create-target.sh  xtarget/lisp/lisp as your compiler.  Be sure to use create-target.sh
615  to create a new directory where the result can go.  to create a new directory where the result can go.
616    
617    Cross-Platform Cross-Compile
618    ----------------------------
619    
620    A cross-platform cross-compile is very similar to a normal
621    cross-compile, and the basic steps are the same.  For the sake of
622    concreteness, assume we are on ppc/darwin and want to cross-compile
623    to x86/linux.
624    
625    To simplify things, we assume that both platforms have access to the
626    same file system, via NFS or something else.
627    
628    1. As above, we need to create directories for the cross-compiler and
629       compiled target.  We assume we are on ppc/darwin.  So, when running
630       create-target.sh we need to specify the target:
631    
632            src/tools/create-target.sh x86-cross x86
633            src/tools/create-target.sh x86-target x86
634    
635    2. Adjust the cross-compilation script.  An example for ppc/darwin to
636       x86/linux is in src/tools/cross-scripts/cross-ppc-x86.lisp.
637    
638    3. Build the cross compiler and target, as above, using the specified
639       cross-compile script:
640    
641            src/tools/cross-build-world.sh x86-target x86-cross cross.lisp [ppc binary]
642    
643       where cross.lisp is the cross-compile script from 2) above.
644    
645    4. Everything has now been compiled for the x86/linux target.  We need
646       to compile the C code for x86 and create a lisp.core from the
647       kernel.core.  This is where it's useful to have both platforms be
648       able to access the same file system.  If not, you will need to copy
649       all of the generated files from ppc/darwin to x86/linux.  Basically
650       everything in xtarget needs to be copied.
651    
652       Note carefully that you may have to edit lisp/internals.h and/or
653       lisp/internals.inc to have the correct features.  This is a known
654       bug in the generation of these files during cross-compilation.
655    
656       Compile the lisp code:
657    
658            src/tools/rebuild-lisp.sh x86-target
659    
660    5. Now run load-world.sh to create the desired lisp.core from lisp and
661       kernel.core.  As above, PCL has not been compiled, so select
662       restart 3 (return nil from pclload) to create lisp.core
663    
664            src/tools/load-world.sh x86-target "new x86"
665    
666    At this point, you will have a shiny new lisp on the new platform.
667    Since it's missing PCL, you will need to do at least one normal build
668    to get PCL included.  This is also a good check to see if everything
669    was compiled properly.  A full set of builds via build.sh might be
670    good at this point too.
671    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.5