-
+ 3D7A61B123D7D1724A079C211678DD85085E56F4C2229C46D9DF7A7257E83461E0F19237C90B58A17E977B19715651539317003A69FFFD06C3CC96D0EA54839B
tinyscheme/BUILDING
(0 . 0)(1 . 139)
5 Building TinyScheme
6 -------------------
7
8 The included makefile includes logic for Linux, Solaris and Win32, and can
9 readily serve as an example for other OSes, especially Unixes. There are
10 a lot of compile-time flags in TinyScheme (preprocessor defines) that can trim
11 unwanted features. See next section. 'make all' and 'make clean' function as
12 expected.
13
14 Autoconfing TinyScheme was once proposed, but the distribution would not be
15 so small anymore. There are few platform dependencies in TinyScheme, and in
16 general compiles out of the box.
17
18 Customizing
19 -----------
20
21 The following symbols are defined to default values in scheme.h.
22 Use the -D flag of cc to set to either 1 or 0.
23
24 STANDALONE
25 Define this to produce a standalone interpreter.
26
27 USE_MATH
28 Includes math routines.
29
30 USE_CHAR_CLASSIFIERS
31 Includes character classifier procedures.
32
33 USE_ASCII_NAMES
34 Enable extended character notation based on ASCII names.
35
36 USE_STRING_PORTS
37 Enables string ports.
38
39 USE_ERROR_HOOK
40 To force system errors through user-defined error handling.
41 (see "Error handling")
42
43 USE_TRACING
44 To enable use of TRACING.
45
46 USE_COLON_HOOK
47 Enable use of qualified identifiers. (see "Colon Qualifiers - Packages")
48 Defining this as 0 has the rather drastic consequence that any code using
49 packages will stop working, and will have to be modified. It should only
50 be used if you *absolutely* need to use '::' in identifiers.
51
52 USE_STRCASECMP
53 Defines stricmp as strcasecmp, for Unix.
54
55 STDIO_ADDS_CR
56 Informs TinyScheme that stdio translates "\n" to "\r\n". For DOS/Windows.
57
58 USE_DL
59 Enables dynamically loaded routines. If you define this symbol, you
60 should also include dynload.c in your compile.
61
62 USE_PLIST
63 Enables property lists (not Standard Scheme stuff). Off by default.
64
65 USE_NO_FEATURES
66 Shortcut to disable USE_MATH, USE_CHAR_CLASSIFIERS, USE_ASCII_NAMES,
67 USE_STRING_PORTS, USE_ERROR_HOOK, USE_TRACING, USE_COLON_HOOK,
68 USE_DL.
69
70 USE_SCHEME_STACK
71 Enables 'cons' stack (the alternative is a faster calling scheme, which
72 breaks continuations). Undefine it if you don't care about strict compatibility
73 but you do care about faster execution.
74
75
76 OS-X tip
77 --------
78 I don't have access to OS-X, but Brian Maher submitted the following tip:
79
80 [1] Download and install fink (I installed fink in
81 /usr/local/fink)
82 [2] Install the 'dlcompat' package using fink as such:
83 > fink install dlcompat
84 [3] Make the following changes to the
85 tinyscheme-1.32.tar.gz
86
87 diff -r tinyscheme-1.32/dynload.c
88 tinyscheme-1.32-new/dynload.c
89 24c24
90 < #define SUN_DL
91 ---
92 >
93 Only in tinyscheme-1.32-new/: dynload.o
94 Only in tinyscheme-1.32-new/: libtinyscheme.a Only in tinyscheme-1.32-new/: libtinyscheme.so diff -r tinyscheme-1.32/makefile tinyscheme-1.32-new/makefile
95 33,34c33,43
96 < LD = gcc
97 < LDFLAGS = -shared
98 ---
99 > #LD = gcc
100 > #LDFLAGS = -shared
101 > #DEBUG=-g -Wno-char-subscripts -O
102 > #SYS_LIBS= -ldl
103 > #PLATFORM_FEATURES= -DSUN_DL=1
104 >
105 > # Mac OS X
106 > CC = gcc
107 > CFLAGS = -I/usr/local/fink/include
108 > LD = gcc
109 > LDFLAGS = -L/usr/local/fink/lib
110 37c46
111 < PLATFORM_FEATURES= -DSUN_DL=1
112 ---
113 > PLATFORM_FEATURES= -DSUN_DL=1 -DOSX
114 60c69
115 < $(CC) -I. -c $(DEBUG) $(FEATURES)
116 $(DL_FLAGS) $<
117 ---
118 > $(CC) $(CFLAGS) -I. -c $(DEBUG)
119 $(FEATURES) $(DL_FLAGS) $<
120 66c75
121 < $(CC) -o $@ $(DEBUG) $(OBJS) $(SYS_LIBS)
122 ---
123 > $(CC) $(LDFLAGS) -o $@ $(DEBUG) $(OBJS)
124 $(SYS_LIBS)
125 Only in tinyscheme-1.32-new/: scheme
126 diff -r tinyscheme-1.32/scheme.c
127 tinyscheme-1.32-new/scheme.c
128 60,61c60,61
129 < #ifndef macintosh
130 < # include <malloc.h>
131 ---
132 > #ifdef OSX
133 > /* Do nothing */
134 62a63,65
135 > # ifndef macintosh
136 > # include <malloc.h>
137 > # else
138 77c80,81
139 < #endif /* macintosh */
140 ---
141 > # endif /* macintosh */
142 > #endif /* !OSX */
143 Only in tinyscheme-1.32-new/: scheme.o