Sample code for building the connection endpoint lookup exit
Code snippets for compiling the source on Windows and distributed platforms.
Compiling source
You can compile the source
with any LDAP client libraries, for example, IBM® Tivoli®
Directory Server 6.3 Client libraries. This documentation assumes
that you are using Tivoli
Directory Server 6.3 client libraries.
Note: The pre-connect exit library
has been tested with the following LDAP servers:
- IBM Tivoli Directory Server V6.3
- Novell eDirectory V8.2
The following code snippets describe how to compile the exits on Windows, and other distributed platforms:
- Compiling the exit on the Windows platform
- You can use the following snippet for compiling the exit source
on Windows:
CC=cl.exe LL=link.exe CCARGS=/c /I. /DWIN32 /W3 /DNDEBUG /EHsc /D_CRT_SECURE_NO_DEPRECATE /Zl # The libraries to include LDLIBS=Ws2_32.lib Advapi32.lib libibmldapstatic.lib libibmldapdbgstatic.lib \ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib \ shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib OBJS=amqlcel0.obj all: amqlcelp.dll amqlcelp.dll: $(OBJS) $(LL) /OUT:amqlcelp.dll /INCREMENTAL /NOLOGO /DLL /SUBSYSTEM:WINDOWS /MACHINE: X86 /DEF:amqlcelp.def $(OBJS) $(LDLIBS) /NODEFAULTLIB:msvcrt.lib # The exit source amqlcel0.obj: amqlcel0.c $(CC) $(CCARGS) $*.c
Note: You might get warnings while compiling the IBM Tivoli Directory
Server 6.3 Client libraries with Microsoft Visual
Studio 2005 or above compiler, if you are using the IBM Tivoli Directory
Server 6.3 Client libraries compiled with Microsoft Visual Studio 2003 compiler.
- Compiling the exit on other distributed platforms
- You can use the following snippet for compiling the exit source
on other distributed platforms, for example, Linux®. Some compiler options might differ on
other distributed platforms.
#Make file to build exit CC=gcc MQML=/opt/mqm/lib MQMI=/opt/mqm/inc TDSI=/opt/ibm/ldap/V6.3/include XFLAG=-m32 TDSL=/opt/ibm/ldap/V6.3/lib
IBM Tivoli Directory Server ships both static and dynamic link libraries, but only one form of the libraries can be used. This script assumes that you are using the static libraries.
#Use static libraries. LDLIBS=-L$(TDSL) -libibmldapstatic CFLAGS=-I. -I$(MQMI) -I$(TDSI) all:amqlcepl amqlcepl: amqlcel0.c $(CC) -o cepl amqlcel0.c -shared -fPIC $(XFLAG) $(CFLAGS) $(LDLIBS)