|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Compiling a Channel Exit with GCC on AIX |
« View previous topic :: View next topic » |
Author |
Message
|
TonyD |
Posted: Tue Jan 20, 2004 10:04 pm Post subject: Compiling a Channel Exit with GCC on AIX |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
Could anyone give me the commands for doing this?.. |
|
Back to top |
|
 |
EddieA |
Posted: Tue Jan 20, 2004 10:46 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Have you looked in the Intercommunication Guide. There's a section called "Writing and compiling channel-exit programs".
But also, the manuals state that this is the only supported compiler for AIX: IBM VisualAge C++ Professional for AIX V5.0.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Michael Dag |
Posted: Wed Jan 21, 2004 5:12 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Following worked for me... (not a programmer so was on trail and error)
/usr/vac/bin/cc -G -I/usr/include -I/usr/mqm/inc -o XXXexit XXXexit.c
Michael |
|
Back to top |
|
 |
JasonE |
Posted: Wed Jan 21, 2004 6:43 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
For a sample exit we have played with, here is something from the comments. Dont quote me and I havent tried these on any platform so try them at your own risk
Note: amqscsx.c was the channel exit name, and SecurityExit was the entrypoint exported.
Code: |
/* Windows NT (Visual C): */
/* ********************** */
/* set MQBASEDIR=C:\Program Files\IBM\WebSphere MQ */
/* cl amqscsx.c "%MQBASEDIR%\tools\lib\mqmvx.lib" */
/* wsock32.lib /I "%MQBASEDIR%\tools\c\include" /MD /LD */
/* */
/* LINUX (GCC): */
/* ************ */
/* gcc -o amqscsx_r amqscsx.c -shared */
/* */
/* AIX: */
/* **** */
/* echo "#!\nSecurityExit\nMQStart" > amqscsx.exp */
/* cc -o amqscsx amqscsx.c -H512 -T512 -bM:SRE */
/* -bE:amqscsx.exp -e MQStart */
/* */
/* Solaris: */
/* ******** */
/* cc -o amqscsx amqscsx.c -KPIC -G */
/* */
/* HPUX: */
/* ***** */
/* c89 -c +z +e amqscsx.c */
/* ld -o amqscsx amqscsx.o +b : +IMQStart +eMQStart */
/* +ISecurityExit +eSecurityExit -b */ |
Note it also includes the following, I dont understand why!:
Code: |
#if (MQAT_DEFAULT == MQAT_WINDOWS_NT)
__declspec( dllexport ) void MQENTRY Start(){;}
#else
MQENTRY Start(){;}
#endif |
And the main entrypoint code:
Code: |
/*********************************************************************/
/* Use declspec on Windows to export SecExitFunc as SecurityExit */
/*********************************************************************/
#if (MQAT_DEFAULT == MQAT_WINDOWS_NT)
__declspec( dllexport ) void MQENTRY SecurityExit(
PMQVOID pChannelExitParms,
PMQVOID pChannelDefinition,
PMQLONG pDataLength,
PMQLONG pAgentBufferLength,
PMQVOID pAgentBuffer,
PMQLONG pExitBufferLength,
PMQPTR pExitBufferAddr)
{
#else
/*********************************************************************/
/* Functions exported by default or using compiler flags on UNIX */
/* platforms, so wrapper defined to map SecurityExit to SecExitFunc */
/*********************************************************************/
MQENTRY SecurityExit(
PMQVOID pChannelExitParms,
PMQVOID pChannelDefinition,
PMQLONG pDataLength,
PMQLONG pAgentBufferLength,
PMQVOID pAgentBuffer,
PMQLONG pExitBufferLength,
PMQPTR pExitBufferAddr)
{
#endif
...code goes here...
}
|
|
|
Back to top |
|
 |
TonyD |
Posted: Wed Jan 21, 2004 1:40 pm Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
Thanks guys....my question was specifically with regard to the snytax of commands, i.e. compile and link options, for using the GCC compiler rather than the IBM AIX one. Although not supported we have used it successfully for other programs. I had checked the section in the Intercomm manual but the supplied sample commands are not applicable to GCC. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|