Tutorials for Developing a BEA Tuxedo Application
Step 2: Building Servers in STOCKAPP
buildserver is used to put together an executable server. Options identify the names of the output file, the input files provided by the application, and various libraries that permit you to run a BEA Tuxedo system application in a variety of ways.
buildserver with the -C option invokes the cobcc command. The environment variables ALTCC and ALTCFLAGS can be set to name an alternative compile command and to set flags for the compile and link edit phases. The key buildserver command line options are illustrated in the examples that follow.
The buildserver command is used in STOCKAPP.mk to compile and build each server in the stock application. (Refer to the buildserver(1) in BEA Tuxedo Command Reference for complete details.)
How to Build the BUYSELL Server
The BUYSELL server is derived from files that contain the code for the BUYSR and SELLSR functions. The BUYSELL server is first compiled to a BUYSELL.o file before supplying it to the buildserver command so that any compile-time errors can be clearly identified and dealt with before this step.
- Create the BUYSELL.o file (performed for you in STOCKAPP.mk). The
buildserver command that was used to build the BUYSELL server follows:
buildserver -C -v -o BUYSELL -s SELLSR -f SELLSR.cbl -s BUYSR -f BUYSR.cbl
The explanation of the command line options follows:
- The -C option is used to build servers with COBOL modules.
- The -v option is used to specify the verbose mode. It writes the cc command to its standard output.
- The -o option is used to assign a name to the executable output file. If no name is provided, the file is named SERVER.
- The -s option is used to specify the service names in the server that are available to be advertised when the server is booted. If the name of the function that performs a service is different from the service name, the function name becomes part of the argument of the -s option. In the STOCKAPP, the function name is the same as the name of the service so only the service names themselves need to be specified. It is our convention to specify all uppercase for the service name. However, the -s option of buildserver does allow you to specify an arbitrary name for the processing function for a service within a server. Refer to the buildserver(1) in BEA Tuxedo Command Reference for details. It is also possible for the administrator to specify that only a subset of the services that were used to create the server with the buildserver command is to be available when the server is booted. For more information, refer to the Administering a BEA Tuxedo Application at Run Time and Setting Up a BEA Tuxedo Application.
- The -f option specifies the files that are used in the link-edit phase. Also refer to the -l option on the buildserver reference page. For more detail information on both of these options refer to the Building Servers in Programming a BEA Tuxedo Application Using COBOL. There is a significance to the order in which the files are listed. The order is dependent on function references and in what libraries the references are resolved. Source modules should be listed ahead of libraries that might be used to resolve their references. If these are .cbl files, they are first compiled. Object files can be either separate .o files or groups of files in archive (.a) files. If more than a single filename is given as an argument to a -f, the syntax calls for a list enclosed in double quotes. You can use as many -f options as you need.
- The -s option names the SELLSR and BUYSR services to be the services that comprise the BUYSELL server. The -o option assigns the name BUYSELL to the executable output file and the -f option specifies that the SELLSR.cbl and the BUYSR.cbl files are to be used in the link edit phase of the build.
Servers Built in STOCKAPP.mk
The topics on creating the STOCKAPP servers are important to your understanding of how the buildserver command is specified. However, in actual practice you are apt to incorporate the build into a makefile; that is the way it is done in STOCKAPP.
See Also
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
|