summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-16 16:20:38 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-16 16:20:38 +0100
commit4e640bd930d133889dbc9f9a77e29bab902e3b7d (patch)
tree40de12e8f80fb2e494845e6f14c64461221dc0bb /src
parentd125001297ac76e0ed4759a9320ffb7872cf6242 (diff)
patch 7.4.1104v7.4.1104
Problem: Various problems building with MzScheme/Racket. Solution: Make it work with new versions of Racket. (Yukihiro Nakadaira, Ken Takata)
Diffstat (limited to 'src')
-rw-r--r--src/INSTALLpc.txt73
-rw-r--r--src/Make_cyg_ming.mak36
-rw-r--r--src/Make_mvc.mak55
-rwxr-xr-xsrc/auto/configure187
-rw-r--r--src/configure.in168
-rw-r--r--src/if_mzsch.c372
-rw-r--r--src/version.c2
7 files changed, 616 insertions, 277 deletions
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index 3777784d14..071ede44a2 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -24,7 +24,7 @@ Contents:
5. Cross compiling for Win32 from a Linux machine
6. Building with Python support
7. Building with Python3 support
-8. Building with MzScheme support
+8. Building with MzScheme/Racket support
9. Building with Lua support
10. Building with Perl support
11. Building with Ruby support
@@ -415,8 +415,10 @@ E.g. When using MSVC (as one line):
PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
-8. Building with MzScheme support
-=================================
+8. Building with MzScheme/Racket support
+========================================
+
+1) Building with MzScheme support
(written by Sergey Khorev <sergey.khorev@gmail.com>)
@@ -451,31 +453,75 @@ After a successful build, these dlls can be freely removed, leaving them in
%WINDOWS%\System32 only.
+2) Building with Racket support
+
+MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
+(https://racket-lang.org/) support can be built with either MSVC or MinGW (or
+Cygwin).
+
+You need to set the following variables:
+
+ MZSCHEME: Where Racket is installed.
+ E.g. C:\Program Files (x86)\Racket
+ DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
+ MZSCHEME_VER: Racket DLL version. E.g. 3m_9z0ds0 for Racket 6.3.
+ MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
+ runtime. Default: $(MZSCHEME)\collects
+ User can override this with the PLTCOLLECTS environment
+ variable.
+
+E.g. When using MSVC (as one line):
+
+ nmake -f Make_mvc.mak
+ MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
+ MZSCHEME_VER=3m_9z0ds0
+
+Or when using MinGW (as one line):
+
+ mingw32-make -f Make_ming.mak
+ MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
+ MZSCHEME_VER=3m_9z0ds0
+
+ Spaces should be escaped with '\'.
+
+
9. Building with Lua support
============================
-Vim with Lua support can be built with either MSVC or MinGW (or Cygwin).
-You can use binaries from LuaBinaries.
- http://luabinaries.sourceforge.net/
+Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
+You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
+This also applies to when you get a Vim executable and don't build yourself,
+do the part up to "Build".
1) Download and install LuaBinaries
+
Go to the Download page of LuaBinaries:
- http://luabinaries.sourceforge.net/download.html
+ http://luabinaries.sourceforge.net/download.html
Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
-lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them for both MSVC and
+lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
MinGW.
Unpack it to a working directory. E.g. C:\projects\lua53.
Lua's header files will be installed under the include directory.
+Copy luaXY.dll to your Windows system directory. The system directory depends
+on your Windows bitness and Vim bitness:
+ 32-bit Vim on 32-bit Windows: C:\Windows\System32
+ 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
+ 64-bit Vim on 64-bit Windows: C:\Windows\System32
+
+Or another option is copying luaXY.dll to the directory where gvim.exe
+(or vim.exe) is.
+
2) Build
-You need to set the following variables:
- LUA: Where Lua is installed. E.g. C:\projects\lua53.
- DYNAMIC_LUA: Whether dynamic linking is used. Usually, set to yes.
- LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
+You need to set LUA, DYNAMIC_LUA and LUA_VER.
+
+ LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
+ DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
+ LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
E.g. When using MSVC (as one line):
@@ -487,7 +533,8 @@ Or when using MinGW (as one line):
mingw32-make -f Make_mingw.mak
LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
-Or when using Cygwin (as one line):
+
+Or when using Cygwin (as one line) (untested):
make -f Make_cyg.mak
LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
index d89ba29594..79628a823c 100644
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -171,26 +171,37 @@ ifndef MZSCHEME_VER
MZSCHEME_VER=205_000
endif
-ifndef MZSCHEME_PRECISE_GC
-MZSCHEME_PRECISE_GC=no
-endif
-
# for version 4.x we need to generate byte-code for Scheme base
ifndef MZSCHEME_GENERATE_BASE
MZSCHEME_GENERATE_BASE=no
endif
-ifndef MZSCHEME_USE_RACKET
+ifneq ($(wildcard $(MZSCHEME)/lib/msvc/libmzsch$(MZSCHEME_VER).lib),)
MZSCHEME_MAIN_LIB=mzsch
else
MZSCHEME_MAIN_LIB=racket
endif
+ifndef MZSCHEME_PRECISE_GC
+MZSCHEME_PRECISE_GC=no
+ifneq ($(wildcard $(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll),)
+ifeq ($(wildcard $(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll),)
+MZSCHEME_PRECISE_GC=yes
+endif
+else
+ifneq ($(wildcard $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib),)
+ifeq ($(wildcard $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib),)
+MZSCHEME_PRECISE_GC=yes
+endif
+endif
+endif
+endif
+
ifeq (no,$(DYNAMIC_MZSCHEME))
ifeq (yes,$(MZSCHEME_PRECISE_GC))
MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
else
-MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
+MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
endif
# the modern MinGW can dynamically link to dlls directly.
# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
@@ -429,10 +440,21 @@ endif
endif
ifdef MZSCHEME
-CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
+ifndef MZSCHEME_COLLECTS
+MZSCHEME_COLLECTS=$(MZSCHEME)/collects
+ifeq (yes, $(UNDER_CYGWIN))
+MZSCHEME_COLLECTS:=$(shell cygpath -m $(MZSCHEME_COLLECTS) | sed -e 's/ /\\ /g')
+endif
+endif
+CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME_COLLECTS)\"
ifeq (yes, $(DYNAMIC_MZSCHEME))
+ifeq (yes, $(MZSCHEME_PRECISE_GC))
+# Precise GC does not use separate dll
+CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\"
+else
CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
endif
+endif
ifeq (yes, "$(MZSCHEME_DEBUG)")
CFLAGS += -DMZSCHEME_FORCE_GC
endif
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 6f0b84391c..df5a748ce9 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -755,43 +755,52 @@ PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
!ifndef MZSCHEME_VER
MZSCHEME_VER = 205_000
!endif
-CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
-!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
- || EXIST("$(MZSCHEME)\collects\scheme\base.rkt") \
- || EXIST("$(MZSCHEME)\collects\racket\base.rkt")
-# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
-MZSCHEME_EXTRA_DEP = mzscheme_base.c
-CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
+!ifndef MZSCHEME_COLLECTS
+MZSCHEME_COLLECTS=$(MZSCHEME)\collects
!endif
+CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I "$(MZSCHEME)\include"
!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
MZSCHEME_MAIN_LIB=mzsch
!else
MZSCHEME_MAIN_LIB=racket
!endif
-!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
- && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
+!if (EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll") \
+ && !EXIST("$(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll")) \
+ || (EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
+ && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib"))
!message Building with Precise GC
MZSCHEME_PRECISE_GC = yes
CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
!endif
!if "$(DYNAMIC_MZSCHEME)" == "yes"
+!message MzScheme DLLs will be loaded dynamically
+CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME
!if "$(MZSCHEME_PRECISE_GC)" == "yes"
-!error MzScheme with Precise GC cannot be loaded dynamically
+# Precise GC does not use separate dll
+CFLAGS = $(CFLAGS) \
+ -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
+ -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\"
+!else
+CFLAGS = $(CFLAGS) \
+ -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
+ -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
!endif
-!message MzScheme DLLs will be loaded dynamically
-CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
- -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
- -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
!else
!if "$(MZSCHEME_DEBUG)" == "yes"
CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
!endif
!if "$(MZSCHEME_PRECISE_GC)" == "yes"
# Precise GC does not use separate dll
-MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
+!if EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def")
+# create .lib from .def
+MZSCHEME_LIB = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
+MZSCHEME_EXTRA_DEP = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
!else
-MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
- $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
+MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib"
+!endif
+!else
+MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib" \
+ "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib"
!endif
!endif
MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
@@ -1059,7 +1068,6 @@ clean:
- if exist dimm_i.c del dimm_i.c
- if exist dimm.tlb del dimm.tlb
- if exist dosinst.exe del dosinst.exe
- - if exist mzscheme_base.c del mzscheme_base.c
cd xxd
$(MAKE) /NOLOGO -f Make_mvc.mak clean
cd ..
@@ -1172,13 +1180,10 @@ $(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
$(CC) $(CFLAGS) if_mzsch.c \
- -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
-mzscheme_base.c:
-!IF "$(MZSCHEME_MAIN_LIB)" == "racket"
- $(MZSCHEME)\raco ctool --c-mods mzscheme_base.c ++lib scheme/base
-!ELSE
- $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
-!ENDIF
+ -DMZSCHEME_COLLECTS="\"$(MZSCHEME_COLLECTS:\=\\)\""
+
+lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib:
+ lib /DEF:"$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def"
$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
$(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
diff --git a/src/auto/configure b/src/auto/configure
index e07d7ecf38..ed8ca6aa95 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -5207,6 +5207,7 @@ fi
if test "X$with_plthome" != "X"; then
vi_cv_path_mzscheme_pfx="$with_plthome"
+ vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PLTHOME environment var" >&5
$as_echo_n "checking PLTHOME environment var... " >&6; }
@@ -5214,6 +5215,7 @@ $as_echo_n "checking PLTHOME environment var... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$PLTHOME\"" >&5
$as_echo "\"$PLTHOME\"" >&6; }
vi_cv_path_mzscheme_pfx="$PLTHOME"
+ vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5
$as_echo "not set" >&6; }
@@ -5285,54 +5287,63 @@ $as_echo "$vi_cv_path_mzscheme_pfx" >&6; }
fi
fi
- SCHEME_INC=
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include" >&5
-$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include... " >&6; }
- if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
- SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket include directory" >&5
+$as_echo_n "checking for racket include directory... " >&6; }
+ SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'`
+ if test "X$SCHEME_INC" != "X"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_INC}" >&5
+$as_echo "${SCHEME_INC}" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt" >&5
-$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt... " >&6; }
- if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include" >&5
+$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include... " >&6; }
+ if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
+ SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket" >&5
-$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket... " >&6; }
- if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt" >&5
+$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt... " >&6; }
+ if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
+ SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/plt/" >&5
-$as_echo_n "checking if scheme.h can be found in /usr/include/plt/... " >&6; }
- if test -f /usr/include/plt/scheme.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket" >&5
+$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket... " >&6; }
+ if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- SCHEME_INC=/usr/include/plt
+ SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/racket/" >&5
-$as_echo_n "checking if scheme.h can be found in /usr/include/racket/... " >&6; }
- if test -f /usr/include/racket/scheme.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/plt/" >&5
+$as_echo_n "checking if scheme.h can be found in /usr/include/plt/... " >&6; }
+ if test -f /usr/include/plt/scheme.h; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- SCHEME_INC=/usr/include/racket
+ SCHEME_INC=/usr/include/plt
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- vi_cv_path_mzscheme_pfx=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in /usr/include/racket/" >&5
+$as_echo_n "checking if scheme.h can be found in /usr/include/racket/... " >&6; }
+ if test -f /usr/include/racket/scheme.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SCHEME_INC=/usr/include/racket
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ vi_cv_path_mzscheme_pfx=
+ fi
fi
fi
fi
@@ -5341,52 +5352,101 @@ $as_echo "no" >&6; }
fi
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
- if test "x$MACOSX" = "xyes"; then
- MZSCHEME_LIBS="-framework Racket"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket lib directory" >&5
+$as_echo_n "checking for racket lib directory... " >&6; }
+ SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'`
+ if test "X$SCHEME_LIB" != "X"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_LIB}" >&5
+$as_echo "${SCHEME_LIB}" >&6; }
else
- if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc"
- else
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ fi
+
+ for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do
+ if test "X$path" != "X"; then
+ if test "x$MACOSX" = "xyes"; then
+ MZSCHEME_LIBS="-framework Racket"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libmzscheme3m.a"; then
+ MZSCHEME_LIBS="${path}/libmzscheme3m.a"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket3m.a"; then
+ MZSCHEME_LIBS="${path}/libracket3m.a"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket.a"; then
+ MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a"
+ elif test -f "${path}/libmzscheme.a"; then
+ MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a"
+ else
+ if test -f "${path}/libmzscheme3m.so"; then
+ MZSCHEME_LIBS="-L${path} -lmzscheme3m"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket3m.so"; then
+ MZSCHEME_LIBS="-L${path} -lracket3m"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket.so"; then
+ MZSCHEME_LIBS="-L${path} -lracket -lmzgc"
+ else
+ if test "$path" != "$SCHEME_LIB"; then
+ continue
+ fi
+ MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc"
+ fi
+ if test "$GCC" = yes; then
+ MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
+ elif test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
+ fi
+ fi
fi
- if test "$GCC" = yes; then
- MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
- elif test "`(uname) 2>/dev/null`" = SunOS &&
- uname -r | grep '^5' >/dev/null; then
- MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib"
+ if test "X$MZSCHEME_LIBS" != "X"; then
+ break
fi
+ done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if racket requires -pthread" >&5
+$as_echo_n "checking if racket requires -pthread... " >&6; }
+ if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread"
+ MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket config directory" >&5
+$as_echo_n "checking for racket config directory... " >&6; }
+ SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'`
+ if test "X$SCHEME_CONFIGDIR" != "X"; then
+ MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_CONFIGDIR}" >&5
+$as_echo "${SCHEME_CONFIGDIR}" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket collects directory" >&5
$as_echo_n "checking for racket collects directory... " >&6; }
- if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
- else
- if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
+ SCHEME_COLLECTS=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-collects-dir))) (when (path? p) (let-values (((base _1 _2) (split-path p))) (display base))))'`
+ if test "X$SCHEME_COLLECTS" = "X"; then
+ if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
else
- if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
+ if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
else
- if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
+ if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
+ else
+ if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
+ fi
fi
fi
fi
@@ -5420,7 +5480,6 @@ $as_echo_n "checking for mzscheme_base.c... " >&6; }
fi
if test "X$MZSCHEME_EXTRA" != "X" ; then
MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
- MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: needed" >&5
$as_echo "needed" >&6; }
else
diff --git a/src/configure.in b/src/configure.in
index 6048e8f9c0..adb30c4299 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -695,11 +695,13 @@ if test "$enable_mzschemeinterp" = "yes"; then
if test "X$with_plthome" != "X"; then
vi_cv_path_mzscheme_pfx="$with_plthome"
+ vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
else
AC_MSG_CHECKING(PLTHOME environment var)
if test "X$PLTHOME" != "X"; then
AC_MSG_RESULT("$PLTHOME")
vi_cv_path_mzscheme_pfx="$PLTHOME"
+ vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
else
AC_MSG_RESULT(not set)
dnl -- try to find MzScheme executable
@@ -731,39 +733,45 @@ if test "$enable_mzschemeinterp" = "yes"; then
fi
fi
- SCHEME_INC=
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
- AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
- if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
- SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
- AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(for racket include directory)
+ SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'`
+ if test "X$SCHEME_INC" != "X"; then
+ AC_MSG_RESULT(${SCHEME_INC})
else
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
- if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
+ if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
+ SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
AC_MSG_RESULT(yes)
- SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
else
AC_MSG_RESULT(no)
- AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
- if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
+ AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
+ if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
AC_MSG_RESULT(yes)
- SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
+ SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
else
AC_MSG_RESULT(no)
- AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
- if test -f /usr/include/plt/scheme.h; then
+ AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
+ if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
AC_MSG_RESULT(yes)
- SCHEME_INC=/usr/include/plt
+ SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
else
AC_MSG_RESULT(no)
- AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
- if test -f /usr/include/racket/scheme.h; then
+ AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
+ if test -f /usr/include/plt/scheme.h; then
AC_MSG_RESULT(yes)
- SCHEME_INC=/usr/include/racket
+ SCHEME_INC=/usr/include/plt
else
AC_MSG_RESULT(no)
- vi_cv_path_mzscheme_pfx=
+ AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
+ if test -f /usr/include/racket/scheme.h; then
+ AC_MSG_RESULT(yes)
+ SCHEME_INC=/usr/include/racket
+ else
+ AC_MSG_RESULT(no)
+ vi_cv_path_mzscheme_pfx=
+ fi
fi
fi
fi
@@ -772,54 +780,95 @@ if test "$enable_mzschemeinterp" = "yes"; then
fi
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
- if test "x$MACOSX" = "xyes"; then
- MZSCHEME_LIBS="-framework Racket"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then
- MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
+
+ AC_MSG_CHECKING(for racket lib directory)
+ SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'`
+ if test "X$SCHEME_LIB" != "X"; then
+ AC_MSG_RESULT(${SCHEME_LIB})
else
- dnl Using shared objects
- if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m"
- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc"
- else
- MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
+ AC_MSG_RESULT(not found)
+ fi
+
+ for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do
+ if test "X$path" != "X"; then
+ if test "x$MACOSX" = "xyes"; then
+ MZSCHEME_LIBS="-framework Racket"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libmzscheme3m.a"; then
+ MZSCHEME_LIBS="${path}/libmzscheme3m.a"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket3m.a"; then
+ MZSCHEME_LIBS="${path}/libracket3m.a"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket.a"; then
+ MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a"
+ elif test -f "${path}/libmzscheme.a"; then
+ MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a"
+ else
+ dnl Using shared objects
+ if test -f "${path}/libmzscheme3m.so"; then
+ MZSCHEME_LIBS="-L${path} -lmzscheme3m"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket3m.so"; then
+ MZSCHEME_LIBS="-L${path} -lracket3m"
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+ elif test -f "${path}/libracket.so"; then
+ MZSCHEME_LIBS="-L${path} -lracket -lmzgc"
+ else
+ dnl try next until last
+ if test "$path" != "$SCHEME_LIB"; then
+ continue
+ fi
+ MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc"
+ fi
+ if test "$GCC" = yes; then
+ dnl Make Vim remember the path to the library. For when it's not in
+ dnl $LD_LIBRARY_PATH.
+ MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
+ elif test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
+ fi
+ fi
fi
- if test "$GCC" = yes; then
- dnl Make Vim remember the path to the library. For when it's not in
- dnl $LD_LIBRARY_PATH.
- MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
- elif test "`(uname) 2>/dev/null`" = SunOS &&
- uname -r | grep '^5' >/dev/null; then
- MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib"
+ if test "X$MZSCHEME_LIBS" != "X"; then
+ break
fi
+ done
+
+ AC_MSG_CHECKING([if racket requires -pthread])
+ if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then
+ AC_MSG_RESULT(yes)
+ MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread"
+ MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread"
+ else
+ AC_MSG_RESULT(no)
fi
- AC_MSG_CHECKING(for racket collects directory)
- if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
+ AC_MSG_CHECKING(for racket config directory)
+ SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'`
+ if test "X$SCHEME_CONFIGDIR" != "X"; then
+ MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'"
+ AC_MSG_RESULT(${SCHEME_CONFIGDIR})
else
- if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
+ AC_MSG_RESULT(not found)
+ fi
+
+ AC_MSG_CHECKING(for racket collects directory)
+ SCHEME_COLLECTS=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-collects-dir))) (when (path? p) (let-values (((base _1 _2) (split-path p))) (display base))))'`
+ if test "X$SCHEME_COLLECTS" = "X"; then
+ if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
else
- if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
+ if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
else
- if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
- SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
+ if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
+ else
+ if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
+ SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
+ fi
fi
fi
fi
@@ -851,7 +900,6 @@ if test "$enable_mzschemeinterp" = "yes"; then
if test "X$MZSCHEME_EXTRA" != "X" ; then
dnl need to generate bytecode for MzScheme base
MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
- MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
AC_MSG_RESULT(needed)
else
AC_MSG_RESULT(not needed)
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index 287ab1a1c3..ea04705459 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -29,6 +29,27 @@
* depend". */
#if defined(FEAT_MZSCHEME) || defined(PROTO)
+/*
+ * scheme_register_tls_space is only available on 32-bit Windows until
+ * racket-6.3. See
+ * http://docs.racket-lang.org/inside/im_memoryalloc.html?q=scheme_register_tls_space
+ */
+#if MZSCHEME_VERSION_MAJOR >= 500 && defined(WIN32) \
+ && defined(USE_THREAD_LOCAL) \
+ && (!defined(_WIN64) || MZSCHEME_VERSION_MAJOR >= 603)
+# define HAVE_TLS_SPACE 1
+#endif
+
+/*
+ * Since version 4.x precise GC requires trampolined startup.
+ * Futures and places in version 5.x need it too.
+ */
+#if defined(MZ_PRECISE_GC) && MZSCHEME_VERSION_MAJOR >= 400 \
+ || MZSCHEME_VERSION_MAJOR >= 500 \
+ && (defined(MZ_USE_FUTURES) || defined(MZ_USE_PLACES))
+# define TRAMPOLINED_MZVIM_STARTUP
+#endif
+
/* Base data structures */
#define SCHEME_VIMBUFFERP(obj) SAME_TYPE(SCHEME_TYPE(obj), mz_buffer_type)
#define SCHEME_VIMWINDOWP(obj) SAME_TYPE(SCHEME_TYPE(obj), mz_window_type)
@@ -138,9 +159,9 @@ static Scheme_Object *vim_window_validp(void *data, int, Scheme_Object **);
*/
static int vim_error_check(void);
static int do_mzscheme_command(exarg_T *, void *, Scheme_Closed_Prim *what);
-static void startup_mzscheme(void);
+static int startup_mzscheme(void);
static char *string_to_line(Scheme_Object *obj);
-#if MZSCHEME_VERSION_MAJOR >= 500
+#if MZSCHEME_VERSION_MAJOR >= 501
# define OUTPUT_LEN_TYPE intptr_t
#else
# define OUTPUT_LEN_TYPE long
@@ -237,7 +258,7 @@ static Scheme_Object *dll_scheme_true;
static Scheme_Thread **dll_scheme_current_thread_ptr;
static void (**dll_scheme_console_printf_ptr)(char *str, ...);
-static void (**dll_scheme_console_output_ptr)(char *str, long len);
+static void (**dll_scheme_console_output_ptr)(char *str, OUTPUT_LEN_TYPE len);
static void (**dll_scheme_notify_multithread_ptr)(int on);
static void *(*dll_GC_malloc)(size_t size_in_bytes);
@@ -255,6 +276,7 @@ static Scheme_Object *(*dll_scheme_apply)(Scheme_Object *rator, int num_rands,
static Scheme_Object *(*dll_scheme_builtin_value)(const char *name);
# if MZSCHEME_VERSION_MAJOR >= 299
static Scheme_Object *(*dll_scheme_byte_string_to_char_string)(Scheme_Object *s);
+static Scheme_Object *(*dll_scheme_make_path)(const char *chars);
# endif
static void (*dll_scheme_close_input_port)(Scheme_Object *port);
static void (*dll_scheme_count_lines)(Scheme_Object *port);
@@ -264,7 +286,7 @@ static Scheme_Object *(*dll_scheme_current_continuation_marks)(void);
static Scheme_Object *(*dll_scheme_current_continuation_marks)(Scheme_Object *prompt_tag);
#endif
static void (*dll_scheme_display)(Scheme_Object *obj, Scheme_Object *port);
-static char *(*dll_scheme_display_to_string)(Scheme_Object *obj, long *len);
+static char *(*dll_scheme_displ