# Windows SDK 64-bit compiler and tools
#
# This is set up to build a perl.exe that runs off a shared library
-# (perl526.dll). Also makes individual DLLs for the XS extensions.
+# (perl527.dll). Also makes individual DLLs for the XS extensions.
#
##
# versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-#INST_VER *= \5.26.0
+#INST_VER *= \5.27.11
#
# Comment this out if you DON'T want your perl installation to have
# Uncomment this if you want to support the use of long doubles in GCC builds.
# This option is not supported for MSVC builds.
#
-#USE_LONG_DOUBLE *=define
+#USE_LONG_DOUBLE *= define
+
+#
+# Uncomment this if you want to build perl with __USE_MINGW_ANSI_STDIO defined.
+# (If you're building perl with USE_LONG_DOUBLE defined then
+# __USE_MINGW_ANSI_STDIO will be defined whether or not this is uncommented.)
+# This option is not supported for MSVC builds.
+#
+#USE_MINGW_ANSI_STDIO *= define
#
# Comment this out if you want the legacy default behavior of including '.' at
# HKEY_CURRENT_USER\Software\Perl and HKEY_LOCAL_MACHINE\Software\Perl in
# the Registry.
#
-#USE_NO_REGISTRY *=define
+#USE_NO_REGISTRY *= define
#
# uncomment exactly one of the following
#CCTYPE *= MSVC70FREE
# Windows Server 2003 SP1 Platform SDK (April 2005)
#CCTYPE = SDK2003SP1
-# Visual C++ 2005 (aka Visual C++ 8.0) (full version)
+# Visual C++ 2005 (aka Visual C++ 8.0) (full version or Express Edition)
#CCTYPE *= MSVC80
-# Visual C++ 2005 Express Edition (aka Visual C++ 8.0) (free version)
-#CCTYPE *= MSVC80FREE
-# Visual C++ 2008 (aka Visual C++ 9.0) (full version)
+# Visual C++ 2008 (aka Visual C++ 9.0) (full version or Express Edition)
#CCTYPE *= MSVC90
-# Visual C++ 2008 Express Edition (aka Visual C++ 9.0) (free version)
-#CCTYPE *= MSVC90FREE
-# Visual C++ 2010 (aka Visual C++ 10.0) (full version)
+# Visual C++ 2010 (aka Visual C++ 10.0) (full version or Express Edition)
#CCTYPE = MSVC100
-# Visual C++ 2010 Express Edition (aka Visual C++ 10.0) (free version)
-#CCTYPE = MSVC100FREE
-# Visual C++ 2012 (aka Visual C++ 11.0) (full version)
+# Visual C++ 2012 (aka Visual C++ 11.0) (full version or Express Edition)
#CCTYPE = MSVC110
-# Visual C++ 2012 Express Edition (aka Visual C++ 11.0) (free version)
-#CCTYPE = MSVC110FREE
-# Visual C++ 2013 (aka Visual C++ 12.0) (full version)
+# Visual C++ 2013 (aka Visual C++ 12.0) (full version or Express Edition)
#CCTYPE = MSVC120
-# Visual C++ 2013 Express Edition (aka Visual C++ 12.0) (free version)
-#CCTYPE = MSVC120FREE
-# Visual C++ 2015 (aka Visual C++ 14.0) (full version)
+# Visual C++ 2015 (aka Visual C++ 14.0) (full version or Express Edition)
#CCTYPE = MSVC140
-# Visual C++ 2015 Express Edition (aka Visual C++ 14.0) (free version)
-#CCTYPE = MSVC140FREE
+# Visual C++ 2017 (aka Visual C++ 14.1) (full version or Community Edition)
+#CCTYPE = MSVC141
# MinGW or mingw-w64 with gcc-3.4.5 or later
#CCTYPE = GCC
# set this to additionally provide a statically linked perl-static.exe.
# Note that dynamic loading will not work with this perl, so you must
# include required modules statically using the STATIC_EXT or ALL_STATIC
-# variables below. A static library perl526s.lib will also be created.
+# variables below. A static library perl527s.lib will also be created.
# Ordinary perl.exe is not affected by this option.
#
#BUILD_STATIC *= define
#
# in addition to BUILD_STATIC the option ALL_STATIC makes *every*
-# extension get statically built
+# extension get statically built.
# This will result in a very large perl executable, but the main purpose
# is to have proper linking set so as to be able to create miscellaneous
-# executables with different built-in extensions
+# executables with different built-in extensions. It implies BUILD_STATIC.
#
#ALL_STATIC *= define
#
-# set the install locations of the compiler include/libraries
-# Running VCVARS32.BAT is *required* when using Visual C.
-# Some versions of Visual C don't define MSVCDIR in the environment,
-# so you may have to set CCHOME explicitly (spaces in the path name should
-# not be quoted)
+# set the install location of the compiler
+# Running VCVARS32.BAT, VCVARSALL.BAT or similar is *required* when using
+# Visual C++.
#
#CCHOME *= C:\MinGW
.ENDIF
.ENDIF
-
+# 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
+# by $(VCToolsInstallDir).
.IF "$(CCHOME)" == ""
.IF "$(CCTYPE)" == "GCC"
CCHOME *= C:\MinGW
+.ELIF "$(CCTYPE)" == "MSVC60" || \
+ "$(CCTYPE)" == "MSVC70" || "$(CCTYPE)" == "MSVC70FREE"
+CCHOME *= $(MSVCDir)
+.ELIF "$(CCTYPE)" == "MSVC141"
+CCHOME *= $(VCToolsInstallDir)
.ELSE
-CCHOME *= $(MSVCDIR)
+CCHOME *= $(VCINSTALLDIR)
.ENDIF
.ENDIF
-#
-# Following sets $Config{incpath} and $Config{libpth}
-#
-
-.IF "$(GCCCROSS)" == "define"
-CCINCDIR *= $(CCHOME)\x86_64-w64-mingw32\include
-CCLIBDIR *= $(CCHOME)\x86_64-w64-mingw32\lib
-CCDLLDIR *= $(CCLIBDIR)
-.ELSE
-CCINCDIR *= $(CCHOME)\include
-CCLIBDIR *= $(CCHOME)\lib
-CCDLLDIR *= $(CCHOME)\bin
-.ENDIF
-
PROCESSOR_ARCHITECTURE *= x86
.IF "$(WIN64)" == "undef"
ARCHNAME !:= $(ARCHNAME)-ld
.ENDIF
+# Set the install location of the compiler headers/libraries.
+# These are saved into $Config{incpath} and $Config{libpth}.
+.IF "$(GCCCROSS)" == "define"
+CCINCDIR *= $(CCHOME)\x86_64-w64-mingw32\include
+CCLIBDIR *= $(CCHOME)\x86_64-w64-mingw32\lib
+.ELIF "$(CCTYPE)" == "GCC"
+CCINCDIR *= $(CCHOME)\include
+CCLIBDIR *= $(CCHOME)\lib
+.ELSE
+CCINCDIR *= $(CCHOME)\include
+.IF "$(CCTYPE)" == "MSVC141"
+.IF "$(WIN64)" == "define"
+CCLIBDIR *= $(CCHOME)\lib\x64
+.ELSE
+CCLIBDIR *= $(CCHOME)\lib\x86
+.ENDIF
+.ELSE
+.IF "$(WIN64)" == "define"
+CCLIBDIR *= $(CCHOME)\lib\amd64
+.ELSE
+CCLIBDIR *= $(CCHOME)\lib
+.ENDIF
+.ENDIF
+.ENDIF
+
+# Set DLL location for GCC compilers.
+.IF "$(CCTYPE)" == "GCC"
+.IF "$(GCCCROSS)" == "define"
+CCDLLDIR *= $(CCLIBDIR)
+.ELSE
+CCDLLDIR *= $(CCHOME)\bin
+.ENDIF
+.ENDIF
+
ARCHDIR = ..\lib\$(ARCHNAME)
COREDIR = ..\lib\CORE
AUTODIR = ..\lib\auto
PODDIR = ..\pod
HTMLDIR = .\html
-#
INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
INST_LIB = $(INST_TOP)$(INST_VER)\lib
IMPLIB = $(ARCHPREFIX)dlltool
RSC = $(ARCHPREFIX)windres
-.IF "$(USE_LONG_DOUBLE)" == "define"
+.IF "$(USE_LONG_DOUBLE)" == "define" || "$(USE_MINGW_ANSI_STDIO)" == "define"
BUILDOPT += -D__USE_MINGW_ANSI_STDIO
MINIBUILDOPT += -D__USE_MINGW_ANSI_STDIO
.ENDIF
LOCDEFS = -DPERLDLL -DPERL_CORE
CXX_FLAG = -TP -EHsc
-.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
LIBC = ucrt.lib
.ELSE
LIBC = msvcrt.lib
OPTIMIZE = -Od -MD -Zi
LINK_DBG = -debug
.ELIF "$(CFG)" == "DebugFull"
-.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
LIBC = ucrtd.lib
.ELSE
LIBC = msvcrtd.lib
DEFINES += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
.ENDIF
-# Likewise for deprecated Winsock APIs in VC++ 14.0 for now.
-.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
-DEFINES = $(DEFINES) -D_WINSOCK_DEPRECATED_NO_WARNINGS
+# Likewise for deprecated Winsock APIs in VC++ 14.0 onwards for now.
+.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
+DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS
.ENDIF
# In VS 2005 (VC++ 8.0) Microsoft changes time_t from 32-bit to
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib \
odbc32.lib odbccp32.lib comctl32.lib
-.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
.IF "$(CFG)" == "DebugFull"
LIBBASEFILES += msvcrtd.lib vcruntimed.lib
.ELSE
RSC_FLAGS = -DINCLUDE_MANIFEST
.ENDIF
+# VS 2017 (VC++ 14.1) requires at minimum Windows 7 SP1 (with latest Windows Updates)
# For XP support in >= VS 2013 (VC++ 12.0), subsystem is always in Config.pm
# 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)" == "MSVC120FREE" \
- || "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+.IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC140"
.IF "$(WIN64)" == "define"
LINK_FLAGS += -subsystem:console,"5.02"
.ELSE
CFGSH_TMPL = config.gc
CFGH_TMPL = config_H.gc
-PERLIMPLIB = $(COREDIR)\libperl526$(a)
-PERLSTATICLIB = ..\libperl526s$(a)
+PERLIMPLIB = $(COREDIR)\libperl527$(a)
+PERLSTATICLIB = ..\libperl527s$(a)
INT64 = long long
.ELSE
# makedef.pl must be updated if this changes, and this should normally
# only change when there is an incompatible revision of the public API.
-PERLIMPLIB *= $(COREDIR)\perl526$(a)
-PERLEXPLIB *= $(COREDIR)\perl526.exp
-PERLSTATICLIB *= ..\perl526s$(a)
-PERLDLL = ..\perl526.dll
+PERLIMPLIB *= $(COREDIR)\perl527$(a)
+PERLEXPLIB *= $(COREDIR)\perl527.exp
+PERLSTATICLIB *= ..\perl527s$(a)
+PERLDLL = ..\perl527.dll
+PERLDLLBASE = perl527.dll
#EUMM on Win32 isn't ready for parallel make, so only allow this file to be parallel
#$(MAKE) will contain the -P that this makefile was called with, which is bad for
# some exclusions, unfortunately, until fixed:
# - MakeMaker isn't capable enough for SDBM_File (small bug)
STATIC_EXT = * !SDBM_File
+NORMALIZE_STATIC = Normalize_static
.ELSE
# specify static extensions here, for example:
# (be sure to include Win32CORE to load Win32 on demand)
#STATIC_EXT = Win32CORE Cwd Compress/Raw/Zlib
STATIC_EXT = Win32CORE
+NORMALIZE_DYN = Normalize_dyn
.ENDIF
DYNALOADER = ..\DynaLoader$(o)
# Top targets
#
-all : CHECKDMAKE rebasePE Extensions_nonxs $(PERLSTATIC)
+all : CHECKDMAKE rebasePE Extensions_nonxs $(PERLSTATIC) PostExt
..\regcomp$(o) : ..\regnodes.h ..\regcharclass.h
echo #undef NVgf&& \
echo #undef USE_LONG_DOUBLE&& \
echo #undef USE_CPLUSPLUS)>> config.h
-.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+.IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
@(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 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
.IF "$(USE_LARGE_FILES)"=="define"
$(PERLEXPLIB) $(PERLIMPLIB) .UPDATEALL : perldll.def
.IF "$(CCTYPE)" == "GCC"
- $(IMPLIB) -k -d perldll.def -l $(PERLIMPLIB) -e $(PERLEXPLIB)
+ $(IMPLIB) -k -d perldll.def -D $(PERLDLLBASE) -l $(PERLIMPLIB) -e $(PERLEXPLIB)
.ELSE #VC family
lib -def:perldll.def -machine:$(ARCHITECTURE) /OUT:$(PERLIMPLIB)
.ENDIF
# DynaLoader.pm, so this will have to do
#most of deps of this target are in DYNALOADER and therefore omitted here
-Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) MakePPPort
+Extensions : $(PERLDEP) $(DYNALOADER) Extension_lib $(GLOBEXE) MakePPPort
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize
-Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
+Normalize_static : $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) $(UNIDATAFILES)
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static +Unicode/Normalize
+
+Normalize_dyn : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +Unicode/Normalize
Extensions_reonly : $(PERLDEP) $(DYNALOADER)
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
-Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) MakePPPort
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
+Exts_static_general : ..\make_ext.pl $(CONFIGPM) Extension_lib $(GLOBEXE) $(HAVE_COREDIR) MakePPPort
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static !Unicode/Normalize
+
+Extensions_static : list_static_libs.pl Exts_static_general $(NORMALIZE_STATIC)
$(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
Extensions_nonxs : ..\make_ext.pl ..\pod\perlfunc.pod $(CONFIGPM) $(GLOBEXE)
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs !libs
+Extension_lib : ..\make_ext.pl $(CONFIGPM)
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) lib
+
#lib must be built, it can't be buildcustomize.pl-ed, and is required for XS building
$(DYNALOADER) : ..\make_ext.pl $(CONFIGPM) $(HAVE_COREDIR)
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader lib
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader
Extensions_clean :
-if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
# all PE files need to be built by the time this target runs, PP files can still
# be running in parallel like UNIDATAFILES, this target a placeholder for the
# future
-.IF "$(BUILD_STATIC)"=="define"
-rebasePE : Extensions $(PERLDLL) Extensions_normalize $(PERLEXE) $(PERLEXESTATIC)
+.IF "$(PERLSTATIC)"=="static"
+rebasePE : Extensions $(PERLDLL) $(PERLEXE) $(PERLEXESTATIC)
.ELSE
-rebasePE : Extensions $(PERLDLL) Extensions_normalize $(PERLEXE)
+rebasePE : Extensions $(PERLDLL) $(NORMALIZE_DYN) $(PERLEXE)
.ENDIF
$(NOOP)
+PostExt : ..\lib\Storable\Limit.pm
+ $(NOOP)
+
+# we need the exe, perl(ver).dll, and the Exporter, Storable, Win32 extensions
+# rebasePE most of that, including adjustment for static builds, so we
+# just need non-xs extensions
+..\lib\Storable\Limit.pm : rebasePE Extensions_nonxs
+ cd ..\dist\Storable && $(MAKE) lib\Storable\Limit.pm
+ if not exist ..\lib\Storable mkdir ..\lib\Storable
+ copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
+
#-------------------------------------------------------------------------------
copy ..\README.tw ..\pod\perltw.pod
copy ..\README.vos ..\pod\perlvos.pod
copy ..\README.win32 ..\pod\perlwin32.pod
- copy ..\pod\perldelta.pod ..\pod\perl52512delta.pod
+ copy ..\pod\perldelta.pod ..\pod\perl52711delta.pod
$(MINIPERL) -I..\lib $(PL2BAT) $(UTILS)
$(MINIPERL) -I..\lib ..\autodoc.pl ..
$(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q ..
-..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs Extensions_normalize utils
+..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs $(NORMALIZE_DYN) utils
$(PERLEXE) -f ..\pod\buildtoc -q
# Note that the pod cleanup in this next section is parsed (and regenerated
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
-del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
-del /f $(LIBDIR)\File\Glob.pm
- -del /f $(LIBDIR)\Storable.pm
-del /f $(LIBDIR)\Sys\Hostname.pm
-del /f $(LIBDIR)\Time\HiRes.pm
-del /f $(LIBDIR)\Unicode\Normalize.pm
-del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
+ -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm
-del /f $(LIBDIR)\Win32.pm
-del /f $(LIBDIR)\Win32CORE.pm
-del /f $(LIBDIR)\Win32API\File.pm
-if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
-if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
-cd $(PODDIR) && del /f *.html *.bat roffitall \
- perl52512delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
+ perl52711delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \