Update usage synopsis; fix miscellaneous typos
[p5sagit/p5-mst-13.2.git] / os2 / README
CommitLineData
eacfb5f1 1Current state of the patches here is with respect to perl5.002b1d ;-).
4633a7c4 2
3========================================================
4
5The OS/2 patchkit was submitted by ilya@math.ohio-state.edu. I have
6applied some parts that I suspect won't cause any problems.
7Others do things that I haven't had time to fully consider.
8
9Still other patches included here should perhaps be integrated with the
10metaconfig package that generates Configure.
11
12 Andy Dougherty <doughera@lafcol.lafayette.edu>
13
14========================================================
15
16Notes on the patch:
17~~~~~~~~~~~~~~~~~~~
eacfb5f1 18patches should be applied as
4633a7c4 19 patch -p0 <.....
eacfb5f1 20All the diff.* files and POSIX.mkfifo should be applied.
4633a7c4 21
eacfb5f1 22Additional files are available on
4633a7c4 23 ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2
eacfb5f1 24including patched pdksh and gnumake, needed for build.
25
4633a7c4 26
27Target:
28~~~~~~~
29
30This is not supposed to make a perfect Perl on OS/2. This patch is
31concerned only with perfect _build_ of Perl on OS/2. A lot of good
32features from Andreas Kaiser port missed this patch.
33
eacfb5f1 34Annotations of changes: (part of what is below is already included by Andy,
35~~~~~~~~~~~~~~~~~~~~~~~ thus there are skips below)
4633a7c4 361) C files
372) Configure
383) MakeMaker
394) Build tools
40
411) C files
42 a) mkfifo macro added to Posix.c
43 b) Copyright notice for OS/2 port changed
44 c) MYMALLOC section in perl.h moved (why?)
45 d) setgrent grent and getgrent wrapped in ifdef
46 e) declarations for #if defined(MYMALLOC) && defined(HIDEMYMALLOC)
47 added
48 f) some diagnostics added to tests
49
502) Configure
4633a7c4 51 b) Support for extraction from NE style libraries.
52 c) a lot of
53 cc -o whatever
54 lines did not have $ldopts.
55 d) The above variables are used throughout the file for checks
56
573) Build tools and libraries
58
4633a7c4 59
60 a) ln changed to $ln in some places
61 b) Makefiles and related scripts made to use $(O), $(A), $(AR)
62 using the vars found by Configure or defaulted to
63 some reasonable value.
64 c) $firstmakefile is the file make looks onto before Makefile
65 d) $plibext is the extension for the perl library
66 e) $archobjs is the list of additional object files needed for
67 local build.
4633a7c4 68 l) Makefile.SH : added sh in front of some commands
69 if $d_shrplib is 'custom', looks into
70 $osname/Makefile.$osname.SH to construct the section
eacfb5f1 71 on shared Perl library.
72 !!!!!! Also: installperl installman makedepend
73 !!!!!! added as dependencies to the corresponding
74 !!!!!! targets.
4633a7c4 75 m) clean target extended to delete some intermediate files
4633a7c4 76
77Notes on build on OS/2:
78~~~~~~~~~~~~~~~~~~~~~~~
79The change of C code in this patch is based on the ak port of 5.001+.
80
c0c09dfd 81a) Make sure your sort is not the broken OS/2 one, and that you have /tmp
82on the build partition.
4633a7c4 83
eacfb5f1 84b) when extraction perl5.*.tar.gz you need to extract perl5.*/Configure
c0c09dfd 85separately, since by default perl5.001m/configure may overwrite it;
eacfb5f1 86 like this:
81ab40be 87 tar vzxf perl5.004.tar.gz --case-sensitive perl5.004/Configure
4633a7c4 88
89c) Necessary manual intervention when compiling on OS/2:
90
91 Need to put perl.dll on LIBPATH after it is created.
92
93d) Compile summary:
94
95# Look for hints/os2.sh and correct what is different on your system
96# I have rather spartan configuration.
97
98 # Prefix means where to install:
eacfb5f1 99sh Configure -des -D prefix=f:/perl5.005
4633a7c4 100make
101 # Will probably die after build of miniperl (unless you have DLL
102 # from previous compile). Need to move DLL where it belongs
c0c09dfd 103 #
104 # Somehow with 5.002b3 I needed to type another make after pod2man
4633a7c4 105make
106 # some warnings in POSIX.c
107make test
c0c09dfd 108 # some tests fail, 9 or 10 on my system (see the list at end).
4633a7c4 109 #
110 # before this you should create subdirs bin and lib in the
eacfb5f1 111 # prefix directory (f:/perl5.005 above):
4633a7c4 112make install
4633a7c4 113
114e) At the end of August GNU make and pdksh were too buggy for compile.
115Both maintainers have patches that make it possible to compile perl.
eacfb5f1 116The binaries are included in
4633a7c4 117 ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2
eacfb5f1 118patches are available too.
c0c09dfd 119Note that the pdksh5.2.4 broke builds with -Zexe option because of a
120changed order of executable extensions. A patch is sent to maintainer.
4633a7c4 121
122!!!!!!!!!!!!!!!!!
123If you see that some '/' became '\' in pdksh 5.2.3, you did not apply
124my patches!
125Same with segfaults in Make 3.74.
126!!!!!!!!!!!!!!!!!
127
128Problems reported:
129
130a) one of the latest tr is broken, get an old one :-(
131 1.11 works. (On compuserver?)
132b) You need a perlglob.exe and link386.
133c) Get rid of invalid perl.dll on your LIBPATH.
134
135
136Send comments to ilya@math.ohio-state.edu.
eacfb5f1 137
138======================================================
139Requires 0.9b (well, provision are made to make it build under 0.9a6,
140but they are not tested, please inform me on success).
141(earlier than 0.9b ttyname was not present, it is hard to maintain this
142difference automatically, though I try).
143======================================================
144
145You may try building with a.out style by using `-D emxaout' on the Configure
146line (dynamic extensions should not use CRT (and/or any perl API) in this
147case, which prohibits most buildin extensions). Probably no extension is
148possible, since boot code should return the amount on stack.
149
150The reason why compiling with a.out style executables leads to problems
151with dynamic extensions is:
152 a) OS/2 does not export symbols from executables;
153 b) Thus if extension needs to import symbols from an application
154 the symbols for the application should reside in a .dll.
155 c) You cannot export data from a .dll compiled with a.out style.
156On the other hand, aout-style compiled extension enjoys all the
157(dis)advantages of fork().
c0c09dfd 158
159======================================================
160Tests which fail with OMF compile:
161
162io/fs.t: 2-5, 7-11, 18 as they should.
163io/pipe: all, since open("|-") is not working (even with fork, so far).
164lib/"all the dbm".t: 1 test should fail (file permission).
165op/fork all fail, as they should
166op/stat 3 20 35 as they should, 39 (-t on /dev/null) ???? Sometimes 4 ????
167
168Segfault in socket ????, only if run with Testing tools.
169
170A lot of `bad free'... in databases, bug in DB confirmed on other
171platforms.
172
173Fail: Total 30 subtests (if stat:4 fails) in 10 scripts (one of 10
174is socket, which runs OK standalone).
175
176=======================================================
177
178Changes to calls to external programs:
179~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180Due to a popular demand the perl external program calling has been changed.
181_If_ perl needs to call an external program via shell, the sh.exe will be
182called. The name of the shell is not overridable.
183
184Thus means that you need to pickup some copy of a sh.exe as well (I use one
185from pdksh).
186
187Reasons: a consensus on perl5-porters was that perl should use one
188non-overridable shell per platform. The obvious choices for OS/2 are cmd.exe
189and sh.exe. Having perl build itself would be impossible with cmd.exe as
190a shell, thus I picked up sh.exe. Thus assures almost 100% compatibility
191with the scripts coming from *nix.
192
193Disadvantages: sh.exe calls external programs via fork/exec, and there is
194_no_ functioning exec on OS/2. exec is emulated by EMX by asyncroneous call
195while the caller waits for child completion (to pretend that pid did
196not change). This means that 1 _extra_ copy of sh.exe is made active via
197fork/exec, which may lead to some resources taken from the system.
198
199The long-term solution proposed on p5-p is to have a directive
200 use OS2::Cmd;
201which will override system(), exec(), ``, and open(,' |'). With current
202perl you may override only system(), readpipe() - the explicit version
203of ``, and maybe exec(). The code will substitute a one-argument system
204by CORE::system('cmd.exe', '/c', shift).
205
206If you have some working code for OS2::Cmd.pm, please send it to me,
207I will include it into distribution. I have no need for such a module, so
208cannot test it.
209
210===================================================
211
212OS/2 extensions
213~~~~~~~~~~~~~~~
214I include 3 extensions by Andread Kaiser, OS2::REXX, OS2::UPM, and OS2::FTP,
81ab40be 215into my ftp directory, mirrored on CPAN. I made
216some minor changes needed to compile them by standard tools. I cannot
c0c09dfd 217test UPM and FTP, so I will appreciate your feedback.
218
219The -R switch of older perl is deprecated. If you need to call a REXX code
220which needs access to variables, include the call into a REXX compartment
221created by
81ab40be 222 REXX_call {...block...};
c0c09dfd 223
224Two new functions are supported by REXX code,
225 REXX_eval 'string';
226 REXX_eval_with 'string', REXX_function_name => \&perl_sub_reference;
227
228If you have some other extensions you want to share, send the code to me.
229Two jump to mind: tied access to EA's, and tied access to system databases.