To: vim_dev@googlegroups.com Subject: Patch 7.4.1104 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1104 Problem: Various problems building with MzScheme/Racket. Solution: Make it work with new versions of Racket. (Yukihiro Nakadaira, Ken Takata) Files: runtime/doc/if_mzsch.txt, src/INSTALLpc.txt, src/Make_cyg_ming.mak, src/Make_mvc.mak, src/auto/configure, src/configure.in, src/if_mzsch.c *** ../vim-7.4.1103/runtime/doc/if_mzsch.txt 2013-08-10 13:24:55.000000000 +0200 --- runtime/doc/if_mzsch.txt 2016-01-16 16:04:40.050904905 +0100 *************** *** 13,18 **** --- 13,19 ---- 5. mzeval() Vim function |mzscheme-mzeval| 6. Using Function references |mzscheme-funcref| 7. Dynamic loading |mzscheme-dynamic| + 8. MzScheme setup |mzscheme-setup| {Vi does not have any of these commands} *************** *** 272,277 **** --- 273,281 ---- This means that Vim will search for the MzScheme DLL files only when needed. When you don't use the MzScheme interface you don't need them, thus you can use Vim without these DLL files. + NOTE: Newer version of MzScheme (Racket) require earlier (trampolined) + initialisation via scheme_main_setup. So Vim always loads the MzScheme DLL at + startup if possible. To use the MzScheme interface the MzScheme DLLs must be in your search path. In a console window type "path" to see what directories are used. *************** *** 282,286 **** --- 286,309 ---- command, look for -DDYNAMIC_MZSCH_DLL="something" and -DDYNAMIC_MZGC_DLL="something" in the "Compilation" info. + For example, if MzScheme (Racket) is installed at C:\Racket63, you may need + to set the environment variable as the following: > + + PATH=%PATH%;C:\Racket63\lib + PLTCOLLECTS=C:\Racket63\collects + PLTCONFIGDIR=C:\Racket63\etc + < + ============================================================================== + 8. MzScheme setup *mzscheme-setup* + + Vim requires "racket/base" module for if_mzsch core (fallback to "scheme/base" + if it doesn't exist), "r5rs" module for test and "raco ctool" command for + building Vim. If MzScheme did not have them, you can install them with + MzScheme's raco command: + > + raco pkg install scheme-lib # scheme/base module + raco pkg install r5rs-lib # r5rs module + raco pkg install cext-lib # raco ctool command + < ====================================================================== vim:tw=78:ts=8:sts=4:ft=help:norl: *** ../vim-7.4.1103/src/INSTALLpc.txt 2016-01-10 14:35:53.844384077 +0100 --- src/INSTALLpc.txt 2016-01-16 15:57:03.787793150 +0100 *************** *** 24,30 **** 5. Cross compiling for Win32 from a Linux machine 6. Building with Python support 7. Building with Python3 support ! 8. Building with MzScheme support 9. Building with Lua support 10. Building with Perl support 11. Building with Ruby support --- 24,30 ---- 5. Cross compiling for Win32 from a Linux machine 6. Building with Python support 7. Building with Python3 support ! 8. Building with MzScheme/Racket support 9. Building with Lua support 10. Building with Perl support 11. Building with Ruby support *************** *** 415,422 **** PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 ! 8. Building with MzScheme support ! ================================= (written by Sergey Khorev ) --- 415,424 ---- PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 ! 8. Building with MzScheme/Racket support ! ======================================== ! ! 1) Building with MzScheme support (written by Sergey Khorev ) *************** *** 451,481 **** %WINDOWS%\System32 only. 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/ 1) Download and install LuaBinaries Go to the Download page of LuaBinaries: ! 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 MinGW. Unpack it to a working directory. E.g. C:\projects\lua53. Lua's header files will be installed under the include directory. 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. E.g. When using MSVC (as one line): --- 453,527 ---- %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 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 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 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 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,493 **** mingw32-make -f Make_mingw.mak LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53 ! Or when using Cygwin (as one line): make -f Make_cyg.mak LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 --- 533,540 ---- mingw32-make -f Make_mingw.mak LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53 ! ! Or when using Cygwin (as one line) (untested): make -f Make_cyg.mak LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 *** ../vim-7.4.1103/src/Make_cyg_ming.mak 2016-01-09 17:49:11.485452004 +0100 --- src/Make_cyg_ming.mak 2016-01-16 15:57:03.787793150 +0100 *************** *** 171,196 **** 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 MZSCHEME_MAIN_LIB=mzsch else MZSCHEME_MAIN_LIB=racket 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) endif # the modern MinGW can dynamically link to dlls directly. # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll --- 171,207 ---- MZSCHEME_VER=205_000 endif # for version 4.x we need to generate byte-code for Scheme base ifndef MZSCHEME_GENERATE_BASE MZSCHEME_GENERATE_BASE=no endif ! 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) endif # the modern MinGW can dynamically link to dlls directly. # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll *************** *** 429,438 **** endif ifdef MZSCHEME ! CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\" ifeq (yes, $(DYNAMIC_MZSCHEME)) CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" endif ifeq (yes, "$(MZSCHEME_DEBUG)") CFLAGS += -DMZSCHEME_FORCE_GC endif --- 440,460 ---- endif ifdef MZSCHEME ! 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 *** ../vim-7.4.1103/src/Make_mvc.mak 2016-01-15 18:03:26.869250872 +0100 --- src/Make_mvc.mak 2016-01-16 15:57:03.787793150 +0100 *************** *** 755,797 **** !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 !endif !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") !message Building with Precise GC MZSCHEME_PRECISE_GC = yes CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC !endif !if "$(DYNAMIC_MZSCHEME)" == "yes" !if "$(MZSCHEME_PRECISE_GC)" == "yes" ! !error MzScheme with Precise GC cannot be loaded dynamically !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 !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 --- 755,806 ---- !ifndef MZSCHEME_VER MZSCHEME_VER = 205_000 !endif ! !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\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" ! # 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 !else !if "$(MZSCHEME_DEBUG)" == "yes" CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC !endif !if "$(MZSCHEME_PRECISE_GC)" == "yes" # Precise GC does not use separate dll ! !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\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,1065 **** - 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 .. --- 1068,1073 ---- *************** *** 1172,1184 **** $(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 $(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL) $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c --- 1180,1189 ---- $(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP) $(CC) $(CFLAGS) if_mzsch.c \ ! -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 *** ../vim-7.4.1103/src/auto/configure 2016-01-09 19:39:39.277685945 +0100 --- src/auto/configure 2016-01-16 15:57:47.427325684 +0100 *************** *** 5207,5212 **** --- 5207,5213 ---- 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,5219 **** --- 5215,5221 ---- { $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,5338 **** 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; } 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: 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}: result: yes" >&5 $as_echo "yes" >&6; } ! 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/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/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/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 --- 5287,5349 ---- fi fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then ! { $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: 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; } 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: 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}: result: yes" >&5 $as_echo "yes" >&6; } ! 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/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/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/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,5392 **** 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" ! 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" 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" fi 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/ else ! 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 --- 5352,5452 ---- fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then ! ! { $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 ! { $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 "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; } ! 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/lib/racket/collects"; then ! SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ else ! 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,5426 **** 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 --- 5480,5485 ---- *** ../vim-7.4.1103/src/configure.in 2016-01-09 19:39:39.277685945 +0100 --- src/configure.in 2016-01-16 15:57:03.791793107 +0100 *************** *** 695,705 **** --- 695,707 ---- 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,769 **** 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) 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(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_RESULT(yes) ! 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/plt/) ! if test -f /usr/include/plt/scheme.h; then AC_MSG_RESULT(yes) ! SCHEME_INC=/usr/include/plt 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_RESULT(yes) ! SCHEME_INC=/usr/include/racket else AC_MSG_RESULT(no) ! vi_cv_path_mzscheme_pfx= fi fi fi --- 733,777 ---- fi fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then ! 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(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) 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(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_RESULT(yes) ! 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/plt/) ! if test -f /usr/include/plt/scheme.h; then AC_MSG_RESULT(yes) ! SCHEME_INC=/usr/include/plt 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_RESULT(yes) ! SCHEME_INC=/usr/include/racket ! else ! AC_MSG_RESULT(no) ! vi_cv_path_mzscheme_pfx= ! fi fi fi fi *************** *** 772,825 **** 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" ! 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" 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" fi 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/ else ! 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/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 --- 780,874 ---- fi if test "X$vi_cv_path_mzscheme_pfx" != "X"; then ! ! 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 ! 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 "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 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 ! 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/lib/racket/collects"; then ! SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ else ! 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,857 **** 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) --- 900,905 ---- *** ../vim-7.4.1103/src/if_mzsch.c 2015-07-21 17:53:11.577527989 +0200 --- src/if_mzsch.c 2016-01-16 16:10:24.599219683 +0100 *************** *** 29,34 **** --- 29,55 ---- * 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,146 **** */ static int vim_error_check(void); static int do_mzscheme_command(exarg_T *, void *, Scheme_Closed_Prim *what); ! static void startup_mzscheme(void); static char *string_to_line(Scheme_Object *obj); ! #if MZSCHEME_VERSION_MAJOR >= 500 # define OUTPUT_LEN_TYPE intptr_t #else # define OUTPUT_LEN_TYPE long --- 159,167 ---- */ static int vim_error_check(void); static int do_mzscheme_command(exarg_T *, void *, Scheme_Closed_Prim *what); ! static int startup_mzscheme(void); static char *string_to_line(Scheme_Object *obj); ! #if MZSCHEME_VERSION_MAJOR >= 501 # define OUTPUT_LEN_TYPE intptr_t #else # define OUTPUT_LEN_TYPE long *************** *** 237,243 **** 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_notify_multithread_ptr)(int on); static void *(*dll_GC_malloc)(size_t size_in_bytes); --- 258,264 ---- 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, OUTPUT_LEN_TYPE len); static void (**dll_scheme_notify_multithread_ptr)(int on); static void *(*dll_GC_malloc)(size_t size_in_bytes); *************** *** 255,260 **** --- 276,282 ---- 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,270 **** 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 int (*dll_scheme_eq)(Scheme_Object *obj1, Scheme_Object *obj2); static Scheme_Object *(*dll_scheme_do_eval)(Scheme_Object *obj, int _num_rands, Scheme_Object **rands, int val); --- 286,292 ---- 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, OUTPUT_LEN_TYPE *len); static int (*dll_scheme_eq)(Scheme_Object *obj1, Scheme_Object *obj2); static Scheme_Object *(*dll_scheme_do_eval)(Scheme_Object *obj, int _num_rands, Scheme_Object **rands, int val); *************** *** 280,286 **** Scheme_Object **argv, long *rlen); # else static char *(*dll_scheme_format_utf8)(char *format, int flen, int argc, ! Scheme_Object **argv, long *rlen); static Scheme_Object *(*dll_scheme_get_param)(Scheme_Config *c, int pos); # endif static void (*dll_scheme_gc_ptr_ok)(void *p); --- 302,308 ---- Scheme_Object **argv, long *rlen); # else static char *(*dll_scheme_format_utf8)(char *format, int flen, int argc, ! Scheme_Object **argv, OUTPUT_LEN_TYPE *rlen); static Scheme_Object *(*dll_scheme_get_param)(Scheme_Config *c, int pos); # endif static void (*dll_scheme_gc_ptr_ok)(void *p); *************** *** 289,295 **** long *len); # else static char *(*dll_scheme_get_sized_byte_string_output)(Scheme_Object *, ! long *len); # endif static Scheme_Object *(*dll_scheme_intern_symbol)(const char *name); static Scheme_Object *(*dll_scheme_lookup_global)(Scheme_Object *symbol, --- 311,317 ---- long *len); # else static char *(*dll_scheme_get_sized_byte_string_output)(Scheme_Object *, ! OUTPUT_LEN_TYPE *len); # endif static Scheme_Object *(*dll_scheme_intern_symbol)(const char *name); static Scheme_Object *(*dll_scheme_lookup_global)(Scheme_Object *symbol, *************** *** 354,363 **** static Scheme_Object *(*dll_scheme_hash_get)(Scheme_Hash_Table *table, Scheme_Object *key); static Scheme_Object *(*dll_scheme_make_double)(double d); - # ifdef INCLUDE_MZSCHEME_BASE static Scheme_Object *(*dll_scheme_make_sized_byte_string)(char *chars, long len, int copy); static Scheme_Object *(*dll_scheme_namespace_require)(Scheme_Object *req); # endif /* arrays are imported directly */ --- 376,409 ---- static Scheme_Object *(*dll_scheme_hash_get)(Scheme_Hash_Table *table, Scheme_Object *key); static Scheme_Object *(*dll_scheme_make_double)(double d); static Scheme_Object *(*dll_scheme_make_sized_byte_string)(char *chars, long len, int copy); static Scheme_Object *(*dll_scheme_namespace_require)(Scheme_Object *req); + static Scheme_Object *(*dll_scheme_dynamic_wind)(void (*pre)(void *), Scheme_Object *(* volatile act)(void *), void (* volatile post)(void *), Scheme_Object *(*jmp_handler)(void *), void * volatile data); + # ifdef MZ_PRECISE_GC + static void *(*dll_GC_malloc_one_tagged)(size_t size_in_bytes); + static void (*dll_GC_register_traversers)(short tag, Size_Proc size, Mark_Proc mark, Fixup_Proc fixup, int is_constant_size, int is_atomic); + # endif + # if MZSCHEME_VERSION_MAJOR >= 400 + static void (*dll_scheme_init_collection_paths)(Scheme_Env *global_env, Scheme_Object *extra_dirs); + static void **(*dll_scheme_malloc_immobile_box)(void *p); + static void (*dll_scheme_free_immobile_box)(void **b); + # endif + # if MZSCHEME_VERSION_MAJOR >= 500 + # ifdef TRAMPOLINED_MZVIM_STARTUP + static int (*dll_scheme_main_setup)(int no_auto_statics, Scheme_Env_Main _main, int argc, char **argv); + # if defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS) || MZSCHEME_VERSION_MAJOR >= 603 + static void (*dll_scheme_register_tls_space)(void *tls_space, int _tls_index); + # endif + # endif + # if defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS) || defined(IMPLEMENT_THREAD_LOCAL_EXTERNALLY_VIA_PROC) + static Thread_Local_Variables *(*dll_scheme_external_get_thread_local_variables)(void); + # endif + # endif + # if MZSCHEME_VERSION_MAJOR >= 600 + static void (*dll_scheme_embedded_load)(intptr_t len, const char *s, int predefined); + static void (*dll_scheme_register_embedded_load)(intptr_t len, const char *s); + static void (*dll_scheme_set_config_path)(Scheme_Object *p); # endif /* arrays are imported directly */ *************** *** 368,374 **** # define scheme_true dll_scheme_true /* pointers are GetProceAddress'ed as pointers to pointer */ ! # define scheme_current_thread (*dll_scheme_current_thread_ptr) # define scheme_console_printf (*dll_scheme_console_printf_ptr) # define scheme_console_output (*dll_scheme_console_output_ptr) # define scheme_notify_multithread (*dll_scheme_notify_multithread_ptr) --- 414,422 ---- # define scheme_true dll_scheme_true /* pointers are GetProceAddress'ed as pointers to pointer */ ! #if !defined(USE_THREAD_LOCAL) && !defined(LINK_EXTENSIONS_BY_TABLE) ! # define scheme_current_thread (*dll_scheme_current_thread_ptr) ! # endif # define scheme_console_printf (*dll_scheme_console_printf_ptr) # define scheme_console_output (*dll_scheme_console_output_ptr) # define scheme_notify_multithread (*dll_scheme_notify_multithread_ptr) *************** *** 384,389 **** --- 432,438 ---- # define scheme_builtin_value dll_scheme_builtin_value # if MZSCHEME_VERSION_MAJOR >= 299 # define scheme_byte_string_to_char_string dll_scheme_byte_string_to_char_string + # define scheme_make_path dll_scheme_make_path # endif # define scheme_check_threads dll_scheme_check_threads # define scheme_close_input_port dll_scheme_close_input_port *************** *** 455,463 **** # define scheme_hash_set dll_scheme_hash_set # define scheme_hash_get dll_scheme_hash_get # define scheme_make_double dll_scheme_make_double ! # ifdef INCLUDE_MZSCHEME_BASE ! # define scheme_make_sized_byte_string dll_scheme_make_sized_byte_string ! # define scheme_namespace_require dll_scheme_namespace_require # endif typedef struct --- 504,542 ---- # define scheme_hash_set dll_scheme_hash_set # define scheme_hash_get dll_scheme_hash_get # define scheme_make_double dll_scheme_make_double ! # define scheme_make_sized_byte_string dll_scheme_make_sized_byte_string ! # define scheme_namespace_require dll_scheme_namespace_require ! # define scheme_dynamic_wind dll_scheme_dynamic_wind ! # ifdef MZ_PRECISE_GC ! # define GC_malloc_one_tagged dll_GC_malloc_one_tagged ! # define GC_register_traversers dll_GC_register_traversers ! # endif ! # if MZSCHEME_VERSION_MAJOR >= 400 ! # ifdef TRAMPOLINED_MZVIM_STARTUP ! # define scheme_main_setup dll_scheme_main_setup ! # if defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS) || MZSCHEME_VERSION_MAJOR >= 603 ! # define scheme_register_tls_space dll_scheme_register_tls_space ! # endif ! # endif ! # define scheme_init_collection_paths dll_scheme_init_collection_paths ! # define scheme_malloc_immobile_box dll_scheme_malloc_immobile_box ! # define scheme_free_immobile_box dll_scheme_free_immobile_box ! # endif ! # if MZSCHEME_VERSION_MAJOR >= 600 ! # define scheme_embedded_load dll_scheme_embedded_load ! # define scheme_register_embedded_load dll_scheme_register_embedded_load ! # define scheme_set_config_path dll_scheme_set_config_path ! # endif ! ! # if MZSCHEME_VERSION_MAJOR >= 500 ! # if defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS) || defined(IMPLEMENT_THREAD_LOCAL_EXTERNALLY_VIA_PROC) ! /* define as function for macro in schshread.h */ ! Thread_Local_Variables * ! scheme_external_get_thread_local_variables(void) ! { ! return dll_scheme_external_get_thread_local_variables(); ! } ! # endif # endif typedef struct *************** *** 477,483 **** --- 556,564 ---- {"scheme_void", (void **)&dll_scheme_void}, {"scheme_null", (void **)&dll_scheme_null}, {"scheme_true", (void **)&dll_scheme_true}, + #if !defined(USE_THREAD_LOCAL) && !defined(LINK_EXTENSIONS_BY_TABLE) {"scheme_current_thread", (void **)&dll_scheme_current_thread_ptr}, + #endif {"scheme_console_printf", (void **)&dll_scheme_console_printf_ptr}, {"scheme_console_output", (void **)&dll_scheme_console_output_ptr}, {"scheme_notify_multithread", *************** *** 488,493 **** --- 569,575 ---- {"scheme_basic_env", (void **)&dll_scheme_basic_env}, # if MZSCHEME_VERSION_MAJOR >= 299 {"scheme_byte_string_to_char_string", (void **)&dll_scheme_byte_string_to_char_string}, + {"scheme_make_path", (void **)&dll_scheme_make_path}, # endif {"scheme_builtin_value", (void **)&dll_scheme_builtin_value}, {"scheme_check_threads", (void **)&dll_scheme_check_threads}, *************** *** 564,573 **** {"scheme_hash_set", (void **)&dll_scheme_hash_set}, {"scheme_hash_get", (void **)&dll_scheme_hash_get}, {"scheme_make_double", (void **)&dll_scheme_make_double}, - # ifdef INCLUDE_MZSCHEME_BASE {"scheme_make_sized_byte_string", (void **)&dll_scheme_make_sized_byte_string}, {"scheme_namespace_require", (void **)&dll_scheme_namespace_require}, ! #endif {NULL, NULL}}; static HINSTANCE hMzGC = 0; --- 646,679 ---- {"scheme_hash_set", (void **)&dll_scheme_hash_set}, {"scheme_hash_get", (void **)&dll_scheme_hash_get}, {"scheme_make_double", (void **)&dll_scheme_make_double}, {"scheme_make_sized_byte_string", (void **)&dll_scheme_make_sized_byte_string}, {"scheme_namespace_require", (void **)&dll_scheme_namespace_require}, ! {"scheme_dynamic_wind", (void **)&dll_scheme_dynamic_wind}, ! # ifdef MZ_PRECISE_GC ! {"GC_malloc_one_tagged", (void **)&dll_GC_malloc_one_tagged}, ! {"GC_register_traversers", (void **)&dll_GC_register_traversers}, ! # endif ! # if MZSCHEME_VERSION_MAJOR >= 400 ! # ifdef TRAMPOLINED_MZVIM_STARTUP ! {"scheme_main_setup", (void **)&dll_scheme_main_setup}, ! # if defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS) || MZSCHEME_VERSION_MAJOR >= 603 ! {"scheme_register_tls_space", (void **)&dll_scheme_register_tls_space}, ! # endif ! # endif ! {"scheme_init_collection_paths", (void **)&dll_scheme_init_collection_paths}, ! {"scheme_malloc_immobile_box", (void **)&dll_scheme_malloc_immobile_box}, ! {"scheme_free_immobile_box", (void **)&dll_scheme_free_immobile_box}, ! # endif ! # if MZSCHEME_VERSION_MAJOR >= 500 ! # if defined(IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS) || defined(IMPLEMENT_THREAD_LOCAL_EXTERNALLY_VIA_PROC) ! {"scheme_external_get_thread_local_variables", (void **)&dll_scheme_external_get_thread_local_variables}, ! # endif ! # endif ! # if MZSCHEME_VERSION_MAJOR >= 600 ! {"scheme_embedded_load", (void **)&dll_scheme_embedded_load}, ! {"scheme_register_embedded_load", (void **)&dll_scheme_register_embedded_load}, ! {"scheme_set_config_path", (void **)&dll_scheme_set_config_path}, ! # endif {NULL, NULL}}; static HINSTANCE hMzGC = 0; *************** *** 687,694 **** /* need to put it here for dynamic stuff to work */ #if defined(INCLUDE_MZSCHEME_BASE) # include "mzscheme_base.c" - #elif MZSCHEME_VERSION_MAJOR >= 400 - # error MzScheme >=4 must include mzscheme_base.c, for MinGW32 you need to define MZSCHEME_GENERATE_BASE=yes #endif /* --- 793,798 ---- *************** *** 701,706 **** --- 805,814 ---- static Scheme_Type mz_window_type; static int initialized = FALSE; + #ifdef DYNAMIC_MZSCHEME + static int disabled = FALSE; + #endif + static int load_base_module_failed = FALSE; /* global environment */ static Scheme_Env *environment = NULL; *************** *** 846,883 **** void mzscheme_end(void) { #ifdef DYNAMIC_MZSCHEME dynamic_mzscheme_end(); #endif } ! /* ! * scheme_register_tls_space is only available on 32-bit Windows. ! * 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) ! # define HAVE_TLS_SPACE 1 static __declspec(thread) void *tls_space; ! #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)) ! # ifdef DYNAMIC_MZSCHEME ! # error Precise GC v.4+ or Racket with futures/places do not support dynamic MzScheme # endif - # define TRAMPOLINED_MZVIM_STARTUP #endif int mzscheme_main(int argc, char** argv) { #ifdef HAVE_TLS_SPACE ! scheme_register_tls_space(&tls_space, 0); #endif #ifdef TRAMPOLINED_MZVIM_STARTUP return scheme_main_setup(TRUE, mzscheme_env_main, argc, argv); --- 954,996 ---- void mzscheme_end(void) { + /* We can not unload the DLL. Racket's thread might be still alive. */ + #if 0 #ifdef DYNAMIC_MZSCHEME dynamic_mzscheme_end(); #endif + #endif } ! #if HAVE_TLS_SPACE ! # if defined(_MSC_VER) static __declspec(thread) void *tls_space; ! extern intptr_t _tls_index; ! # elif defined(__MINGW32__) ! static __thread void *tls_space; ! extern intptr_t _tls_index; ! # else ! static THREAD_LOCAL void *tls_space; ! static intptr_t _tls_index = 0; # endif #endif int mzscheme_main(int argc, char** argv) { + #ifdef DYNAMIC_MZSCHEME + /* + * Racket requires trampolined startup. We can not load it later. + * If dynamic dll loading is failed, disable it. + */ + if (!mzscheme_enabled(FALSE)) + { + disabled = TRUE; + return vim_main2(argc, argv); + } + #endif #ifdef HAVE_TLS_SPACE ! scheme_register_tls_space(&tls_space, _tls_index); #endif #ifdef TRAMPOLINED_MZVIM_STARTUP return scheme_main_setup(TRUE, mzscheme_env_main, argc, argv); *************** *** 919,925 **** return vim_main_result; } ! static void startup_mzscheme(void) { #ifndef TRAMPOLINED_MZVIM_STARTUP --- 1032,1052 ---- return vim_main_result; } ! static Scheme_Object* ! load_base_module(void *data) ! { ! scheme_namespace_require(scheme_intern_symbol((char *)data)); ! return scheme_null; ! } ! ! static Scheme_Object * ! load_base_module_on_error(void *data) ! { ! load_base_module_failed = TRUE; ! return scheme_null; ! } ! ! static int startup_mzscheme(void) { #ifndef TRAMPOLINED_MZVIM_STARTUP *************** *** 942,1028 **** MZ_GC_CHECK(); #ifdef INCLUDE_MZSCHEME_BASE ! { ! /* ! * versions 4.x do not provide Scheme bindings by default ! * we need to add them explicitly ! */ ! Scheme_Object *scheme_base_symbol = NULL; ! MZ_GC_DECL_REG(1); ! MZ_GC_VAR_IN_REG(0, scheme_base_symbol); ! MZ_GC_REG(); ! /* invoke function from generated and included mzscheme_base.c */ ! declare_modules(environment); ! scheme_base_symbol = scheme_intern_symbol("scheme/base"); ! MZ_GC_CHECK(); ! scheme_namespace_require(scheme_base_symbol); ! MZ_GC_CHECK(); ! MZ_GC_UNREG(); ! } #endif - register_vim_exn(); - /* use new environment to initialise exception handling */ - init_exn_catching_apply(); - - /* redirect output */ - scheme_console_output = do_output; - scheme_console_printf = do_printf; - #ifdef MZSCHEME_COLLECTS /* setup 'current-library-collection-paths' parameter */ # if MZSCHEME_VERSION_MAJOR >= 299 - # ifdef MACOS { ! Scheme_Object *coll_byte_string = NULL; ! Scheme_Object *coll_char_string = NULL; ! Scheme_Object *coll_path = NULL; ! MZ_GC_DECL_REG(3); ! MZ_GC_VAR_IN_REG(0, coll_byte_string); ! MZ_GC_VAR_IN_REG(1, coll_char_string); ! MZ_GC_VAR_IN_REG(2, coll_path); ! MZ_GC_REG(); ! coll_byte_string = scheme_make_byte_string(MZSCHEME_COLLECTS); ! MZ_GC_CHECK(); ! coll_char_string = scheme_byte_string_to_char_string(coll_byte_string); ! MZ_GC_CHECK(); ! coll_path = scheme_char_string_to_path(coll_char_string); ! MZ_GC_CHECK(); ! scheme_set_collects_path(coll_path); ! MZ_GC_CHECK(); ! MZ_GC_UNREG(); ! } ! # else ! { ! Scheme_Object *coll_byte_string = NULL; ! Scheme_Object *coll_char_string = NULL; ! Scheme_Object *coll_path = NULL; ! Scheme_Object *coll_pair = NULL; ! Scheme_Config *config = NULL; ! ! MZ_GC_DECL_REG(5); ! MZ_GC_VAR_IN_REG(0, coll_byte_string); ! MZ_GC_VAR_IN_REG(1, coll_char_string); ! MZ_GC_VAR_IN_REG(2, coll_path); ! MZ_GC_VAR_IN_REG(3, coll_pair); ! MZ_GC_VAR_IN_REG(4, config); MZ_GC_REG(); ! coll_byte_string = scheme_make_byte_string(MZSCHEME_COLLECTS); ! MZ_GC_CHECK(); ! coll_char_string = scheme_byte_string_to_char_string(coll_byte_string); ! MZ_GC_CHECK(); ! coll_path = scheme_char_string_to_path(coll_char_string); ! MZ_GC_CHECK(); ! coll_pair = scheme_make_pair(coll_path, scheme_null); ! MZ_GC_CHECK(); ! config = scheme_current_config(); ! MZ_GC_CHECK(); ! scheme_set_param(config, MZCONFIG_COLLECTION_PATHS, coll_pair); ! MZ_GC_CHECK(); MZ_GC_UNREG(); } - # endif # else { Scheme_Object *coll_string = NULL; Scheme_Object *coll_pair = NULL; --- 1069,1113 ---- MZ_GC_CHECK(); #ifdef INCLUDE_MZSCHEME_BASE ! /* invoke function from generated and included mzscheme_base.c */ ! declare_modules(environment); #endif /* setup 'current-library-collection-paths' parameter */ # if MZSCHEME_VERSION_MAJOR >= 299 { ! Scheme_Object *coll_path = NULL; ! int mustfree = FALSE; ! char_u *s; ! MZ_GC_DECL_REG(1); ! MZ_GC_VAR_IN_REG(0, coll_path); MZ_GC_REG(); ! /* workaround for dynamic loading on windows */ ! s = vim_getenv("PLTCOLLECTS", &mustfree); ! if (s != NULL) ! { ! coll_path = scheme_make_path(s); ! MZ_GC_CHECK(); ! if (mustfree) ! vim_free(s); ! } ! # ifdef MZSCHEME_COLLECTS ! if (coll_path == NULL) ! { ! coll_path = scheme_make_path(MZSCHEME_COLLECTS); ! MZ_GC_CHECK(); ! } ! # endif ! if (coll_path != NULL) ! { ! scheme_set_collects_path(coll_path); ! MZ_GC_CHECK(); ! } MZ_GC_UNREG(); } # else + # ifdef MZSCHEME_COLLECTS { Scheme_Object *coll_string = NULL; Scheme_Object *coll_pair = NULL; *************** *** 1045,1050 **** --- 1130,1200 ---- } # endif #endif + + # if MZSCHEME_VERSION_MAJOR >= 600 + { + Scheme_Object *config_path = NULL; + int mustfree = FALSE; + char_u *s; + + MZ_GC_DECL_REG(1); + MZ_GC_VAR_IN_REG(0, config_path); + MZ_GC_REG(); + /* workaround for dynamic loading on windows */ + s = vim_getenv("PLTCONFIGDIR", &mustfree); + if (s != NULL) + { + config_path = scheme_make_path(s); + MZ_GC_CHECK(); + if (mustfree) + vim_free(s); + } + #ifdef MZSCHEME_CONFIGDIR + if (config_path == NULL) + { + config_path = scheme_make_path(MZSCHEME_CONFIGDIR); + MZ_GC_CHECK(); + } + #endif + if (config_path != NULL) + { + scheme_set_config_path(config_path); + MZ_GC_CHECK(); + } + MZ_GC_UNREG(); + } + # endif + + #if MZSCHEME_VERSION_MAJOR >= 400 + scheme_init_collection_paths(environment, scheme_null); + #endif + + /* + * versions 4.x do not provide Scheme bindings by default + * we need to add them explicitly + */ + { + /* use error handler to avoid abort */ + scheme_dynamic_wind(NULL, load_base_module, NULL, + load_base_module_on_error, "racket/base"); + if (load_base_module_failed) + { + load_base_module_failed = FALSE; + scheme_dynamic_wind(NULL, load_base_module, NULL, + load_base_module_on_error, "scheme/base"); + if (load_base_module_failed) + return -1; + } + } + + register_vim_exn(); + /* use new environment to initialise exception handling */ + init_exn_catching_apply(); + + /* redirect output */ + scheme_console_output = do_output; + scheme_console_printf = do_printf; + #ifdef HAVE_SANDBOX { Scheme_Object *make_security_guard = NULL; *************** *** 1118,1123 **** --- 1268,1275 ---- * whether thread scheduling is (or not) required */ scheme_notify_multithread = notify_multithread; + + return 0; } /* *************** *** 1130,1142 **** if (!initialized) { #ifdef DYNAMIC_MZSCHEME ! if (!mzscheme_enabled(TRUE)) { EMSG(_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded.")); return -1; } #endif ! startup_mzscheme(); initialized = TRUE; } { --- 1282,1298 ---- if (!initialized) { #ifdef DYNAMIC_MZSCHEME ! if (disabled || !mzscheme_enabled(TRUE)) { EMSG(_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded.")); return -1; } #endif ! if (load_base_module_failed || startup_mzscheme()) ! { ! EMSG(_("Exxx: Sorry, this command is disabled, the MzScheme's racket/base module could not be loaded.")); ! return -1; ! } initialized = TRUE; } { *** ../vim-7.4.1103/src/version.c 2016-01-16 15:45:09.999436846 +0100 --- src/version.c 2016-01-16 15:57:42.111382629 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 1104, /**/ -- BEDEVERE: And what do you burn, apart from witches? FOURTH VILLAGER: ... Wood? BEDEVERE: So why do witches burn? SECOND VILLAGER: (pianissimo) ... Because they're made of wood...? "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///