Product Documentation

c-treeRTG COBOL Edition User's Guide

Previous Topic

Next Topic

Recompiling the Runtime

ACUCOBOL-GT requires the runtime to be compiled with the FairCom DB configuration enabled. The following steps will guide you through this task.

In This Section

Recompiling the Windows Runtime

Recompiling the Unix Runtime

Adding Support for --setenv Command-Line Argument to Runtime

Previous Topic

Next Topic

Recompiling the Windows Runtime

Linking the ACUCOBOL-GT runtime with the FairCom DB client libraries requires a suitable compiler installed:

  • ACUCOBOL-GT 6.X requires Microsoft Visual Studio 6.
  • ACUCOBOL-GT 7.X and V8X require Microsoft Visual Studio 2005.
  • ACUCOBOL-GT 9.X requires Microsoft Visual Studio 2008.

Follow these procedures:

  1. Copy the c-tree module ctreeacu.c into the directory that contains the ACUCOBOL-GT libraries, for example:

    copy win32\Driver\ctree.cobol\Acucobol\ctreeacu.c C:\AcuGT\lib

  2. Copy the c-tree utilities and DLLs ctutil.exe and mtclient.dll into the directory that contains the ACUCOBOL-GT binaries, for example:

    copy win32\Driver\ctree.cobol\Acucobol\mtclient.dll C:\AcuGT\bin

    copy win32\Driver\ctree.cobol\Acucobol\ctutil.exe C:\AcuGT\bin

  3. Open the VC++ project located in the ACUCOBOL-GT lib directory and edit the wrundll project by adding ctreeacu.c. To add the files, click Project from the menu, select Add to Project and select item Files.
    Locate the ACUCOBOL-GT lib directory and select ctreeacu.c.
    • ACUCOBOL-GT 6.X:

    Open the Visual Studio 6 workspace: wrun32.dsw

    • ACUCOBOL-GT 8.X:

    Open the Visual Studio 2005 solution: wrun32.sln

    ACUCOBOL-GT 9.X:

    Open the Visual Studio 2008 solution: wrun32.sln

  4. Edit the ACUCOBOL-GT file system configuration file filetbl.c located in the ACUCOBOL-GT lib directory, for example: C:\AcuGT\lib.

    There are three entries to modify:

    1. The original filetbl.c contains the entry:

    #ifndef USE_VISION

    #define USE_VISION 1

    #endif


    Add the following additional define section:

    #ifndef USE_CTREE

    #define USE_CTREE 1

    #endif

    1. The original filetbl.c contains the entry:

    extern DISPATCH_TBL v5_dispatch,...;


    Add the following extern definition:

    extern DISPATCH_TBL ct_dispatch;

    1. The original filetbl.c contains the entry:

    TABLE_ENTRY file_table[] = {

    #if USE_VISION

    { &v5_dispatch, "VISIO" },

    #endif /* USE_VISION */


    Add the following additional define section:

    #if USE_CTREE

    { &ct_dispatch, "CTREE" },

    #endif /* USE_CTREE */

  5. Re-build the ACUCOBOL-GT runtime by building the wrun32.dll library. To build this library, choose Build from the menu and select Build wrun32.dll.
  6. Copy the new wrun32.dll to the directory that contains the ACUCOBOL-GT binaries, for example C:\AcuGT\bin.
  7. Verify the link by running wrun32 –vv. This will return version information on all of the products linked into your runtime system. Ensure it reports the version of the c-tree interface. For example:

    FairCom version 11.0.xxxxx-yymmdd file system (interface v11.0.xxxxx-yymmdd)

Previous Topic

Next Topic

Recompiling the Unix Runtime
  1. Copy the c-tree module ctreeacu.c into the directory that contains the ACUCOBOL-GT libraries, for example:

    cp linux.v2.6.x86.32bit.COBOL/Driver/ctree.cobol/Acucobol/ctreeacu.c /usr/acucbl810/acugt/lib

  2. Copy the c-tree utility ctutil and the libmtclient.so library into the directory that contains the ACUCOBOL-GT binaries:

    cp linux.v2.6.x86.32bit.COBOL/Driver/ctree.cobol/Acucobol/libmtclient.so /usr/acucbl810/acugt/bin

    cp linux.v2.6.x86.32bit.COBOL/Driver/ctree.cobol/Acucobol/ctutil /usr/acucbl810/acugt/bin

  3. Edit the ACUCOBOL-GT file system configuration file filetbl.c located in the ACUCOBOL-GT lib directory, for example: /usr/acucbl810/acugt/lib.

    There are three entries to modify:

    1. The original filetbl.c contains the entry:

    #ifndef USE_VISION

    #define USE_VISION 1

    #endif

    Add the following additional define section:

    #ifndef USE_CTREE

    #define USE_CTREE 1

    #endif

    1. The original filetbl.c contains the entry:

    extern DISPATCH_TBL v5_dispatch,...;

    Add the following extern definition:

    extern DISPATCH_TBL ct_dispatch;

    1. The original filetbl.c contains the entry:

    TABLE_ENTRY file_table[] = {

    #if USE_VISION

    { &v5_dispatch, "VISIO" },

    #endif /* USE_VISION */


    Add the following additional define section:

    #if USE_CTREE

    { &ct_dispatch, "CTREE" },

    #endif /* USE_CTREE */

    NOTE: The c-tree entry must be added below the Vision entry so as to leave the Vision entry the first one in the file_table[] array.

  4. Open the file Makefile located in the ACUCOBOL-GT lib, for example: /usr/acucbl810/acugt/lib.

    Add the c-treeRTG ACUCOBOL source module to the line FSI_SUBS=, for example:

    FSI_SUBS= < ... > ctreeacu.c

    Note: There may be other items already listed in FSI_SUBS. Leave those in place and only add ctreeacu.c.

  5. Re-build the ACUCOBOL-GT runtime by running make –f Makefile.
  6. Copy the new runcbl file to the directory that contains the ACUCOBOL-GT binaries, for example /usr/acucbl810/acugt/bin. This file needs to have the execute permission set for everyone who will be using the runtime system.
  7. Verify the link by running runcbl –vv. This will return version information on all of the products linked into your runtime system. Ensure it reports the version of the c‑tree interface. For example:

    FairCom version 11.x.xxxxx-yymmdd file system (interface v11.x.xxxxx-yymmdd)

Previous Topic

Next Topic

Adding Support for --setenv Command-Line Argument to Runtime

The ACUCOBOL-GT product allows the user to introduce new command-line arguments that can be passed to the ACUCOBOL-GT runtime. The function exam_args() defined in ACUCOBOL-GT's interface to C module sub.c is called immediately upon startup and is passed the command-line arguments that were passed to the runtime.

The c-tree module ctreeacu.c contains the function ct_exam_args() that provides support for ‑‑setenv command-line argument. The ‑‑setenv command-line argument can be used to set environment variables once the ACUCOBOL-GT runtime has already been started.

To add support for ‑‑setenv command-line argument, edit the sub.c module located in the ACUCOBOL-GT lib directory, for example: /usr/acucbl810/acugt/lib.

  1. Add the ct_exam_args() prototype declaration before exam_args() definition as follows:

    int ct_exam_args(int argc, char *argv[]);

    int

    exam_args(int argc, char *argv[])

    {

    return 0;

    } /* exam_args */

  2. Change exam_args() to call ct_exam_args() function as follows:

    int

    exam_args(int argc, char *argv[])

    {

    return ct_exam_args(argc, argv);

    } /* exam_args */

  3. Re-compile the ACUCOBOL-GT runtime as described in Recompiling the Windows Runtime or Recompiling the Unix Runtime.

Once the ACUCOBOL-GT runtime supports the --setenv command-line argument, you can call the runtime passing ‑‑setenv:variable=value, for example:

Windows

wrun32.exe cobol_Tutorial1.acu --setenv:DEFAULT_HOST=CTREE

Unix

runcbl cobol_Tutorial1.acu --setenv:DEFAULT_HOST=CTREE

TOCIndex