buildclient — Build XATMI server executable
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.
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