From: Ilya Zakharevich <ilya@math.ohio-state.edu>
[p5sagit/p5-mst-13.2.git] / README.dos
CommitLineData
b1be52e8 1If you read this file _as_is_, just ignore the funny characters you
2see. It is written in the POD format (see perlpod manpage) which is
3specially designed to be readable as is.
39e571d4 4
b1be52e8 5=head1 NAME
39e571d4 6
b1be52e8 7perldos - Perl under DOS, W31, W95.
8
9=head1 SYNOPSIS
39e571d4 10
b1be52e8 11These are instructions for building Perl under DOS (or w??), using
12DJGPP v2.01 or later. Under w95 long filenames are supported.
39e571d4 13
b1be52e8 14=head1 DESCRIPTION
39e571d4 15
b1be52e8 16Before you start, you should glance through the README file
17found in the top-level directory where the Perl distribution
18was extracted. Make sure you read and understand the terms under
19which this software is being distributed.
39e571d4 20
b1be52e8 21This port currently supports MakeMaker (the set of modules that
22is used to build extensions to perl). Therefore, you should be
23able to build and install most extensions found in the CPAN sites.
39e571d4 24
b1be52e8 25=head2 Prerequisites
39e571d4 26
b1be52e8 27=over 4
39e571d4 28
b1be52e8 29=item DJGPP
39e571d4 30
b1be52e8 31DJGPP is a port of GNU C/C++ compiler and development tools to 32-bit,
32protected-mode environment on Intel 32-bit CPUs running MS-DOS and compatible
33operating systems, by DJ Delorie <dj@delorie.com> and friends.
39e571d4 34
b1be52e8 35For more details (FAQ), check out the home of DJGPP at:
39e571d4 36
b1be52e8 37 http://www.delorie.com/djgpp/
39e571d4 38
b1be52e8 39If you have questions about DJGPP, try posting to the DJGPP newsgroup:
40comp.os.msdos.djgpp, or use the email gateway djgpp@delorie.com.
39e571d4 41
b1be52e8 42You can find the full DJGPP distribution on any SimTel.Net mirror all over
43the world. Like:
39e571d4 44
b1be52e8 45 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2*
39e571d4 46
b1be52e8 47You need the following files to build perl (or add new modules):
39e571d4 48
b1be52e8 49 v2/djdev201.zip
50 v2/bnu27b.zip
51 v2gnu/gcc2721b.zip
52 v2gnu/bsh1147b.zip
53 v2gnu/mak3761b.zip
54 v2gnu/fil316b.zip
55 v2gnu/sed118b.zip
56 v2gnu/txt122b.zip
57 v2gnu/dif271b.zip
58 v2gnu/grep21b.zip
59 v2gnu/shl112b.zip
60 v2gnu/gawk303b.zip
61 v2misc/csdpmi4b.zip
39e571d4 62
b1be52e8 63or any newer version.
39e571d4 64
b1be52e8 65=item Pthreads
39e571d4 66
b1be52e8 67If you want multithreading support in perl, you need a pthread library
68that supports DJGPP. One of them can be found at:
39e571d4 69
b1be52e8 70 ftp://ftp.cs.fsu.edu/pub/PART/PTHREADS/pthreads.zip
39e571d4 71
b1be52e8 72But thread support is still in alpha, it may be unstable. For more information
73see below.
39e571d4 74
b1be52e8 75=back
39e571d4 76
b1be52e8 77=head2 Shortcomings of Perl under DOS
39e571d4 78
b1be52e8 79Perl under DOS lacks some features of perl under UNIX because of
80deficiencies in the UNIX-emulation, most notably:
39e571d4 81
b1be52e8 82=over 4
39e571d4 83
b1be52e8 84=item *
39e571d4 85
b1be52e8 86fork() and pipe()
39e571d4 87
b1be52e8 88=item *
39e571d4 89
b1be52e8 90some features of the UNIX filesystem regarding link count and file dates
39e571d4 91
b1be52e8 92=item *
39e571d4 93
b1be52e8 94in-place operation is a little bit broken with short filenames
39e571d4 95
b1be52e8 96=item *
39e571d4 97
b1be52e8 98sockets
39e571d4 99
b1be52e8 100=back
39e571d4 101
b1be52e8 102=head2 Building
39e571d4 103
b1be52e8 104=over 4
39e571d4 105
b1be52e8 106=item *
39e571d4 107
b1be52e8 108Unpack the source package F<perl5.00?_??.tar.gz> with djtarx. If you want
109to use long file names under w95, don't forget to use
39e571d4 110
b1be52e8 111 set LFN=y
112
113before unpacking the archive.
39e571d4 114
b1be52e8 115=item *
39e571d4 116
b1be52e8 117Create a "symlink" or copy your bash.exe to sh.exe in your C<($DJDIR)/bin>
118directory.
39e571d4 119
b1be52e8 120 ln -s bash.exe sh.exe
39e571d4 121
b1be52e8 122And make the C<SHELL> environment variable point to this F<sh.exe>:
39e571d4 123
b1be52e8 124 set SHELL=c:/djgpp/bin/sh.exe (use full path name!)
39e571d4 125
b1be52e8 126You can do this in F<djgpp.env> too. Add this line BEFORE any section
127definition:
39e571d4 128
b1be52e8 129 +SHELL=%DJDIR%/bin/sh.exe
39e571d4 130
b1be52e8 131=item *
39e571d4 132
b1be52e8 133If you have F<split.exe> and F<gsplit.exe> in your path, then rename
134F<split.exe> to F<djsplit.exe>, and F<gsplit.exe> to F<split.exe>.
135Copy or link F<gecho.exe> to F<echo.exe> if you don't have F<echo.exe>.
136Copy or link F<gawk.exe> to F<awk.exe> if you don't have F<awk.exe>.
39e571d4 137
b1be52e8 138=item *
39e571d4 139
b1be52e8 140Chdir to the djgpp subdirectory of perl toplevel and type the following
141command:
39e571d4 142
b1be52e8 143 configure.bat
144
145This will do some preprocessing then run the Configure script for you.
146The Configure script is interactive, but in most cases you
147just need to press ENTER.
148
149If the script says that your package is incomplete, and asks whether
150to continue, just answer with Y (this can only happen if you don't use
151long filenames).
152
153When Configure asks about the extensions, I suggest IO and Fcntl,
154and if you want database handling then SDBM_File or GDBM_File
155(you need to install gdbm for this one). If you want to use the
156POSIX extension (this is the default), make sure that the stack
157size of your F<cc1.exe> is at least 512kbyte (you can check this
158with: C<stubedit cc1.exe>).
159
160You can use the Configure script in non-interactive mode too.
161When I built my F<perl.exe>, I used something like this:
162
163 configure.bat -Uuseposix -des
164
165You can find more info about Configure's command line switches in
166the F<INSTALL> file.
167
168When the script ends, and you want to change some values in the
169generated F<config.sh> file, then run
170
171 sh Configure -S
172
173after you made your modifications.
174
175IMPORTANT: if you use this C<-S> switch, be sure to delete the CONFIG
176environment variable before running the script:
177
178 set CONFIG=
179
180=item *
181
182Now you can compile Perl. Type:
183
184 make
185
186=back
187
188=head2 Testing
189
190Type:
191
192 make test
193
194You should see "All tests successful" if you configured a database
195manager, and 1 failed test script if not (F<lib/anydbm.t>). If you
196configured POSIX you will see 1 additional failed subtest in F<lib/posix.t>.
197
198=head2 Installation
199
200Type:
201
202 make install
203
204This will copy the newly compiled perl and libraries into your DJGPP
205directory structure. Perl.exe and the utilities go into C<($DJDIR)/bin>,
206and the library goes under C<($DJDIR)/lib/perl5>. The pod documentation
207goes under C<($DJDIR)/lib/perl5/pod>.
208
209=head2 Threaded perl under dos-djgpp
210
211Multithreading support is considered alpha, because some of the
212tests in C<ext/Thread> still die with SIGSEGV (patches are welcome). But
213if you want to give it a try, here are the necessary steps:
214
215=over 4
216
217=item
218
2191. You will need a pthread library which supports djgpp. Go, and download
220FSU's version from:
221
222 ftp://ftp.cs.fsu.edu/pub/PART/PTHREADS/pthreads.zip
223
224The latest version is 3.5, released in Feb 98.
225
226=item
227
2282. Unzip the file, cd to C<threads\src> and run F<configur.bat>.
229
230=item
231
2323. Add C<RAND_SWITCH> or C<MUTEX_SWITCH> or C<RR_SWITCH> to C<CFLAGS>
233in the F<makefile>. Note that using these values, multithreading will
234NOT be preemptive. This is necessary, since djgpp's libc is not thread safe.
235
236=item
237
2384. Apply the following patch:
239
240 *** include/pthread/signal.h~ Wed Feb 4 10:51:24 1998
241 --- include/pthread/signal.h Tue Feb 10 22:40:32 1998
242 ***************
243 *** 364,368 ****
244 --- 364,370 ----
245
246 #ifndef SA_ONSTACK
247 + #ifdef SV_ONSTACK
248 #define SA_ONSTACK SV_ONSTACK
249 + #endif
250 #endif /* !SA_ONSTACK */
251
252=item
253
2545. run make (before you do this, you must make sure your C<SHELL> environment
255variable does NOT point to bash).
256
257=item
258
2596. Install the library and header files into your djgpp directory structure.
260
261=item
262
2637. Add C<-Dusethreads> to the commmand line of perl's F<configure.bat>.
264
265=back
266
267=head1 AUTHOR
268
933fea7f 269Laszlo Molnar, F<laszlo.molnar@eth.ericsson.se>
b1be52e8 270
271=head1 SEE ALSO
272
273perl(1).
274
275=cut
39e571d4 276