Install Perl 5.8.8
[msysgit.git] / mingw / html / pod / perlmint.html
blobfe6badeef85a7563a735ec7a8d862f1221847f2c
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>README.mint - Perl version 5 on Atari MiNT</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;README.mint - Perl version 5 on Atari MiNT</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#description">DESCRIPTION</a></li>
24 <li><a href="#known_problems_with_perl_on_mint">Known problems with Perl on MiNT</a></li>
25 <li><a href="#author">AUTHOR</a></li>
26 </ul>
27 <!-- INDEX END -->
29 <hr />
30 <p>
31 </p>
32 <h1><a name="name">NAME</a></h1>
33 <p>README.mint - Perl version 5 on Atari MiNT</p>
34 <p>
35 </p>
36 <hr />
37 <h1><a name="description">DESCRIPTION</a></h1>
38 <p>There is a binary version of perl available from the FreeMiNT project
39 <a href="http://freemint.de/">http://freemint.de/</a> You may wish to use this instead of trying to
40 compile yourself.</p>
41 <p><strong>The following advice is from perl 5.004_02 and is probably rather
42 out of date.</strong></p>
43 <p>If you want to build perl yourself on MiNT (or maybe on an Atari without
44 MiNT) you may want to accept some advice from somebody who already did it...</p>
45 <p>There was a perl port for Atari ST done by ++jrb <a href="mailto:bammi@cadence.com.">bammi@cadence.com.</a>
46 This port tried very hard to build on non-MiNT-systems. For the
47 sake of efficiency I've left this way. Yet, I haven't removed bammi's
48 patches but left them intact. Unfortunately some of the files that
49 bammi contributed to the perl distribution seem to have vanished?</p>
50 <p>So, how can you distinguish my patches from bammi's patches? All of
51 bammi's stuff is embedded in ``#ifdef atarist'' preprocessor macros.
52 My MiNT port uses ``#ifdef __MINT__'' instead (and unconditionally
53 undefines ``atarist''. If you want to continue on bammi's port, all
54 you have to do is to swap the ``-D'' and ``-U'' switches for ``__MINT__''
55 and ``atarist'' in the variable ccflags.</p>
56 <p>However, I think that my version will still run on non-MiNT-systems
57 provided that the user has a Eunuchs-like environment (i.e. the
58 standard envariables like $PATH, $HOME, ... are set, there is a
59 POSIX compliant shell in /bin/sh, and...)</p>
60 <p>
61 </p>
62 <hr />
63 <h1><a name="known_problems_with_perl_on_mint">Known problems with Perl on MiNT</a></h1>
64 <p>The problems you may encounter when building perl on your machine
65 are most probably due to deficiencies in MiNT resp. the Atari
66 platform in general.</p>
67 <p>First of all, if you have less than 8 MB of RAM you shouldn't
68 even try to build Perl yourself. Better grab a binary pre-compiled
69 version somewhere. Even if you have more memory you should take
70 some care. Try to run in a fresh environment (without memory
71 fragmented too much) with as few daemons, accessories, xcontrol
72 modules etc. as possible. If you run some AES you should
73 consider to start a console based environment instead.</p>
74 <p>A problem has been reported with sed. Sed is used to create
75 some configuration files based on the answers you have given
76 to the Configure script. Unfortunately the Perl Configure script
77 shows sed on MiNT its limits. I have sed 2.05 with a stacksize
78 of 64k and I have encountered no problems. If sed crashes
79 during your configuration process you should first try to
80 augment sed's stacksize:</p>
81 <pre>
82 fixstk 64k /usr/bin/sed</pre>
83 <p>(or similar). If it still doesn't help you may have a look
84 which other versions of sed are installed on your system.
85 If you have a KGMD 1.0 installation you will find three
86 in /usr/bin. Have a look there.</p>
87 <p>Perl has some ``mammut'' C files. If gcc reports ``internal
88 compiler error: program cc1 got fatal signal 10'' this is very
89 likely due to a stack overflow in program cc1. Find cc1
90 and fix its stack. I have made good experiences with</p>
91 <pre>
92 fixstk 2 cc1</pre>
93 <p>This doesn't establish a stack of 2 Bytes only as you might
94 think. It really reserves one half of the available memory
95 for cc1's stack. A setting of 1 would reserve the entire
96 memory for cc1, 3 would reserve three fourths. You will have
97 to find out the value that suits to your system yourself.</p>
98 <p>To find out the location of the program ``cc1'' simply type
99 `gcc --print-prog-name cc1' at your shell prompt.</p>
100 <p>Now run make (maybe ``make -k''). If you get a fatal signal 10
101 increase cc1's stacksize, if you run out of memory you should
102 either decrease the stacksize or follow some more hints:</p>
103 <p>Perl's building process is very handy on machines with a lot
104 of virtual memory but may result in a disaster if you are short
105 of memory. If gcc fails to compile many source files you should
106 reduce the optimization. Grep for ``optimize'' in the file
107 config.sh and change the flags.</p>
108 <p>If only several huge files cause problems (actually it is not a
109 matter of the file size resp. the amount of code but depends on
110 the size of the individual functions) it is useful to bypass
111 the make program and compile these files directly from the
112 command line. For example if you got something like the
113 following from make:</p>
114 <pre>
115 CCCMD = gcc -DPERL_CORE ....
117 ...: virtual memory exhausted</pre>
118 <p>you should hack into the shell:</p>
119 <pre>
120 gcc -DPERL_CORE ... toke.c</pre>
121 <p>Please note that you have to add the name of the source file
122 (here toke.c) at the end.</p>
123 <p>If none of this helps, you're helpless. Wait for a binary
124 release. If you have succeeded you may encounter another problem
125 at the linking process. If gcc complains that it can't find
126 some libraries within the perl distribution you probably have
127 an old linker. If it complains for example about ``file not
128 found for xxx.olb'' you should cd into the directory in
129 question and</p>
130 <pre>
131 ln -s libxxx.a xxx.olb</pre>
132 <p>This will fix the problem.</p>
133 <p>This version (5.00402) of perl has passed most of the tests on my system:</p>
134 <pre>
135 Failed Test Status Wstat Total Fail Failed List of failed
136 ------------------------------------------------------------------------------
137 io/pipe.t 10 2 20.00% 7, 9
138 io/tell.t 13 1 7.69% 12
139 lib/complex.t 762 13 1.71% 84-85, 248-251, 257, 272-273,
140 371, 380, 419-420
141 lib/io_pipe.t 10 1 10.00% 9
142 lib/io_tell.t 13 1 7.69% 12
143 op/magic.t 30 2 6.67% 29-30
144 Failed 6/152 test scripts, 96.05% okay. 20/4359 subtests failed, 99.54% okay.</pre>
145 <p>Pipes always cause problems with MiNT, it's actually a surprise that
146 most of the tests did work. I've got no idea why the ``tell'' test failed,
147 this shouldn't mean too big a problem however.</p>
148 <p>Most of the failures of lib/complex seem to be harmless, actually errors
149 far right to the decimal point... Two failures seem to be serious:
150 The sign of the results is reversed. I would say that this is due
151 to minor bugs in the portable math lib that I compiled perl with.</p>
152 <p>I haven't bothered very much to find the reason for the failures
153 with op/magic.t and op/stat.t. Maybe you'll find it out.</p>
154 <p>##########################################################################</p>
155 <p>Another possible problem may arise from the implementation of the ``pwd''
156 command. It happened to add a carriage return and newline to its output
157 no matter what the setting of $UNIXMODE is. This is quite annoying since many
158 library modules for perl take the output of pwd, chop off the
159 trailing newline character and then expect to see a valid path in
160 that. But the carriage return (last but second character!) isn't
161 chopped off. You can either try to patch all library modules (at
162 the price of performance for the extra transformation) or you can
163 use my version of pwd that doesn't suffer from this deficiency.</p>
164 <p>The fixed implementation is in the mint subdirectory. Running
165 ``Configure'' will attempt to build and install it if necessary
166 (hints/mint.sh will do this work) but you can build and install it
167 explicitly by:</p>
168 <pre>
169 cd mint
170 make install</pre>
171 <p>This is the fastest solution.</p>
172 <p>Just in case you want to go the hard way: perl won't even build with a
173 broken pwd! You will have to fix the library modules
174 (ext/POSIX/POSIX.pm, lib/Cwd.pm, lib/pwd.pl) at last after building
175 miniperl.</p>
176 <p>A major nuisance of current MiNTLib versions is the implementation
177 of <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> which is far from being POSIX compliant. A real <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a>
178 should fork and then exec /bin/sh with its argument as a command
179 line to the shell. The MiNTLib <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> however doesn't expect
180 that every user has a POSIX shell in /bin/sh. It tries to work
181 around the problem by forking and exec'ing the first token in its argument
182 string. To get a little bit of compliance to POSIX <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> it
183 tries to handle at least redirection (``&lt;'' or ``&gt;'') on its own
184 behalf.</p>
185 <p>This isn't a good idea since many programs expect that they can
186 pass a command line to <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> that exploits all features of a
187 POSIX shell. If you use the MiNTLib version of <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> with
188 perl the Perl function <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> will suffer from the same deficiencies.</p>
189 <p>You will find a fixed version of <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_system"><code>system()</code></a> in the mint subdirectory.
190 You can easily insert this version into your system libc:</p>
191 <pre>
192 cd mint
193 make system.o
194 ar r /usr/lib/libc.a
195 ranlib /usr/lib/libc.a</pre>
196 <p>If you are suspicious you should either back up your libc before
197 or extract the original system.o from your libc with
198 ``ar x /usr/lib/libc.a system.o''. You can then backup the system.o
199 module somewhere before you succeed.</p>
200 <p>Anything missing? Yep, I've almost forgotten...
201 No file in this distribution without a fine saying. Take this one:</p>
202 <pre>
203 &quot;From a thief you should learn: (1) to work at night;
204 (2) if one cannot gain what one wants in one night to
205 try again the next night; (3) to love one's coworkers
206 just as thieves love each other; (4) to be willing to
207 risk one's life even for a little thing; (5) not to
208 attach too much value to things even though one has
209 risked one's life for them - just as a thief will resell
210 a stolen article for a fraction of its real value;
211 (6) to withstand all kinds of beatings and tortures
212 but to remain what you are; and (7) to believe your
213 work is worthwhile and not be willing to change it.&quot;</pre>
214 <pre>
215 -- Rabbi Dov Baer, Maggid of Mezeritch</pre>
216 <p>OK, this was my motto while working on Perl for MiNT, especially rule (1)...</p>
217 <p>Have fun with Perl!</p>
219 </p>
220 <hr />
221 <h1><a name="author">AUTHOR</a></h1>
222 <p>Guido Flohr</p>
223 <pre>
224 <a href="mailto:guido@FreeMiNT.de">mailto:guido@FreeMiNT.de</a></pre>
225 <table border="0" width="100%" cellspacing="0" cellpadding="3">
226 <tr><td class="block" style="background-color: #cccccc" valign="middle">
227 <big><strong><span class="block">&nbsp;README.mint - Perl version 5 on Atari MiNT</span></strong></big>
228 </td></tr>
229 </table>
231 </body>
233 </html>