On most UNIX and Linux systems, ACUCOBOL-GT provides two ways to relink the runtime. The first is the traditional make facility for which ACUCOBOL-GT includes a Makefile. The second is with a script named makerun. makerun allows you to specify the names of libraries and objects on the command line. make is immediately familiar to most UNIX and Linux developers. Both facilities are described below.
On UNIX and Linux systems where extend® products are delivered as shared object libraries, relinking the runtime requires relinking the appropriate shared object. In the case of the runtime, this is "runcbl.so" or "runcbl.sl". On systems where extend products are delivered as statically linked executables, the runtime executable is named runcbl by default.
After relinking, be sure to move or copy the new object to the required directory. The default location is $ACUCOBOL/lib for shared object libraries, and $ACUCOBOL/bin for static libraries.
An ANSI 89-compliant C compiler supplied by the vendor of your UNIX system, either included as part of your UNIX system or as an add-on option. Check with your operating system vendor to see if the C compiler is capable of building shared libraries. If it is not, you will need a full version of the compiler to relink the ACUCOBOL library.
Using the "Make" Utility
On all supported UNIX and Linux platforms, the ACUCOBOL-GT runtime can be relinked with "make" using the Makefile included with the extend distribution.
For your convenience, two environment variables can be used to specify object files and object libraries to be added to the link line of the Makefile. Set EXTLIBS to a list of libraries, and set EXTOBJS to a list of objects. For example, the following command links the C routines in the object file "myroutines.o" into the ACUCOBOL-GT runtime:
Linking with "Make"
To create a new runtime, cd to the lib directory and type:
Using the Makerun Script
On most UNIX and Linux systems, ACUCOBOL-GT comes with a makerun script that can be used to relink the runtime. makerun is a UNIX Korn shell script that relinks the runtime executable (runcbl) or shared object ("runcbl.so" or "runcbl.sl").
The makerun command format is:
makerun [ldflags] [objects] [libraries]
where ldflags, objects, and libraries are optional arguments passed to the "ld" command as described below.
|ldflags||A list of any valid "ld" options|
|objects||A list of additional objects to be linked into the runtime.|
|libraries||A list of additional libraries to be linked into the runtime. Instead of specifying absolute paths to library files, you can also use "-L" and "-l" to specify path and library names. For example, "/home/joe/lib/acme.so" can be specified as "-L /home/joe/lib –lacme".|
For example, the following command links C routines contained in the object file "myroutines.o" into the ACUCOBOL-GT runtime:
You can also execute makerun from your own script. For example, the following script links three object files and three libraries into the ACUCOBOL-GT runtime:
#!/bin/ksh OBJDIR=/home/appuser/appobj OBJECTS="$OBJDIR/a.o \ $OBJDIR/b.o \ $OBJDIR/c.o" LIBDIR=/home/appuser/applib LIBRARIES="$LIBDIR/lib1.a \ $LIBDIR/lib2.a \ $LIBDIR/lib3.a" cd /usr/acu/lib makerun $OBJECTS $LIBRARIES
The makerun script passes the additional linker options in the EXTLIBS environment variable.
Everything specified on the makerun command line is passed to the C linker from the Makefile.
Linking with Makerun
To use the makerun script: