This file contains the latest information for installing the Perl scripting language on a TPF system and was last updated on 30 November 2000. See section 2.0 Perl Support on TPF for important version support information.
The procedures described in this document have been tested on an OS/390 UNIX System Services machine running at version 2.6 that contained both OS/390 UNIX and TPF C header files. Throughout this document, we will refer to this machine as OS/390 UNIX.
The following conventions are used in this document:
Text that you type is shown in bold and is case sensitive.
This file is intended for those persons who are installing Perl. Those who are using the Perl code and writing Perl scripts can learn more about Perl and the TPF file system through the resources identified in 7.0 Technical Documentation and Other Sources of Information.
1.2 How to get help
If you have difficulty installing Perl, contact your TPF service representative.
To use Perl on your TPF system, you must be at TPF V4R1 PUT 13 with APAR PJ27277 installed. TPF only supports Perl version 5.005_03, which is available on the TPF Web page. See 3.0 Getting the Perl Code for TPF for more information about getting the appropriate Perl code.
The following extensions are supported in part or in full on the TPF system:
Errno
Fcntl
IO
Opcode
POSIX
Socket
Process handling of Perl scripts on TPF varies from UNIX because of differences between the models for creating subprocesses: TPF uses tpf_fork while UNIX uses fork and exec.
TPF supports many, but not all, built-in Perl functions and Perl switches. The Table of TPF-Supported Perl Features identifies which functions and which switches are supported.
Download the Perl source code (perl5.005_03.source_code.tar.Z) and the patches that enable Perl to run on your TPF system (perl5.005_03.tpf_patches.tar.Z) by doing the following:
Download each archive to your PC or workstation by clicking the file name and then choosing an appropriate directory. (The instructions that follow assume you have downloaded the archives to your local C:\ drive.) Make sure that you use the .tar.Z extension on the file names. Sometimes browsers do not understand the file extensions and attempt to save the file with a different extension so you may need to reset the file extension to .tar.Z.
Use FTP to send the archives to your OS/390 UNIX system by doing the following:
Open a DOS window.
Enter ftp your.open.edition.machine.com to activate FTP, where your.open.edition.machine.com is the name of your OS/390 UNIX system.
Sign in.
Enter binary to set the session as binary.
Enter send c:\perl5.005_03.source_code.tar.Z perl5.005_03.source_code.tar.Z to send the Perl source code to your OS/390 UNIX system.
Enter send c:\perl5.005_03.tpf_patches.tar.Z perl5.005_03.tpf_patches.tar.Z to send the patches to your OS/390 UNIX system.
Enter bye to exit FTP.
Close the DOS window.
(You can also download Perl source code from CPAN: the Comprehensive Perl Archive Network. However, because the patches required for Perl to run on TPF are specific to version 5.005_03, download the Perl source code from the TPF Web site to ensure compatibility.)
3.2 Extracting
Each archive is compressed into a tarball. To extract the files from these tarballs, do the following on your OS/390 UNIX system:
Ensure both archives are in the same directory on OS/390 UNIX.
Enter gunzip perl5.005_03.source_code.tar.Z to decompress the Perl source code. The tar.Z file is replaced by the .tar archive file.
Enter gunzip perl5.005_03.tpf_patches.tar.Z to decompress the patches. The tar.Z file is replaced by the .tar archive file.
Enter pax -rvkf perl5.005_03.source_code.tar -o from=ISO8859-1,to=IBM-1047 to extract the Perl source code.*
Enter pax -rvkf perl5.005_03.tpf_patches.tar -o from=ISO8859-1,to=IBM-1047 to extract the patches.*
Enter chmod -R 777 perl5.005_03 to ensure all files are accessible.
Enter cp -R perl5.005_03/tpf/* perl5.005_03 to apply the TPF patches by overlaying selected Perl files.
The unique Perl build process uses a small version of itself called miniperl to complete the Perl interpreter. This causes problems on systems that do cross-platform compiling, such as TPF. As a result, to compile Perl for TPF, you will first need to create miniperl so that it runs on OS/390 UNIX and then force a complete build against TPF headers and libraries.
The build for TPF should not interfere with any existing implementations of Perl on OS/390 UNIX nor will it write into the /usr/local directory.
4.1 Building miniperl for OS/390 UNIX
To create miniperl, do the following:
Enter cd perl5.005_03 to change to the perl5.005_03 directory.
Enter Configure -des to kick off the configuration process. This will take approximately 20 to 30 minutes to be completed but requires no interaction. Your output will be similar to the following:
(I see you are using the Korn shell. Some ksh's blow up on Configure,
mainly on older exotic systems. If yours does, try the Bourne shell
instead.)
First let's make sure your kit is complete. Checking...
Locating common programs...
Checking compatibility between /bin/echo and builtin echo (if any)...
(... several screens of output here ...)
Finding dependencies for walk.o.
echo Makefile.SH cflags.SH | tr ' ' '\n' >.shlist
Updating makefile...
Now you must run a make.
If you compile perl5 on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of the policy defaults.
You can safely ignore the following error (or diagnostic) messages:
/bin/awk: Syntax error Context is:
>>> {print $} <<<
perly.y -> perly.c
perly.y -> perly.h
a2p.y -> a2p.c
ERROR CBC3198 ./.nnnnnnnn.c:399 #if, #else, #elif, #ifdef, #ifndef block must be ended with #endif.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile .nnnnnnnn.c. Correct the errors and try again.
Enter make miniperl to compile miniperl for OS/390 UNIX. Your output will be similar to the following:
Once miniperl has been built for OS/390 UNIX, you can build the complete Perl interpreter for TPF by doing the following:
Ensure you are in the perl5.005_03 directory.
Customize the tpf.exports script by putting in the location of your TPF C header files. This script will set the environment variables required to compile Perl for TPF.
Verify that the export variables are valid for your installation; in particular, the system include file directories. The system include files must reside on your OS/390 UNIX system in the appropriate file structure similar to /usr/include and /usr/include/sys. If your system header files contain line numbers in columns 7280, you must truncate them. The lines that read export _C89_OPTIONS="-W 0,langlvl(extended) -DSTANDARD_C" and export TPF=YES are required for the Perl compilation to work correctly.
This example from a customer shows the commands used for the copy process from PDS to HFS:
Enter . tpf.exports to export TPF compiler settings.
The initial period and blank are required to ensure the environment variables exist beyond the scope of the tpf.exports shell script. If you receive either of the following error messages, go back to 4.1 Building miniperl for OS/390 UNIX and complete the miniperl build:
tpf.exports: run "Configure -des" first
tpf.exports: run "make miniperl" first"
Once a successful export of the TPF compiler settings has been completed, you cannot rebuild miniperl for OS/390 UNIX without first clearing the settings. If you must rebuild miniperl, exit and then log on again to clear the settings.
To customize the config.sh.tpf file, do the following:
Change the /u/tpf41/currentmaint/include string to reflect your TPF C header directory on the following lines:
On the perladmin='someone@your.company.com' line, change the e-mail address to a valid address.
Customize the information within single quotation marks (' ') on the following lines with the appropriate information:
cf_by='your name'
cf_email='you@your.company.com'
cf_time='Thu Sep 2 14:34:27 EDT 1999'
You have the option to exclude the Errno, Fcntl, IO, Opcode, POSIX, or Socket extensions. To do this, modify the following line by deleting the extension you want to exclude:
extensions='Errno Fcntl IO Opcode POSIX Socket'
Enter cp config.sh.tpf config.sh to overlay the generated OS/390 UNIX config.sh file with the TPF config.sh.tpf file.
If you must rebuild miniperl for OS/390 UNIX, delete config.sh first to force it to be generated again with OS/390 UNIX values. You also must exit and log on again to clear the TPF settings made by tpf.exports.
Enter tpf.setup to run a shell script to set up for rebuilding against TPF headers and libraries. Your output will be similar to the following:
You can safely ignore the following error message:
ERROR CBC3198 ./.nnnnnnnn.c:399 #if, #else, #elif, #ifdef, #ifndef block must be ended with #endif.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile .nnnnnnnn.c. Correct the errors and try again.
To install Perl on your TPF system, do the following: Note: Program CHTP has been reserved to allow it to be used for Perl to avoid naming conflicts. If you prefer to use another program name, replace CHTP with your program name.
Link the generated Perl object files. Sample link JCL (contained in the linkperl.jcl file) has been included with the TPF patches as an example. You must change the IDs, data set names, and libraries for your particular site.
Create a loadset. Sample loadset JCL (contained in the lsetperl.jcl file) has also been included. You must also modify it for your particular site. A JCL condition code of 4 is expected because the C load module will contain no link map data.
Enter the ZOLDR LOAD and ZOLDR ACT functional messages to load and activate the loadset on your test system. (See TPF Operations for more information about the ZOLDR LOAD and ZOLDR ACT functional messages.)
Technical documentation for APAR PJ27277 (file system tools) can be found in TPF Family Libraries. For an online version of the books, go to the TPF Family Libraries section of the TPF Web site or go directly to http://www.s390.ibm.com/products/tpf/tpfid/tpfpubs.htm. The following books were updated for APAR PJ27277: