Re: change compiler name in 4gl?
Posted in 1993
>From: bud@mtek.com (Bud Hovell) >Subject: change compiler name in 4gl? >Date: Mon, 20 Dec 93 16:37:48 GMT >X-Informix-List-Id: <news.5131> > >Can one change the name of the C-compiler name sought by Informix 4GL from >"cc" to, say, "gcc"? Is there an environmental variable that can be set? Up to 4.12, the answer was No. However, provided you used the C4GL shell script, you could always hack in an environment variable for your own use. However, if you wanted to use the I4GL programmers environment, you were snookered. With 4.12 (available from Feb, as previously discussed), one of the many changes added is the ability to set the environment variable CC to set the C compiler for the final compile and link phase of I4GL and C4GL. In fact, the whole I4GL menu system linking process now takes place using the C4GL script, so any changes made in that script will affect both command line (or makefile) compiling and interactive menu system compiling and compiling via the program compile option. There are some new options which support this. The first option is -phase. This takes a second argument which is some non-empty subset of the numbers 1, 2, 3, 4, where the subset must be contiguous (eg 12 or 234). There are now 4 phases to the compilation: Phase 1: I4GL -> ESQL/C (superset) Phase 2: ESQL/C -> C (1) Phase 3: C (1) -> C Phase 4: C -> object or executable However, if you use the I4GL environment, you will still only see phases 1, 2 and 3, and I4GL phase 2 corresponds to C4GL phases 2 and 3. What is this C (1) to C conversion? Well, 4.12 toolscan be run against 6.00 database engines -- you should use I4GL 6.00, but you can use 4.12 if you want to. And this means that table and column names can contain non-ASCII characters. You can, of course, define RECORD LIKE Table.* against these names. But C compilers don't allow such characters (or not necessarily, anyway). So we sanitise the results with a new filter program, fglc3, which is invoked in C4GL phase 3. It overwrites the C file. To make the mappings safe, we replace any non-ASCII characters not inside quoted strings with the hexadecimal value for the character, printed in upper-case hexadecimal. Almost all valid characters will be in the range A0-FF, and all ordinary identifier names are converted to lower case, so there should be no chance of producing a naming conflict. Also, by the time this translation occurs, the mangled names will not be passed to the engine; the names passed to the engine are protected by quotes. We do one other translation, and that only inside strings, and that is to convert y-umlaut (hex 0xFF) into the escape sequence \\377. This is because the Sun C compiler at any rate reads this as EOF -- it won't handle arbitrary non-ASCII data. If required, fglc3 can be used on its own: it takes the arguments: -V print version information -s ext create backup file with extension ".ext" -o overwrite input files By default, it writes the mangled file(s) to standard output. Note that fglc3 automatically inserts a "." between the name and the extension. The -o and -s options are mutually exclusive and require a filename argument. Otherwise, it processes any files specified, or standard input if there are not files. Note to Walt: the version 4.12.UC1A1 did not have this change in place. Yours verbosely, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>