comparison src/INSTALLpc.txt @ 7553:f0205ac9818f v7.4.1077

commit https://github.com/vim/vim/commit/30a89473ee64a276215a55e7fa99e008945022df Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 14:35:58 2016 +0100 patch 7.4.1077 Problem: The build instructions for MS-Windows are incomplete. Solution: Add explanations for how to build with various interfaces. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jan 2016 14:45:04 +0100
parents 2c5e813e8852
children 77a14f3bc18b
comparison
equal deleted inserted replaced
7552:b5eeaca50ae6 7553:f0205ac9818f
11 this, then you will get the default behavior as is documented, which should 11 this, then you will get the default behavior as is documented, which should
12 be fine for most people. 12 be fine for most people.
13 13
14 With the exception of two sections (Windows 3.1 and MS-DOS), this document 14 With the exception of two sections (Windows 3.1 and MS-DOS), this document
15 assumes that you are building Vim for Win32 or later. 15 assumes that you are building Vim for Win32 or later.
16 (Windows 95/98/Me/NT/2000/XP/2003/Vista/7) 16 (Windows 95/98/Me/NT/2000/XP/2003/Vista/7/8/10)
17 17
18 18
19 Contents: 19 Contents:
20 1. Microsoft Visual C++ 20 1. Microsoft Visual C++
21 2. Using MinGW 21 2. Using MinGW
22 3. Cygwin 22 3. Cygwin
23 4. Borland 23 4. Borland
24 5. Cross compiling for Win32 from a Linux machine 24 5. Cross compiling for Win32 from a Linux machine
25 6. Building with Python support 25 6. Building with Python support
26 7. Building with MzScheme support 26 7. Building with Python3 support
27 8. Windows 3.1 27 8. Building with MzScheme support
28 9. MS-DOS 28 9. Building with Lua support
29 29 10. Building with Perl support
30 10. Installing after building from sources 30 11. Building with Ruby support
31 12. Building with Tcl support
32 13. Windows 3.1
33 14. MS-DOS
34
35 15. Installing after building from sources
31 36
32 37
33 The currently preferred method is using the free Visual C++ Toolkit 2008 38 The currently preferred method is using the free Visual C++ Toolkit 2008
34 |msvc-2008-express|, the produced binary runs on most MS-Windows systems. If 39 |msvc-2008-express|, the produced binary runs on most MS-Windows systems. If
35 you need the executable to run on Windows 98 or ME, use the 2003 one 40 you need the executable to run on Windows 98 or ME, use the 2003 one
40 ======================= 45 =======================
41 46
42 Visual Studio 47 Visual Studio
43 ------------- 48 -------------
44 49
45 Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, and VS 2008) 50 Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
46 is straightforward. (These instructions should also work for VS 4 and VS 5.) 51 VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
52 should also work for VS 4 and VS 5.)
47 53
48 Using VS C++ 2008 Express is recommended, the binaries build with that run on 54 Using VS C++ 2008 Express is recommended, the binaries build with that run on
49 nearly all platforms. Binaries from later versions may not run on Windows 95 55 nearly all platforms. Binaries from later versions may not run on Windows 95
50 or XP. 56 or XP.
51 57
193 199
194 200
195 Targeting Windows XP with new MSVC *new-msvc-windows-xp* 201 Targeting Windows XP with new MSVC *new-msvc-windows-xp*
196 ---------------------------------- 202 ----------------------------------
197 203
198 Beginning with Visual C++ 2010, Microsoft changed the behavior of LINK.EXE 204 Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
199 so that it targets Windows 6.0 (Vista) by default. In order to override 205 so that it targets Windows 6.0 (Vista) by default. In order to override
200 this, the target Windows version number needs to be passed to LINK like 206 this, the target Windows version number needs to be passed to LINK like
201 follows: 207 follows:
202 LINK ... /subsystem:console,5.01 208 LINK ... /subsystem:console,5.01
203 209
343 =============================== 349 ===============================
344 350
345 For building with MSVC 2008 the "Windows Installer" from www.python.org 351 For building with MSVC 2008 the "Windows Installer" from www.python.org
346 works fine. 352 works fine.
347 353
354 When building, you need to set the following variables at least:
355
356 PYTHON: Where Python is installed. E.g. C:\Python27
357 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
358 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
359
360 E.g. When using MSVC (as one line):
361
362 nmake -f Make_mvc.mak
363 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
364
348 (rest written by Ron Aaron: <ronaharon@yahoo.com>) 365 (rest written by Ron Aaron: <ronaharon@yahoo.com>)
349 366
350 Building with the mingw32 compiler, and the ActiveState ActivePython: 367 Building with the mingw32 compiler, and the ActiveState ActivePython:
351 http://www.ActiveState.com/Products/ActivePython/ 368 http://www.ActiveState.com/Products/ActivePython/
352 369
378 STATIC_STDCPLUS=yes 395 STATIC_STDCPLUS=yes
379 396
380 You will end up with a Python-enabled, Win32 version. Enjoy! 397 You will end up with a Python-enabled, Win32 version. Enjoy!
381 398
382 399
383 7. Building with MzScheme support 400 7. Building with Python3 support
401 ================================
402
403 For building with MSVC 2008 the "Windows Installer" from www.python.org
404 works fine. Python 3.4 is recommended.
405
406 When building, you need to set the following variables at least:
407
408 PYTHON3: Where Python3 is installed. E.g. C:\Python34
409 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
410 PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X.
411
412 E.g. When using MSVC (as one line):
413
414 nmake -f Make_mvc.mak
415 PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
416
417
418 8. Building with MzScheme support
384 ================================= 419 =================================
385 420
386 (written by Sergey Khorev <sergey.khorev@gmail.com>) 421 (written by Sergey Khorev <sergey.khorev@gmail.com>)
387 422
388 Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can 423 Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
414 449
415 After a successful build, these dlls can be freely removed, leaving them in 450 After a successful build, these dlls can be freely removed, leaving them in
416 %WINDOWS%\System32 only. 451 %WINDOWS%\System32 only.
417 452
418 453
419 8. Windows 3.1x 454 9. Building with Lua support
420 =============== 455 ============================
456
457 Vim with Lua support can be built with either MSVC or MinGW (or Cygwin).
458 You can use binaries from LuaBinaries.
459 http://luabinaries.sourceforge.net/
460
461 1) Download and install LuaBinaries
462 Go to the Download page of LuaBinaries:
463 http://luabinaries.sourceforge.net/download.html
464
465 Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
466 lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them for both MSVC and
467 MinGW.
468
469 Unpack it to a working directory. E.g. C:\projects\lua53.
470 Lua's header files will be installed under the include directory.
471
472
473 2) Build
474 You need to set the following variables:
475
476 LUA: Where Lua is installed. E.g. C:\projects\lua53.
477 DYNAMIC_LUA: Whether dynamic linking is used. Usually, set to yes.
478 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
479
480 E.g. When using MSVC (as one line):
481
482 nmake -f Make_mvc.mak
483 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
484
485 Or when using MinGW (as one line):
486
487 mingw32-make -f Make_mingw.mak
488 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
489
490 Or when using Cygwin (as one line):
491
492 make -f Make_cyg.mak
493 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
494
495
496 10. Building with Perl support
497 ==============================
498
499 Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
500 You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
501
502 http://www.activestate.com/activeperl
503 http://strawberryperl.com/
504
505 When building, you need to set the following variables:
506
507 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
508 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
509 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
510
511 E.g. When using MSVC (as one line):
512
513 nmake -f Make_mvc.mak
514 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
515
516 Or when using MinGW (as one line):
517
518 mingw32-make -f Make_mingw.mak
519 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
520
521
522 11. Building with Ruby support
523 ==============================
524
525 Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
526 Ruby doesn't provide the official Windows binaries. The most widely used
527 Windows binaries might be RubyInstaller.
528
529 http://rubyinstaller.org/
530
531 If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
532 you need some tricks described below.
533 (Another binary distribution is ActiveScriptRuby:
534 http://www.artonx.org/data/asr/)
535
536 When building, you need to set the following variables at least:
537
538 RUBY: Where ruby is installed. E.g. C:\Ruby22
539 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
540 RUBY_VER: Ruby version. E.g. 22 for Ruby 2.2.X.
541 RUBY_VER_LONG: Ruby API version in a long format.
542 E.g. 2.2.0 for Ruby 2.2.X.
543
544 Ruby version vs. Ruby API version:
545
546 Ruby ver. | Ruby API ver.
547 =========================
548 1.8.X | 1.8
549 1.9.[1-3] | 1.9.1
550 2.0.0 | 2.0.0
551 2.X.Y | 2.X.0
552
553 (Ruby 1.9.0 is excluded from the table because it is an unstable version.)
554
555
556 A) Using MSVC
557
558 If you want to link with ruby, normally you must use the same compiler as
559 which was used to build the ruby binary. RubyInstaller is built with MinGW,
560 so normally you cannot use MSVC for building Vim if you want to link with
561 RubyInstaller. If you use a different complier, there are mainly two problems:
562 config.h and Ruby's DLL name. Here are the steps for working around them:
563
564 1) Download and Install RubyInstaller.
565 You can install RubyInstaller with the default options and directory.
566 E.g.:
567 C:\Ruby22 (32-bit) or C:\Ruby22-x64 (64-bit)
568
569 Ruby 2.2.X is used in this example.
570
571 2) Download Ruby 2.2.X's source code and generate config.h:
572
573 cd C:\projects
574 git clone https://github.com/ruby/ruby.git -b ruby_2_2
575 cd ruby
576 win32\configure.bat
577 nmake .config.h.time
578
579 Note that ruby_2_2 is the branch name for Ruby 2.2.X's source code.
580 There is no need to build whole Ruby, just config.h is needed.
581 If you use 32-bit MSVC10, the config.h is generated in the
582 .ext\include\i386-mswin32_100 directory.
583
584 3) Install the generated config.h.
585
586 xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0
587
588 Note that 2.2.0 is Ruby API version of Ruby 2.2.X.
589
590 4) Build Vim. Note that you need to adjust some variables (as one line):
591
592 nmake -f Make_mvc.mak
593 RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0
594 RUBY_MSVCRT_NAME=msvcrt
595 WINVER=0x500
596
597 WINVER must be set to >=0x500, when building with Ruby 2.1 or later.
598 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
599 which is used for the Ruby's DLL name.
600
601 B) Using MinGW
602
603 Using MinGW is easier than using MSVC when linking with RubyInstaller.
604 After you install RubyInstaller, just type this (as one line):
605
606 mingw32-make -f Make_ming.mak
607 RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0
608 WINVER=0x500
609
610 WINVER must be set to >=0x500, when building with Ruby 2.1 or later.
611
612
613 12. Building with Tcl support
614 =============================
615
616 Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
617 You can use binaries from ActiveState (ActiveTcl).
618
619 http://www.activestate.com/activetcl
620
621 When building, you need to set the following variables:
622
623 TCL: Where tcl is installed. E.g. C:\Tcl86
624 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
625 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
626 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
627
628 E.g. When using MSVC (as one line):
629
630 nmake -f Make_mvc.mak
631 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
632
633 Or when using MinGW (as one line):
634
635 mingw32-make -f Make_mingw.mak
636 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
637
638
639 13. Windows 3.1x
640 ================
421 641
422 make -f Make_w16.mak 16 bit, Borland C++ 5.0 642 make -f Make_w16.mak 16 bit, Borland C++ 5.0
423 643
424 Warning: Be sure to use the right make.exe. It should be Borland make. 644 Warning: Be sure to use the right make.exe. It should be Borland make.
425 645
434 For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER. 654 For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER.
435 In MSVC 4.2 support for Win32s was dropped! Use this command: 655 In MSVC 4.2 support for Win32s was dropped! Use this command:
436 nmake -f Make_mvc.mak GUI=yes 656 nmake -f Make_mvc.mak GUI=yes
437 657
438 658
439 9. MS-DOS 659 14. MS-DOS
440 ========= 660 ==========
441 661
442 Summary: 662 Summary:
443 ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++ 663 ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++
444 ren Make_tcc.mak Makefile; make 16 bit, Turbo C 664 ren Make_tcc.mak Makefile; make 16 bit, Turbo C
445 make -f Make_djg.mak 32 bit, DJGPP 2.0 665 make -f Make_djg.mak 32 bit, DJGPP 2.0
477 697
478 If you get all kinds of strange error messages when compiling, try changing 698 If you get all kinds of strange error messages when compiling, try changing
479 the file format from "unix" to "dos". 699 the file format from "unix" to "dos".
480 700
481 701
482 10. Installing after building from sources 702 15. Installing after building from sources
483 ========================================== 703 ==========================================
484 704
485 [provided by Michael Soyka] 705 [provided by Michael Soyka]
486 706
487 After you've built the Vim binaries as described above, you're ready to 707 After you've built the Vim binaries as described above, you're ready to
488 install Vim on your system. However, if you've obtained the Vim sources 708 install Vim on your system. However, if you've obtained the Vim sources
489 using Mercurial or by downloading them as a unix tar file, you must first 709 using Git, Mercurial or by downloading them as a unix tar file, you must
490 create a "vim73" directory. If you instead downloaded the sources as 710 first create a "vim74" directory. If you instead downloaded the sources as
491 zip files, you can skip this setup as the zip archives already have the 711 zip files, you can skip this setup as the zip archives already have the
492 correct directory structure. 712 correct directory structure.
493 713
494 A. Create a Vim "runtime" subdirectory named "vim73" 714 A. Create a Vim "runtime" subdirectory named "vim74"
495 ----------------------------------------------------- 715 -----------------------------------------------------
496 If you obtained your Vim sources as zip files, you can skip this step. 716 If you obtained your Vim sources as zip files, you can skip this step.
497 Otherwise, continue reading. 717 Otherwise, continue reading.
498 718
499 Go to the directory that contains the Vim "src" and "runtime" 719 Go to the directory that contains the Vim "src" and "runtime"
500 directories and create a new subdirectory named "vim73". 720 directories and create a new subdirectory named "vim74".
501 721
502 Copy the "runtime" files into "vim73": 722 Copy the "runtime" files into "vim74":
503 copy runtime\* vim73 723 copy runtime\* vim74
504 724
505 B. Copy the new binaries into the "vim73" directory 725 B. Copy the new binaries into the "vim74" directory
506 ---------------------------------------------------- 726 ----------------------------------------------------
507 Regardless of how you installed the Vim sources, you need to copy the 727 Regardless of how you installed the Vim sources, you need to copy the
508 new binaries you created above into "vim73": 728 new binaries you created above into "vim74":
509 729
510 copy src\*.exe vim73 730 copy src\*.exe vim74
511 copy src\GvimExt\gvimext.dll vim73 731 copy src\GvimExt\gvimext.dll vim74
512 copy src\xxd\xxd.exe vim73 732 copy src\xxd\xxd.exe vim74
513 733
514 C. Move the "vim73" directory into the Vim installation subdirectory 734 C. Move the "vim74" directory into the Vim installation subdirectory
515 --------------------------------------------------------------------- 735 ---------------------------------------------------------------------
516 Move the "vim73" subdirectory into the subdirectory where you want Vim 736 Move the "vim74" subdirectory into the subdirectory where you want Vim
517 to be installed. Typically, this subdirectory will be named "vim". 737 to be installed. Typically, this subdirectory will be named "vim".
518 If you already have a "vim73" subdirectory in "vim", delete it first 738 If you already have a "vim74" subdirectory in "vim", delete it first
519 by running its uninstal.exe program. 739 by running its uninstal.exe program.
520 740
521 D. Install Vim 741 D. Install Vim
522 --------------- 742 ---------------
523 "cd" to your Vim installation subdirectory "vim\vim73" and run the 743 "cd" to your Vim installation subdirectory "vim\vim74" and run the
524 "install.exe" program. It will ask you a number of questions about 744 "install.exe" program. It will ask you a number of questions about
525 how you would like to have your Vim setup. Among these are: 745 how you would like to have your Vim setup. Among these are:
526 - You can tell it to write a "_vimrc" file with your preferences in the 746 - You can tell it to write a "_vimrc" file with your preferences in the
527 parent directory. 747 parent directory.
528 - It can also install an "Edit with Vim" entry in the Windows Explorer 748 - It can also install an "Edit with Vim" entry in the Windows Explorer