Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
10 KiB

  1. If you read this file _as_is_, just ignore the funny characters you
  2. see. It is written in the POD format (see perlpod manpage) which is
  3. specially designed to be readable as is.
  4. =head1 NAME
  5. perldos - Perl under DOS, W31, W95.
  6. =head1 SYNOPSIS
  7. These are instructions for building Perl under DOS (or w??), using
  8. DJGPP v2.03 or later. Under w95 long filenames are supported.
  9. =head1 DESCRIPTION
  10. Before you start, you should glance through the README file
  11. found in the top-level directory where the Perl distribution
  12. was extracted. Make sure you read and understand the terms under
  13. which this software is being distributed.
  14. This port currently supports MakeMaker (the set of modules that
  15. is used to build extensions to perl). Therefore, you should be
  16. able to build and install most extensions found in the CPAN sites.
  17. Detailed instructions on how to build and install perl extension
  18. modules, including XS-type modules, is included. See 'BUILDING AND
  19. INSTALLING MODULES'.
  20. =head2 Prerequisites
  21. =over 4
  22. =item DJGPP
  23. DJGPP is a port of GNU C/C++ compiler and development tools to 32-bit,
  24. protected-mode environment on Intel 32-bit CPUs running MS-DOS and compatible
  25. operating systems, by DJ Delorie <[email protected]> and friends.
  26. For more details (FAQ), check out the home of DJGPP at:
  27. http://www.delorie.com/djgpp/
  28. If you have questions about DJGPP, try posting to the DJGPP newsgroup:
  29. comp.os.msdos.djgpp, or use the email gateway [email protected].
  30. You can find the full DJGPP distribution on any SimTel.Net mirror all over
  31. the world. Like:
  32. ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2*
  33. You need the following files to build perl (or add new modules):
  34. v2/djdev203.zip
  35. v2/bnu2951b.zip
  36. v2gnu/gcc2952b.zip
  37. v2gnu/bsh204b.zip
  38. v2gnu/mak3791b.zip
  39. v2gnu/fil316b.zip
  40. v2gnu/sed302b.zip
  41. v2gnu/txt20b.zip
  42. v2gnu/dif272b.zip
  43. v2gnu/grep24b.zip
  44. v2gnu/shl112b.zip
  45. v2gnu/gawk303b.zip
  46. v2misc/csdpmi4b.zip
  47. or possibly any newer version.
  48. =item Pthreads
  49. Thread support is not tested in this version of the djgpp perl.
  50. =back
  51. =head2 Shortcomings of Perl under DOS
  52. Perl under DOS lacks some features of perl under UNIX because of
  53. deficiencies in the UNIX-emulation, most notably:
  54. =over 4
  55. =item *
  56. fork() and pipe()
  57. =item *
  58. some features of the UNIX filesystem regarding link count and file dates
  59. =item *
  60. in-place operation is a little bit broken with short filenames
  61. =item *
  62. sockets
  63. =back
  64. =head2 Building
  65. =over 4
  66. =item *
  67. Unpack the source package F<perl5.6*.tar.gz> with djtarx. If you want
  68. to use long file names under w95 and also to get Perl to pass all its
  69. tests, don't forget to use
  70. set LFN=y
  71. set FNCASE=y
  72. before unpacking the archive.
  73. =item *
  74. Create a "symlink" or copy your bash.exe to sh.exe in your C<($DJDIR)/bin>
  75. directory.
  76. ln -s bash.exe sh.exe
  77. [If you have the recommended version of bash for DJGPP, this is already
  78. done for you.]
  79. And make the C<SHELL> environment variable point to this F<sh.exe>:
  80. set SHELL=c:/djgpp/bin/sh.exe (use full path name!)
  81. You can do this in F<djgpp.env> too. Add this line BEFORE any section
  82. definition:
  83. +SHELL=%DJDIR%/bin/sh.exe
  84. =item *
  85. If you have F<split.exe> and F<gsplit.exe> in your path, then rename
  86. F<split.exe> to F<djsplit.exe>, and F<gsplit.exe> to F<split.exe>.
  87. Copy or link F<gecho.exe> to F<echo.exe> if you don't have F<echo.exe>.
  88. Copy or link F<gawk.exe> to F<awk.exe> if you don't have F<awk.exe>.
  89. [If you have the recommended versions of djdev, shell utilities and
  90. gawk, all these are already done for you, and you will not need to do
  91. anything.]
  92. =item *
  93. Chdir to the djgpp subdirectory of perl toplevel and type the following
  94. commands:
  95. set FNCASE=y
  96. configure.bat
  97. This will do some preprocessing then run the Configure script for you.
  98. The Configure script is interactive, but in most cases you just need to
  99. press ENTER. The "set" command ensures that DJGPP preserves the letter
  100. case of file names when reading directories. If you already issued this
  101. set command when unpacking the archive, and you are in the same DOS
  102. session as when you unpacked the archive, you don't have to issue the
  103. set command again. This command is necessary *before* you start to
  104. (re)configure or (re)build perl in order to ensure both that perl builds
  105. correctly and that building XS-type modules can succeed. See the DJGPP
  106. info entry for "_preserve_fncase" for more information:
  107. info libc alphabetical _preserve_fncase
  108. If the script says that your package is incomplete, and asks whether
  109. to continue, just answer with Y (this can only happen if you don't use
  110. long filenames or forget to issue "set FNCASE=y" first).
  111. When Configure asks about the extensions, I suggest IO and Fcntl,
  112. and if you want database handling then SDBM_File or GDBM_File
  113. (you need to install gdbm for this one). If you want to use the
  114. POSIX extension (this is the default), make sure that the stack
  115. size of your F<cc1.exe> is at least 512kbyte (you can check this
  116. with: C<stubedit cc1.exe>).
  117. You can use the Configure script in non-interactive mode too.
  118. When I built my F<perl.exe>, I used something like this:
  119. configure.bat -des
  120. You can find more info about Configure's command line switches in
  121. the F<INSTALL> file.
  122. When the script ends, and you want to change some values in the
  123. generated F<config.sh> file, then run
  124. sh Configure -S
  125. after you made your modifications.
  126. IMPORTANT: if you use this C<-S> switch, be sure to delete the CONFIG
  127. environment variable before running the script:
  128. set CONFIG=
  129. =item *
  130. Now you can compile Perl. Type:
  131. make
  132. =back
  133. =head2 Testing
  134. Type:
  135. make test
  136. If you're lucky you should see "All tests successful". But there can be
  137. a few failed subtests (less than 5 hopefully) depending on some external
  138. conditions (e.g. some subtests fail under linux/dosemu or plain dos
  139. with short filenames only).
  140. =head2 Installation
  141. Type:
  142. make install
  143. This will copy the newly compiled perl and libraries into your DJGPP
  144. directory structure. Perl.exe and the utilities go into C<($DJDIR)/bin>,
  145. and the library goes under C<($DJDIR)/lib/perl5>. The pod documentation
  146. goes under C<($DJDIR)/lib/perl5/pod>.
  147. =head1 BUILDING AND INSTALLING MODULES
  148. =head2 Prerequisites
  149. For building and installing non-XS modules, all you need is a working
  150. perl under DJGPP. Non-XS modules do not require re-linking the perl
  151. binary, and so are simpler to build and install.
  152. XS-type modules do require re-linking the perl binary, because part of
  153. an XS module is written in "C", and has to be linked together with the
  154. perl binary to be executed. This is required because perl under DJGPP
  155. is built with the "static link" option, due to the lack of "dynamic
  156. linking" in the DJGPP environment.
  157. Because XS modules require re-linking of the perl binary, you need both
  158. the perl binary distribution and the perl source distribution to build
  159. an XS extension module. In addition, you will have to have built your
  160. perl binary from the source distribution so that all of the components
  161. of the perl binary are available for the required link step.
  162. =head2 Unpacking CPAN Modules
  163. First, download the module package from CPAN (e.g., the "Comma Separated
  164. Value" text package, Text-CSV-0.01.tar.gz). Then expand the contents of
  165. the package into some location on your disk. Most CPAN modules are
  166. built with an internal directory structure, so it is usually safe to
  167. expand it in the root of your DJGPP installation. Some people prefer to
  168. locate source trees under /usr/src (i.e., C<($DJDIR)/usr/src>), but you may
  169. put it wherever seems most logical to you, *EXCEPT* under the same
  170. directory as your perl source code. There are special rules that apply
  171. to modules which live in the perl source tree that do not apply to most
  172. of the modules in CPAN.
  173. Unlike other DJGPP packages, which are normal "zip" files, most CPAN
  174. module packages are "gzipped tarballs". Recent versions of WinZip will
  175. safely unpack and expand them, *UNLESS* they have zero-length files. It
  176. is a known WinZip bug (as of v7.0) that it will not extract zero-length
  177. files.
  178. From the command line, you can use the djtar utility provided with DJGPP
  179. to unpack and expand these files. For example:
  180. C:\djgpp>djtarx -v Text-CSV-0.01.tar.gz
  181. This will create the new directory C<($DJDIR)/Text-CSV-0.01>, filling
  182. it with the source for this module.
  183. =head2 Building Non-XS Modules
  184. To build a non-XS module, you can use the standard module-building
  185. instructions distributed with perl modules.
  186. perl Makefile.PL
  187. make
  188. make test
  189. make install
  190. This is sufficient because non-XS modules install only ".pm" files and
  191. (sometimes) pod and/or man documentation. No re-linking of the perl
  192. binary is needed to build, install or use non-XS modules.
  193. =head2 Building XS Modules
  194. To build an XS module, you must use the standard module-building
  195. instructions distributed with perl modules *PLUS* three extra
  196. instructions specific to the DJGPP "static link" build environment.
  197. set FNCASE=y
  198. perl Makefile.PL
  199. make
  200. make perl
  201. make test
  202. make -f Makefile.aperl inst_perl MAP_TARGET=perl.exe
  203. make install
  204. The first extra instruction sets DJGPP's FNCASE environment variable so
  205. that the new perl binary which you must build for an XS-type module will
  206. build correctly. The second extra instruction re-builds the perl binary
  207. in your module directory before you run "make test", so that you are
  208. testing with the new module code you built with "make". The third extra
  209. instruction installs the perl binary from your module directory into the
  210. standard DJGPP binary directory, C<($DJDIR)/bin>, replacing your
  211. previous perl binary.
  212. Note that the MAP_TARGET value *must* have the ".exe" extension or you
  213. will not create a "perl.exe" to replace the one in C<($DJDIR)/bin>.
  214. When you are done, the XS-module install process will have added information
  215. to yout "perllocal" information telling that the perl binary has been replaced,
  216. and what module was installed. you can view this information at any time
  217. by using the command:
  218. perl -S perldoc perllocal
  219. =head1 AUTHOR
  220. Laszlo Molnar, F<[email protected]> [Installing/building perl]
  221. Peter J. Farley III F<[email protected]> [Building/installing modules]
  222. =head1 SEE ALSO
  223. perl(1).
  224. =cut