⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perlwin32.pod

📁 MSYS在windows下模拟了一个类unix的终端
💻 POD
📖 第 1 页 / 共 2 页
字号:
If you read this file _as_is_, just ignore the funny characters yousee. It is written in the POD format (see pod/perlpod.pod) which isspecially designed to be readable as is.=head1 NAMEperlwin32 - Perl under Win32=head1 SYNOPSISThese are instructions for building Perl under Windows (9x, NT and2000).=head1 DESCRIPTIONBefore you start, you should glance through the README filefound in the top-level directory to which the Perl distributionwas extracted.  Make sure you read and understand the terms underwhich this software is being distributed.Also make sure you read L<BUGS AND CAVEATS> below for theknown limitations of this port.The INSTALL file in the perl top-level has much information that isonly relevant to people building Perl on Unix-like systems.  Inparticular, you can safely ignore any information that talks about"Configure".You may also want to look at two other options for buildinga perl that will work on Windows NT:  the README.cygwin andREADME.os2 files, each of which give a different set of rules tobuild a Perl that will work on Win32 platforms.  Those two methodswill probably enable you to build a more Unix-compatible perl, butyou will also need to download and use various other build-time andrun-time support software described in those files.This set of instructions is meant to describe a so-called "native"port of Perl to Win32 platforms.  The resulting Perl requires noadditional software to run (other than what came with your operatingsystem).  Currently, this port is capable of using one of thefollowing compilers:      Borland C++		version 5.02 or later      Microsoft Visual C++	version 4.2 or later      Mingw32 with GCC		version 2.95.2 or betterThe last of these is a high quality freeware compiler.  Supportfor it is still experimental.  (Older versions of GCC are knownnot to work.)This port currently supports MakeMaker (the set of modules thatis used to build extensions to perl).  Therefore, you should beable to build and install most extensions found in the CPAN sites.See L<Usage Hints> below for general hints about this.=head2 Setting Up=over 4=item MakeYou need a "make" program to build the sources.  If you are usingVisual C++ under Windows NT or 2000, nmake will work.  All otherbuilds need dmake.dmake is a freely available make that has very nice macro featuresand parallelability.A port of dmake for Windows is available from:    http://www.cpan.org/authors/id/GSAR/dmake-4.1pl1-win32.zip(This is a fixed version of the original dmake sources obtained fromhttp://www.wticorp.com/dmake/.  As of version 4.1PL1, the originalsources did not build as shipped and had various other problems.A patch is included in the above fixed version.)Fetch and install dmake somewhere on your path (follow the instructionsin the README.NOW file).There exists a minor coexistence problem with dmake and Borland C++compilers.  Namely, if a distribution has C files named with mixedcase letters, they will be compiled into appropriate .obj-files namedwith all lowercase letters, and every time dmake is invokedto bring files up to date, it will try to recompile such files again.For example, Tk distribution has a lot of such files, resulting inneedless recompiles everytime dmake is invoked.  To avoid this, youmay use the script "sncfnmcs.pl" after a successful build.  It isavailable in the win32 subdirectory of the Perl source distribution.=item Command ShellUse the default "cmd" shell that comes with NT.  Some versions of thepopular 4DOS/NT shell have incompatibilities that may cause you trouble.If the build fails under that shell, try building again with the cmdshell.The nmake Makefile also has known incompatibilities with the"command.com" shell that comes with Windows 9x.  You will need touse dmake and makefile.mk to build under Windows 9x.The surest way to build it is on Windows NT, using the cmd shell.Make sure the path to the build directory does not contain spaces.  Thebuild usually works in this circumstance, but some tests will fail.=item Borland C++If you are using the Borland compiler, you will need dmake.(The make that Borland supplies is seriously crippled and will notwork for MakeMaker builds.)See L</"Make"> above.=item Microsoft Visual C++The nmake that comes with Visual C++ will suffice for building.You will need to run the VCVARS32.BAT file, usually found somewherelike C:\MSDEV4.2\BIN.  This will set your build environment.You can also use dmake to build using Visual C++; provided, however,you set OSRELEASE to "microsft" (or whatever the directory nameunder which the Visual C dmake configuration lives) in your environmentand edit win32/config.vc to change "make=nmake" into "make=dmake".  Thelatter step is only essential if you want to use dmake as your defaultmake for building extensions using MakeMaker.=item Mingw32 with GCCGCC-2.95.2 binaries can be downloaded from:    ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/You also need dmake.  See L</"Make"> above on how to get it.The GCC-2.95.2 bundle comes with Mingw32 libraries and headers.Make sure you install the binaries that work with MSVCRT.DLL as indicatedin the README for the GCC bundle.  You may need to set up a few environmentvariables (usually ran from a batch file).There are a couple of problems with the version of gcc-2.95.2-msvcrt.exereleased 7 November 1999:=over=item *It left out a fix for certain command line quotes.  To fix this, be sureto download and install the file fixes/quote-fix-msvcrt.exe from the aboveftp location.=item *The definition of the fpos_t type in stdio.h may be wrong.  If yourstdio.h has this problem, you will see an exception when running thetest t/lib/io_xs.t.  To fix this, change the typedef for fpos_t from"long" to "long long" in the file i386-mingw32msvc/include/stdio.h,and rebuild.=backA potentially simpler to install (but probably soon-to-be-outdated) bundleof the above package with the mentioned fixes already applied is availablehere:    http://downloads.ActiveState.com/pub/staff/gsar/gcc-2.95.2-msvcrt.zip    ftp://ftp.ActiveState.com/pub/staff/gsar/gcc-2.95.2-msvcrt.zip=back=head2 Building=over 4=item *Make sure you are in the "win32" subdirectory under the perl toplevel.This directory contains a "Makefile" that will work withversions of nmake that come with Visual C++, and a dmake "makefile.mk"that will work for all supported compilers.  The defaults in the dmakemakefile are setup to build using the GCC compiler.=item *Edit the makefile.mk (or Makefile, if you're using nmake) and change the values of INST_DRV and INST_TOP.   You can also enable variousbuild flags.  These are explained in the makefiles.You will have to make sure that CCTYPE is set correctly and that CCHOME points to wherever you installed your compiler.The default value for CCHOME in the makefiles for Visual C++may not be correct for some versions.  Make sure the default existsand is valid.If you have either the source or a library that contains des_fcrypt(),enable the appropriate option in the makefile.  des_fcrypt() is notbundled with the distribution due to US Government restrictionson the export of cryptographic software.  Nevertheless, this routineis part of the "libdes" library (written by Eric Young) which is widelyavailable worldwide, usually along with SSLeay (for example, "ftp://ftp.funet.fi/pub/crypt/mirrors/dsi/libdes/").  Set CRYPT_SRC to thename of the file that implements des_fcrypt().  Alternatively, ifyou have built a library that contains des_fcrypt(), you can setCRYPT_LIB to point to the library name.  The location above containsmany versions of the "libdes" library, all with slightly differentimplementations of des_fcrypt().  Older versions have a single,self-contained file (fcrypt.c) that implements crypt(), so they may beeasier to use.  A patch against the fcrypt.c found in libdes-3.06 isin des_fcrypt.patch.An easier alternative may be to get the pre-patched and ready-to-usefcrypt.c that can be found here:    http://downloads.ActiveState.com/pub/staff/gsar/fcrypt.c    ftp://ftp.ActiveState.com/pub/staff/gsar/fcrypt.cPerl will also build without des_fcrypt(), but the crypt() builtin willfail at run time.Be sure to read the instructions near the top of the makefiles carefully.=item *Type "dmake" (or "nmake" if you are using that make).This should build everything.  Specifically, it will create perl.exe,perl56.dll at the perl toplevel, and various other extension dll'sunder the lib\auto directory.  If the build fails for any reason, makesure you have done the previous steps correctly.=back=head2 TestingType "dmake test" (or "nmake test").  This will run most of the tests fromthe testsuite (many tests will be skipped).There should be no test failures when running under Windows NT 4.0 orWindows 2000.  Many tests I<will> fail under Windows 9x due to the inferiorcommand shell.Some test failures may occur if you use a command shell other than thenative "cmd.exe", or if you are building from a path that containsspaces.  So don't do that.If you are running the tests from a emacs shell window, you may seefailures in op/stat.t.  Run "dmake test-notty" in that case.If you're using the Borland compiler, you may see a failure in op/taint.tarising from the inability to find the Borland Runtime DLLs on the systemdefault path.  You will need to copy the DLLs reported by the messagesfrom where Borland chose to install it, into the Windows system directory(usually somewhere like C:\WINNT\SYSTEM32) and rerun the test.If you're using Borland compiler versions 5.2 and below, you may run intoproblems finding the correct header files when building extensions.  Forexample, building the "Tk" extension may fail because both perl and Tkcontain a header file called "patchlevel.h".  The latest Borland compiler(v5.5) is free of this misbehaviour, and it even supports anoption -VI- for backward (bugward) compatibility for using the old Borlandsearch algorithm  to locate header files.Please report any other failures as described under L<BUGS AND CAVEATS>.=head2 InstallationType "dmake install" (or "nmake install").  This will put the newlybuilt perl and the libraries under whatever C<INST_TOP> points to in theMakefile.  It will also install the pod documentation underC<$INST_TOP\$VERSION\lib\pod> and HTML versions of the same underC<$INST_TOP\$VERSION\lib\pod\html>.  To use the Perl you just installed,you will need to add two components to your PATH environment variable,C<$INST_TOP\$VERSION\bin> and C<$INST_TOP\$VERSION\bin\$ARCHNAME>.For example:    set PATH c:\perl\5.6.0\bin;c:\perl\5.6.0\bin\MSWin32-x86;%PATH%If you opt to comment out INST_VER and INST_ARCH in the makefiles, theinstallation structure is much simpler.  In that case, it will besufficient to add a single entry to the path, for instance:    set PATH c:\perl\bin;%PATH%=head2 Usage Hints=over 4=item Environment VariablesThe installation paths that you set during the build get compiledinto perl, so you don't have to do anything additional to startusing that perl (except add its location to your PATH variable).If you put extensions in unusual places, you can set PERL5LIBto a list of paths separated by semicolons where you want perlto look for libraries.  Look for descriptions of other environmentvariables you can set in L<perlrun>.You can also control the shell that perl uses to run system() andbacktick commands via PERL5SHELL.  See L<perlrun>.Perl does not depend on the registry, but it can look up certain defaultvalues if you choose to put them there.  Perl attempts to read entries fromC<HKEY_CURRENT_USER\Software\Perl> and C<HKEY_LOCAL_MACHINE\Software\Perl>.Entries in the former override entries in the latter.  One or more of thefollowing entries (of type REG_SZ or REG_EXPAND_SZ) may be set:    lib-$]		version-specific standard library path to add to @INC    lib			standard library path to add to @INC    sitelib-$]		version-specific site library path to add to @INC    sitelib		site library path to add to @INC    vendorlib-$]	version-specific vendor library path to add to @INC    vendorlib		vendor library path to add to @INC    PERL*		fallback for all %ENV lookups that begin with "PERL"Note the C<$]> in the above is not literal.  Substitute whatever versionof perl you want to honor that entry, e.g. C<5.6.0>.  Paths must beseparated with semicolons, as usual on win32.=item File GlobbingBy default, perl handles file globbing using the File::Glob extension,which provides portable globbing.If you want perl to use globbing that emulates the quirks of DOSfilename conventions, you might want to consider using File::DosGlobto override the internal glob() implementation.  See L<File::DosGlob> fordetails.=item Using perl from the command lineIf you are accustomed to using perl from various command-lineshells found in UNIX environments, you will be less than pleasedwith what Windows offers by way of a command shell.The crucial thing to understand about the Windows environment is thatthe command line you type in is processed twice before Perl sees it.First, your command shell (usually CMD.EXE on Windows NT, andCOMMAND.COM on Windows 9x) preprocesses the command line, to handleredirection, environment variable expansion, and location of theexecutable to run. Then, the perl executable splits the remainingcommand line into individual arguments, using the C runtime libraryupon which Perl was built.It is particularly important to note that neither the shell nor the Cruntime do any wildcard expansions of command-line arguments (sowildcards need not be quoted).  Also, the quoting behaviours of theshell and the C runtime are rudimentary at best (and may, if you areusing a non-standard shell, be inconsistent).  The only (useful) quotecharacter is the double quote (").  It can be used to protect spacesand other special characters in arguments.The Windows NT documentation has almost no description of how the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -