HOWTO link the Acucobol runtime with Eloquence ============================================== Revision: 1.1, Sept. 10, 2003 (DRAFT) This document provides instructions to link the Acucobol runtime (runcbl) with the Eloquence TurboIMAGE compatibility library. This makes the TurboIMAGE intrinsics available without requiring to load the image3k library in the program. It has been tested on the Acucobol 5.2.2 and 6.0.0 version for HP-UX 11.22 (Itanium, 64 bit) and HP-UX 11i (PA-RISC, 32 and 64 bit). Pre-requisites: 1. HP ANSI-C compiler 2. Eloquence B.07.00 is installed on the system 3. Eloquence Acucobol customizon files - eloquence.h - modified Makefile - modified direct.c Acucobol provides a lib directory to re-link the Acucobol runtime (runcbl). It contains a small C program (direct.c) that could be customized and is then compiled and linked with the Acucobol libraries. This allows to create a customized version of the Acucobol runtime. 1. Download the Eloquence Acucobol customizon files These files can be obtained from the Eloquence web server at the following location: http://www.hp-eloquence.com/download/B0700/contrib/acucobol/ ftp://ftp.hp-eloquence.com/eloq/B0700/contrib/acucobol/ Please refer to the README file for more information. 2. Install the modified files in the Acucobol lib directory. You can either install the modified files in the Acucobol lib directory, overwriting the default files or create a copy of the Acucobol lib directory. The steps below demonstrate how to create a copy of the Acucobol lib directory and unpack the files in there: $ cd /opt/acucobol/6.0.0 $ cp -rp lib lib.eq $ cd lib.eq $ tar -xf /tmp/EQ-ACU-hpux.tar This example assumes that Acucobol has been installed in the /opt/acucobol/6.0.0 directory and the Eloquence Acucobol customizon archive has been placed in the /tmp directory. This unpacks the following files: README - These instructions Makefile5-IA64 - Used with Acucobol 5.2.x, 64bit, Itanium Makefile5-PA32 - Used with Acucobol 5.2.x, 32bit, PA-RISC Makefile5-PA64 - Used with Acucobol 5.2.x, 64bit, PA-RISC Makefile6-IA64 - Used with Acucobol 6.0.0, 64bit, Itanium Makefile6-PA32 - Used with Acucobol 6.0.0, 32bit, PA-RISC Makefile6-PA64 - Used with Acucobol 6.0.0, 64bit, PA-RISC direct.c - modified direct.c file eloquence.h - Eloquence include file for direct.h $ ln -sf Makefile6-IA64 Makefile This creates Makefile as a symbolic link from Makefile6-IA64. Please use the appropriate Makefile template, depending on your CPU architecture and Acucobol version. 3. Compile, link and install the Acucobol runtime This is done with the following commands: $ make The make command compiles the sub.o and filetbl.o object files and links the runcbl executable. The screen output should be roughly the same as shown in the section "make screen output" below. $ cp -p ../bin/runcbl ../bin/runcbl.bkup This creates a backup of the previous runcbl executable with the name runcbl.bkup. $ cp runcbl ../bin/runcbl This installs the new runcbl. ---------------------------------------------------------------------- Troubleshooting ---------------------------------------------------------------------- With a pre-linked run-time, any TurboIMAGE intrinsic should be available. If an error message like below is output by runcbl, the Eloquence TurboIMAGE intrinsics have not been linked with the Acucobol runtime. *===========================================- | | | DBOPEN: Program missing or inaccessible | | COBOL error at 000029 in cust | | | | | | | --------------------------------------------- ---------------------------------------------------------------------- make screen output ---------------------------------------------------------------------- When executing make, the screen output should be substentially similar then shown below. To enhance readability, the output below has been broken into multiple lines. $ make cc -Ae +DSitanium +DD64 +O2 -DNO_ACUSQL=1 -DUSE_XML=1 \ -DELOQUENCE=1 -c sub.c cc -Ae +DSitanium +DD64 +O2 -DNO_ACUSQL=1 -DUSE_XML=1 \ -DELOQUENCE=1 -c filetbl.c cc -Ae +DSitanium +DD64 -s -o runcbl amain.o sub.o filetbl.o axml.o \ ./libruncbl.a \ ./libclnt.a ./libacvt.a ./libfsi.a ./libacuterm.a \ ./libvision.a ./libexpat.a \ -L/opt/eloquence6/lib/hpux64 -limage3k \ ./libsocks.a ./libmessage.a ./libcfg.a ./liblib.a \ ./libstdlib.a ./libmemory.a ./libz.a -lm ---------------------------------------------------------------------- Explaining the changes ---------------------------------------------------------------------- The following changes were made to the default Acucobol files. The following changes are provided in the GNU diff format. A leading - indicates the line was removed, a leading + indicates a line was added. Changes to direct.c ------------------- The eloquence.h include file is included if the ELOQUENCE preprocessor variable is nonzero. The eloquence.h include file defines the Eloquence_IMAGE_intrinsics macro which is then added to the LIBDIRECT array. This makes the Eloquence turboIMAGE intrinsics known to Acucobol. --- direct.c.bkup 2002-09-09 16:25:23.000000000 +0200 +++ direct.c 2003-09-10 23:37:16.000000000 +0200 @@ -78,7 +78,14 @@ /* "int". On the other hand, S9(9) data items are "long" on some */ /* machines and will not match an "int" parameter. */ +#if ELOQUENCE +#include "eloquence.h" +#endif + struct DIRECTTABLE LIBDIRECT[] = { +#if ELOQUENCE +Eloquence_IMAGE_intrinsics +#endif { NULL, NULL, 0 } }; Changes to the Makefile ----------------------- First, the ELOQUENCE_FLAGS variable to the CFLAGS make variable. The CFLAGS variable is passed to the C combiler. The ELOQUENCE_FLAGS make variable is set to the value -DELOQUENCE=1 which causes the ELOQUENCE variable to be set to a non-zero value in the C pre-processor. The ELOQUENCE_LIBDIR make variable is set to the directory where the Elouence image3k shared library resides. On HP-UX, the location depends on the architecture (PA-RISC or Itanium) and if you create a 32 or 64 bit runcbl. Archtecture Bits Location ----------- ---- ----------------------------- PA-RISC 32 /opt/eloquence6/lib/pa11_32 PA-RISC 64 /opt/eloquence6/lib/pa20_64 Itanium 64 /opt/eloquence6/lib/pa20_64 The ELOQUENCE_LIB make variable specifies the required options to link against the Eloquence image3k library. It is subsequently passed to the compiler/linker. To disable the use of Eloquence, you may simply place a comment in front of the three lines, defining the ELOQUENCE_FLAGS, ELOQUENCE_LIBDIR and ELOQUENCE_LIB make variables. --- Makefile.bkup 2003-04-23 22:39:54.000000000 +0200 +++ Makefile 2003-09-11 00:53:33.000000000 +0200 @@ -9,7 +9,7 @@ # PMK: 146 CC = cc -Ae +DSitanium +DD64 -CFLAGS = +O2 $(ACUSERVER_FLAGS) $(ACUCONNECT_FLAGS) $(ACUSQL_FLAGS) $(XML_FLAGS ) +CFLAGS = +O2 $(ACUSERVER_FLAGS) $(ACUCONNECT_FLAGS) $(ACUSQL_FLAGS) $(XML_FLAGS ) $(ELOQUENCE_FLAGS) LDFLAGS = -s SHELL = /bin/sh @@ -115,6 +115,15 @@ #ACUSQL_LIBS = $(ACU_LIBDIR)/libesql.a $(ACUSQL_ODBC_LIB) # +# Eloquence configuration +# + +# Use the following three lines for an Eloquence-ENABLED runtime: +ELOQUENCE_FLAGS = -DELOQUENCE=1 +ELOQUENCE_LIBDIR = /opt/eloquence6/lib/hpux64 +ELOQUENCE_LIB = -L$(ELOQUENCE_LIBDIR) -limage3k + +# # File System Interface configuration # @@ -134,6 +143,7 @@ $(ACUSQL_LIBS) \ $(CICS_LIB_USE) \ $(MQSERIES_LIB_USE) \ + $(ELOQUENCE_LIB) \ $(ACME_LIB) NOTE: A TAB charcter _must_ be used for leading space in a Makefile. Otherwise this results in a make syntax error.