22.12.2012 Views

z/TPF Program Management - IBM

z/TPF Program Management - IBM

z/TPF Program Management - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Create an export file<br />

EXE := custsumm<br />

<strong>TPF</strong>_OL := OS/390<br />

C_SRC := list.c<br />

maketpf_env := billing_zos<br />

maketpf_env += base_rt<br />

include maketpf.rules<br />

Note: z/OS programs do not support the use of archives and, because the<br />

programs are written to a PDS, the program name must be 8 characters<br />

or less.<br />

2. Create a source segment named /home/joe/mywork/billing/zos/src/list.c.<br />

3. Update the user control file and add a new entry for the offline Linux program<br />

named custsumm. Enter the following information on one line.<br />

custsumm;ARCHIVE;billing/zos/src/custsumm.mak;1;OS/390;<br />

NOOBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br />

Note: The control file entry uses the value OS/390 ® rather than z/OS. This was<br />

done for compatibility reasons with <strong>TPF</strong> 4.1 and the terms are<br />

considered interchangeable.<br />

See “Control files” on page 103 for more information about the control file fields<br />

and values.<br />

4. Enter the maketpf command to build the program. This assumes that a file<br />

named maketpf.cfg exists in the /home/joe/mywork/build directory.<br />

cd /home/joe/mywork/build<br />

maketpf custsumm<br />

See “maketpf utility” on page 6 for more information about the maketpf<br />

command and its options.<br />

The following task shows you how to create an export file for a CSO or BSO.<br />

Export files are used to control the entry points that are exported globally and the<br />

ones that are kept local to the object. Export files are required whenever you code<br />

APP_EXPORT := LIST in the program makefile. (An alternate way to change the<br />

scope of symbols that are global for a shared object is to use the -fvisibility<br />

compiler option. Specify -fvisibility=default to indicate that the functions in the<br />

CSO (or C/C++ functions in a BSO) are global for the shared object. Specify<br />

-fvisibility=hidden to indicate that all C/C++ functions are local except where they<br />

are coded with __attribute__((visibility(default))). )<br />

Note: Although we are using a CSO for an example, you can follow the same<br />

steps to create an export file for a BSO.<br />

If you have created a CSO named BILL as described in “Create a C shared object”<br />

on page 64 and have coded APP_EXPORT := LIST in the /home/joe/mywork/billing/<br />

rt/src/bill.mak makefile, you can create an export file by following these steps:<br />

1. Run maketpf to create a preliminary version of the export file.<br />

cd /home/joe/mywork/build<br />

maketpf bill<br />

Note: Export files present a “what came first” problem; you must link the<br />

program to be able to generate the export file, but when you code<br />

APP_EXPORT := LIST, you need an export file at link time. To work around<br />

Assemble, compile, and link (build) application programs 69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!