This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "New deprecation warning: Dot after %s literal is concatenation"
[perl5.git] / README.win32
index 066a6dc..5679a03 100644 (file)
@@ -44,24 +44,43 @@ following compilers on the Intel x86 architecture:
       Borland C++           version 5.02 or later
       Microsoft Visual C++  version 2.0 or later
       MinGW with gcc        gcc version 2.95.2 or later
-
-The last of these is a high quality freeware compiler.  Use version
-3.2.x or later for the best results with this compiler.
+      Gcc by mingw.org        gcc version 2.95.2 or later
+      Gcc by mingw-w64.sf.net gcc version 4.4.3 or later
+
+Note that the last two of these are actually competing projects both
+delivering complete gcc toolchain for MS Windows:
+- http://mingw.org - delivers gcc toolchain targeting 32-bit Windows
+  platform.
+  Use version 3.2.x or later for the best results with this compiler.
+- http://mingw-w64.sf.net - delivers gcc toolchain targeting both 64-bit
+  Windows and 32-bit Windows platforms (despite the project name "mingw-w64"
+  they are not only 64-bit oriented). They deliver the native gcc compilers
+  + cross-compilers that are also supported by perl's makefile.
 
 The Borland C++ and Microsoft Visual C++ compilers are also now being given
 away free.  The Borland compiler is available as "Borland C++ Compiler Free
 Command Line Tools" and is the same compiler that ships with the full
 "Borland C++ Builder" product.  The Microsoft compiler is available as
-"Visual C++ Toolkit 2003", and also as part of the ".NET Framework SDK", and
-is the same compiler that ships with "Visual Studio .NET 2003 Professional".
-Currently, Perl cannot be compiled with Visual C++ 8.0, which is part of the
-.NET 2.0 Framework SDK and Visual Studio 2005.  
+"Visual C++ Toolkit 2003" or "Visual C++ 2005/2008 Express Edition" (and also
+as part of the ".NET Framework SDK") and is the same compiler that ships with
+"Visual C++ .NET 2003 Professional" or "Visual C++ 2005/2008 Professional"
+respectively.
 
-This port can also be built on the Intel IA64 using:
+This port can 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)
 
 The MS Platform SDK can be downloaded from http://www.microsoft.com/.
+The MinGW64 compiler is available at http://sourceforge.net/projects/mingw-w64.
+The latter is actually a cross-compiler targeting Win64. There's also a trimmed
+down compiler (no java, or gfortran) suitable for building perl available at:
+http://strawberryperl.com/package/kmx/64_gcctoolchain/mingw64-w64-20100123-kmx-v2.zip
+
+NOTE: If you're using a 32-bit compiler to build perl on a 64-bit Windows
+operating system, then you should set the WIN64 environment variable to "undef".
+Also, the trimmed down compiler only passes tests when USE_ITHREADS *= define
+(as opposed to undef) and when the CFG *= Debug line is commented out.
 
 This port fully supports MakeMaker (the set of modules that
 is used to build extensions to perl).  Therefore, you should be
@@ -135,10 +154,84 @@ and edit win32/config.vc to change "make=nmake" into "make=dmake".  The
 latter step is only essential if you want to use dmake as your default
 make for building extensions using MakeMaker.
 
+=item Microsoft Visual C++ 2008 Express Edition
+
+This free version of Visual C++ 2008 Professional contains the same compiler
+and linker that ship with the full version, and also contains everything
+necessary to build Perl, rather than requiring a separate download of the
+Platform SDK like previous versions did.
+
+This package can be downloaded by searching for "Visual Studio 2008 Express
+Edition" in the Download Center at
+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.)
+
+Install Visual C++ 2008, then setup your environment using
+
+       C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
+
+(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 = MSVC90FREE
+
+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 "Platform 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
+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 Platform 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.
+
+According to the download pages these packages are only supported on Windows
+2000/XP/2003, so trying to use these tools on Windows 95/98/ME and even Windows
+NT probably won't work.
+
+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 = MSVC80FREE
+
+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 Studio .NET 2003 Professional, but doesn't contain everything
+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
@@ -155,20 +248,29 @@ changing so often.)
 
 Try to obtain the latest version of the Platform 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 SP1 Platform SDK"
