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