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