aboutsummaryrefslogtreecommitdiffstats
path: root/README
blob: 17d25f21df357ac8d7bd6d59f6dd6f5f7c4b03fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
This directory contains the distribution of scm5f2.  SCM conforms to
Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178
specification.  SCM runs under Amiga, Atari-ST, MacOS, MS-DOS, OS/2,
NOS/VE, Unicos, VMS, Unix and similar systems.  SCM supports the SLIB
Scheme library; both SCM and SLIB are GNU packages.

               `http://people.csail.mit.edu/jaffer/SCM'

0.1 Manifest
============

`.gdbinit'       provides commands for debugging SCM with GDB
`COPYING'        GNU GENERAL PUBLIC LICENSE
`COPYING.LESSER' GNU LESSER GENERAL PUBLIC LICENSE
`ChangeLog'      changes to SCM.
`Idiffer.scm'    Linear-space O(PN) sequence comparison.
`Iedline.scm'    Gnu readline input editing.
`Init.scm'       Scheme initialization.
`Link.scm'       Dynamic link/loading.
`Macro.scm'      Supports Syntax-Rules Macros.
`Makefile'       builds SCMLIT using the `make' program.
`QUICKREF'       Quick Reference card for R4RS and IEEE Scheme.
`README'         contains a MANIFEST, INSTALLATION INSTRUCTIONS, hints
                 for EDITING SCHEME CODE, and a TROUBLE SHOOTING GUIDE.
`Transcen.scm'   inexact builtin procedures.
`bench.scm'      computes and records performance statistics of pi.scm.
`build.bat'      invokes build.scm for MS-DOS
`build.scm'      database for compiling and linking new SCM programs.
`byte.c'         strings as bytes.
`bytenumb.c'     Byte-number conversions.
`compile.scm'    Hobbit compilation to C.
`continue-ia64.S'replaces make_root_continuation(), make_continuation(),
                 and dynthrow() in continue.c
`continue.c'     continuations.
`continue.h'     continuations.
`crs.c'          interactive terminal control.
`debug.c'        debugging, printing code.
`differ.c'       Linear-space O(PN) sequence comparison.
`dynl.c'         dynamically load object files.
`ecrt0.c'        discover the start of initialized data space
                 dynamically at runtime.
`edline.c'       Gnu readline input editing (get
                 ftp.sys.toronto.edu:/pub/rc/editline.shar).
`eval.c'         evaluator, apply, map, and foreach.
`example.scm'    example from R4RS which uses inexact numbers.
`fdl.texi'       GNU Free Documentation License.
`findexec.c'     find the executable file function.
`get-contoffset-ia64.c'makes contoffset-ia64.S for inclusion by continue-ia64.S
`gmalloc.c'      Gnu malloc(); used for unexec.
`gsubr.c'        make_gsubr for arbitrary (< 11) arguments to C
                 functions.
`ioext.c'        system calls in common between PC compilers and unix.
`lastfile.c'     find the point in data space between data and libraries.
`macosx-config.h'Included by unexmacosx.c and lastfile.c.
`mkimpcat.scm'   build SCM-specific catalog for SLIB.
`patchlvl.h'     patchlevel of this release.
`pi.c'           computes digits of pi [cc -o pi pi.c;time pi 100 5].
`pi.scm'         computes digits of pi [type (pi 100 5)].  Test
                 performance against pi.c.
`posix.c'        posix library interface.
`pre-crt0.c'     loaded before crt0.o on machines which do not remap
                 part of the data space into text space in unexec.
`r4rstest.scm'   tests conformance with Scheme specifications.
`ramap.c'        array mapping
`record.c'       proposed `Record' user definable datatypes.
`repl.c'         error, read-eval-print loop, read, write and load.
`rgx.c'          string regular expression match.
`rope.c'         C interface functions.
`sc2.c'          procedures from R2RS and R3RS not in R4RS.
`scl.c'          inexact arithmetic
`scm.1'          unix style man page.
`scm.c'          initialization, interrupts, and non-IEEE utility
                 functions.
`scm.doc'        man page generated from scm.1.
`scm.h'          data type and external definitions of SCM.
`scm.texi'       SCM installation and use.
`scmfig.h'       contains system dependent definitions.
`scmmain.c'      initialization, interrupts, and non-IEEE utility
                 functions.
`script.c'       utilities for running as `#!' script.
`setjump.h'      continuations, stacks, and memory allocation.
`setjump.mar'    provides setjump and longjump which do not use $unwind
                 utility on VMS.
`setjump.s'      provides setjump and longjump for the Cray YMP.
`socket.c'       BSD socket interface.
`split.scm'      example use of crs.c.  Input, output, and diagnostic
                 output directed to separate windows.
`subr.c'         the rest of IEEE functions.
`sys.c'          call-with-current-continuation, opening and closing
                 files, storage allocation and garbage collection.
`time.c'         functions dealing with time.
`ugsetjump.s'    provides setjump and longjump which work on Ultrix VAX.
`unexalpha.c'    Convert a running program into an Alpha executable file.
`unexec.c'       Convert a running program into an executable file.
`unexelf.c'      Convert a running ELF program into an executable file.
`unexhp9k800.c'  Convert a running HP-UX program into an executable file.
`unexmacosx.c'   Convert a running program into an executable file under
                 MacOS X.
`unexsgi.c'      Convert a running program into an IRIX executable file.
`unexsunos4.c'   Convert a running program into an executable file.
`unif.c'         uniform vectors.
`unix.c'         non-posix system calls on unix systems.



File: scm-5f2.info,  Node: Distributions,  Next: GNU configure and make,  Prev: Installing SCM,  Up: Installing SCM

2.1 Distributions
=================

The SCM homepage contains links to precompiled binaries and source
distributions.

Downloads and instructions for installing the precompiled binaries are
at `http://people.csail.mit.edu/jaffer/SCM#QuickStart'.

If there is no precompiled binary for your platform, you may be able to
build from the source distribution.  The rest of these instructions
deal with building and installing SCM and SLIB from sources.

Download (both SCM and SLIB of) either the last release or current
development snapshot from
`http://people.csail.mit.edu/jaffer/SCM#BuildFromSource'.

Unzip both the SCM and SLIB zips.  For example, if you are working in
`/usr/local/src/', this will create directories `/usr/local/src/scm/'
and `/usr/local/src/slib/'.



File: scm-5f2.info,  Node: GNU configure and make,  Next: Building SCM,  Prev: Distributions,  Up: Installing SCM

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 *note 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 (*note 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'.

* Menu:

* Making scmlit::
* Makefile targets::



File: scm-5f2.info,  Node: Making scmlit,  Next: Makefile targets,  Prev: GNU configure and make,  Up: GNU configure and make

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 (*note 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:

   * Use the build (http://people.csail.mit.edu/jaffer/buildscm.html)
     web page to create custom batch scripts for compiling SCM.

   * Use SCM on a different platform to run `build' to create a script
     to build SCM;

   * Use another implementation of Scheme to run `build' to create a
     script to build SCM;

   * Create your own script or `Makefile'.

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 `Init5f1.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 (*note
SCHEME_LIBRARY_PATH: SCM 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
(*note chmod: I/O-Extensions.).  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)))



File: scm-5f2.info,  Node: Makefile targets,  Prev: Making scmlit,  Up: GNU configure and make

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 *note Build Options::.

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

`make x.so'
     The `Xlib' module; *note SCM Language X Interface: (Xlibscm)Top.

`make myturtle'
     Creates a DLL named `turtlegr.so' which is a simple graphics API.

`make wbscm.so'
     The `wb' module; *note B-tree database implementation: (wb)Top.
     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
     (*note Reporting Problems::).




File: scm-5f2.info,  Node: Building SCM,  Next: Saving Executable Images,  Prev: GNU configure and make,  Up: Installing SCM

2.3 Building SCM
================

The file "build" loads the file "build.scm", which constructs a
relational database of how to compile and link SCM executables.
`build.scm' has information for the platforms which SCM has been ported
to (of which I have been notified).  Some of this information is old,
incorrect, or incomplete.  Send corrections and additions to
agj@alum.mit.edu.

* Menu:

* Invoking Build::
* Build Options::               build --help
* Compiling and Linking Custom Files::



File: scm-5f2.info,  Node: Invoking Build,  Next: Build Options,  Prev: Building SCM,  Up: Building SCM

2.3.1 Invoking Build
--------------------

This section teaches how to use `build', a Scheme program for creating
compilation scripts to produce SCM executables and library modules.
The options accepted by `build' are documented in *note Build Options::.

Use the _any_ method if you encounter problems with the other two
methods (MS-DOS, Unix).

MS-DOS
     From the SCM source directory, type `build' followed by up to 9
     command line arguments.

Unix
     From the SCM source directory, type `./build' followed by command
     line arguments.

_any_
     From the SCM source directory, start `scm' or `scmlit' and type
     `(load "build")'.  Alternatively, start `scm' or `scmlit' with the
     command line argument `-ilbuild'.  This method will also work for
     MS-DOS and Unix.

     After loading various SLIB modules, the program will print:

          type (b "build <command-line>") to build
          type (b*) to enter build command loop

     The `b*' procedure enters into a "build shell" where you can enter
     commands (with or without the `build').  Blank lines are ignored.
     To create a build script with all defaults type `build'.

     If the build-shell encouters an error, you can reenter the
     build-shell by typing `(b*)'.  To exit scm type `(quit)'.


Here is a transcript of an interactive (b*) build-shell.

     bash$ scmlit
     SCM version 5e7, Copyright (C) 1990-2006 Free Software Foundation.
     SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `(terms)' for details.
     > (load "build")
     ;loading build
     ;  loading /home/jaffer/slib/getparam
     ;    loading /home/jaffer/slib/coerce
     ...
     ;  done loading build.scm
     type (b "build <command-line>") to build
     type (b*) to enter build command loop
     ;done loading build
     #<unspecified>
     > (b*)
     ;loading /home/jaffer/slib/comparse
     ;done loading /home/jaffer/slib/comparse.scm
     build> -t exe
     #! /bin/sh
     # unix (linux) script created by SLIB/batch Wed Oct 26 17:14:23 2011
     # [-p linux]
     # ================ Write file with C defines
     rm -f scmflags.h
     echo '#define IMPLINIT "Init5e7.scm"'>>scmflags.h
     echo '#define BIGNUMS'>>scmflags.h
     echo '#define FLOATS'>>scmflags.h
     echo '#define ARRAYS'>>scmflags.h
     # ================ Compile C source files
     gcc -c continue.c scm.c scmmain.c findexec.c script.c time.c repl.c scl.c eval.c sys.c subr.c debug.c unif.c rope.c
     # ================ Link C object files
     gcc -rdynamic -o scm continue.o scm.o scmmain.o findexec.o script.o time.o repl.o scl.o eval.o sys.o subr.o debug.o unif.o rope.o -lm -lc
     "scm"
     build> -t exe -w myscript.sh
     "scm"
     build> (quit)

No compilation was done.  The `-t exe' command shows the compile
script.  The `-t exe -w myscript.sh' line creates a file `myscript.sh'
containing the compile script.  To actually compile and link it, type
`./myscript.sh'.

Invoking build without the `-F' option will build or create a shell
script with the `arrays', `inexact', and `bignums' options as defaults.
Invoking `build' with `-F lit -o scmlit' will make a script for
compiling `scmlit'.

     bash$ ./build
     -|
     #! /bin/sh
     # unix (linux) script created by SLIB/batch
     # ================ Write file with C defines
     rm -f scmflags.h
     echo '#define IMPLINIT "Init5f1.scm"'>>scmflags.h
     echo '#define BIGNUMS'>>scmflags.h
     echo '#define FLOATS'>>scmflags.h
     echo '#define ARRAYS'>>scmflags.h
     # ================ Compile C source files
     gcc -O2 -c continue.c scm.c scmmain.c findexec.c script.c time.c repl.c scl.c eval.c sys.c subr.c debug.c unif.c rope.c
     # ================ Link C object files
     gcc -rdynamic -o scm continue.o scm.o scmmain.o findexec.o script.o time.o repl.o scl.o eval.o sys.o subr.o debug.o unif.o rope.o -lm -lc

To cross compile for another platform, invoke build with the `-p' or
`--platform=' option.  This will create a script for the platform named
in the `-p' or `--platform=' option.

     bash$ ./build -o scmlit -p darwin -F lit
     -|
     #! /bin/sh
     # unix (darwin) script created by SLIB/batch
     # ================ Write file with C defines
     rm -f scmflags.h
     echo '#define IMPLINIT "Init5f1.scm"'>>scmflags.h
     # ================ Compile C source files
     cc -O3 -c continue.c scm.c scmmain.c findexec.c script.c time.c repl.c scl.c eval.c sys.c subr.c debug.c unif.c rope.c
     # ================ Link C object files
     mv -f scmlit scmlit~
     cc -o scmlit continue.o scm.o scmmain.o findexec.o script.o time.o repl.o scl.o eval.o sys.o subr.o debug.o unif.o rope.o



File: scm-5f2.info,  Node: Build Options,  Next: Compiling and Linking Custom Files,  Prev: Invoking Build,  Up: Building SCM

2.3.2 Build Options
-------------------

The options to "build" specify what, where, and how to build a SCM
program or dynamically linked module.  These options are unrelated to
the SCM command line options.

 -- Build Option: -p PLATFORM-NAME
 -- Build Option: --platform=PLATFORM-NAME
     specifies that the compilation should be for a
     computer/operating-system combination called PLATFORM-NAME.
     _Note_ The case of PLATFORM-NAME is distinguised.  The current
     PLATFORM-NAMEs are all lower-case.

     The platforms defined by table "platform" in `build.scm' are:

     Table: platform
     name              processor         operating-system  compiler
     #f                processor-family  operating-system  #f
     symbol            processor-family  operating-system  symbol
     symbol            symbol            symbol            symbol
     ================= ================= ================= =================
     *unknown*         *unknown*         unix              cc
     acorn-unixlib     acorn             *unknown*         cc
     aix               powerpc           aix               cc
     alpha-elf         alpha             unix              cc
     alpha-linux       alpha             linux             gcc
     amiga-aztec       m68000            amiga             cc
     amiga-dice-c      m68000            amiga             dcc
     amiga-gcc         m68000            amiga             gcc
     amiga-sas         m68000            amiga             lc
     atari-st-gcc      m68000            atari-st          gcc
     atari-st-turbo-c  m68000            atari-st          tcc
     borland-c         i8086             ms-dos            bcc
     darwin            powerpc           unix              cc
     djgpp             i386              ms-dos            gcc
     freebsd           *unknown*         unix              cc
     gcc               *unknown*         unix              gcc
     gnu-win32         i386              unix              gcc
     highc             i386              ms-dos            hc386
     hp-ux             hp-risc           hp-ux             cc
     irix              mips              irix              gcc
     linux             *unknown*         linux             gcc
     linux-aout        i386              linux             gcc
     linux-ia64        ia64              linux             gcc
     microsoft-c       i8086             ms-dos            cl
     microsoft-c-nt    i386              ms-dos            cl
     microsoft-quick-c i8086             ms-dos            qcl
     ms-dos            i8086             ms-dos            cc
     netbsd            *unknown*         unix              gcc
     openbsd           *unknown*         unix              gcc
     os/2-cset         i386              os/2              icc
     os/2-emx          i386              os/2              gcc
     osf1              alpha             unix              cc
     plan9-8           i386              plan9             8c
     sunos             sparc             sunos             cc
     svr4              *unknown*         unix              cc
     svr4-gcc-sun-ld   sparc             sunos             gcc
     turbo-c           i8086             ms-dos            tcc
     unicos            cray              unicos            cc
     unix              *unknown*         unix              cc
     vms               vax               vms               cc
     vms-gcc           vax               vms               gcc
     watcom-9.0        i386              ms-dos            wcc386p

 -- Build Option: -f PATHNAME
     specifies that the build options contained in PATHNAME be spliced
     into the argument list at this point.  The use of option files can
     separate functional features from platform-specific ones.

     The `Makefile' calls out builds with the options in `.opt' files:

    `dlls.opt'
          Options for Makefile targets dlls, myturtle, and x.so.

    `gdb.opt'
          Options for udgdbscm and gdbscm.

    `libscm.opt'
          Options for libscm.a.

    `pg.opt'
          Options for pgscm, which instruments C functions.

    `udscm4.opt'
          Options for targets udscm4 and dscm4 (scm).

    `udscm5.opt'
          Options for targets udscm5 and dscm5 (scm).

     The Makefile creates options files it depends on only if they do
     not already exist.

 -- Build Option: -o FILENAME
 -- Build Option: --outname=FILENAME
     specifies that the compilation should produce an executable or
     object name of FILENAME.  The default is `scm'.  Executable
     suffixes will be added if neccessary, e.g. `scm' => `scm.exe'.

 -- Build Option: -l LIBNAME ...
 -- Build Option: --libraries=LIBNAME
     specifies that the LIBNAME should be linked with the executable
     produced.  If compile flags or include directories (`-I') are
     needed, they are automatically supplied for compilations.  The `c'
     library is always included.  SCM "features" specify any libraries
     they need; so you shouldn't need this option often.

 -- Build Option: -D DEFINITION ...
 -- Build Option: --defines=DEFINITION
     specifies that the DEFINITION should be made in any C source
     compilations.  If compile flags or include directories (`-I') are
     needed, they are automatically supplied for compilations.  SCM
     "features" specify any flags they need; so you shouldn't need this
     option often.

 -- Build Option: --compiler-options=FLAG
     specifies that that FLAG will be put on compiler command-lines.

 -- Build Option: --linker-options=FLAG
     specifies that that FLAG will be put on linker command-lines.

 -- Build Option: -s PATHNAME
 -- Build Option: --scheme-initial=PATHNAME
     specifies that PATHNAME should be the default location of the SCM
     initialization file `Init5f1.scm'.  SCM tries several likely
     locations before resorting to PATHNAME (*note File-System
     Habitat::).  If not specified, the current directory (where build
     is building) is used.

 -- Build Option: -c PATHNAME ...
 -- Build Option: --c-source-files=PATHNAME
     specifies that the C source files PATHNAME ... are to be compiled.

 -- Build Option: -j PATHNAME ...
 -- Build Option: --object-files=PATHNAME
     specifies that the object files PATHNAME ... are to be linked.

 -- Build Option: -i CALL ...
 -- Build Option: --initialization=CALL
     specifies that the C functions CALL ... are to be invoked during
     initialization.

 -- Build Option: -t BUILD-WHAT
 -- Build Option: --type=BUILD-WHAT
     specifies in general terms what sort of thing to build.  The
     choices are:
    `exe'
          executable program.

    `lib'
          library module.

    `dlls'
          archived dynamically linked library object files.

    `dll'
          dynamically linked library object file.

     The default is to build an executable.

 -- Build Option: -h BATCH-SYNTAX
 -- Build Option: -batch-dialect=BATCH-SYNTAX
     specifies how to build.  The default is to create a batch file for
     the host system.  The SLIB file `batch.scm' knows how to create
     batch files for:
        * unix

        * dos

        * vms

        * amigaos (was amigados)

        * system

          This option executes the compilation and linking commands
          through the use of the `system' procedure.

        * *unknown*

          This option outputs Scheme code.

 -- Build Option: -w BATCH-FILENAME
 -- Build Option: -script-name=BATCH-FILENAME
     specifies where to write the build script.  The default is to
     display it on `(current-output-port)'.

 -- Build Option: -F FEATURE ...
 -- Build Option: --features=FEATURE
     specifies to build the given features into the executable.  The
     defined features are:

    "array"
          Alias for ARRAYS

    "array-for-each"
          array-map! and array-for-each (arrays must also be featured).

    "arrays"
          Use if you want arrays, uniform-arrays and uniform-vectors.

    "bignums"
          Large precision integers.

    "byte"
          Treating strings as byte-vectors.

    "byte-number"
          Byte/number conversions

    "careful-interrupt-masking"
          Define this for extra checking of interrupt masking and some
          simple checks for proper use of malloc and free.  This is for
          debugging C code in `sys.c', `eval.c', `repl.c' and makes the
          interpreter several times slower than usual.

    "cautious"
          Normally, the number of arguments arguments to interpreted
          closures (from LAMBDA) are checked if the function part of a
          form is not a symbol or only the first time the form is
          executed if the function part is a symbol.  defining
          `reckless' disables any checking.  If you want to have SCM
          always check the number of arguments to interpreted closures
          define feature `cautious'.

    "cheap-continuations"
          If you only need straight stack continuations, executables
          compile with this feature will run faster and use less
          storage than not having it.  Machines with unusual stacks
          _need_ this.  Also, if you incorporate new C code into scm
          which uses VMS system services or library routines (which
          need to unwind the stack in an ordrly manner) you may need to
          use this feature.

    "compiled-closure"
          Use if you want to use compiled closures.

    "curses"
          For the "curses" screen management package.

    "debug"
          Turns on the features `cautious' and
          `careful-interrupt-masking'; uses `-g' flags for debugging
          SCM source code.

    "differ"
          Sequence comparison

    "dont-memoize-locals"
          SCM normally converts references to local variables to ILOCs,
          which make programs run faster.  If SCM is badly broken, try
          using this option to disable the MEMOIZE_LOCALS feature.

    "dump"
          Convert a running scheme program into an executable file.

    "dynamic-linking"
          Be able to load compiled files while running.

    "edit-line"
          interface to the editline or GNU readline library.

    "engineering-notation"
          Use if you want floats to display in engineering notation
          (exponents always multiples of 3) instead of scientific
          notation.

    "generalized-c-arguments"
          `make_gsubr' for arbitrary (< 11) arguments to C functions.

    "i/o-extensions"
          Commonly available I/O extensions: "exec", line I/O, file
          positioning, file delete and rename, and directory functions.

    "inexact"
          Use if you want floating point numbers.

    "lit"
          Lightweight - no features

    "macro"
          C level support for hygienic and referentially transparent
          macros (syntax-rules macros).

    "mysql"
          Client connections to the mysql databases.

    "no-heap-shrink"
          Use if you want segments of unused heap to not be freed up
          after garbage collection.  This may increase time in GC for
          *very* large working sets.

    "none"
          No features

    "posix"
          Posix functions available on all "Unix-like" systems.  fork
          and process functions, user and group IDs, file permissions,
          and "link".

    "reckless"
          If your scheme code runs without any errors you can disable
          almost all error checking by compiling all files with
          `reckless'.

    "record"
          The Record package provides a facility for user to define
          their own record data types.  See SLIB for documentation.

    "regex"
          String regular expression matching.

    "rev2-procedures"
          These procedures were specified in the `Revised^2 Report on
          Scheme' but not in `R4RS'.

    "sicp"
          Use if you want to run code from:

          Harold Abelson and Gerald Jay Sussman with Julie Sussman.
          `Structure and Interpretation of Computer Programs.'  The MIT
          Press, Cambridge, Massachusetts, USA, 1985.

          Differences from R5RS are:
             * (eq? '() '#f)

             * (define a 25) returns the symbol a.

             * (set! a 36) returns 36.

    "single-precision-only"
          Use if you want all inexact real numbers to be single
          precision.  This only has an effect if SINGLES is also
          defined (which is the default).  This does not affect complex
          numbers.

    "socket"
          BSD "socket" interface.  Socket addr functions require
          inexacts or bignums for 32-bit precision.

    "tick-interrupts"
          Use if you want the ticks and ticks-interrupt functions.

    "turtlegr"
          "Turtle" graphics calls for both Borland-C and X11 from
          sjm@ee.tut.fi.

    "unix"
          Those unix features which have not made it into the Posix
          specs: nice, acct, lstat, readlink, symlink, mknod and sync.

    "wb"
          WB database with relational wrapper.

    "wb-no-threads"
          no-comment

    "windows"
          Microsoft Windows executable.

    "x"
          Alias for Xlib feature.

    "xlib"
          Interface to Xlib graphics routines.




File: scm-5f2.info,  Node: Saving Executable Images,  Next: Installation,  Prev: Building SCM,  Up: Installing SCM

2.4 Saving Executable Images
============================

In SCM, the ability to save running program images is called "dump"
(*note Dump::).  In order to make `dump' available to SCM, build with
feature `dump'.  `dump'ed executables are compatible with dynamic
linking.

Most of the code for "dump" is taken from `emacs-19.34/src/unex*.c'.
No modifications to the emacs source code were required to use
`unexelf.c'.  Dump has not been ported to all platforms.  If `unexec.c'
or `unexelf.c' don't work for you, try using the appropriate `unex*.c'
file from emacs.

The `dscm4' and `dscm5' targets in the SCM `Makefile' save images from
`udscm4' and `udscm5' executables respectively.

"Address space layout randomization" interferes with `dump'.  Here are
the fixes for various operating-systems:

Fedora-Core-1
     Remove the `#' from the line `#SETARCH = setarch i386' in the
     `Makefile'.

Fedora-Core-3
     `http://jamesthornton.com/writing/emacs-compile.html' [For FC3]
     combreloc has become the default for recent GNU ld, which breaks
     the unexec/undump on all versions of both Emacs and XEmacs...

     Override by adding the following to `udscm5.opt':
     `--linker-options="-z nocombreloc"'

Linux Kernels later than 2.6.11
`http://www.opensubscriber.com/message/emacs-devel@gnu.org/1007118.html'
     mentions the "exec-shield" feature.  Kernels later than 2.6.11
     must do (as root):

          echo 0 > /proc/sys/kernel/randomize_va_space

     before dumping.  `Makefile' has this `randomize_va_space' stuffing
     scripted for targets `dscm4' and `dscm5'.  You must either set
     `randomize_va_space' to 0 or run as root to dump.

OS-X 10.6
`http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html'
     The dynamic linker uses the following environment variables.  They
     affect any program that uses the dynamic linker.

     DYLD_NO_PIE

     Causes dyld to not randomize the load addresses of images in a
     process where the main executable was built position independent.
     This can be helpful when trying to reproduce and debug a problem
     in a PIE.




File: scm-5f2.info,  Node: Installation,  Next: Troubleshooting and Testing,  Prev: Saving Executable Images,  Up: Installing SCM

2.5 Installation
================

Once `scmlit', `scm', and `dlls' have been built, these commands will
install them to the locations specified when you ran `./configure':

     bash$ (cd scm; make install)
     bash$ (cd slib; make install)

Note that installation to system directories (like `/usr/bin/') will
require that those commands be run as root:

     bash$ (cd scm; sudo make install)
     bash$ (cd slib; sudo make install)



File: scm-5f2.info,  Node: Problems Compiling,  Next: Problems Linking,  Prev: Troubleshooting and Testing,  Up: Troubleshooting and Testing

2.6.1 Problems Compiling
------------------------

FILE    PROBLEM / MESSAGE                HOW TO FIX
*.c     include file not found.          Correct the status of
                                         STDC_HEADERS in scmfig.h.
                                         fix #include statement or add
                                         #define for system type to
                                         scmfig.h.
*.c     Function should return a value.  Ignore.
        Parameter is never used.         
        Condition is always false.       
        Unreachable code in function.    
scm.c   assignment between incompatible  Change SIGRETTYPE in scm.c.
        types.                           
time.c  CLK_TCK redefined.               incompatablility between
                                         <stdlib.h> and <sys/types.h>.
                                         Remove STDC_HEADERS in scmfig.h.
                                         Edit <sys/types.h> to remove
                                         incompatability.
subr.c  Possibly incorrect assignment    Ignore.
        in function lgcd.                
sys.c   statement not reached.           Ignore.
        constant in conditional          
        expression.                      
sys.c   undeclared, outside of           #undef STDC_HEADERS in scmfig.h.
        functions.                       
scl.c   syntax error.                    #define SYSTNAME to your system
                                         type in scl.c (softtype).



File: scm-5f2.info,  Node: Problems Linking,  Next: Testing,  Prev: Problems Compiling,  Up: Troubleshooting and Testing

2.6.2 Problems Linking
----------------------

PROBLEM                              HOW TO FIX
_sin etc. missing.                   Uncomment LIBS in makefile.



File: scm-5f2.info,  Node: Problems Starting,  Next: Problems Running,  Prev: Testing,  Up: Troubleshooting and Testing

2.6.4 Problems Starting
-----------------------

PROBLEM                              HOW TO FIX
/bin/bash: scm: program not found    Is `scm' in a `$PATH' directory?
/bin/bash: /usr/local/bin/scm:       `chmod +x /usr/local/bin/scm'
Permission denied                    
Opening message and then machine     Change memory model option to C
crashes.                             compiler (or makefile).
                                     Make sure sizet definition is
                                     correct in scmfig.h.
                                     Reduce the size of HEAP_SEG_SIZE in
                                     setjump.h.
Input hangs.                         #define NOSETBUF
ERROR: heap: need larger initial.    Increase initial heap allocation
                                     using -a<kb> or INIT_HEAP_SIZE.
ERROR: Could not allocate.           Check sizet definition.
                                     Use 32 bit compiler mode.
                                     Don't try to run as subproccess.
remove <FLAG> in scmfig.h and        Do so and recompile files.
recompile scm.                       
add <FLAG> in scmfig.h and           
recompile scm.                       
ERROR: Init5f1.scm not found.        Assign correct IMPLINIT in makefile
                                     or scmfig.h.
                                     Define environment variable
                                     SCM_INIT_PATH to be the full
                                     pathname of Init5f1.scm.
WARNING: require.scm not found.      Define environment variable
                                     SCHEME_LIBRARY_PATH to be the full
                                     pathname of the scheme library
                                     [SLIB].
                                     Change library-vicinity in
                                     Init5f1.scm to point to library or
                                     remove.
                                     Make sure the value of
                                     (library-vicinity) has a trailing
                                     file separator (like / or \).



File: scm-5f2.info,  Node: Problems Running,  Next: Reporting Problems,  Prev: Problems Starting,  Up: Troubleshooting and Testing

2.6.5 Problems Running
----------------------

PROBLEM                              HOW TO FIX
Runs some and then machine crashes.  See above under machine crashes.
Runs some and then ERROR: ...        Remove optimization option to C
(after a GC has happened).           compiler and recompile.
                                     #define SHORT_ALIGN in `scmfig.h'.
Some symbol names print incorrectly. Change memory model option to C
                                     compiler (or makefile).
                                     Check that HEAP_SEG_SIZE fits
                                     within sizet.
                                     Increase size of HEAP_SEG_SIZE (or
                                     INIT_HEAP_SIZE if it is smaller
                                     than HEAP_SEG_SIZE).
ERROR: Rogue pointer in Heap.        See above under machine crashes.
Newlines don't appear correctly in   Check file mode (define OPEN_... in
output files.                        `Init5f1.scm').
Spaces or control characters appear  Check character defines in
in symbol names.                     `scmfig.h'.
Negative numbers turn positive.      Check SRS in `scmfig.h'.
;ERROR: bignum: numerical overflow   Increase NUMDIGS_MAX in `scmfig.h'
                                     and recompile.
VMS: Couldn't unwind stack.          #define CHEAP_CONTINUATIONS in
                                     `scmfig.h'.
VAX: botched longjmp.                



File: scm-5f2.info,  Node: Reporting Problems,  Prev: Problems Running,  Up: Troubleshooting and Testing

2.6.6 Reporting Problems
------------------------

Reported problems and solutions are grouped under Compiling, Linking,
Running, and Testing.  If you don't find your problem listed there, you
can send a bug report to `agj@alum.mit.edu' or `scm-discuss@gnu.org'.
The bug report should include:

  1. The version of SCM (printed when SCM is invoked with no arguments).

  2. The type of computer you are using.

  3. The name and version of your computer's operating system.

  4. The values of the environment variables `SCM_INIT_PATH' and
     `SCHEME_LIBRARY_PATH'.

  5. The name and version of your C compiler.

  6. If you are using an executable from a distribution, the name,
     vendor, and date of that distribution.  In this case,
     corresponding with the vendor is recommended.



File: scm-5f2.info,  Node: Editing Scheme Code,  Next: Debugging Scheme Code,  Prev: SCM Session,  Up: Operational Features

3.7 Editing Scheme Code
=======================

 -- Function: ed arg1 ...
     The value of the environment variable `EDITOR' (or just `ed' if it
     isn't defined) is invoked as a command with arguments ARG1 ....

 -- Function: ed filename
     If SCM is compiled under VMS `ed' will invoke the editor with a
     single the single argument FILENAME.

Gnu Emacs:
     Editing of Scheme code is supported by emacs.  Buffers holding
     files ending in .scm are automatically put into scheme-mode.

     If your Emacs can run a process in a buffer you can use the Emacs
     command `M-x run-scheme' with SCM.  Otherwise, use the emacs
     command `M-x suspend-emacs'; or see "other systems" below.

Epsilon (MS-DOS):
     There is lisp (and scheme) mode available by use of the package
     `LISP.E'.  It offers several different indentation formats.  With
     this package, buffers holding files ending in `.L', `.LSP', `.S',
     and `.SCM' (my modification) are automatically put into lisp-mode.

     It is possible to run a process in a buffer under Epsilon.  With
     Epsilon 5.0 the command line options `-e512 -m0' are neccessary to
     manage RAM properly.  It has been reported that when compiling SCM
     with Turbo C, you need to `#define NOSETBUF' for proper operation
     in a process buffer with Epsilon 5.0.

     One can also call out to an editor from SCM if RAM is at a
     premium; See "under other systems" below.

other systems:
     Define the environment variable `EDITOR' to be the name of the
     editing program you use.  The SCM procedure `(ed arg1 ...)' will
     invoke your editor and return to SCM when you exit the editor.  The
     following definition is convenient:

          (define (e) (ed "work.scm") (load "work.scm"))

     Typing `(e)' will invoke the editor with the file of interest.
     After editing, the modified file will be loaded.