+other OS versions too.  For example, the "Windows Server 2003 R2 Platform SDK"
 also runs on Windows XP SP2 and Windows 2000.
 
-According to the download pages the Toolkit and the .NET Framework SDK are only
-supported on Windows 2000/XP/2003, so trying to use these tools on Windows
-95/98/ME and even Windows NT probably won't work.
+According to the download pages these packages are only supported on Windows
+2000/XP/2003, so trying to use these tools on Windows 95/98/ME and even Windows
+NT probably won't work.
 
 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 PATH=%SystemRoot%\system32;%SystemRoot%;C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;C:\Program Files\Microsoft SDK\Bin;C:\Program Files\Microsoft.NET\SDK\v1.1\Bin
-       SET INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;C:\Program Files\Microsoft SDK\include;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include
-       SET LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;C:\Program Files\Microsoft SDK\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib
+       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:
 
@@ -182,7 +284,7 @@ following:
 
        C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
 
-Copy it from there to C:\Program Files\Microsoft SDK\Bin
+Copy it from there to %PlatformSDKDir%\Bin
 
 =item *
 
@@ -211,12 +313,12 @@ $Config{ar}.
 
 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 C:\Program Files\Microsoft SDK\src\crt.  Copy setargv.c, cruntime.h and
+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 C:\Program Files\Microsoft SDK\lib
+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)
@@ -247,6 +349,9 @@ gcc-3.2.3.  It can be downloaded here:
 Perl also compiles with earlier releases of gcc (2.95.2 and up).  See below
 for notes about using earlier versions of MinGW/gcc.
 
+And perl also compiles with gcc-4.3.0 and up, and perhaps even some of the
+earlier 4.x.x versions.
+
 You also need dmake.  See L</"Make"> above on how to get it.
 
 =item MinGW release 1 with gcc
@@ -313,7 +418,16 @@ may end up building against the installed perl's lib/CORE directory rather
 than the one being tested.
 
 You will have to make sure that CCTYPE is set correctly and that
-CCHOME points to wherever you installed your compiler.
+CCHOME points to wherever you installed your compiler. If building with
+gcc-4.x.x, you'll also need to uncomment the assignment to GCC_4XX and
+uncomment the assignment to the appropriate GCCHELPERDLL in the makefile.mk.
+
+If building with the cross-compiler provided by
+mingw-w64.sourceforge.net you'll need to uncomment the line that sets
+GCCCROSS in the makefile.mk. Do this only if it's the cross-compiler - ie
+only if the bin folder doesn't contain a gcc.exe. (The cross-compiler
+does not provide a gcc.exe, g++.exe, ar.exe, etc. Instead, all of these
+executables are prefixed with 'x86_64-w64-mingw32-'.)
 
 The default value for CCHOME in the makefiles for Visual C++
 may not be correct for some versions.  Make sure the default exists
@@ -323,6 +437,9 @@ You may also need to comment out the C<DELAYLOAD = ...> line in the
 Makefile if you're using VC++ 6.0 without the latest service pack and
 the linker reports an internal error.
 
+If you are using VC++ 4.2 or earlier then you'll have to change the /EHsc
+option in the CXX_FLAG macro to the equivalent /GX option.
+
 If you have either the source or a library that contains des_fcrypt(),
 enable the appropriate option in the makefile.  A ready-to-use version
 of fcrypt.c, based on the version originally written by Eric Young at
@@ -343,7 +460,7 @@ Be sure to read the instructions near the top of the makefiles carefully.
 Type "dmake" (or "nmake" if you are using that make).
 
 This should build everything.  Specifically, it will create perl.exe,
-perl59.dll at the perl toplevel, and various other extension dll's
+perl513.dll at the perl toplevel, and various other extension dll's
 under the lib\auto directory.  If the build fails for any reason, make
 sure you have done the previous steps correctly.
 
@@ -909,6 +1026,6 @@ Win9x support was added in 5.6 (Benjamin Stuhl).
 
 Support for 64-bit Windows added in 5.8 (ActiveState Corp).
 
-Last updated: 30 September 2005
+Last updated: 29 August 2007
 
 =cut