Mercurial > vim
comparison src/Make_mvc.mak @ 27384:0b1acd38c7de v8.2.4220
patch 8.2.4220: MS-Windows: some old compiler support remains
Commit: https://github.com/vim/vim/commit/250155ae319802418c1576e9ff88d0e16b108282
Author: K.Takata <kentkt@csc.jp>
Date: Wed Jan 26 11:16:52 2022 +0000
patch 8.2.4220: MS-Windows: some old compiler support remains
Problem: MS-Windows: some old compiler support remains.
Solution: Remove obsolete compiler support. (Ken Takata, closes https://github.com/vim/vim/issues/9627)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 Jan 2022 12:30:06 +0100 |
parents | 584f91cc2508 |
children | 83bd6e25d0b6 |
comparison
equal
deleted
inserted
replaced
27383:3086d6127d94 | 27384:0b1acd38c7de |
---|---|
272 !else | 272 !else |
273 MSVC_MAJOR = ($(MSVCVER) / 100 - 5) | 273 MSVC_MAJOR = ($(MSVCVER) / 100 - 5) |
274 MSVCRT_VER = ($(MSVCVER) / 100 * 10 - 50) | 274 MSVCRT_VER = ($(MSVCVER) / 100 * 10 - 50) |
275 !endif | 275 !endif |
276 | 276 |
277 # Calculate MSVC_FULL for Visual C++ 8 and up. | 277 # Calculate MSVC_FULL. |
278 !if $(MSVC_MAJOR) >= 8 | 278 !if [echo MSVC_FULL=_MSC_FULL_VER> msvcfullver.c && $(CC) /EP msvcfullver.c > msvcfullver.~ 2> nul] |
279 ! if [echo MSVC_FULL=_MSC_FULL_VER> msvcfullver.c && $(CC) /EP msvcfullver.c > msvcfullver.~ 2> nul] | 279 ! message *** ERROR |
280 ! message *** ERROR | 280 ! message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH. |
281 ! message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH. | 281 ! message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed. |
282 ! message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed. | 282 ! error Make aborted. |
283 ! error Make aborted. | 283 !else |
284 ! else | 284 ! include msvcfullver.~ |
285 ! include msvcfullver.~ | 285 ! if [del msvcfullver.c msvcfullver.~] |
286 ! if [del msvcfullver.c msvcfullver.~] | |
287 ! endif | |
288 ! endif | 286 ! endif |
289 !endif | 287 !endif |
290 | 288 |
291 | 289 |
292 # Calculate MSVCRT_VER | 290 # Calculate MSVCRT_VER |
307 | 305 |
308 ### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET) | 306 ### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET) |
309 !ifndef WINVER | 307 !ifndef WINVER |
310 WINVER = 0x0501 | 308 WINVER = 0x0501 |
311 !endif | 309 !endif |
312 | |
313 # Flag to turn on Win64 compatibility warnings for VC7.x and VC8. | |
314 WP64CHECK = /Wp64 | |
315 | 310 |
316 # Use multiprocess build | 311 # Use multiprocess build |
317 USE_MP = yes | 312 USE_MP = yes |
318 | 313 |
319 #>>>>> path of the compiler and linker; name of include and lib directories | 314 #>>>>> path of the compiler and linker; name of include and lib directories |
493 ! endif | 488 ! endif |
494 | 489 |
495 NETBEANS_LIB = WSock32.lib Ws2_32.lib | 490 NETBEANS_LIB = WSock32.lib Ws2_32.lib |
496 !endif | 491 !endif |
497 | 492 |
498 # Set which version of the CRT to use | |
499 !if defined(USE_MSVCRT) | |
500 # CVARS = $(cvarsdll) | |
501 # !elseif defined(MULTITHREADED) | |
502 # CVARS = $(cvarsmt) | |
503 !else | |
504 # CVARS = $(cvars) | |
505 # CVARS = $(cvarsmt) | |
506 !endif | |
507 | |
508 # need advapi32.lib for GetUserName() | 493 # need advapi32.lib for GetUserName() |
509 # need shell32.lib for ExtractIcon() | 494 # need shell32.lib for ExtractIcon() |
510 # need netapi32.lib for NetUserEnum() | 495 # need netapi32.lib for NetUserEnum() |
511 # gdi32.lib and comdlg32.lib for printing support | 496 # gdi32.lib and comdlg32.lib for printing support |
512 # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT | 497 # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT |
520 # If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal | 505 # If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal |
521 # default, use these lines. | 506 # default, use these lines. |
522 #VIMRCLOC = somewhere | 507 #VIMRCLOC = somewhere |
523 #VIMRUNTIMEDIR = somewhere | 508 #VIMRUNTIMEDIR = somewhere |
524 | 509 |
525 CFLAGS = -c /W3 /GF /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \ | 510 CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 \ |
526 $(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \ | 511 $(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \ |
527 $(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \ | 512 $(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \ |
528 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) | 513 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) |
529 | 514 |
530 #>>>>> end of choices | 515 #>>>>> end of choices |
554 !elseif "$(CPUNR)" != "any" && "$(CPUNR)" != "i586" && "$(CPUNR)" != "i686" && "$(CPUNR)" != "sse" && "$(CPUNR)" != "sse2" && "$(CPUNR)" != "avx" && "$(CPUNR)" != "avx2" | 539 !elseif "$(CPUNR)" != "any" && "$(CPUNR)" != "i586" && "$(CPUNR)" != "i686" && "$(CPUNR)" != "sse" && "$(CPUNR)" != "sse2" && "$(CPUNR)" != "avx" && "$(CPUNR)" != "avx2" |
555 ! error *** ERROR Unknown target architecture "$(CPUNR)". Make aborted. | 540 ! error *** ERROR Unknown target architecture "$(CPUNR)". Make aborted. |
556 !endif | 541 !endif |
557 | 542 |
558 # Convert processor ID to MVC-compatible number | 543 # Convert processor ID to MVC-compatible number |
559 !if $(MSVC_MAJOR) < 8 | |
560 ! if "$(CPUNR)" == "i586" | |
561 CPUARG = /G5 | |
562 ! elseif "$(CPUNR)" == "i686" | |
563 CPUARG = /G6 | |
564 ! elseif "$(CPUNR)" == "sse" | |
565 CPUARG = /G6 /arch:SSE | |
566 ! elseif "$(CPUNR)" == "sse2" | |
567 CPUARG = /G7 /arch:SSE2 | |
568 ! elseif "$(CPUNR)" == "avx" || "$(CPUNR)" == "avx2" | |
569 ! message AVX/AVX2 Instruction Sets are not supported by Visual C++ v$(MSVC_MAJOR) | |
570 ! message Falling back to SSE2 | |
571 CPUARG = /G7 /arch:SSE2 | |
572 ! elseif "$(CPUNR)" == "any" | |
573 CPUARG = | |
574 ! endif | |
575 !else | |
576 # IA32/SSE/SSE2 are only supported on x86 | 544 # IA32/SSE/SSE2 are only supported on x86 |
577 ! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && ("$(CPUNR)" == "i586" || "$(CPUNR)" == "i686" || "$(CPUNR)" == "any") | 545 !if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && ("$(CPUNR)" == "i586" || "$(CPUNR)" == "i686" || "$(CPUNR)" == "any") |
578 # VC<11 generates fp87 code by default | 546 # VC<11 generates fp87 code by default |
579 ! if $(MSVC_MAJOR) < 11 | 547 ! if $(MSVC_MAJOR) < 11 |
580 CPUARG = | 548 CPUARG = |
581 # VC>=11 needs explicit instructions to generate fp87 code | 549 # VC>=11 needs explicit instructions to generate fp87 code |
550 ! else | |
551 CPUARG = /arch:IA32 | |
552 ! endif | |
553 !elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse" | |
554 CPUARG = /arch:SSE | |
555 !elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse2" | |
556 CPUARG = /arch:SSE2 | |
557 !elseif "$(CPUNR)" == "avx" | |
558 # AVX is only supported by VC 10 and up | |
559 ! if $(MSVC_MAJOR) < 10 | |
560 ! message AVX Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) | |
561 ! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" | |
562 ! message Falling back to SSE2 | |
563 CPUARG = /arch:SSE2 | |
582 ! else | 564 ! else |
583 CPUARG = /arch:IA32 | 565 CPUARG = |
584 ! endif | 566 ! endif |
585 ! elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse" | 567 ! else |
586 CPUARG = /arch:SSE | 568 CPUARG = /arch:AVX |
587 ! elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse2" | 569 ! endif |
570 !elseif "$(CPUNR)" == "avx2" | |
571 # AVX is only supported by VC 10 and up | |
572 ! if $(MSVC_MAJOR) < 10 | |
573 ! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) | |
574 ! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" | |
575 ! message Falling back to SSE2 | |
588 CPUARG = /arch:SSE2 | 576 CPUARG = /arch:SSE2 |
589 ! elseif "$(CPUNR)" == "avx" | 577 ! else |
590 # AVX is only supported by VC 10 and up | |
591 ! if $(MSVC_MAJOR) < 10 | |
592 ! message AVX Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) | |
593 ! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" | |
594 ! message Falling back to SSE2 | |
595 CPUARG = /arch:SSE2 | |
596 ! else | |
597 CPUARG = | 578 CPUARG = |
598 ! endif | |
599 ! else | |
600 CPUARG = /arch:AVX | |
601 ! endif | 579 ! endif |
602 ! elseif "$(CPUNR)" == "avx2" | |
603 # AVX is only supported by VC 10 and up | |
604 ! if $(MSVC_MAJOR) < 10 | |
605 ! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR) | |
606 ! if "$(ASSEMBLY_ARCHITECTURE)" == "i386" | |
607 ! message Falling back to SSE2 | |
608 CPUARG = /arch:SSE2 | |
609 ! else | |
610 CPUARG = | |
611 ! endif | |
612 # AVX2 is only supported by VC 12U2 and up | 580 # AVX2 is only supported by VC 12U2 and up |
613 # 180030501 is the full version number for Visual Studio 2013/VC 12 Update 2 | 581 # 180030501 is the full version number for Visual Studio 2013/VC 12 Update 2 |
614 ! elseif $(MSVC_FULL) < 180030501 | 582 ! elseif $(MSVC_FULL) < 180030501 |
615 ! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)-$(MSVC_FULL) | 583 ! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)-$(MSVC_FULL) |
616 ! message Falling back to AVX | 584 ! message Falling back to AVX |
617 CPUARG = /arch:AVX | 585 CPUARG = /arch:AVX |
618 ! else | 586 ! else |
619 CPUARG = /arch:AVX2 | 587 CPUARG = /arch:AVX2 |
620 ! endif | |
621 ! endif | 588 ! endif |
622 !endif | 589 !endif |
623 | 590 |
624 # Pass CPUARG to GvimExt, to avoid using version-dependent defaults | 591 # Pass CPUARG to GvimExt, to avoid using version-dependent defaults |
625 MAKEFLAGS_GVIMEXT = $(MAKEFLAGS_GVIMEXT) CPUARG="$(CPUARG)" | 592 MAKEFLAGS_GVIMEXT = $(MAKEFLAGS_GVIMEXT) CPUARG="$(CPUARG)" |
683 OPTFLAG = /O2 | 650 OPTFLAG = /O2 |
684 ! else # MAXSPEED | 651 ! else # MAXSPEED |
685 OPTFLAG = /Ox | 652 OPTFLAG = /Ox |
686 ! endif | 653 ! endif |
687 | 654 |
688 ! if $(MSVC_MAJOR) >= 8 | |
689 # Use link time code generation if not worried about size | 655 # Use link time code generation if not worried about size |
690 ! if "$(OPTIMIZE)" != "SPACE" | 656 ! if "$(OPTIMIZE)" != "SPACE" |
691 OPTFLAG = $(OPTFLAG) /GL | 657 OPTFLAG = $(OPTFLAG) /GL |
692 ! endif | |
693 ! endif | |
694 | |
695 # (/Wp64 is deprecated in VC9 and generates an obnoxious warning.) | |
696 ! if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8) | |
697 CFLAGS = $(CFLAGS) $(WP64CHECK) | |
698 ! endif | 658 ! endif |
699 | 659 |
700 CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) | 660 CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) |
701 RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG | 661 RCFLAGS = -DNDEBUG |
702 ! ifdef USE_MSVCRT | 662 ! ifdef USE_MSVCRT |
703 CFLAGS = $(CFLAGS) /MD | 663 CFLAGS = $(CFLAGS) /MD |
704 LIBC = msvcrt.lib | 664 LIBC = msvcrt.lib |
705 ! else | 665 ! else |
706 CFLAGS = $(CFLAGS) /Zl /MT | 666 CFLAGS = $(CFLAGS) /Zl /MT |
712 VIM = vimd | 672 VIM = vimd |
713 ! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86") | 673 ! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86") |
714 DEBUGINFO = /ZI | 674 DEBUGINFO = /ZI |
715 ! endif | 675 ! endif |
716 CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od | 676 CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od |
717 RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG | 677 RCFLAGS = -D_DEBUG -DDEBUG |
718 # The /fixed:no is needed for Quantify. | 678 # The /fixed:no is needed for Quantify. |
719 LIBC = /fixed:no | 679 LIBC = /fixed:no |
720 ! ifdef USE_MSVCRT | 680 ! ifdef USE_MSVCRT |
721 CFLAGS = $(CFLAGS) /MDd | 681 CFLAGS = $(CFLAGS) /MDd |
722 LIBC = $(LIBC) msvcrtd.lib | 682 LIBC = $(LIBC) msvcrtd.lib |
729 | 689 |
730 !if "$(CL)" == "/D_USING_V110_SDK71_" | 690 !if "$(CL)" == "/D_USING_V110_SDK71_" |
731 RCFLAGS = $(RCFLAGS) /D_USING_V110_SDK71_ | 691 RCFLAGS = $(RCFLAGS) /D_USING_V110_SDK71_ |
732 !endif | 692 !endif |
733 | 693 |
734 !if $(MSVC_MAJOR) >= 8 | |
735 # Visual Studio 2005 has 'deprecated' many of the standard CRT functions | 694 # Visual Studio 2005 has 'deprecated' many of the standard CRT functions |
736 CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE | 695 CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE |
737 CFLAGS = $(CFLAGS) $(CFLAGS_DEPR) | 696 CFLAGS = $(CFLAGS) $(CFLAGS_DEPR) |
738 !endif | |
739 | 697 |
740 !include Make_all.mak | 698 !include Make_all.mak |
741 !include testdir\Make_all.mak | 699 !include testdir\Make_all.mak |
742 | 700 |
743 INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h errors.h globals.h \ | 701 INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h errors.h globals.h \ |
1321 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \ | 1279 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \ |
1322 $(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB) | 1280 $(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB) |
1323 | 1281 |
1324 # Report link time code generation progress if used. | 1282 # Report link time code generation progress if used. |
1325 !ifdef NODEBUG | 1283 !ifdef NODEBUG |
1326 ! if $(MSVC_MAJOR) >= 8 | 1284 ! if "$(OPTIMIZE)" != "SPACE" |
1327 ! if "$(OPTIMIZE)" != "SPACE" | |
1328 LINKARGS1 = $(LINKARGS1) /LTCG:STATUS | 1285 LINKARGS1 = $(LINKARGS1) /LTCG:STATUS |
1329 ! endif | |
1330 ! endif | 1286 ! endif |
1331 !endif | 1287 !endif |
1332 | 1288 |
1333 !if $(MSVC_MAJOR) >= 11 && "$(CPU)" == "AMD64" && "$(GUI)" == "yes" | 1289 !if $(MSVC_MAJOR) >= 11 && "$(CPU)" == "AMD64" && "$(GUI)" == "yes" |
1334 # This option is required for VC2012 or later so that 64-bit gvim can | 1290 # This option is required for VC2012 or later so that 64-bit gvim can |