Commit | Line | Data |
---|---|---|
5243f9ae PP |
1 | Contents: |
2 | Notes on the patch | |
3 | IMPORTANT NOTE | |
4 | Target | |
5 | Binary Install | |
6 | Reading the docs | |
7 | Notes on build on OS/2 | |
8 | Compile summary | |
9 | Tests which fail | |
10 | Calls to external programs | |
11 | OS/2 extensions | |
12 | Report from the battlefield on 5.002_01 | |
615d1a09 PP |
13 | |
14 | Notes on the patch: | |
15 | ~~~~~~~~~~~~~~~~~~~ | |
16 | patches should be applied as | |
17 | patch -p0 <..... | |
18 | All the diff.* files and POSIX.mkfifo should be applied. | |
19 | ||
20 | Additional files are available on | |
21 | ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2 | |
22 | including patched pdksh and gnumake, needed for build. | |
23 | ||
5243f9ae PP |
24 | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
25 | IMPORTANT NOTE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |
26 | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |
27 | ||
28 | Note with the release 5.003_01 the dynamically loadable libraries | |
29 | should be rebuilt. In particular, DLLs are now created with the names | |
30 | which contain a checksum, thus allowing workaround for OS/2 scheme of | |
31 | caching DLLs. | |
32 | ||
33 | In particular, it is VERY IMPORTANT to have a correct perl.dll on | |
34 | LIBPATH during build, otherwise DLLs with wrong names will be | |
35 | created. Or have a perl.dll with the same naming convention for DLLs | |
36 | (hopefully, it should not change any time soon), or remove it from | |
37 | LIBPATH, add . to LIBPATH, wait until the build of DynaLoader fails, | |
38 | and then move the built DLL into LIBPATH. | |
39 | ||
40 | I also used this possibility to change perl linking type to -Zmt. It | |
41 | means that Perl now uses multithreaded CRTDLL, so your extensions can | |
42 | be multithreaded (note that the perl core is not thread-safe so far, | |
43 | so make sure you access Perl from one thread only). In particular, it | |
44 | is no longer needed to statically link X11_s.lib if you compile | |
45 | Perl/Tk/XFree. | |
46 | ||
47 | This newer port includes | |
48 | . numeric first argument to system(), see OS2::Process docs; | |
49 | . modules OS2::Process, OS2::REXX, OS2::PrfDB, OS2::ExtAttrib. | |
50 | . {get,set,end}*ent may work now (not checked) | |
51 | (most of this merged from ak's port). | |
52 | ||
53 | Note that static build of OS2::ExtAttrib fails some tests! | |
615d1a09 PP |
54 | |
55 | Target: | |
56 | ~~~~~~~ | |
57 | ||
58 | This is not supposed to make a perfect Perl on OS/2. This patch is | |
59 | concerned only with perfect _build_ of Perl on OS/2. Some good | |
60 | features from Andreas Kaiser port missed this port. However, most of | |
5243f9ae | 61 | the features are available (possibly in different form). |
615d1a09 PP |
62 | |
63 | !!! Note that [gs]etpriority functions in this port are compatible | |
64 | !!! with *nix, not with ak's port!!! | |
65 | ||
66 | The priorities are absolute, go from 32 to -95, lower is quickier. 0 | |
67 | is default, | |
68 | ||
5243f9ae PP |
69 | Binary Install: |
70 | ~~~~~~~~~~~~~~ | |
71 | This version of perl allows binary installation on another site. There | |
72 | are two possibilities: | |
73 | a) sh.exe is in the directory with the same name as on machine | |
74 | where perl was compiled (f:/bin here), and perl library is installed | |
75 | into the same directory as the built target (f:/perllib); | |
76 | b) One of the above conditions is not true. Perl may be | |
77 | informed about location of sh.exe via PERL_SH_DRIVE or PERL_SH_DIR | |
78 | (see below). To relocate the perl library, one can | |
79 | b1) either use the usual PERLLIB environment variable - but | |
80 | you should deduce yourself which components should be put there, say, | |
81 | by doing | |
82 | perl -de 0 | |
83 | x \@INC | |
84 | q | |
85 | in the directory of the perl library. Another problem with this is | |
86 | that a module is missing, then perl will try to scan the builtin | |
87 | directories nevertheless. If perl was intended to be installed on | |
88 | f:/perllib, but your f: is a CDROM, then you may have some trouble. | |
89 | b2) Best: binary edit perl.dll and perl_.exe (using perl | |
90 | itself as a binary editor) to fix the paths. Note that the new paths | |
91 | should be better no longer than the old. | |
92 | b3) More convinient: set PERLLIB_PREFIX environment | |
93 | variable. It should contain two components, separated by whitespace | |
94 | and/or semicolon `;'. The first component is translated to the second | |
95 | one if it is | |
96 | a prefix of | |
97 | a component of | |
98 | Perl library lookup path. | |
99 | Say, if you install perllibrary into c:/lib/perl/ instead of | |
100 | f:/perllib/, set it to | |
101 | set PERLLIB_PREFIX=f:/perllib/;c:/lib/perl/ | |
102 | ||
103 | Reading the docs: | |
104 | ~~~~~~~~~~~~~~~~ | |
105 | If your `man' is correctly installed, you should just add | |
106 | x:/perllib/man directory to the end of MANPATH like this: | |
107 | set MANPATH=c:/man;f:/perllib/man | |
108 | After this you can access the docs like this: | |
109 | man perlfunc | |
110 | man 3 less | |
111 | man ExtUtils.MakeMaker | |
112 | Note that dot is used as package separator for package documentation, | |
113 | and as usual, sometimes you need to give the section - 3 above - to | |
114 | avoid shadowing by the less(1) manpage. | |
115 | ||
116 | Alternatively, you can build HTML docs by running | |
117 | pod2html | |
118 | in x:/perllib/lib/pod directory. | |
119 | ||
120 | Alternatively, you can build IPF source by running | |
121 | pod2ipf > perl.ipf | |
122 | in x:/perllib/lib/pod directory, and build (excellent! - best of perl | |
123 | docs available!) .INF documentation by running | |
124 | ipfc /inf perl.ipf | |
125 | Move it on your BOOKSHELF path, and now you may inspect docs by | |
126 | view perl | |
127 | or | |
128 | view perl keyword_to_see | |
129 | ||
130 | Alternatively you may pick up precompiled HTML and .INF docs from the | |
131 | net, as usual, .INF is available on CPAN/.../os2/ilyaz. | |
132 | ||
133 | There are also _very_ good docs in TexInfo and Adobe PDF format. | |
134 | ||
615d1a09 PP |
135 | Notes on build on OS/2: |
136 | ~~~~~~~~~~~~~~~~~~~~~~~ | |
615d1a09 | 137 | a) Make sure your sort is not the broken OS/2 one, and that you have /tmp |
5243f9ae PP |
138 | on the build partition. Make sure that your pdksh.exe, make.exe and |
139 | db.lib are OK (look elsewhere in this file). | |
615d1a09 PP |
140 | |
141 | b) when extracting perl5.*.tar.gz you need to extract perl5.*/Configure | |
142 | separately, since by default perl5.001m/configure may overwrite it; | |
143 | like this: | |
144 | tar vzxf perl5.004.tar.gz --case-sensitive perl5.004/Configure | |
5243f9ae PP |
145 | or |
146 | tar --case-sensitive -vzxf perl5.004.tar.gz perl5.004/Configure | |
615d1a09 PP |
147 | |
148 | c) Necessary manual intervention when compiling on OS/2: | |
149 | ||
150 | Need to put perl.dll on LIBPATH after it is created. | |
151 | ||
152 | d) Compile summary: | |
153 | ~~~~~~~~~~~~~~~ | |
154 | !!! At the end of this README is independent description of the build | |
155 | !!! process by Rocco Caputo. | |
156 | ||
157 | # Look for hints/os2.sh and correct what is different on your system | |
158 | # I have rather spartan configuration. | |
159 | ||
160 | # Prefix means where to install: | |
161 | sh Configure -des -D prefix=f:/perl5.005 | |
5243f9ae PP |
162 | # Note that you need to have /tmp/ ready. |
163 | # | |
615d1a09 PP |
164 | # Ignore the message about missing `ln', and about `c' option |
165 | # to tr. | |
166 | make | |
167 | # Will probably die after build of miniperl (unless you have DLL | |
168 | # from previous compile). Need to move DLL where it belongs | |
169 | # | |
170 | # Somehow with 5.002b3 I needed to type another make after pod2man | |
171 | make | |
172 | # some warnings in POSIX.c | |
173 | make test | |
174 | # some tests fail, 9 or 10 on my system (see the list at end). | |
175 | # | |
176 | # before this you should create subdirs bin and lib in the | |
177 | # prefix directory (f:/perl5.005 above): | |
178 | # | |
179 | # To run finer tests, cd t && perl harness | |
180 | make install | |
181 | ||
5243f9ae PP |
182 | e) At the end of July 1996 GNU make was too buggy for compile. |
183 | The maintainer has the patch (for a year now) that make it possible to | |
184 | compile perl. The binaries are included in | |
615d1a09 PP |
185 | ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2 |
186 | patches are available too. | |
5243f9ae PP |
187 | |
188 | Note that the pdksh5.2.7 or later is required. | |
615d1a09 PP |
189 | |
190 | !!!!!!!!!!!!!!!!! | |
5243f9ae PP |
191 | If you see that some '/' became '\' in pdksh, you use an old pdksh! |
192 | Same with segfaults in Make 3.76 (?) - use my patched verions. | |
615d1a09 PP |
193 | !!!!!!!!!!!!!!!!! |
194 | ||
5243f9ae PP |
195 | f) As distributed the DB library db.a-db.lib is not suitable for |
196 | linking with -Zmt. A recompiled version must be available from my FTP | |
197 | site in os2/db_mt.zip. | |
198 | ||
199 | !!!!!!!!!!!!!!!! | |
200 | If you see: | |
201 | 'errno' - unresolved external | |
202 | it means you use a wrong db.lib. | |
203 | !!!!!!!!!!!!!!!! | |
204 | ||
615d1a09 PP |
205 | Problems reported: |
206 | ||
207 | a) one of the latest tr is broken, get an old one :-( | |
208 | 1.11 works. (On compuserver?) | |
5243f9ae | 209 | b) You need a perlglob.exe and link386. |
615d1a09 PP |
210 | c) Get rid of invalid perl.dll on your LIBPATH. |
211 | ||
615d1a09 PP |
212 | |
213 | Send comments to ilya@math.ohio-state.edu. | |
214 | ||
215 | ====================================================== | |
216 | Requires 0.9b (well, provision are made to make it build under 0.9a6, | |
217 | but they are not tested, please inform me on success). | |
218 | (earlier than 0.9b ttyname was not present, it is hard to maintain this | |
219 | difference automatically, though I try). | |
220 | ====================================================== | |
221 | ||
222 | Building with a.out style is supported by the `perl_' target of make. | |
223 | Dynamic extensions are not possible with perl_.exe, since boot code | |
5243f9ae PP |
224 | should return the retvalue on the Perl stack, the address of which is |
225 | not known to the extension. Moreover: The build process for `perl_' | |
226 | DOES NOT KNOW about dependencies, so you should make sure that | |
227 | anything is up-to-date, say, by doing | |
228 | make perl.dll | |
229 | first. | |
615d1a09 PP |
230 | |
231 | The reason why compiling with a.out style executables leads to problems | |
232 | with dynamic extensions is: | |
233 | a) OS/2 does not export symbols from executables; | |
234 | b) Thus if extension needs to import symbols from an application | |
235 | the symbols for the application should reside in a .dll. | |
236 | c) You cannot export data from a .dll compiled with a.out style. | |
237 | On the other hand, aout-style compiled extension enjoys all the | |
238 | (dis)advantages of fork(). | |
239 | ||
5243f9ae | 240 | ====================================================== |
615d1a09 | 241 | |
5243f9ae PP |
242 | If you need to run PM code from perl, you may use PM mode executable |
243 | perl__.exe. It is subject to restrictions specific to PM programs: it | |
244 | will close the VIO window the moment any PM call is performed. | |
245 | ||
246 | It is needed to run Perl/Tk (currently 7/96 - pre-alpha). | |
615d1a09 PP |
247 | |
248 | ====================================================== | |
5243f9ae PP |
249 | |
250 | The reason why the executables are named perl_.exe and perl__.exe is | |
251 | the following: Perl may parse #! lines in perl scripts to find out the | |
252 | additional switches to enable. Thus there is a convention `What is a | |
253 | perl executable - judging by name', and the above names conform to | |
254 | this convention. | |
255 | ||
256 | ====================================================== | |
257 | Tests which fail | |
258 | ~~~~~~~~~~~~~~~~ | |
259 | with OMF compile (fork works - and all the related | |
260 | test - with A.OUT compile): | |
615d1a09 PP |
261 | |
262 | io/fs.t: 2-5, 7-11, 18 as they should. | |
263 | io/pipe: all, since open("|-") is not working (works with perl_.exe). | |
264 | lib/"all the dbm".t: 1 test should fail (file permission). | |
5243f9ae | 265 | lib/io_pipe io_sock, as they should: use fork. |
615d1a09 PP |
266 | op/fork all fail, as they should (except with perl_.exe) |
267 | op/stat 3 20 35 as they should, 39 (-t on /dev/null) ???? Sometimes 4 | |
268 | - timing problem ???? | |
269 | ||
270 | Sometimes I have seen segfault in socket ????, only if run with Testing tools. | |
271 | ||
272 | A lot of `bad free'... in databases, bug in DB confirmed on other | |
5243f9ae PP |
273 | platforms. You may disable it by setting PERL_BADFREE environment variable |
274 | to 0. | |
275 | ||
276 | Here is my result with OMF: | |
277 | ||
278 | Test Status Wstat Total Fail Success List of failed | |
279 | ------------------------------------------------------------------------------ | |
280 | io/fs.t 22 10 45.45% 2-5, 7-11, 18 | |
281 | io/pipe.t 1 256 8 ?? % ?? | |
282 | lib/anydbm.t 12 1 8.33% 2 | |
283 | lib/db-btree.t 86 1 1.16% 20 | |
284 | lib/db-hash.t 43 1 2.33% 16 | |
285 | lib/db-recno.t 35 1 2.86% 18 | |
286 | lib/io_pipe.t 2 512 6 ?? % ?? | |
287 | lib/io_sock.t 255 65280 5 ?? % ?? | |
288 | lib/sdbm.t 12 1 8.33% 2 | |
289 | op/exec.t 8 1 12.50% 5 | |
290 | op/fork.t 255 65280 2 ?? % ?? | |
291 | op/stat.t 56 4 7.14% 3, 20, 35, 39 | |
292 | Failed 12/104 test scripts, 88.46% okay. 41/2224 subtests failed, 98.16% okay. | |
293 | ||
294 | and with A.OUT: | |
295 | ||
296 | Test Status Wstat Total Fail Failed List of failed | |
297 | ------------------------------------------------------------------------------ | |
298 | io/fs.t 22 10 45.45% 2-5, 7-11, 18 | |
299 | lib/anydbm.t 12 1 8.33% 2 | |
300 | lib/db-btree.t 86 1 1.16% 20 | |
301 | lib/db-hash.t 43 1 2.33% 16 | |
302 | lib/db-recno.t 35 1 2.86% 18 | |
303 | lib/sdbm.t 12 1 8.33% 2 | |
304 | op/exec.t 8 1 12.50% 5 | |
305 | op/stat.t 56 4 7.14% 3, 20, 35, 39 | |
306 | Failed 8/104 test scripts, 92.31% okay. 20/2224 subtests failed, 99.10% okay. | |
307 | ||
308 | Note that op/exec.5 fail because I do not have /bin/sh on this drive. | |
309 | ||
310 | With newer configs I could not reproduce most the crashes. However, | |
311 | after fixpak17 REXX variables acquire a trailing '\0' at end when go | |
312 | through the variable pool (even if they had one), thus making some | |
313 | REXX tests fail. | |
615d1a09 PP |
314 | |
315 | ======================================================= | |
316 | ||
5243f9ae PP |
317 | Calls to external programs: |
318 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
319 | Due to a popular demand the perl external program calling has been | |
320 | changed. _If_ perl needs to call an external program _via shell_, the | |
321 | X:/bin/sh.exe will be called. The name of the shell is | |
322 | overridable, as described below. | |
615d1a09 PP |
323 | |
324 | Thus means that you need to pickup some copy of a sh.exe as well (I use one | |
325 | from pdksh). The drive X: above is set up automatically during the | |
5243f9ae PP |
326 | build, is settable in runtime from $ENV{PERL_SH_DRIVE}. Another way to |
327 | change it is to set $ENV{PERL_SH_DIR} to be the directory in which | |
328 | sh.exe resides. | |
615d1a09 PP |
329 | |
330 | Reasons: a consensus on perl5-porters was that perl should use one | |
331 | non-overridable shell per platform. The obvious choices for OS/2 are cmd.exe | |
332 | and sh.exe. Having perl build itself would be impossible with cmd.exe as | |
333 | a shell, thus I picked up sh.exe. Thus assures almost 100% compatibility | |
334 | with the scripts coming from *nix. | |
335 | ||
336 | Disadvantages: sh.exe calls external programs via fork/exec, and there is | |
337 | _no_ functioning exec on OS/2. exec is emulated by EMX by asyncroneous call | |
338 | while the caller waits for child completion (to pretend that pid did | |
339 | not change). This means that 1 _extra_ copy of sh.exe is made active via | |
340 | fork/exec, which may lead to some resources taken from the system. | |
341 | ||
342 | The long-term solution proposed on p5-p is to have a directive | |
343 | use OS2::Cmd; | |
344 | which will override system(), exec(), ``, and open(,' |'). With current | |
345 | perl you may override only system(), readpipe() - the explicit version | |
346 | of ``, and maybe exec(). The code will substitute a one-argument system | |
347 | by CORE::system('cmd.exe', '/c', shift). | |
348 | ||
349 | If you have some working code for OS2::Cmd.pm, please send it to me, | |
350 | I will include it into distribution. I have no need for such a module, so | |
351 | cannot test it. | |
352 | ||
353 | =================================================== | |
354 | ||
355 | OS/2 extensions | |
356 | ~~~~~~~~~~~~~~~ | |
357 | Since binaries cannot go into perl distribution, no extensions are | |
358 | included. They are available in .../os2/ilyaz directory of CPAN, as | |
359 | well as in my directory | |
360 | ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2 | |
361 | ||
362 | I include 3 extensions by Andread Kaiser, OS2::REXX, OS2::UPM, and OS2::FTP, | |
363 | into my ftp directory, mirrored on CPAN. I made | |
364 | some minor changes needed to compile them by standard tools. I cannot | |
365 | test UPM and FTP, so I will appreciate your feedback. Other extensions | |
366 | there are OS2::ExtAttribs, OS2::PrfDB for tied access to EAs and .INI | |
367 | files - and maybe some other extensions at the time you read it. | |
368 | ||
369 | Note that OS2 perl defines 2 pseudo-extension functions | |
370 | OS2::Copy::copy and DynaLoader::mod2fname. | |
371 | ||
372 | The -R switch of older perl is deprecated. If you need to call a REXX code | |
373 | which needs access to variables, include the call into a REXX compartment | |
374 | created by | |
375 | REXX_call {...block...}; | |
376 | ||
377 | Two new functions are supported by REXX code, | |
378 | REXX_eval 'string'; | |
379 | REXX_eval_with 'string', REXX_function_name => \&perl_sub_reference; | |
380 | ||
5243f9ae PP |
381 | If you have some other extensions you want to share, send the code to |
382 | me. At least two are available: tied access to EA's, and tied access | |
383 | to system databases. | |
615d1a09 PP |
384 | |
385 | ================================================================== | |
386 | == == | |
387 | == User report [my comments in brackets, IZ] == | |
388 | == == | |
5243f9ae PP |
389 | == A web page: http://www.shadow.net/~troc/os2perl.html == |
390 | == == | |
615d1a09 PP |
391 | ================================================================== |
392 | ||
393 | Starting in x:/usr/src, using 4OS2/32 2.5 as the command interpreter on | |
394 | OS/2 2.30 with FixPak-17. DAX is installed, but this shouldn't be a | |
395 | factor. Drive X is a TVFS virtual drive pointing to several physical | |
396 | HPFS drives. | |
397 | ||
398 | >>> Make sure that no copies or perl are currently running. Miniperl | |
399 | may fail during the build because it will find an older version | |
400 | of perl.dll loaded in memory. | |
401 | ||
402 | Close any running perl scripts. | |
403 | Shut down anything that might run perl scripts, like cron. | |
404 | `emxload -l` to check for loaded versions of perl. | |
405 | `emxload -u perl.exe` to unload them. | |
406 | ||
407 | >>> Pre-load some common utilities: | |
408 | ||
409 | emxload -e sh.exe make.exe ls.exe tr.exe id.exe sed.exe | |
410 | SET GCCLOAD=30 (number of minutes to hold the compiler) | |
411 | [grep egrep fgrep cat rm uniq basename uniq sort - are not bad too.] | |
412 | The theory is that it's faster to demand-load the development tools | |
413 | from virtual memory than it is to re-load and re-link them all the | |
414 | time. This is definitely true with my system because swapfile.dat | |
415 | is on a faster drive than my development environment. | |
416 | ||
417 | ls, tr, and id represent the GNU file, text, and shell utilities. | |
418 | These may not be needed, but it makes sure that their respective | |
419 | DLLs are in memory. | |
420 | ||
421 | >>> Unpack the perl 5_002_01 archive onto an HPFS partition. | |
422 | ||
423 | tar vxzf perl5_002_01.tar-gz | |
424 | cd perl5.002_01 | |
425 | ||
426 | [Do not forget to extract Configure as described above.] | |
427 | ||
428 | >>> Read the README, keeping a copy open in another session for reference. | |
429 | ||
430 | start /c /fg less os2/README | |
431 | ||
432 | >>> Apply the OS/2 patches included with 5.002_01, as per the README. | |
433 | ||
434 | for %m in (os2\diff.*) patch -p0 < %m | |
435 | patch -p0 < os2\POSIX.mkfifo | |
436 | ||
437 | [The patch below is already applied.] | |
438 | ||
439 | >>> You may need to apply this patch if you plan to run a non-standard | |
440 | Configure (that is, if you defy the README). This patch will ensure | |
441 | that Makefile inherits the libraries specified during Configure. | |
442 | People running standard perl builds can probably ignore this patch. | |
443 | ||
444 | *** os2\Makefile.SHs Mon Mar 25 02:05:00 1996 | |
445 | --- os2\Makefile.SHs.new Fri May 24 10:37:10 1996 | |
446 | *************** | |
447 | *** 9,15 **** | |
448 | emximp -o perl.imp perl5.def | |
449 | ||
450 | perl.dll: $(obj) perl5.def perl$(OBJ_EXT) | |
451 | ! $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) -lsocket perl5.def | |
452 | ||
453 | perl5.def: perl.linkexp | |
454 | echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@ | |
455 | --- 9,15 ---- | |
456 | emximp -o perl.imp perl5.def | |
457 | ||
458 | perl.dll: $(obj) perl5.def perl$(OBJ_EXT) | |
459 | ! $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs) perl5.def | |
460 | ||
461 | perl5.def: perl.linkexp | |
462 | echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@ | |
463 | *************** | |
464 | *** 49,55 **** | |
465 | cat perl.exports perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp | |
466 | ||
467 | perl.map: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) | |
468 | ! $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o dummy.exe miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) -lsocket -lm -Zmap -Zlinker /map | |
469 | awk '{if ($$3 == "") print $$2}' <dummy.map | sort | uniq > perl.map | |
470 | rm dummy.exe dummy.map | |
471 | ||
472 | --- 49,55 ---- | |
473 | cat perl.exports perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp | |
474 | ||
475 | perl.map: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) | |
476 | ! $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o dummy.exe miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs) -Zmap -Zlinker /map | |
477 | awk '{if ($$3 == "") print $$2}' <dummy.map | sort | uniq > perl.map | |
478 | rm dummy.exe dummy.map | |
479 | ||
480 | >>> Apply the patches from Ilya's perl5.002_01 binary distribution: | |
481 | ||
482 | touch os2/dlfcn.h os2/dl_os2.c | |
483 | patch -p1 < f:\perllib\README.fix1 | |
484 | ||
485 | >>> Run Configure. Most people can run it by following the README: | |
486 | ||
487 | sh Configure -des -D prefix=f:/usr/local | |
488 | ||
489 | Advanced perl users (experienced C programmers, recommended) can run | |
490 | the interactive Configure and answer the questions. When in doubt | |
491 | about an answer, check the EMX headers and documentation. Pick the | |
492 | default answer if that doesn't help: | |
493 | ||
494 | sh Configure | |
495 | ||
496 | [Yet more advanced users just specify the answers on the command line | |
497 | of Configure, like I did with prefix.] | |
498 | ||
499 | Note: You may need to wrap an answer in quotes if it contains | |
500 | spaces. For example, "-lsocket -lm". | |
501 | ||
502 | Note: If you want to add some options to a long default, you can | |
503 | use $* to include the default in your answer: "$* -DDEBUGGING". | |
504 | ||
505 | Configure warnings and errors, and possible work-arounds: | |
506 | ||
507 | I don't know where 'ln' is.... | |
508 | (ignored; OS/2 doesn't have a ln command) | |
509 | ||
510 | nm didn't seem to work right. Trying emxomfar instead... | |
511 | (nothing to worry about) | |
512 | ||
513 | The recommended value for $d_shrplib on this machine was "define"! | |
514 | (kept the recommended value: y) | |
515 | ||
516 | Directory f:/usr/lib/perl5/os2/5.00201/CORE doesn't exist. | |
517 | (created the directory from another window with | |
518 | \usr\bin\mkdir -p f:/usr/lib/perl5/os2/5.00201/CORE | |
519 | and then answered: y. Your directory may look different.) | |
520 | ||
521 | [Ignore this as well, install script will create it for you.] | |
522 | ||
523 | The recommended value for $i_dlfcn on this machine was "define"! | |
524 | (kept the recommended value: y) | |
525 | ||
526 | The recommended value for $d_fork on this machine was "undef"! | |
527 | (kept the recommended value: y) | |
528 | ||
529 | Figuring out the flag used by open() for non-blocking I/O... | |
530 | Seems like we can use O_NONBLOCK. | |
531 | This seems to be used for informative purposes only. | |
532 | The errors that follow this (including a SIGPIPE) don't seem | |
533 | to affect perl at all. These were safely ignored. | |
534 | ||
535 | What pager is used on your system? [/usr/ucb/more] | |
536 | Had to answer "/usr/bin/less.exe" because Configure wants a | |
537 | leading / (unix full path). Need to edit config.sh later with | |
538 | the real full path to the pager, including the drive letter. | |
539 | ||
540 | [Apparently this setting is never used, so it is safe to ignore it.] | |
541 | ||
542 | Hmm... F:/USR/BIN/sed: Unterminated `s' command | |
543 | Perl built fine even with this error, so it seems safe to | |
544 | ignore. | |
545 | ||
546 | Things I did different from the defaults. Most (if not all) of these | |
547 | are optional changes. They're listed here to show how good Configure | |
548 | is at detecting the system setup. | |
549 | ||
550 | [I add the options to put it on command line of Configure, see below.] | |
551 | ||
552 | Selected 'none' for the man1 location. | |
553 | (I prefer the pod2html version.) | |
554 | [-D man1dir=none] | |
555 | Selected 'none' for the man3 location. | |
556 | (I prefer the pod2html version.) | |
557 | [-D man3dir=none] | |
558 | Changed the hostname and domain. | |
559 | (I wanted to override a dynamic PPP address. This only | |
560 | matters if other people will be using your perl build.) | |
561 | [-D myhostname=my_host_name -D mydomain=.foo.org] | |
562 | Fixed the e-mail address. | |
563 | (Put in a known working e-mail address. This only matters | |
564 | if other people will be using your perl build.) | |
565 | [-D cf_email=root@myhostname.uucp] | |
566 | Added some directories to the library search path. | |
567 | [-D "libpth=f:/emx/lib/st f:/emx/lib"] | |
568 | Added -g to the optimizer/debugger flags. | |
569 | [-D optimize=-g] | |
570 | Added "-lgdbm -ldb -lcrypt -lbsd" to the additional libraries. | |
571 | [ -D "libs=-lsocket -lcrypt -lgdbm" | |
572 | the rest of libraries will not be used] | |
573 | ||
574 | >>> Advanced users may want to edit config.sh when prompted by Configure. | |
575 | Most (all?) of these changes aren't really necessary: | |
576 | ||
577 | d_getprior='define' | |
578 | d_setprior='define' | |
579 | (getpriority and setpriority are included in os2.c, but | |
580 | Configure doesn't know to look there.) | |
581 | [fixed already] | |
582 | pager='f:/usr/bin/less.exe' | |
583 | (Correcting Configure's insistence on a leading slash.) | |
584 | bin_sh='f:/usr/bin/sh.exe' | |
585 | (If Configure detects sh.exe somewhere else first. Example: | |
586 | it saw sh.exe at /bin/sh.exe on my TVFS drive, but I want | |
587 | perl to look for it on the physical F drive.) | |
588 | aout_ccflags='... existing flags... -DDEBUGGING' | |
589 | aout_cppflags='... existing flags... -DDEBUGGING' | |
590 | (If you want to include DEBUGGING for the aout version.) | |
591 | [Do not do it, -D optimize=-g will automatically add these flags.] | |
592 | ||
593 | >>> Allow Configure to make the build scripts. | |
594 | ||
595 | >>> Allow Configure to run `make depend`. Ignore the following warning: | |
596 | ||
597 | perl.h:861: warning: `DEBUGGING_MSTATS' redefined | |
598 | [corrected now] | |
599 | ||
600 | >>> Rename any existing perl.dll, preventing anything from loading it and | |
601 | saving a known working copy in case something goes wrong: | |
602 | ||
603 | mv /usr/lib/perl.dll /usr/lib/ilya-perl.dll | |
604 | ||
605 | >>> Run `make`, and ignore the following warnings: | |
606 | ||
607 | perl.h:861: warning: `DEBUGGING_MSTATS' redefined | |
608 | [corrected now] | |
609 | invalid preprocessing directive name | |
610 | emxomf warning: Cycle detected by make_type | |
611 | LINK386 : warning L4071: application type not specified; assuming WINDOWCOMPAT | |
612 | Warning (will try anyway): No library found for -lposix | |
613 | Warning (will try anyway): No library found for -lcposix | |
614 | POSIX.c:203: warning: `mkfifo' redefined | |
615 | POSIX.c:4603: warning: assignment makes pointer from integer without a cast | |
616 | ||
617 | >>> If `make` dies while "Making DynaLoader (static)", you'll need to | |
618 | put miniperl in the OS/2 paths. This step is only necessary if `make` | |
619 | can't find miniperl: | |
620 | [I would be interested if somebody confirmes this.] | |
621 | ||
622 | cp perl.dll /usr/lib (where /usr/lib is in your LIBPATH) | |
623 | cp miniperl.exe /usr/bin (where /usr/bin is in your PATH) | |
624 | make (ignore the errors in the previous step) | |
625 | ||
626 | This should run to completion. | |
627 | ||
628 | >>> Test the build: | |
629 | ||
630 | make test | |
631 | ||
632 | These tests fail: | |
633 | ||
634 | io/fs..........FAILED on test 2 | |
635 | ||
636 | "OS/2 is not unix". Test 2 checks the link() command, which | |
637 | is not supported by OS/2. | |
638 | ||
639 | io/pipe........f:/usr/bin/sh.exe: -c requires an argument | |
640 | f:/usr/bin/sh.exe: -c requires an argument | |
641 | The Unsupported function fork function is unimplemented at | |
642 | io/pipe.t line 26. | |
643 | FAILED on test 1 | |
644 | ||
645 | More "OS/2 is not unix" errors. Read ahead to find out | |
646 | why fork() fails. | |
647 | ||
648 | op/exec........FAILED on test 4 | |
649 | ||
650 | if (system "true") {print "not ok 4\n";} else \ | |
651 | {print "ok 4\n";} | |
652 | ||
653 | This fails for me, but changing it to read like this works: | |
654 | ||
655 | if (system '\usr\bin\true.cmd') {print "not ok 4\n";} \ | |
656 | else {print "ok 4\n";} | |
657 | ||
658 | So you can count this as another "OS/2 is not unix". | |
659 | ||
660 | op/fork........The Unsupported function fork function is \ | |
661 | unimplemented at op/fork.t line 8. | |
662 | FAILED on test 1 | |
663 | ||
664 | The dynamically-loaded version of perl currently doesn't | |
665 | support fork(). This is a known behavior of EMX. | |
666 | ||
667 | op/magic....... | |
668 | Process terminated by SIGINT | |
669 | ok | |
670 | ||
671 | The test passed even with the SIGINT message. I don't | |
672 | know why, but I won't argue. | |
673 | ||
674 | op/stat........ls: /dev: No such file or directory | |
675 | f:/usr/bin/sh.exe: ln: not found | |
676 | ls: perl: No such file or directory | |
677 | FAILED on test 3 | |
678 | ||
679 | "OS/2 is not unix". We don't have the ln command. | |
680 | ||
681 | lib/anydbm.....Bad free() ignored at lib/anydbm.t line 51. | |
682 | Bad free() ignored at lib/anydbm.t line 51. | |
683 | Bad free() ignored at lib/anydbm.t line 51. | |
684 | Bad free() ignored during global destruction. | |
685 | Bad free() ignored during global destruction. | |
686 | Bad free() ignored during global destruction. | |
687 | FAILED on test 2 | |
688 | ||
689 | Test 2 looks at the file permissions for a database. "OS/2 | |
690 | is not unix" so the permissions aren't exactly what this test | |
691 | expects. | |
692 | ||
693 | lib/db-btree...Bad free() ignored at lib/db-btree.t line 109. | |
694 | Bad free() ignored at lib/db-btree.t line 221. | |
695 | Bad free() ignored at lib/db-btree.t line 337. | |
696 | Bad free() ignored at lib/db-btree.t line 349. | |
697 | Bad free() ignored at lib/db-btree.t line 349. | |
698 | Bad free() ignored at lib/db-btree.t line 399. | |
699 | Bad free() ignored at lib/db-btree.t line 400. | |
700 | Bad free() ignored at lib/db-btree.t line 401. | |
701 | FAILED on test 20 | |
702 | ||
703 | Another file permissions test fails. | |
704 | ||
705 | lib/db-hash....Bad free() ignored at lib/db-hash.t line 101. | |
706 | Bad free() ignored at lib/db-hash.t line 101. | |
707 | Bad free() ignored at lib/db-hash.t line 101. | |
708 | Bad free() ignored at lib/db-hash.t line 239. | |
709 | Bad free() ignored at lib/db-hash.t line 239. | |
710 | Bad free() ignored at lib/db-hash.t line 239. | |
711 | Bad free() ignored at lib/db-hash.t line 253. | |
712 | Bad free() ignored at lib/db-hash.t line 253. | |
713 | Bad free() ignored at lib/db-hash.t line 253. | |
714 | FAILED on test 16 | |
715 | ||
716 | Another file permissions test fails. | |
717 | ||
718 | lib/db-recno...Bad free() ignored at lib/db-recno.t line 138. | |
719 | Bad free() ignored at lib/db-recno.t line 138. | |
720 | FAILED on test 18 | |
721 | ||
722 | Another file permissions test fails. | |
723 | ||
724 | lib/gdbm.......FAILED on test 2 | |
725 | ||
726 | Another file permissions test fails. | |
727 | ||
728 | lib/sdbm.......FAILED on test 2 | |
729 | ||
730 | Another file permissions test fails. | |
731 | ||
732 | Failed 11/94 tests, 88.30% okay. | |
733 | ||
734 | All of which are known differences with unix or documented | |
735 | behaviors in EMX. I re-run the test with Ilya's version, | |
736 | and the same tests fail. This new build is a success. | |
737 | [Note that bad free() mentioned above are bugs in the Berkeley | |
738 | DB. They just are more visible under OS/2 with perl free(), because of | |
5243f9ae PP |
739 | "rigid" function name resolution. You may disable it by setting |
740 | PERL_BADFREE environment variable to 0. | |
615d1a09 PP |
741 | To get finer tests, cd to ./t and run |
742 | perl harness | |
743 | ] | |
744 | ||
745 | (Actually, Ilya's perl release fails an extra test because I don't | |
746 | have sed in f:\emx.add. This shows how important it is to configure | |
747 | and build perl yourself instead of grabbing pre-built binaries.) | |
748 | [Hmm, should not happen... There is no mentions of full_sed under ./t | |
749 | directory...] | |
750 | ||
751 | >>> Cross your fingers and install it: | |
752 | ||
753 | make install | |
754 | ||
755 | Warnings encountered and workarounds presented.: | |
756 | ||
757 | WARNING: You've never run 'make test'!!! (Installing anyway.) | |
758 | (Lies! All lies! At least it still installs.) | |
759 | ||
760 | WARNING: Can't find libperl*.dll* to install into \ | |
761 | f:/usr/lib/perl5/os2/5.00201/CORE. (Installing other things anyway.) | |
762 | (Safe to ignore. The important one, libperl.lib, gets copied.) | |
763 | ||
764 | Couldn't copy f:/usr/bin/perl5.00201.exe to f:/usr/bin/perl.exe: \ | |
765 | No such file or directory | |
766 | cp /usr/bin/perl5.00201.exe /usr/bin/perl.exe | |
767 | ||
768 | Couldn't copy f:/usr/bin/perl.exe to /usr/bin/perl.exe: No such \ | |
769 | file or directory | |
770 | (I think this one is safe to ignore since the two directories | |
771 | point to the same place.) | |
772 | ||
773 | >>> Laugh maniacally because you just built and installed your own copy | |
774 | of perl, with all the paths set "just so" and with whatever little | |
775 | psychotic modifications you've always wanted but were afraid to add. | |
776 | ||
777 | ----------------------------------------------------------------------------- | |
778 | ||
779 | Development tools and versions: | |
780 | ||
781 | EMX 0.9b with emxfix04 applied. | |
782 | ||
783 | `ls --version` reports: 'GNU file utilities 3.12' | |
784 | `tr --version` reports: 'tr - GNU textutils 1.14' | |
785 | `id --version` reports: 'id - GNU sh-utils 1.12' | |
786 | ||
787 | `sed --version` reports: 'GNU sed version 2.05' | |
788 | `awk --version` reports: 'Gnu Awk (gawk) 2.15, patchlevel 6' | |
789 | `grep --version` reports an illegal option and: 'GNU grep version 2.0' | |
790 | (this includes egrep) | |
791 | ||
792 | `sort --version` reports: 'sort - GNU textutils 1.14' | |
793 | `uniq --version` reports: 'uniq - GNU textutils 1.14' | |
794 | `find --version` reports: 'GNU find version 4.1' | |
795 | ||
796 | KSH_VERSION='@(#)PD KSH v5.2.4 96/01/17' | |
797 | (Ilya's patched version.) | |
798 | ||
799 | `make --version` reports: 'GNU Make version 3.74' | |
800 | (Ilya's patched version.) | |
801 | ||
802 | `emxrev` reports: | |
803 | EMX : revision = 42 | |
804 | EMXIO : revision = 40 | |
805 | EMXLIBC : revision = 40 | |
806 | EMXLIBCM : revision = 43 | |
807 | EMXLIBCS : revision = 43 | |
808 | EMXWRAP : revision = 40 | |
809 | ||
810 | ----------------------------------------------------------------------------- | |
811 | ||
812 | Rocco | |
813 | <troc@shadow.net> | |
814 |