/[cmucl]/src/BUILDING
ViewVC logotype

Diff of /src/BUILDING

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

revision 1.1 by toy, Fri Oct 24 16:55:36 2003 UTC revision 1.2 by rtoy, Tue May 17 16:14:05 2005 UTC
# Line 51  Setting up a build environment Line 51  Setting up a build environment
51    
52  2.) Fetch the sources and put them into the base directory  2.) Fetch the sources and put them into the base directory
53    
54      tar xzf /tmp/cmucl-18d.source.tar.gz      tar xzf /tmp/cmucl-source.tar.gz
55    
56      or, if you want to use the CVS sources directly:      or, if you want to use the CVS sources directly:
57    
58      export CVSROOT=:pserver:anonymous@cvs2.cons.org:/home/anoncvs/CVS-cmucl      export CVSROOT=:pserver:anonymous@common-lisp.net:/project/cmucl/cvsroot
59      cvs login  (password is `anonymous')      cvs login  (password is `anonymous')
60      cvs co src      cvs co src
61    
# Line 155  d) Populating the kernel.core, and dumpi Line 155  d) Populating the kernel.core, and dumpi
155     were compiled in phase a) are loaded into it, and a new lisp.core     were compiled in phase a) are loaded into it, and a new lisp.core
156     file is dumped out.     file is dumped out.
157    
158    We're not quite done yet.  This produces just a basic lisp.core.
159    To complete the build so that you something similar to what the
160    releases of CMUCL do, there are a few more steps:
161    
162    e) Build the utilities like Gray streams, simple streams, CLX, CLM,
163       and Hemlock.  Use the src/tools/build-utils.sh script for this, as
164       described below
165    
166    f) Create tarfiles using the src/tools/make-dist.sh script, as
167       explained below.
168    
169    With these tarfiles, you can install them anywhere.  The contents of
170    the tarfiles will be the same as the snapshots and releases of CMUCL.
171    
172  When cross-compiling, there is additional phase at the beginning, and  When cross-compiling, there is additional phase at the beginning, and
173  some of the phases happen with different hosts/platforms.  The initial  some of the phases happen with different hosts/platforms.  The initial
174  phase is setting up and compiling the cross-compilation backend, using  phase is setting up and compiling the cross-compilation backend, using
# Line 173  the scripts included with this little te Line 187  the scripts included with this little te
187  Overview of the included build scripts  Overview of the included build scripts
188  --------------------------------------  --------------------------------------
189    
190  * create-target.sh target-directory [lisp-variant [motif-variant]]  * src/tools/create-target.sh target-directory [lisp-variant [motif-variant]]
191    
192  This script creates a new target directory, which is a shadow of the  This script creates a new target directory, which is a shadow of the
193  source directory, that will contain all the files that are created by  source directory, that will contain all the files that are created by
# Line 211  sample setenv.lisp includes a set of fea Line 225  sample setenv.lisp includes a set of fea
225  intended configuration.  Note also that some adding or removing some  intended configuration.  Note also that some adding or removing some
226  features may require a cross-compile instead of a normal compile.  features may require a cross-compile instead of a normal compile.
227    
228  * clean-target.sh [-l] target-directory [more dirs]  * src/tools/clean-target.sh [-l] target-directory [more dirs]
229    
230  Cleans the given target directory, so that all created files will be  Cleans the given target directory, so that all created files will be
231  removed.  This is useful to force recompilation.  If the -l flag is  removed.  This is useful to force recompilation.  If the -l flag is
# Line 219  given, then the C runtime is also remove Line 233  given, then the C runtime is also remove
233  executable, any lisp cores, all object files, lisp.nm, internals.h,  executable, any lisp cores, all object files, lisp.nm, internals.h,
234  and the config file.  and the config file.
235    
236  * build-world.sh target-directory [build-binary] [build-flags...]  * src/tools/build-world.sh target-directory [build-binary] [build-flags...]
237    
238  Starts a complete world build for the given target, using the lisp  Starts a complete world build for the given target, using the lisp
239  binary/core specified as a build host.  The recompilation step will  binary/core specified as a build host.  The recompilation step will
# Line 230  step of the world build will inform you Line 244  step of the world build will inform you
244  you'll have to use the rebuild-lisp.sh script, and then restart the  you'll have to use the rebuild-lisp.sh script, and then restart the
245  world build process with build-world.sh  world build process with build-world.sh
246    
247  * rebuild-lisp.sh target-directory  * src/tools/rebuild-lisp.sh target-directory
248    
249  This script will force a complete recompilation of the C runtime code  This script will force a complete recompilation of the C runtime code
250  of CMU CL (aka the lisp executable).  Doing this will necessitate  of CMU CL (aka the lisp executable).  Doing this will necessitate
251  building a new kernel.core file, using build-world.sh.  building a new kernel.core file, using build-world.sh.
252    
253  * load-world.sh target-directory version  * src/tools/load-world.sh target-directory version
254    
255  This will finish the CMU CL rebuilding process, by loading the  This will finish the CMU CL rebuilding process, by loading the
256  remaining compiled files generated in the world build process into the  remaining compiled files generated in the world build process into the
# Line 251  ISO8601 format is often a good idea, e.g Line 265  ISO8601 format is often a good idea, e.g
265  binary that is based on sources current on the 6th May, 2002, which is  binary that is based on sources current on the 6th May, 2002, which is
266  post the 18d release.  post the 18d release.
267    
268  * build-utils.sh target-directory  * src/tools/build-utils.sh target-directory
269    
270  This script will build auxiliary libraries packaged with CMU CL,  This script will build auxiliary libraries packaged with CMU CL,
271  including CLX, CMUCL/Motif, the Motif debugger, inspector, and control  including CLX, CMUCL/Motif, the Motif debugger, inspector, and control
272  panel, and the Hemlock editor.  It will use the lisp executable and  panel, and the Hemlock editor.  It will use the lisp executable and
273  core of the given target.  core of the given target.
274    
275  * make-dist.sh [-bg] [-G group] [-O owner] target-directory version arch os  * src/tools/make-dist.sh [-bg] [-G group] [-O owner] target-directory version arch os
276    
277  This script creates both main and extra distribution tarballs from the  This script creates both main and extra distribution tarballs from the
278  given target directory, using the make-main-dist.sh and  given target directory, using the make-main-dist.sh and
279  make-extra-dist.sh scripts.  You can select the compression method via  make-extra-dist.sh scripts.  The result will be two tar files.  One
280  the -b (bzip2) and -g (gzip) flags.  The default is gzip compression.  contains the main distribution including the runtime and lisp.core
281  When making the distribution, you can also select the group and owner  with PCL (CLOS); the second contains the extra libraries such as
282  of the files via the -G and -O options.  Gray-streams, simple-streams, CLX, CLM, and Hemlock.
283    
284    Some options that are available:
285    
286      -b           Use bzip2 compression
287      -g           Use gzip compression
288      -G group     Group to use
289      -O owner     Owner to use
290    
291    If you specify both -b and -g, you will get two sets of tarfiles.  The
292    -G and -O options will attempt to set the owner and group of the files
293    when building the tarfiles.  This way, when you extract the tarfiles,
294    the owner and group will be set as specified.  You may need to be root
295    to do this because many Unix systems don't normally let you change the
296    owner and group of a file.
297    
298    The remaining arguments used to create the name of the tarfiles.  The
299    names will have the form:
300    
301       cmucl-<version>-<arch>-<os>.tar.bz2
302       cmucl-<version>-<arch>-<os>.extras.tar.bz2
303    
304    Of course, the "bz2" will be "gz" if you specified gzip compression
305    instead of bzip.
306    
307    * /src/tools/make-main-dist.sh target-directory version arch os
308    
309  * make-main-dist.sh target-directory version arch os  This is script is not normally invoked by the user; make-dist will do
310    it appropriately.
311    
312  This script creates a main distribution tarball (both in gzipped and  This script creates a main distribution tarball (both in gzipped and
313  bzipped variants) from the given target directory.  This will include  bzipped variants) from the given target directory.  This will include
# Line 277  simple streams. Line 317  simple streams.
317    
318  This is intended to be run from make-dist.sh.  This is intended to be run from make-dist.sh.
319    
320  * make-extra-dist.sh target-directory version arch os  * src/tools/make-extra-dist.sh target-directory version arch os
321    
322    This is script is not normally invoked by the user; make-dist will do
323    it appropriately.
324    
325  This script creates an extra distribution tarball (both in gzipped and  This script creates an extra distribution tarball (both in gzipped and
326  bzipped variants) from the given target directory.  This will include  bzipped variants) from the given target directory.  This will include
# Line 402  a) Bootfiles Line 445  a) Bootfiles
445     in the order they are numbered.  Be sure to remove the bootstrap     in the order they are numbered.  Be sure to remove the bootstrap
446     file once it is no longer needed.     file once it is no longer needed.
447    
448       Alternatively, the bootstrap file can just "load" the individual
449       bootfiles as needed.
450    
451  b) Cross-compiling  b) Cross-compiling
452    
# Line 440  that is up-to-date with the sources.  Ot Line 485  that is up-to-date with the sources.  Ot
485  add a bootstrap file to get any bootfiles to make your lisp  add a bootstrap file to get any bootfiles to make your lisp
486  up-to-date with the current sources.  up-to-date with the current sources.
487    
488  Create a cross-compiler directory to hold the cross-compiler and a  1.  Select a directory for the cross-compiler and compiled target:
489  target directory to hold the result:  
490            Create a cross-compiler directory to hold the cross-compiler
491            and a target directory to hold the result:
492    
493                   src/tools/create-target.sh xcross
494                   src/tools/create-target.sh xtarget
495    
496    2.  Adjust cross-compilation script
497    
498            Copy the src/tools/cross-scripts/cross-sparc-sparc.lisp to
499            xtarget/cross.lisp.  Edit it appropriately.  In this case, it
500            should look something like:
501    
502         src/tools/create-target.sh xcross              (c::new-backend "SPARC"
503         src/tools/create-target.sh xtarget                 ;; Features to add here
504                   '(:sparc :sparc-v8
505                     :complex-fp-vops
506                     :linkage-table
507                     :gencgc
508                     :stack-checking
509                     :relative-package-names
510                     :conservative-float-type
511                     :hash-new :random-mt19937
512                     :cmu :cmu19 :cmu19a
513                     )
514                   ;; Features to remove from current *features* here
515                   '(:sparc-v9 :sparc-v7 :x86 :x86-bootstrap :alpha :osf1 :mips
516                     :propagate-fun-type :propagate-float-type :constrain-float-type
517                     :openbsd :freebsd :glibc2 :linux :pentium
518                     :long-float :new-random :small))
519    
520  Copy the src/tools/cross-scripts/cross-sparc-sparc.lisp to              (setf *features* (remove :sparc-v9 *features*))
521  xtarget/cross.lisp.  Edit it appropriately.  In this case, it should              (pushnew :sparc-v8 *features*)
 look something like:  
