BUILDING 3.9 KB

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