Informix on Linux logo

For a change, rather than starting a series of new rants on why Informix should port their products to Linux, I'd like to spend a little time to describe how to successfully compile 4gl apps on a Linux box using Informix-4gl compiled.

I will not go into discussing why one might want to use SCO ports of Informix products under Linux further than it has been discussed in c.d.i, except for noting that on my little notebook (P133/40Mb/1.3Gb) OnLine runs a tiny bit faster than on SCO (around 5%). On the other hand, compiling 4glWorks (see sig and stroll down to my little site :-) has shown dramatic improvements: over 40% faster using the same hardware, the same development package (I use gawk on SCO too, since fglpp, on SCO's awk, preprocesses files at the amazing speed of 1 line a second!), and in the same conditions (no swapping, online down, no X, a minimal number of other processes around).

Of course, YMMV quite a lot. The fact that SCO has problems on my Echos (in particular with power saving features) doesn't mean that it won't perform well on all PC on steroids. And bear in mind that I could just be a lousy kernel tuner ;-)

Credits: Mike Jagdis deserves to be thanked for sending me his hosted environment cc.ibcs2 script, which I used as base for what I describe later, and for writing the iBCS2 module, without which we wouldn't be even talking of Informix products on Linux.

Disclaimer: You'll need valid SCO and Informix licenses, and must be prepared to refrain from using (and probably installing to start with) Informix software and the SCO development package on two different boxes at the same time. Of course, you'll be able to install both Linux and SCO on two different partitions, alternatively bootable, of the same box. SCO can mount DOS fs', and Linux happily handles SYSV (untested!) / DOS / VFAT , so either way you'll be able to move the SCO dev sys to Linux.
All this said, I still am not sure that you're not infringing either license agreement (even though SCO says nothing against using their software on a different OS)

(Stop Press Apparently SCO is now offering a license to use their binaries and libraries on other operating systems. You have been warned)

Ports: 4gl-c 4.16UC2, Esql/c 5.07.UC1, OnLine 5.08UD1 for SCO 3.2.5.0

Procedure: executables distributed with the SCO port of Informix-4gl c use shared libraries, so just to properly install 4gl you need to move the SCO development package to the Linux box. The small script below will conveniently pack it in a huge archive and create a script to fix .so symlinks on the target box.

---------------------------cut here------------------------------------------
#
#  must be run from the root directory to masquerade relative pathnames --
#  tar A flag strips / from filenames but not from target links!
#
cd /
#
# list all the files to be tarred, isolating simlinks to be created
# (tar -cPL follows the simliks but copies verbatim rather than creating
# links)
#
ls -l lib/*.a usr/lib/*.a lib/*.o usr/lib/*.o lib/*.so* usr/lib/*.so* \
 `find shlib usr/include usr/ccs -type l -print` | \
#
# this isolates .so* that should be simlinked - note that since, due to
# sorting problems, we not always get the links the right way round, we'll be
# using hard links instead -- edit scodev.lnk if that bothers you
#
sort -k 11,11 | awk '{if ($11==of) print "ln ", ol," ", $9 > "scodev.lnk"; \
                     else {of=$11; ol=$9; print $9}}' > /tmp/st$$
#
# tar, compress, remove temp files & quit
#
tar -cPLvfF - /tmp/st$$ | compress > scodev.tar.Z
rm /tmp/st$$
------------------------end cut----------------------------------------------

Of course, this is like killing mosquitos with a bazooka -- you'll be copying tons of things you won't actually use unless you plan to do serious Linux hosted SCO development. As a pointer, you can consider removing all the dialect directories under usr/include except for xpg4plus, all the X related libs/headers, or m4, make and the SCCS commands (in usr/ccs/bin).
The braver among my readers can try if OnLine 7 runs using SCO TLI libs (I strongly doubt it)

Next, move the two files on a suitable directory on the Linux box (say /scodev), unzip/untar the archive (NB note that bin has a 2 uid on SCO and 1 on Linux), run the scodev.lnk script, create the following simlinks

ln -s /scodev/lib/libprot.so.1 /lib/libprot.so.1
ln -s /scodev/usr/lib/libc.so.1 /usr/lib/libc.so.1	#easy - that won't break gcc: only placing
ln -s /scodev/usr/lib/ld.so.1 /usr/lib/ld.so.1		#SCO stuff on top of iBCS replacements

and voila` you are ready to run install4gl! (note that the dynamic link loader distributed as part of the iBCS is perfectly capable of handling the Informix utilities, and 4gl apps linked with the -shared flag load and execute without problems; however for some obscure reason they core dump at the first DATABASE statement encountered)

C4gl

At this point i4gl, form4gl and the like are all happily working. To actually use c4gl, you'll need the following two steps

Esql/c

The procedure outlined above works with esql/c too, with a notable exception: esql/c 5.0x in which, for reasons beyond my understanding, the esql script makes no use of INFORMIXC. I find none of the following suggestions entirely satisfactory, however, consider

4j's Universal compiler

I had a chance to play with the beta of the trial version 4j's universal compiler for SCO around July 1997 and I had no difficulty in getting it to work. The principle is similar to what has been discussed so far, except that 4j's utilities make use of an environmental variable named FGLCC rather than INFORMIXC.
I haven't had a chance to use the compiled version of the 4j's product, but I assume that since the trial version produces a perfectly working runner, you shouldn't find any difficulty using the full tool.
The only glitch I found was the findlib.sh utility (whose job is to determine the libraries that need to linked in the runner), which consistently produced an erroneous FGLCC in the envf4gl output file.

4j's has recently changed the distribution demo to include a fairly comprehensive installation script, and added Linux as one of the ports (even though is just a repackaged SCO port). I haven't had a chance to to try them, but I would expect that the combo irons out any Linux related issues


This page maintained by marco greco
(last updated Jan, 28 2004)