522    
523      (c::new-backend "SPARC"          It's important to add frob *features* here as well as in the
524         ;; Features to add here          new-backend.  If you don't adjust *features*, they won't be
525         '(:sparc :sparc-v8          set appropriately in the result.
          :complex-fp-vops  
          :linkage-table  
          :gencgc  
          :stack-checking  
          :relative-package-names  
          :conservative-float-type  
          :hash-new :random-mt19937  
          :cmu :cmu19 :cmu19a  
          )  
        ;; Features to remove from current *features* here  
        '(:sparc-v9 :sparc-v7 :x86 :x86-bootstrap :alpha :osf1 :mips  
          :propagate-fun-type :propagate-float-type :constrain-float-type  
          :openbsd :freebsd :glibc2 :linux :pentium  
          :long-float :new-random :small))  
526    
527      (setf *features* (remove :sparc-v9 *features*))  3.  Build the cross compiler and target
528      (pushnew :sparc-v8 *features*)          Now compile the result:
529    
530  It's important to add frob *features* here as well as in the              src/tools/cross-build-world.sh xtarget xcross xtarget/cross.lisp [v9 binary]
 new-backend.  If you don't adjust *features*, they won't be set  
 appropriately in the result.  
531    
532  Now compile the result:  4.  Rebuild the lisp files:
533    
534          src/tools/cross-build-world.sh xtarget xcross xtarget/cross.lisp [v9 binary]          When this finishes, you need to compile the C code:
535    
536  When this finishes, you need to compile the C code:                  src/tools/rebuild-lisp.sh xtarget
537    
538          src/tools/rebuild-lisp.sh xtarget          At this point, you may want to run cross-build-world.sh again
539            to generate a new kernel.core.  It shouldn't build anything;
540            just loads everything and creates a kernel.core.
541    
542  At this point, you may want to run cross-build-world.sh again to  5.  Build the world:
 generate a new kernel.core.  It shouldn't build anything;  just loads  
 everything and creates a kernel.core.  
543    
544  With the new kernel.core, we need to create a lisp.core:          With the new kernel.core, we need to create a lisp.core:
545    
546          src/tools/load-world.sh xtarget "new lisp"                  src/tools/load-world.sh xtarget "new lisp"
547    
548  Test the result with          Test the result with
549    
550          xtarget/lisp/lisp -noinit                  xtarget/lisp/lisp -noinit
551    
552  You may now want to use this cross-compiled lisp to rebuild itself, to  However, this lisp will be missing some functionality like PCL.  You
553  make sure you haven't messed up.  You can do a normal build as  probably now want to use the compiler to rebuild everything once
554  described above, except your build-lisp is xtarget/lisp/lisp.  again.  Just follow the directions for a normal build, and use
555    xtarget/lisp/lisp as your compiler.  Be sure to use create-target.sh
556    to create a new directory where the result can go.
557    

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

  ViewVC Help
Powered by ViewVC 1.1.5