Skip to content

Commit

Permalink
Update README.win32 to the new C99/MSVC 12.0 requirements
Browse files Browse the repository at this point in the history
Remove specific notes related to Microsoft Visual C++ 2005 Express Edition
and earlier. Note that the build instructions related to "IA64/AMD64"
haven't been tested recently, but stop short of purging them completely.
  • Loading branch information
nwc10 committed Oct 6, 2021
1 parent 0634b63 commit 0da48c9
Showing 1 changed file with 19 additions and 155 deletions.
174 changes: 19 additions & 155 deletions README.win32
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ perlwin32 - Perl under Windows

=head1 SYNOPSIS

These are instructions for building Perl under Windows 2000 and later.
These are instructions for building Perl under Windows 7 and later.

=head1 DESCRIPTION

Expand Down Expand Up @@ -39,7 +39,7 @@ additional software to run (other than what came with your operating
system). Currently, this port is capable of using one of the
following compilers on the Intel x86 architecture:

Microsoft Visual C++ version 6.0 or later
Microsoft Visual C++ version 12.0 or later
Intel C++ Compiler (experimental)
Gcc by mingw.org gcc version 3.4.5-5.3.0
Gcc by mingw-w64.org gcc version 4.4.3 or later
Expand All @@ -63,16 +63,25 @@ 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-2019 Express [or
available as "Visual C++ 2013-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-2019 Professional" respectively.
and are the same compilers that ship with
or "Visual C++ 2013-2019 Professional".

This port can also be built on IA64/AMD64 using:
Visual C++ 2013 is capable of B<targeting> XP and Windows Server 2003 but the
build host requirement is Windows 7/Windows Server 2012. For more details see
https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2013-compatibility-vs
and
https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2013-sysrequirements-vs


Older versions of perl could also be built on IA64/AMD64 using:

Microsoft Platform SDK Nov 2001 (64-bit compiler and tools)
MinGW64 compiler (gcc version 4.4.3 or later)

but these have not been tested recently.

The Windows SDK can be downloaded from L<https://developer.microsoft.com/windows/downloads/sdk-archive>.
The MinGW64 compiler is available at L<http://mingw-w64.org>.
The latter is actually a cross-compiler targeting Win64. There's also a trimmed
Expand Down Expand Up @@ -129,9 +138,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-2019 Express/Community Edition
=item Microsoft Visual C++ 2013-2019 Express/Community Edition

These free versions of Visual C++ 2008-2019 Professional contain the same
These free versions of Visual C++ 2013-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.
Expand All @@ -141,7 +150,7 @@ L<https://www.microsoft.com/downloads/search.aspx?displaylang=en>. (Providing e
links to these packages has proven a pointless task because the links keep on
changing so often.)

Install Visual C++ 2008-2019 Express/Community, then setup your environment
Install Visual C++ 2013-2019 Express/Community, then setup your environment
using, e.g.

C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat
Expand All @@ -151,151 +160,6 @@ using, e.g.
Perl should now build using the win32/Makefile. You will need to edit that
file to set CCTYPE to one of MSVC90-MSVC142 first.

=item Microsoft Visual C++ 2005 Express Edition

This free version of Visual C++ 2005 Professional contains the same compiler
and linker that ship with the full version, but doesn't contain everything
necessary to build Perl.

You will also need to download the "Windows SDK" (the "Core SDK" and "MDAC
SDK" components are required) for more header files and libraries.

These packages can both be downloaded by searching in the Download Center at
L<http://www.microsoft.com/downloads/search.aspx?displaylang=en>. (Providing exact
links to these packages has proven a pointless task because the links keep on
changing so often.)

Try to obtain the latest version of the Windows SDK. Sometimes these packages
contain a particular Windows OS version in their name, but actually work on
other OS versions too. For example, the "Windows Server 2003 R2 Platform SDK"
also runs on Windows XP SP2 and Windows 2000.

Install Visual C++ 2005 first, then the Platform SDK. Setup your environment
as follows (assuming default installation locations were chosen):

SET PlatformSDKDir=C:\Program Files\Microsoft Platform SDK

SET PATH=%SystemRoot%\system32;%SystemRoot%;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;%PlatformSDKDir%\Bin

SET INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;%PlatformSDKDir%\include

SET LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%PlatformSDKDir%\lib

SET LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

(The PlatformSDKDir might need to be set differently depending on which version
you are using. Earlier versions installed into "C:\Program Files\Microsoft SDK",
while the latest versions install into version-specific locations such as
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2".)

Perl should now build using the win32/Makefile. You will need to edit that
file to set

CCTYPE = MSVC80

and to set CCHOME, CCINCDIR and CCLIBDIR as per the environment setup above.

=item Microsoft Visual C++ Toolkit 2003

This free toolkit contains the same compiler and linker that ship with
Visual C++ .NET 2003 Professional, but doesn't contain everything
necessary to build Perl.

You will also need to download the "Platform SDK" (the "Core SDK" and "MDAC
SDK" components are required) for header files, libraries and rc.exe, and
".NET Framework SDK" for more libraries and nmake.exe. Note that the latter
(which also includes the free compiler and linker) requires the ".NET
Framework Redistributable" to be installed first. This can be downloaded and
installed separately, but is included in the "Visual C++ Toolkit 2003" anyway.

These packages can all be downloaded by searching in the Download Center at
L<https://www.microsoft.com/downloads/search.aspx?displaylang=en>. (Providing exact
links to these packages has proven a pointless task because the links keep on
changing so often.)

Try to obtain the latest version of the Windows SDK. Sometimes these packages
contain a particular Windows OS version in their name, but actually work on
other OS versions too. For example, the "Windows Server 2003 R2 Platform SDK"
also runs on Windows XP SP2 and Windows 2000.

Install the Toolkit first, then the Platform SDK, then the .NET Framework SDK.
Setup your environment as follows (assuming default installation locations
were chosen):

SET PlatformSDKDir=C:\Program Files\Microsoft Platform SDK

SET PATH=%SystemRoot%\system32;%SystemRoot%;C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;%PlatformSDKDir%\Bin;C:\Program Files\Microsoft.NET\SDK\v1.1\Bin

SET INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;%PlatformSDKDir%\include;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include

SET LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;%PlatformSDKDir%\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib

(The PlatformSDKDir might need to be set differently depending on which version
you are using. Earlier versions installed into "C:\Program Files\Microsoft SDK",
while the latest versions install into version-specific locations such as
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2".)

Several required files will still be missing:

=over 4

=item *

cvtres.exe is required by link.exe when using a .res file. It is actually
installed by the .NET Framework SDK, but into a location such as the
following:

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322

Copy it from there to %PlatformSDKDir%\Bin

=item *

lib.exe is normally used to build libraries, but link.exe with the /lib
option also works, so change win32/config.vc to use it instead:

Change the line reading:

ar='lib'

to:

ar='link /lib'

It may also be useful to create a batch file called lib.bat in
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin containing:

@echo off
link /lib %*

for the benefit of any naughty C extension modules that you might want to build
later which explicitly reference "lib" rather than taking their value from
$Config{ar}.

=item *

setargv.obj is required to build perlglob.exe (and perl.exe if the USE_SETARGV
option is enabled). The Platform SDK supplies this object file in source form
in %PlatformSDKDir%\src\crt. Copy setargv.c, cruntime.h and
internal.h from there to some temporary location and build setargv.obj using

cl.exe /c /I. /D_CRTBLD setargv.c

Then copy setargv.obj to %PlatformSDKDir%\lib

Alternatively, if you don't need perlglob.exe and don't need to enable the
USE_SETARGV option then you can safely just remove all mention of $(GLOBEXE)
from win32/Makefile and setargv.obj won't be required anyway.

=back

Perl should now build using the win32/Makefile. You will need to edit that
file to set

CCTYPE = MSVC70FREE

and to set CCHOME, CCINCDIR and CCLIBDIR as per the environment setup above.

=item Microsoft Platform SDK 64-bit Compiler

The nmake that comes with the Platform SDK will suffice for building
Expand Down Expand Up @@ -942,6 +806,6 @@ Win9x support was added in 5.6 (Benjamin Stuhl).

Support for 64-bit Windows added in 5.8 (ActiveState Corp).

Last updated: 26 January 2020
Last updated: 06 October 2021

=cut

0 comments on commit 0da48c9

Please sign in to comment.