diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2019-04-04 18:08:52 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2019-04-09 20:12:21 +0100 |
commit | 2a0cb97d42cd1bfb3be8a6509417d205870a63ba (patch) | |
tree | fca3355707113c6d2aadc6ae360ab350ffb892e8 | |
parent | 858fc58a344c7550c68495d7fe648b39a1a50c0c (diff) | |
download | perl-2a0cb97d42cd1bfb3be8a6509417d205870a63ba.tar.gz |
Add support for VS2019 (Visual C++ 14.2)
This also fixes LINK_FLAGS for VS2017 (Visual C++ 14.1): The subsystem
setting was missed in the changes to add VS2017 support, which was surely
just an oversight.
-rw-r--r-- | README.win32 | 14 | ||||
-rw-r--r-- | pod/perldelta.pod | 11 | ||||
-rw-r--r-- | win32/GNUmakefile | 46 | ||||
-rw-r--r-- | win32/Makefile | 20 | ||||
-rw-r--r-- | win32/makefile.mk | 18 |
5 files changed, 83 insertions, 26 deletions
diff --git a/README.win32 b/README.win32 index f42a7cb5b6..94fd520ca8 100644 --- a/README.win32 +++ b/README.win32 @@ -64,10 +64,10 @@ that are also supported by perl's makefile. =back The Microsoft Visual C++ compilers are also now being given away free. They are -available as "Visual C++ Toolkit 2003" or "Visual C++ 2005-2017 Express [or +available as "Visual C++ Toolkit 2003" or "Visual C++ 2005-2019 Express [or Community, from 2017] Edition" (and also as part of the ".NET Framework SDK") and are the same compilers that ship with "Visual C++ .NET 2003 Professional" -or "Visual C++ 2005-2017 Professional" respectively. +or "Visual C++ 2005-2019 Professional" respectively. This port can also be built on IA64/AMD64 using: @@ -140,9 +140,9 @@ console already set up for your target architecture (x86-32 or x86-64 or IA64). With the newer compilers, you may also use the older batch files if you choose so. -=item Microsoft Visual C++ 2008-2017 Express/Community Edition +=item Microsoft Visual C++ 2008-2019 Express/Community Edition -These free versions of Visual C++ 2008-2017 Professional contain the same +These free versions of Visual C++ 2008-2019 Professional contain the same compilers and linkers that ship with the full versions, and also contain everything necessary to build Perl, rather than requiring a separate download of the Windows SDK like previous versions did. @@ -152,7 +152,7 @@ L<http://www.microsoft.com/downloads/search.aspx?displaylang=en>. (Providing ex links to these packages has proven a pointless task because the links keep on changing so often.) -Install Visual C++ 2008-2017 Express/Community, then setup your environment +Install Visual C++ 2008-2019 Express/Community, then setup your environment using, e.g. C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat @@ -160,7 +160,7 @@ using, e.g. (assuming the default installation location was chosen). Perl should now build using the win32/Makefile. You will need to edit that -file to set CCTYPE to one of MSVC90-MSVC141 first. +file to set CCTYPE to one of MSVC90-MSVC142 first. =item Microsoft Visual C++ 2005 Express Edition @@ -972,6 +972,6 @@ Win9x support was added in 5.6 (Benjamin Stuhl). Support for 64-bit Windows added in 5.8 (ActiveState Corp). -Last updated: 23 May 2018 +Last updated: 4 April 2019 =cut diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 73399e7f01..fb8a050c6f 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -340,9 +340,16 @@ L</Modules and Pragmata> section. =over 4 -=item XXX-some-platform +=item Windows -XXX +=over 4 + +=item * + +Support for compiling perl on Windows using Microsoft Visual Studio 2019 +(containing Visual C++ 14.2) has been added. + +=back =back diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 5d5e3a086a..31142b696e 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -182,6 +182,8 @@ DEFAULT_INC_EXCLUDES_DOT := define #CCTYPE := MSVC140 # Visual C++ 2017 (aka Visual C++ 14.1) (full version or Community Edition) #CCTYPE := MSVC141 +# Visual C++ 2019 (aka Visual C++ 14.2) (full version or Community Edition) +#CCTYPE := MSVC142 # MinGW or mingw-w64 with gcc-3.4.5 or later #CCTYPE := GCC @@ -400,6 +402,8 @@ else ifeq ($(CCTYPE),MSVC70FREE) CCHOME := $(MSVCDir) else ifeq ($(CCTYPE),MSVC141) CCHOME := $(VCToolsInstallDir) +else ifeq ($(CCTYPE),MSVC142) +CCHOME := $(VCToolsInstallDir) else CCHOME := $(VCINSTALLDIR) endif @@ -515,6 +519,12 @@ CCLIBDIR := $(CCHOME)\lib\x64 else CCLIBDIR := $(CCHOME)\lib\x86 endif +else ifeq ($(CCTYPE),MSVC142) +ifeq ($(WIN64),define) +CCLIBDIR := $(CCHOME)\lib\x64 +else +CCLIBDIR := $(CCHOME)\lib\x86 +endif else ifeq ($(WIN64),define) CCLIBDIR := $(CCHOME)\lib\amd64 @@ -696,6 +706,8 @@ ifeq ($(CCTYPE),MSVC140) LIBC = ucrt.lib else ifeq ($(CCTYPE),MSVC141) LIBC = ucrt.lib +else ifeq ($(CCTYPE),MSVC142) +LIBC = ucrt.lib else LIBC = msvcrt.lib endif @@ -711,6 +723,8 @@ ifeq ($(CCTYPE),MSVC140) LIBC = ucrtd.lib else ifeq ($(CCTYPE),MSVC141) LIBC = ucrtd.lib +else ifeq ($(CCTYPE),MSVC142) +LIBC = ucrtd.lib else LIBC = msvcrtd.lib endif @@ -751,6 +765,8 @@ ifeq ($(CCTYPE),MSVC140) DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS else ifeq ($(CCTYPE),MSVC141) DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS +else ifeq ($(CCTYPE),MSVC142) +DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS endif # The Windows Server 2003 SP1 SDK compiler only defines _configthreadlocale() if @@ -793,6 +809,12 @@ LIBBASEFILES += msvcrtd.lib vcruntimed.lib else LIBBASEFILES += msvcrt.lib vcruntime.lib endif +else ifeq ($(CCTYPE),MSVC142) +ifeq ($(CFG),DebugFull) +LIBBASEFILES += msvcrtd.lib vcruntimed.lib +else +LIBBASEFILES += msvcrt.lib vcruntime.lib +endif endif # Avoid __intel_new_proc_init link error for libircmt. @@ -863,6 +885,20 @@ else LINK_FLAGS += -subsystem:console,"5.01" endif +else ifeq ($(CCTYPE),MSVC141) +ifeq ($(WIN64),define) +LINK_FLAGS += -subsystem:console,"5.02" +else +LINK_FLAGS += -subsystem:console,"5.01" +endif + +else ifeq ($(CCTYPE),MSVC142) +ifeq ($(WIN64),define) +LINK_FLAGS += -subsystem:console,"5.02" +else +LINK_FLAGS += -subsystem:console,"5.01" +endif + else ifneq ($(CCTYPE),GCC) PRIV_LINK_FLAGS += -subsystem:console endif @@ -1373,6 +1409,16 @@ else ifeq ($(CCTYPE),MSVC141) echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \ echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \ echo #define I_STDBOOL)>> config.h +else ifeq ($(CCTYPE),MSVC142) + @(echo #undef FILE_ptr&& \ + echo #undef FILE_cnt&& \ + echo #undef FILE_base&& \ + echo #undef FILE_bufsiz&& \ + echo #define FILE_ptr^(fp^) PERLIO_FILE_ptr^(fp^)&& \ + echo #define FILE_cnt^(fp^) PERLIO_FILE_cnt^(fp^)&& \ + echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \ + echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \ + echo #define I_STDBOOL)>> config.h endif ifeq ($(USE_LARGE_FILES),define) @(echo #define Off_t $(INT64)&& \ diff --git a/win32/Makefile b/win32/Makefile index e42b4d87ca..5e278efffe 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -133,6 +133,8 @@ DEFAULT_INC_EXCLUDES_DOT = define #CCTYPE = MSVC140 # Visual C++ 2017 (aka Visual C++ 14.1) (full version or Community Edition) #CCTYPE = MSVC141 +# Visual C++ 2019 (aka Visual C++ 14.2) (full version or Community Edition) +#CCTYPE = MSVC142 # # If you are using Intel C++ Compiler uncomment this @@ -211,14 +213,14 @@ DEFAULT_INC_EXCLUDES_DOT = define # Running VCVARS32.BAT, VCVARSALL.BAT or similar is *required* when using # Visual C++. # Versions of Visual C++ up to VC++ 7.1 define $(MSVCDir); versions since then -# define $(VCINSTALLDIR) instead, but for VC++ 14.1 we need the subfolder given +# define $(VCINSTALLDIR) instead, but from VC++ 14.1 we need the subfolder given # by $(VCToolsInstallDir). # !IF "$(CCTYPE)" == "MSVC60" || \ "$(CCTYPE)" == "MSVC70" || "$(CCTYPE)" == "MSVC70FREE" CCHOME = $(MSVCDIR) !ELSE -! IF "$(CCTYPE)" == "MSVC141" +! IF "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" CCHOME = $(VCTOOLSINSTALLDIR) ! ELSE CCHOME = $(VCINSTALLDIR) @@ -439,7 +441,7 @@ EMBED_DLL_MANI = if exist $@.manifest mt -nologo -manifest $@.manifest -outputre # Set the install location of the compiler headers/libraries. # These are saved into $Config{incpath} and $Config{libpth}. CCINCDIR = $(CCHOME)\include -!IF "$(CCTYPE)" == "MSVC141" +!IF "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" ! IF "$(WIN64)" == "define" CCLIBDIR = $(CCHOME)\lib\x64 ! ELSE @@ -500,7 +502,7 @@ DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT LOCDEFS = -DPERLDLL -DPERL_CORE CXX_FLAG = -TP -EHsc -!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" LIBC = ucrt.lib !ELSE LIBC = msvcrt.lib @@ -515,7 +517,7 @@ OPTIMIZE = -Od -MD -Zi LINK_DBG = -debug !ELSE !IF "$(CFG)" == "DebugFull" -!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" LIBC = ucrtd.lib !ELSE LIBC = msvcrtd.lib @@ -555,7 +557,7 @@ DEFINES = $(DEFINES) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE !ENDIF # Likewise for deprecated Winsock APIs in VC++ 14.0 onwards for now. -!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" DEFINES = $(DEFINES) -D_WINSOCK_DEPRECATED_NO_WARNINGS !ENDIF @@ -588,7 +590,7 @@ LIBBASEFILES = \ netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \ version.lib odbc32.lib odbccp32.lib comctl32.lib -!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" ! IF "$(CFG)" == "DebugFull" LIBBASEFILES = $(LIBBASEFILES) msvcrtd.lib vcruntimed.lib ! ELSE @@ -645,7 +647,7 @@ RSC_FLAGS = -DINCLUDE_MANIFEST # LINK_FLAGS else subsystem is only needed for EXE building, not XS DLL building # Console vs GUI makes no difference for DLLs, so use default for cleaner # building cmd lines -!IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC140" +!IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" ! IF "$(WIN64)" == "define" LINK_FLAGS = $(LINK_FLAGS) -subsystem:console,"5.02" ! ELSE @@ -1058,7 +1060,7 @@ $(MINIDIR)\.exists : $(CFGH_TMPL) echo #undef USE_64_BIT_INT&& \ echo #undef USE_LONG_DOUBLE&& \ echo #undef USE_CPLUSPLUS)>> config.h -!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" @(echo #undef FILE_ptr&& \ echo #undef FILE_cnt&& \ echo #undef FILE_base&& \ diff --git a/win32/makefile.mk b/win32/makefile.mk index 8b8be18d1e..712b513098 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -154,6 +154,8 @@ DEFAULT_INC_EXCLUDES_DOT *= define #CCTYPE = MSVC140 # Visual C++ 2017 (aka Visual C++ 14.1) (full version or Community Edition) #CCTYPE = MSVC141 +# Visual C++ 2019 (aka Visual C++ 14.2) (full version or Community Edition) +#CCTYPE = MSVC142 # MinGW or mingw-w64 with gcc-3.4.5 or later #CCTYPE = GCC @@ -396,7 +398,7 @@ CCHOME *= C:\MinGW .ELIF "$(CCTYPE)" == "MSVC60" || \ "$(CCTYPE)" == "MSVC70" || "$(CCTYPE)" == "MSVC70FREE" CCHOME *= $(MSVCDir) -.ELIF "$(CCTYPE)" == "MSVC141" +.ELIF "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" CCHOME *= $(VCToolsInstallDir) .ELSE CCHOME *= $(VCINSTALLDIR) @@ -484,7 +486,7 @@ CCINCDIR *= $(CCHOME)\include CCLIBDIR *= $(CCHOME)\lib .ELSE CCINCDIR *= $(CCHOME)\include -.IF "$(CCTYPE)" == "MSVC141" +.IF "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" .IF "$(WIN64)" == "define" CCLIBDIR *= $(CCHOME)\lib\x64 .ELSE @@ -673,7 +675,7 @@ DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT LOCDEFS = -DPERLDLL -DPERL_CORE CXX_FLAG = -TP -EHsc -.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" LIBC = ucrt.lib .ELSE LIBC = msvcrt.lib @@ -686,7 +688,7 @@ LINK_DBG = -debug OPTIMIZE = -Od -MD -Zi LINK_DBG = -debug .ELIF "$(CFG)" == "DebugFull" -.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" LIBC = ucrtd.lib .ELSE LIBC = msvcrtd.lib @@ -724,7 +726,7 @@ DEFINES += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE .ENDIF # Likewise for deprecated Winsock APIs in VC++ 14.0 onwards for now. -.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS .ENDIF @@ -756,7 +758,7 @@ LIBBASEFILES = oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \ netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib \ odbc32.lib odbccp32.lib comctl32.lib -.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" .IF "$(CFG)" == "DebugFull" LIBBASEFILES += msvcrtd.lib vcruntimed.lib .ELSE @@ -817,7 +819,7 @@ RSC_FLAGS = -DINCLUDE_MANIFEST # LINK_FLAGS else subsystem is only needed for EXE building, not XS DLL building # Console vs GUI makes no difference for DLLs, so use default for cleaner # building cmd lines -.IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC140" +.IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" .IF "$(WIN64)" == "define" LINK_FLAGS += -subsystem:console,"5.02" .ELSE @@ -1333,7 +1335,7 @@ $(MINIDIR)\.exists : $(CFGH_TMPL) echo #undef NVgf&& \ echo #undef USE_LONG_DOUBLE&& \ echo #undef USE_CPLUSPLUS)>> config.h -.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" +.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" || "$(CCTYPE)" == "MSVC142" @(echo #undef FILE_ptr&& \ echo #undef FILE_cnt&& \ echo #undef FILE_base&& \ |