User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:manuals:buildclient.8

buildclient

Name

buildclient — Build XATMI server executable

Synopsis

clientclient [OPTIONS]

DESCRIPTION

Build client is a binary which compiles and links the ATMI client binary executable. Linkage does occur with Enduro/X UBF, ATMI and ATMI client libraries. The build Entry point of main() for binary is expected to be present in user sources. Either in object files or .c passed to compile command. During the compilation, resource manager XA switch name export symbol is generated and built-in in the binary. If resource manager/XA switch is not passed to the build command, NULL switch (tmnull_switch) is used. When configuration applications which uses two phase commit where build-in switch usage is required, then XA group/RM must be configured with libndrxxatmsx(8) driver, which resolves the built in symbol.

The generated source code which is linked with the binary looks like this:

/* Buildclient auto-generated code */
/*---------------------------Includes-----------------------------------*/
#include <atmi.h>
#include <xa.h>
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#define NDRX_API_EXPORT __declspec(dllexport)
#else
#define NDRX_API_EXPORT
#endif
extern struct xa_switch_t ndrxstatsw;
extern struct xa_switch_t * ndrx_xa_builtin_get(void);
expublic NDRX_API_EXPORT struct xa_switch_t *ndrx_G_p_xaswitch = &ndrxstatsw;
struct xa_switch_t * ndrx_switch_pull(void)
{
    return ndrx_xa_builtin_get();
}

The command line template, how C compiler is invoked, is following:

<CC> [$CFLAGS] -o <binary_name> <generated_source>.c [-I<$NDRX_HOME>/include
-L<NDRX_HOME>/{lib|lib64}] [<first_files>] [<RM_libs>] -latmicltbld -latmi -lubf -lnstd [<last_files>]

All filesystem path related buffers internally are set to 5120 bytes + EOS byte, thus for example if build command is longer than 5120, it will be truncated to 5120.

ENVIRONMENT

[CC]
Optional environment variable indicating which C compiler to use. If parameter is not set, the cc command is used.
[CFLAGS]
Optional C flags to be passed to C compiler during the cc execution. There is set of compiler flags that are required for certain platforms and compilers. see "PLATFORM SPECIFIC COMPILER FLAGS" section in buildserver(8) program manpage for these requirements.
[NDRX_HOME]
Optional environment variable indicating the Enduro/X installation home. If variable is set then, "-I$NDRX_HOME/include" and "-L$NDRX_HOME/lib" (or lib64) is added to the cc command line.

OPTIONS

[-C]
COBOL mode. Reserved for future use.
[-o filename]
Output file name for compiler. If not specified, then default is SERVER.
[-f firstfiles]
Arguments to be passed to compiler command line. Typically here source file names, object file names or library settings are passed. These names are included in compilation command before Enduro/X libraries (from left to right).
[-a]
Alias to -f.
[-l lastfiles]
Arguments to be passed to compiler command line. Typically here source file names, object file names or library settings are passed. These names are included in compilation command after Enduro/X libraries (from left to right).
[-r rm_name]
This is resource manager name. The resource manager according the specified name shall be configured in $NDRX_RMFILE (first priority) or $NDRX_HOME/udataobj/RM file. The file format is following rm_name:xa_switch_name:<compiler libraries>. If specified, then xa_switch_name is included in the process. Thus later libndrxxatmsx(8) XA driver can be used (set in NDRX_XA_DRIVERLIB env var, see ex_env(5)), so that driver resolves built in symbols. Compiler libraries from resource manager are passed in command line after the first files. If switch name is not specified, then default null switch tmnull_switch is reference (present in libatmi). Full format example can be seen in buildserver(8) manpage.
[-k]
Keep the the generate source code with the main function. If not set, the file is deleted when buildserver finishes.
[-t]
Server is multi-threaded. Indicates that server can be started/configured in multi-threaded mode. This flag is reserved for future use. Currently this indication is built in the binary, but not used in any other way. Will be used once Enduro/X will support multi-threaded service dispatching. Do not confuse this flag with current Enduro/X threading model, as user threads are fully supported.
[-v]
Verbose mode. This will print the build command to stderr.
[-h]
Print the help.

EXAMPLE

See atmitest/test071_buildtools/run.sh for samples. Some of them:

$ export CC=cc
$ buildclient -o atmiclt71_txn -a atmiclt71_txn.c -v -r TestSw -k \
    -f "-I../../include -L../../libatmi -L../../libubf -L../../libnstd -L ../../libatmiclt"

That would result in following compilation unit:

$ cc  -o atmiclt71_txn ndrx_bc_ANd6SM.c atmiclt71_txn.c -I../../include \
    -L../../libatmi -L../../libubf -L../../libnstd -L ../../libatmiclt \
    -L ../test021_xafull -l xadrv -latmicltbld -latmi -lubf -lnstd -lrt -ldl -lm -lc -lpthread

EXIT STATUS

0
Success
1
Failure

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd