Creating a BDS Informix runner for OnLine 5.20 under AIX 5.2 with gcc
"McGrath, Colin" <[email protected]> Fri, 8 Sep 2006 15:19:27 -0500
| Newsgroups | gmane.comp.lang.4gl.fourjs.user |
|---|---|
| Message-ID | <[email protected]> |
The fine folks at Four-Js helped me through a problem, and I thought I'd
pass the solution along in case any one else happens to have the same
configuration:
We are running Online 5.20, and have CDKS Version 2.90 (and 4GL 7.32) on
a machine running AIX 5.2.
We have the gcc compiler.
To create a BDS Informix runner (with the fglmkrun script), I had
originally used the following command:
> > fglmkrun -o ifxrunner -d ix501 -l esql -v
> >
> > 4GL Virtual Machine Builder
> >
> > Selecting standard C extension interface...
> > /fgl2c/f4gl_3.54/lib/fglExt.o
> >
> > Runner creation parameters :
> > Output file : ifxrunner
> > Database interface : ix501
> > Language support library : /fgl2c/f4gl_3.54/lib/libascii.a
> > C extension file : /fgl2c/f4gl_3.54/lib/fglExt.o
> >
> > Linking Informix 5.01 runner...
> >
> > esql -o ifxrunner /fgl2c/f4gl_3.54/lib/fglExt.o
> > /fgl2c/f4gl_3.54/lib/fglrun.o /fgl2c/f4gl_3.54/lib/libfglr.a
> > /fgl2c/f4gl_3.54/lib/libf2c.a /fgl2c/f4gl_3.54/lib/libix501.a
> > /fgl2c/f4gl_3.54/lib/libf2c.a /fgl2c/f4gl_3.54/lib/libascii.a -lm
> > -ldl
> > -lsupc++ /fgl2c/f4gl_3.54/lib/libgcc.a
> >
> >
> > Runner successfully created.
But when I ran a 4GL program using that runner, cursors fetching data
from our Informix database didn't grab the data, and the sqlca.sqlcode
value returned from the fetch was a large negative value, (not 0 nor
100).
But when the informix runner was created with "-d ifx9xx" instead of
with "-d ix501", the proper sqlca.sqlcodes are now returned when we
fetch/add/update, etc.
The explaination I got from Four-Js tech support was:
> Since you are linking with -l esql which will be coming from your CSDK
that
> is why I suggested you use ifx9 according to your version.
> Once you are linking with the right driver then your lower level ODI
> will be taking care of the database interface which in your case is
online
> 5.20.
Because we are using the gcc compiler instead of the AIX xlc c-code
compiler, I also had to make some other changes:
In the 4JS "envcomp" script:
export CC="gcc -maix64"
export FGLCC="$CC"
export INFORMIXC="$CC"
export FGLLIBSYS="-lm -ldl -lsupc++"
export OBJECT_MODE=64
In the Informix "esql" script:
From:
< CC="${INFORMIXC=cc} -qchars=signed -q64 -qlanglvl=ansi
-qalign=natural -qcheck=nullptr -qmaxmem=-1 -qspill=2000 -D_H_LOCALEDEF"
To:
> CC="${INFORMIXC=cc} -fwritable-strings -D_H_LOCALEDEF -DAIX5L
-Wl,-b64"
< STATICFLAGS="$STATICFLAGS -brtl"
---
> STATICFLAGS="$STATICFLAGS -Wl,-brtl"
< exec $CC -I$INFDIR/incl/esql $INCLUDE -brtl $A $BO
$LIBPATHS $SLIB $ALIB $GLIB $OLIB $GLSLIB $SYSNLIB $SYSLIB $ESQLDB2
$CHKAPI $GLXLIB $THRLIB
---
> exec $CC -I$INFDIR/incl/esql $INCLUDE -Wl,-brtl $A $BO
$LIBPATHS $SLIB $ALIB $GLIB $OLIB $GLSLIB $SYSNLIB $SYSLIB $ESQLDB2
$CHKAPI $GLXLIB $THRLIB
I was also able to create a BDS runner with C code extensions, by first
compiling the .c files with esql, then running:
fglmkrun -d ifx9xx -l esql -o fglgui -ext myExt.c -aob "usr_funcs.o
blob2blob.o blob2char.o char2blob.o"
--
Colin