|
Compiling programs |
|
|
XFRAME suite provides some scripts to make programmers work easier. This chapter briefly describes the most important tools for XCICS program development. For more detailed information about these tools, please refer to the Programmer's Tools book. Compiling COBOL programs The COBOL programs can be easily compiled by means of the xcob compiler script, which provides a set of facility to speed up program development and compiling. Normally, once correctly configured, an on-line program can be compiled simply issuing: xcob [options] <PROGRAM> I.e. # xcob -sua PRGM0010.pre Compiling PL/I programs PL/I programs can be compiled by means of the xpli compiler script, which provides an easy interface to XCICS translator and Liant PL/I compiler. Once configured, a PL/I program may be compiled issuing: xpli [options] <PROGRAM> Compiling C programs There is no specific script for c compiling, because there are to many C compilers available. Therefore, to compile C programs you have to follow these steps:
Translate CICS commands First of all, CICS commands must be translated into C commands with xpre. It must be invoked with the option --language=c, to activate C language parser. Compile C source Then translated C source have to be compiled into PIC (Position Independent Code), with the C compiler (cc or gcc). The C compiler must be invoked adding the XFRAME headers path to the include search list and properly defining the HWFLAG and OSFLAG symbols, according to the XFRAME configuration. Create the shared library The code object obtained from the compiling, must be included into a shared library. UNIX/Linux XFRAME provides an include for makefiles to define configuration dependant symbols and commands for program compiling: xport.make. Programmers simply have to include this file in their makefiles. # Windows On Windows systems, XFRAME provides an NMAKE compatible source to be included in user NMAKE makefiles, that sets some NMAKE variable to compile and link C/CICS programs correctly. This file is named xframe.nmake and may be found in the directory %XFRAMEHOME%/include. In your makefile, you have to:
Example # If you plan to build your C/CICS programs with Microsoft Visual Studio, you may use either makefile based project types or DLL project types. In this case rememeber to include the settings contained in xframe.nmake in the your Visual Studio project. Compiling Java programs Java programs may be compiled directly using JDK compiler, the javac command. Simply add to the following jars to classpath:
I.e. javac -classpath $XFRAMEHOME/lib/hdm.jar:$XFRAMEHOME/lib/xcics.jar:. JavaCicsClass.java Of course, Java programmers may use ant <!-- build.xml -->
|