Re: Problem compiling 4gl/cgi when I don't have esql
Posted in 1996
This was covered in a previous posting from me in December 1995. I attach my records on the subject... Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >Date: Tue, 28 May 1996 16:56:57 -0500 >From: dboothby@isd.state.in.us (DONALD BOOTHBY) >X-Informix-List-Id: <list.10035> > >I thought there was discussion about the fact that the I-4GL comes >with the esql compiler. Can anyone refresh my memory about this? > >Details: I-4GL 6.01.UD2 > DSA 7.11.UC1 > no ESQL > >The precise error during a make was: > >Compiling: cgiprintblob.ec >/bin/sh: /usr/users/informix/bin/esql: not found >make: *** [lib4glcgi.a(cgiprintblob.o)] Error 1 =========================================================================== From: hlt@napcc-hp.cvm.uiuc.edu (Harold Trammel) Date: 21 Dec 95 20:00:36 GMT X-Informix-List-Id: <news.19855> I downloaded the latest versions of the Informix WWW Freeware. I followed the instructions and read the Informix CGI.FAQ. We only have the Informix-4GL/RDS and do not have esql/c. The makefile that comes with the package appears to expect esql regardless. There are 6 .ec files that my system cannot handle (obviously?). =========================================================================== Date: Thu Dec 21 18:12:22 1995 From: johnl (Jonathan Leffler) Subject: Re: cgi_rds problems w/o esql/c I'll let you into a minuscule secret -- you don't really need ESQL/C after all, but you do have to fix the source code, file names and the makefile for the build to work without ESQL/C. As far as I can see, the files in question are: cgiprintblob.ec icgiencode.ec icgimimetype.ec icgidecode.ec icgigetvalue.ec icgiprintblob.ec None of these contain executable ESQL/C statements. They are named as ESQL/C files to simplify compilation; the esql script provides the correct -I directives. To fix the problem, rename these files as .c files. Edit them, replacing '$include xyz;' by '#include "xyz.h"'. Remove stray $ signs from variable declarations. Edit the makefile lib4glcgi.mak: change the suffixes in the macros CGIU_ECFILES and IECFILES from ".ec" to ".c". Change the macro for UEOBJ to use ".c" in place of ".ec". Change the macros for ICECFILES and UCECFILES so that the RHS of the macro is empty; this means that your carefully produced .c files don't get cleaned up for you. I haven't done the necessary testing to be certain that that's all you have to do, but there's a reasonable chance. It assumes that you have, or can locate, copies of the sqltypes.h and locator.h headers -- if you can't, you are completely stuck. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> Subsequently, Harold Trammel wrote: > On Thu, 21 Dec 1995, Jonathan Leffler wrote: > > To fix the problem, rename these files as .c files. [...] > > Thanks so very much, Jonathan. One addition though. The IEOBJ macro has > to be changed from ".ec" to ".c" as well. > > With that change, everything compiled fine. Now I get to try all the > examples. =========================================================================== Date: Fri, 5 Apr 1996 11:44:48 -0800 From: johnl@informix.com (Jonathan Leffler) To: johnl@informix.com, suvdb@inasan.rssi.ru Subject: Re: 4GL/CGI problems Andrew, You didn't do anything wrong; the code is wrong... The code in i4glsetenv.c pops 32kB of characters (mostly blanks) and tries to set that as the environment variable. Not a good idea. The code in i4glsetenv.c should be like the code in icgisetenv.c, and should use cgi_trim() to strip the trailing blanks. Additionally, it is easily arguable that the maximum length of the envarg variable should be triggered off ARG_MAX defined in <limits.h>, defaulting to _POSIX_ARG_MAX (which is 4096) if it is not available. Meaningful environment variables should be much shorter than that! This would apply to the code in both icgisetenv.c and i4glsetenv.c. Actually, I'm not even clear why there is so much duplicated code... If your version of I4GL is recent enough, there is a popstring() function in it which automatically strips off the trailing blanks and it should be used in preference to popquote(). Etc... Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >Date: Fri, 5 Apr 1996 18:19:06 -0300 >From: suvdb@inasan.rssi.ru (Spectrum-UV Database) >To: johnl@informix.com >Subject: 4GL/CGI problems > >Dear Mr. Leffler, > >Please, could you help me with Informix Esql/cgi ToolKit >you sent me before? > >Problem is that I can't connect with server when I tried do >it from 4GL program. > >When I tried to set INFORMIXSERVER throu i4gl_setenv I failed >(error "servername too long"). I modified envarg in i4gl_setenv >reduced size of it to char[30]. When I try to connect, I failed >again (error "sqlhosts file not found .." -errno -25553). When >I set INFORMIXDIR throu i4gl_setenv core was dumped without any >explaine. > >Do you know where and what I did wrong? > >ESQL/C-CGI works fine, 4GL programs failed only. > >Thank you, > Andrew Belikov. > http://www.inasan.rssi.ru/~suvdb/