시작하기 전에
C로 쓰여진 사용자 정의 확장이 있어야 합니다. 이것은 샘플 노드 파일에서 설명한 제공된 샘플 노드 중 하나이거나 샘플 구문 분석기 파일에서 설명된 샘플 구문 분석기 또는 C로 메시지 처리 또는 출력 노드 작성, C로 입력 노드 작성 및 C로 구문 분석기 작성의 지시사항을 사용하여 사용자 자신이 작성한 노드나 구문 분석기일 수 있습니다. 사용자 정의 노드 이름은 <nodename>.lil 형식이어야 합니다.
이 절에서는 지원되는 모든 플랫폼용 사용자 정의 정의 확장 구성요소를 컴파일하는 방법에 대한 정보를 제공합니다.
본 지시사항에서 사용된 파일 이름은 제공된 샘플의 파일 이름입니다. 자체 사용자 정의 확장 컴파일하는 경우, 이 파일 이름을 자체 파일 이름으로 바꾸어야 합니다.
사용자 정의 확장 구성요소를 컴파일하기 전에 사용자의 운영 체제에 의해 지원되는 적절한 컴파일러가 있는지 확인하십시오. 적절한 컴파일러의 예제는 다음과 같습니다.
Windows의 경우, Microsoft Visual C++ .NET 2003
AIX의 경우, AIX용 VisualAge® C++ 버전 6.0
HP-UX의 경우, HP ANSI C 03.52
Linux(x86 플랫폼) 및 Linux(zSeries 플랫폼) 2.4 Kernel 및 2.6 Kernel의 경우, Gnu g++ 버전 3.2 이상
Linux(POWER 플랫폼)의 경우, Gnu g++ 버전 3.3 이상
Solaris x86-64의 경우, Sun Studio 10
z/OS Language Environment (LE) z/OS 1.5, z/OS 1.6의 경우, z/OS C/C++ 1.5 이상
기존에 고객이나 Third-Party에서 제공한 사용자 정의 확장 구성요소 라이브러리를 수정하거나 다시 컴파일하지 않아도 WebSphere Message Broker 브로커에서 실행되지만, Workbench에서 이를 수동으로 작성해야 합니다.
지원되는 각 플랫폼에서 사용자 정의 확장 구성요소의 소스를 컴파일하면 브로커가 사용자 정의 확장 구성요소를 구현하는 데 필요한 LIL(oadable implementation library) 파일이 작성됩니다.
cd install_dir\sample\extensions\nodes\ (Windows) cd install_dir/sample/extensions/nodes(Linux 및 UNIX 플랫폼)
cl /VERBOSE /LD /MD /Zi /I. /I..\..\..\include\plugin SwitchNode.c BipSampPluginUtil.c Common.c NodeFactory.c TransformNode.c -link /DLL ..\..\..\lib\imbdfplg.lib /OUT:SwitchNode.lil
xlc_r \ -I. \ -I /opt/IBM/mqsi/6.0/include/plugin \ -c SwitchNode.c \ -o SwitchNode.o xlc_r \ -I. \ -I /opt/IBM/mqsi/6.0/include/plugin \ -c BipSampPluginUtil.c \ -o BipSampPluginUtil.o xlc_r \ -I. \ -I /opt/IBM/mqsi/6.0/include/plugin \ -c Common.c \ -o Common.o xlc_r \ -I. \ -I /opt/IBM/mqsi/6.0/include/plugin \ -c NodeFactory.c \ -o NodeFactory.o xlc_r -qmkshrobj \ -bM:SRE \ -bexpall \ -bnoentry \ -o SwitchNode.lil SwitchNode.o BipSampPluginUtil.o Common.o NodeFactory.o \ -L /opt/IBM/mqsi/6.0/lib -l imbdfplg chmod a+r SwitchNode.lil
cc +z \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c BipSampPluginUtil.c \ -o <output_dir>/BipSampPluginUtil.o cc +z \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c Common.c \ -o <output_dir>/Common.o cc +z \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c NodeFactory.c \ -o <output_dir>/NodeFactory.o cc +z \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c SwitchNode.c \ -o <output_dir>/SwitchNode.o cc +z \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c TransformNode.c \ -o <output_dir>/TransformNode.o ld -b \ -o <output_dir>/SwitchNode.lil \ <output_dir>/BipSampPluginUtil.o \ <output_dir>/Common.o \ <output_dir>/NodeFactory.o \ <output_dir>/SwitchNode.o \ <output_dir>/TransformNode.o \ -L <install_dir>/lib \ -L <install_dir>/xml4c/lib \ -L <install_dir>/merant/lib \ -L <install_dir>/jre/lib/PA_RISC2.0 \ -L <install_dir>/jre/lib/PA_RISC2.0/server \ -l imbdfplg chmod a+r <output_dir>/SwitchNode.lil
다음과 같이 지원되는 C 컴파일러를 사용하여 Linux에서 사용자 정의 노드를 컴파일하고 링크하십시오. 행은 읽기 쉽도록 하기 위해 여러 행으로 분리되었습니다. 각 명령을 단일 입력 행에 입력하십시오.
/usr/bin/g++ -c -fpic -MD -trigraphs -I. -I/opt/mqsi/include -I/opt/mqsi/include/plugin -DLINUX -D__USE_GNU -D_GNU_SOURCE TransformNode.c /usr/bin/g++ -c -fpic -MD -trigraphs -I. -I/opt/mqsi/include -I/opt/mqsi/include/plugin -DLINUX -D__USE_GNU -D_GNU_SOURCE SwitchNode.c /usr/bin/gcc -c -fpic -MD -trigraphs -I. -I/opt/mqsi/include -I/opt/mqsi/include/plugin -DLINUX -D__USE_GNU -D_GNU_SOURCE BipSampPluginUtil.c /usr/bin/g++ -c -fpic -MD -trigraphs -I. -I/opt/mqsi/include -I/opt/mqsi/include/plugin -DLINUX -D__USE_GNU -D_GNU_SOURCE Common.c /usr/bin/g++ -c -fpic -MD -trigraphs -I. -I/opt/mqsi/include -I/opt/mqsi/include/plugin -DLINUX -D__USE_GNU -D_GNU_SOURCE NodeFactory.c /usr/bin/g++ -o samples.lil TransformNode.o SwitchNode.o BipSampPluginUtil.o Common.o NodeFactory.o -shared -lc -lnsl -ldl -L/opt/mqsi/lib -limbdfplg이 명령은 TransformNode 및 SwitchNode 오브젝트를 제공하는 samples.lil 파일을 작성합니다.
#ifdef __cplusplus extern "C"{ #endif void LilFactoryExportPrefix * LilFactoryExportSuffix bipGetParserFactory() { ... ... } #ifdef __cplusplus } #endif
cc -mt \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c SwitchNode.c \ -o <output_dir>/SwitchNode.o cc -mt \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c BipSampPluginUtil.c \ -o <output_dir>/BipSampPluginUtil.o cc -mt \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c NodeFactory.c \ -o <output_dir>/NodeFactory.o cc -mt \ -I. \ -I<install_dir>/include \ -I<install_dir>/include/plugin \ -c Common.c \ -o <output_dir>/Common.o cc -G \ -o <output_dir>/SwitchNode.lil \ <output_dir>/SwitchNode.o \ <output_dir>/BipSampPluginUtil.o \ <output_dir>/NodeFactory.o \ <output_dir>/Common.o \ -L <install_dir>/lib / -l imbdfplg chmod a+r <output_dir>/SwitchNode.lil
export _CC_STEPS=-1아니면 다음과 같이 이 두 행을 Makefile에 추가하여 내보낼 수 있습니다.
_CC_STEPS=-1 .EXPORT : _CC_STEPS
다음과 같이 지원되는 C 컴파일러를 사용하여 z/OS에서 사용자 정의 노드를 컴파일하고 링크하십시오.
cc -c \ -Wc,DLL -g -W0,long,langlvl\(extended\),EXPORTALL,TARGET\(OSV2R8\),float\(ieee\) \ -Wc,xplink \ -W0,LIST\(./SwitchNode.lst\) \ -I. -I${install_dir}/include \ -I${install_dir}/include/plugin \ -I${install_dir}/sample/include \ -I${install_dir}/sample/plugin \ -o ./SwitchNode.o ./SwitchNode.c
cc -c \ -Wc,DLL -g -W0,long,langlvl\(extended\),EXPORTALL,TARGET\(OSV2R8\),float\(ieee\) \ -Wc,xplink \ -W0,LIST\(./SwitchNode.lst\) \ -I. -I${install_dir}/include \ -I${install_dir}/include/plugin \ -I${install_dir}/sample/include \ -I${install_dir}/sample/plugin \ -o ./BipSampPluginUtil.o ./BipSampPluginUtil.c
cc -c \ -Wc,DLL -g -W0,long,langlvl\(extended\),EXPORTALL,TARGET\(OSV2R8\),float\(ieee\) \ -Wc,xplink \ -W0,LIST\(./SwitchNode.lst\) \ -I. -I${install_dir}/include \ -I${install_dir}/include/plugin \ -I${install_dir}/sample/include \ -I${install_dir}/sample/plugin \ -o ./Common.o ./Common.c
cc -c \ -Wc,DLL -g -W0,long,langlvl\(extended\),EXPORTALL,TARGET\(OSV2R8\),float\(ieee\) \ -Wc,xplink \ -W0,LIST\(./SwitchNode.lst\) \ -I. -I${install_dir}/include \ -I${install_dir}/include/plugin \ -I${install_dir}/sample/include \ -I${install_dir}/sample/plugin \ -o ./NodeFactory.o ./NodeFactory.c
cc \ -Wl,DLL -g -Wl,p,map -Wl,LIST=ALL,MAP,XREF,REUS=RENT \ -Wl,xplink \ -o ./SwitchNode.lil ./SwitchNode.o ./BipSampPluginUtil.o \ ./Common.o ./NodeFactory.o \ ${install_dir}/lib/libimbdfplg.x
다음 명령을 실행하여 사용자 정의 확장의 파일 권한을 그룹 읽기 및 실행으로 설정하십시오.
chmod a+rx {output_dir}/SwitchNode.lil