Building libraries for use with TXSeries for Multiplatforms
Use this information when building libraries for use with TXSeries® for Multiplatforms.
Pre-built switch load files are shared libraries (called DLLs on the
Windows system) that you can use with CICS® programs, which require a 2-phase commit transaction by
using the XA protocol. The names of these pre-built libraries are in the table Essential code for CICS applications: XA initialization routine. Sample
source code is also supplied in the following directories:
where MQ_INSTALLATION_PATH is the directory in which you
installed IBM® MQ.
Platform | Directory | Source file |
---|---|---|
AIX® and Linux® | MQ_INSTALLATION_PATH/samp/ | amqzscix.c |
Windows | MQ_INSTALLATION_PATH\Tools\c\Samples | amqzscin.c |
Note: You must use a CICS switch load file that has been built against the version of IBM MQ that the switch load file is used with.
To build the switch load file from the sample source, follow the instructions appropriate for
your operating system:
- AIX
- Issue the following command:
export MQM_HOME=/usr/mqm echo "amqzscix" > tmp.exp xlc_r $MQM_HOME/samp/amqzscix.c -I/usr/lpp/cics/include -I$MQM_HOME/inc -e amqzscix -bE:tmp.exp -bM:SRE -o amqzsc /usr/lpp/cics/lib/regxa_swxa.o -L$MQM_HOME/lib -L/usr/lpp/cics/lib -lcicsrt -lEncina -lEncServer -lpthreads -lsarpc -lmqmcics_r -lmqmxa_r -lmqzi_r -lmqmcs_r rm tmp.exp
- Linux platforms
- Issue the following
command:
gcc -m32 -shared -fPIC -o amqzscix amqzscix.c \-IMQ_INSTALLATION_PATH/inc -I CICS_INSTALLATION_PATH/include \-LMQ_INSTALLATION_PATH/lib -Wl,-rpath=MQ_INSTALLATION_PATH/lib \-Wl,-rpath=/usr/lib -Wl,-rpath-link,/usr/lib -Wl,--no-undefined -Wl,--allow-shlib-undefined \-L CICS_LIB_PATH/regxa_swxa.o \-lpthread -ldl -lc -shared -lmqzi_r -lmqmxa_r -lmqmcics_r -ldl -lc
- Windows
- Follow these steps:
- Use the cl command to build amqzscin.obj by compiling at least the following variables:
cl.exe -c -I EncinaPath\include -I MQ_INSTALLATION_PATH\include -Gz -LD amqzscin.c
- Create a module definition file named mqmc1415.def, which contains the
following lines:
LIBRARY MQMC4SWI EXPORTS CICS_XA_Init
- Use the lib command to build an export file and an import library by using at
least the following option:
If the lib command is successful then an mqmc4swi.exp file is also built.lib -def:mqmc4swi.def -out:mqmc4swi.lib
- Use the link command to build mqmc4swi.dll by using at least the following
option:
link.exe -dll -nod -out:mqmc4swi.dll amqzscin.obj CicsPath\lib\regxa_swxa.obj mqmc4swi.exp mqmcics4.lib CicsPath\lib\libcicsrt.lib DcePath\lib\libdce.lib DcePath\lib\pthreads.lib EncinaPath\lib\libEncina.lib EncinaPath\lib\libEncServer.lib msvcrt.lib kernel32.lib
- Use the cl command to build amqzscin.obj by compiling at least the following variables: