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