How to build an EAB as shared library on Linux with Gen
search cancel

How to build an EAB as shared library on Linux with Gen

book

Article ID: 217304

calendar_today

Updated On:

Products

Gen

Issue/Introduction

Want to build an EAB (External Action Block) as a shared library on Linux for Gen.  How to set the options for the Linux Build Tool (Implementation Toolset) to include the EAB as a shared library? 

Environment

Release : 8.6

Component : CA Gen Build Tool

Resolution

This is a sample guide to building a Gen External Action Block (EAB) in a shared library on Linux.
Note that it is an example, application users/developers are required to have knowledge of the C coding language, compiler and linker used on the system. Additionally, they must have a knowledge of Gen and the Build Tool.

1. After modifying the generated External Action Block source code, need to compile it.
For an example of the compiler options to be used, look at the output of building a Gen load module on Linux.

Here is an example:

 gcc -m64 -fPIC -DIEF_LINUX -DIEF_ORACLE -DIEF_PROLOGUE -I./ -I/home/it/gen86-Rollup/runtime/include -I/usr/include -D_XOPEN_SOURCE_EXTENDED=1 -D_XOPEN_SOURCE -DSNPLOG -DNOTRACE -DBM_RT -c <EAB Source code module>.c

NOTE: If any third party references which includes header files were added as part of the modification to the source code, the locations of these header files will need to be added as a '-I' parameter.


2. To build the shared library on Linux,  call the C++ linker using something like the following:

     g++ -shared -m64 -o /<Path to where you want the library put>/lib<shared library name>.so <EAB object file>
  
Example:   g++ -shared -m64 -o /opt/GEN/eablib/libEAB1.so EAB1.o

3. Modify the build tool profile to include the library built in step #2 when building the Gen load module:

Example: 
     If the user profile file is user.test123.profile  add the line below based on the examples above:
        test123.C.LOC.EXTERNAL_LIB=-L/opt/GEN/eablib -lEAB1

4. When executing the build tool on Linux add a '-f test123' (using the example from #3) so that the shared library just built will be linked into the <load module>

NOTE:  Again, any third party libraries may need to be referenced in the link so that the resulting shared external action block library will be complete. They would need to be referenced in the LOC.EXTERNAL_LIB token.
Example:
    test123.C.LOC.EXTERNAL_LIB=-L/opt/GEN/eablib -lEAB1 -L$<Third Party Library location> -l<library>

Please consult the user manuals for the linker on the system for more details.