This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Define setlocale_i() on unsafe threaded builds
[perl5.git] / README.os400
CommitLineData
ffe25ee3
B
1# vim: syntax=pod
2
522b859a
JH
3If you read this file _as_is_, just ignore the funny characters you see.
4It is written in the POD format (see pod/perlpod.pod) which is specially
5designed to be readable as is.
6
7=head1 NAME
8
de2902a6 9perlos400 - Perl version 5 on OS/400
522b859a 10
2b7f2baa 11B<This document needs to be updated, but we don't know what it should say.
8166b4e0 12Please submit comments to L<https://github.com/Perl/perl5/issues>.>
2b7f2baa 13
522b859a
JH
14=head1 DESCRIPTION
15
16This document describes various features of IBM's OS/400 operating
17system that will affect how Perl version 5 (hereafter just Perl) is
18compiled and/or runs.
19
20By far the easiest way to build Perl for OS/400 is to use the PASE
21(Portable Application Solutions Environment), for more information see
635d4d9b 22L<http://www.iseries.ibm.com/developer/factory/pase/index.html>
522b859a
JH
23This environment allows one to use AIX APIs while programming, and it
24provides a runtime that allows AIX binaries to execute directly on the
25PowerPC iSeries.
26
27=head2 Compiling Perl for OS/400 PASE
28
29The recommended way to build Perl for the OS/400 PASE is to build the
30Perl 5 source code (release 5.8.1 or later) under AIX.
31
32The trick is to give a special parameter to the Configure shell script
33when running it on AIX:
34
35 sh Configure -DPASE ...
36
37The default installation directory of Perl under PASE is /QOpenSys/perl.
38This can be modified if needed with Configure parameter -Dprefix=/some/dir.
39
40Starting from OS/400 V5R2 the IBM Visual Age compiler is supported
41on OS/400 PASE, so it is possible to build Perl natively on OS/400.
42The easier way, however, is to compile in AIX, as just described.
43
64e35db4
RGS
44If you don't want to install the compiled Perl in AIX into /QOpenSys
45(for packaging it before copying it to PASE), you can use a Configure
46parameter: -Dinstallprefix=/tmp/QOpenSys/perl. This will cause the
47"make install" to install everything into that directory, while the
48installed files still think they are (will be) in /QOpenSys/perl.
49
522b859a
JH
50If building natively on PASE, please do the build under the /QOpenSys
51directory, since Perl is happier when built on a case sensitive filesystem.
52
53=head2 Installing Perl in OS/400 PASE
54
55If you are compiling on AIX, simply do a "make install" on the AIX box.
56Once the install finishes, tar up the /QOpenSys/perl directory. Transfer
57the tarball to the OS/400 using FTP with the following commands:
58
59 > binary
60 > site namefmt 1
61 > put perl.tar /QOpenSys
62
63Once you have it on, simply bring up a PASE shell and extract the tarball.
64
65If you are compiling in PASE, then "make install" is the only thing you
66will need to do.
67
68The default path for perl binary is /QOpenSys/perl/bin/perl. You'll
69want to symlink /QOpenSys/usr/bin/perl to this file so you don't have
70to modify your path.
71
72=head2 Using Perl in OS/400 PASE
73
74Perl in PASE may be used in the same manner as you would use Perl on AIX.
75
76Scripts starting with #!/usr/bin/perl should work if you have
77/QOpenSys/usr/bin/perl symlinked to your perl binary. This will not
78work if you've done a setuid/setgid or have environment variable
79PASE_EXEC_QOPENSYS="N". If you have V5R1, you'll need to get the
80latest PTFs to have this feature. Scripts starting with
81#!/QOpenSys/perl/bin/perl should always work.
82
954a4c1b
JH
83=head2 Known Problems
84
61074b56
JH
85When compiling in PASE, there is no "oslevel" command. Therefore,
86you may want to create a script called "oslevel" that echoes the
87level of AIX that your version of PASE runtime supports. If you're
88unsure, consult your documentation or use "4.3.3.0".
89
90If you have test cases that fail, check for the existence of spool files.
91The test case may be trying to use a syscall that is not implemented
92in PASE. To avoid the SIGILL, try setting the PASE_SYSCALL_NOSIGILL
93environment variable or have a handler for the SIGILL. If you can
94compile programs for PASE, run the config script and edit config.sh
95when it gives you the option. If you want to remove fchdir(), which
96isn't implement in V5R1, simply change the line that says:
97
98d_fchdir='define'
99
100to
101
102d_fchdir='undef'
103
104and then compile Perl. The places where fchdir() is used have
105alternatives for systems that do not have fchdir() available.
954a4c1b 106
522b859a
JH
107=head2 Perl on ILE
108
109There exists a port of Perl to the ILE environment. This port, however,
110is based quite an old release of Perl, Perl 5.00502 (August 1998).
111(As of July 2002 the latest release of Perl is 5.8.0, and even 5.6.1
112has been out since April 2001.) If you need to run Perl on ILE, though,
635d4d9b 113you may need this older port: L<http://www.cpan.org/ports/#os400>
522b859a
JH
114Note that any Perl release later than 5.00502 has not been ported to ILE.
115
116If you need to use Perl in the ILE environment, you may want to consider
117using Qp2RunPase() to call the PASE version of Perl.
118
119=head1 AUTHORS
120
121Jarkko Hietaniemi <jhi@iki.fi>
122Bryan Logan <bryanlog@us.ibm.com>
123David Larson <larson1@us.ibm.com>
124
125=cut