Next: , Previous: , Up: Installing SCM   [Contents][Index]

2.2 GNU configure and make

scm/configure and slib/configure are Shell scripts which create the files scm/config.status and slib/config.status on Unix and MinGW systems.

The config.status files are used (included) by the Makefile to control where the packages will be installed by make install. With GNU shell (bash) and utilities, the following commands should build and install SCM and SLIB:

bash$ (cd slib; ./configure --prefix=/usr/local/)
bash$ (cd scm
> ./configure --prefix=/usr/local/
> make scmlit
> sudo make all
> sudo make install)
bash$ (cd slib; sudo make install)

If the install commands worked, skip to Testing.

If configure doesn’t work on your system, make scm/config.status and slib/config.status be empty files.

For additional help on using the configure script, run ‘./configure --help.

make all’ will attempt to create a dumped executable (see Saving Executable Images), which has very small startup latency. If that fails, it will try to compile an ordinary ‘scm’ executable.

Note that the compilation output may contain error messages; be concerned only if the ‘make install’ transcripts contain errors.

sudo’ runs the command after it as user root. On recent GNU/Linux systems, dumping requires that ‘make all’ be run as user root; hence the use of ‘sudo’.

make install’ requires root privileges if you are installing to standard Unix locations as specified to (or defaulted by) ‘./configure’. Note that this is independent of whether you did ‘sudo make all or ‘make all.


2.2.1 Making scmlit

The SCM distribution Makefile contains rules for making scmlit, a “bare-bones” version of SCM sufficient for running build. build is a Scheme program used to compile (or create scripts to compile) full featured versions of SCM (see Building SCM). To create scmlit, run ‘make scmlit in the scm/ directory.

Makefiles are not portable to the majority of platforms. If you need to compile SCM without ‘scmlit’, there are several ways to proceed:

Finding SLIB

If you didn’t create scmlit using ‘make scmlit’, then you must create a file named scm/require.scm. For most installations, scm/require.scm can just be copied from scm/requires.scm, which is part of the SCM distribution.

If, when executing ‘scmlit’ or ‘scm’, you get a message like:

ERROR: "LOAD couldn't find file " "/usr/local/src/scm/require"

then create a file require.scm in the SCM implementation-vicinity (this is the same directory as where the file Init5f4.scm is). require.scm should have the contents:

(define (library-vicinity) "/usr/local/lib/slib/")

where the pathname string /usr/local/lib/slib/ is to be replaced by the pathname into which you unzipped (or installed) SLIB.

Alternatively, you can set the (shell) environment variable SCHEME_LIBRARY_PATH to the pathname of the SLIB directory (see Environment Variables). If set, this environment variable overrides scm/require.scm.

Absolute pathnames are recommended here; if you use a relative pathname, SLIB can get confused when the working directory is changed (see chmod). The way to specify a relative pathname is to append it to the implementation-vicinity, which is absolute:

(define library-vicinity
  (let ((lv (string-append (implementation-vicinity) "../slib/")))
    (lambda () lv)))

2.2.2 Makefile targets

Each of the following four ‘make’ targets creates an executable named scm. Each target takes its build options from a file with an ‘.opt’ suffix. If that options file doesn’t exist, making that target will create the file with the ‘-F’ features: cautious, bignums, arrays, inexact, engineering-notation, and dynamic-linking. Once that ‘.opt’ file exists, you can edit it to your taste and it will be preserved.

make scm4

Produces a R4RS executable named scm lacking hygienic macros (but with defmacro). The build options are taken from scm4.opt. If build or the executable fails, try removing ‘dynamic-linking’ from scm4.opt.

make scm5

R5RS; like ‘make scm4’ but with ‘-F macro’. The build options are taken from scm5.opt. If build or the executable fails, try removing ‘dynamic-linking’ from scm5.opt.

make dscm4

Produces a R4RS executable named udscm4, which it starts and dumps to a low startup latency executable named scm. The build options are taken from udscm4.opt.

If the build fails, then ‘build scm4’ instead. If the dumped executable fails to run, then send me a bug report (and use ‘build scm4 until the problem with dump is corrected).

make dscm5

Like ‘make dscm4’ but with ‘-F macro’. The build options are taken from udscm5.opt.

If the build fails, then ‘build scm5’ instead. If the dumped executable fails to run, then send me a bug report (and use ‘build scm5 until the problem with dump is corrected).

If the above builds fail because of ‘-F dynamic-linking, then (because they can’t be dynamically linked) you will likely want to add some other features to the build’s ‘.opt’ file. See the ‘-F’ build option in Build Options.

If dynamic-linking is working, then you will likely want to compile most of the modules as DLLs. The build options for compiling DLLs are in dlls.opt.

make x.so

The Xlib module; SCM Language X Interface in Xlibscm.

make myturtle

Creates a DLL named turtlegr.so which is a simple graphics API.

make wbscm.so

The wb module; B-tree database implementation in wb. Compiling this requires that wb source be in a peer directory to scm.

make dlls

Compiles all the distributed library modules, but not wbscm.so. Many of the module compiles are recursively invoked in such a way that failure of one (which could be due to a system library not being installed) doesn’t cause the top-level ‘make dlls’ to fail. If ‘make dlls’ fails as a whole, it is time to submit a bug report (see Reporting Problems).


Next: , Previous: , Up: Installing SCM   [Contents][Index]