Re: Looking for compiling scripts
Posted in 1997
>From: Jane Vohden <jvohden@polarnet.com> >Date: Thu, 6 Feb 1997 12:49:01 -0900 >X-Informix-List-Id: <list.13030> > >I have kind of messy situation and I was wondering if someone could >help. We have 2 applications that both need to run against a 5.03 >online engine. One application is running with esql/c 5.03 and isql >4.13. The other application requires 4.10 esql/c and 4.10 isql. I >would like to compile the 4.10 code in one directory and then move it >to run against the 5.03 engine because I can't have 2 copies of esql/c >or isql in the same INFORMIXDIR. OK. Recognizing that you must have two different INFORMIXDIRs is the key point. >Does anyone have any experience or knowledge on this? Yes. Not this combination, of course, but similar issues. I have 4.12, 5.03, 6.00, 7.20 and 7.21 OnLines configured on my machine (though not more than a couple of those running at one time), with different versions of the various tools products available in a variety of different INFORMIXDIRs on a variety of different disks. >Do you have any scripts already written? Yes, maybe, but you'd need to be 'compatible' with my assumptions and then tailor the scripts I attach in the shell archive to suit yourself. Assumption 1: you use Korn Shell. The changes for Bourne Shell are trivial; change the 'export X=value' lines into 'X=value; export X'. If you use C Shell, you're on your own. Assumption 2: you won't get confused about which Informix environment you are using. The script dbenv below does a pretty good job of telling you the values of any environment variables may affect the Informix database(s) you are using. To switch to a new environment, use on of the following: . 503UC1.OnLine # Similar to what you've got . 503UC1.SE # Note the alternative value of SQLEXEC . 412UE1.OnLine # Similar to your 4.10 environment . 721UC1.OnLine # My normal working environment. Note that the 7.21 script sets SQLEXEC so that you can still use pre-6.00 software to talk to post-6.00 engines, even though the 'indigenous' software does not use it. If you are making serious use of SQLRM and SQLRMDIR in your 5.03 system, you'll have to make appropriate changes to the files. For each script, you will need to ensure that the values set for INFORMIXDIR will be correct for you, and that auxilliary definitions ONCONFIG, TBCONFIG, SQLEXEC, INFORMIXSERVER, etc, are also OK. Note that some of these variables are only relevant with 6.00 and above, but I don't have versions which I would have used prior to 6.00 being available because I didn't have the problem prior to that. You will want to rename the scripts, probably using your own naming convention. I place dbenv, clnpath, and all the scripts in $HOME/bin, which is always on my $PATH. The 412UE1.OnLine scripts are not made executable! The shell will be able to locate and read them using the '.' command, but won't execute them otherwise -- which is just as well since if you did execute them, the calling shell's environment wouldn't be affected. So, to use the main OnLine system, I'd include ". 503UC1.OnLine" in my profile. Then, to switch to the 4.10 system for compiling that software, I'd type: ". 410UC1.OnLine", change to the relevant directory, build, test and install the 4.10 software, then redo ". 503UC1.OnLine" to revert to the main working environment. One residual complication is knowing where to install the software. I'd encode that into a variable in the 4.10 area makefile, possibly with an environment variable. The other residual complication is how to test against the 5.03 OnLine database with the 4.10 environment. I'd probably install the 5.03 OnLine in the 4.10 area (after the ISQL and ESQL/C was installed), and make sure that the $TBCONFIG file in both $INFORMIXDIRs was the same (using a symbolic link), and also the sqlhosts file. I'd never run tbinit in the 4.10 area. I think that'd work -- I've not actually done that recently, so there may be some other trick required too. >Is there any reason why this won't work? No. Incidentally, I also have some scripts which I use to install software using another installation as a reference installation, and to remove such software. I haven't included those in this emailing. If there's some interest, I'll put another mailing together... Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> : "@(#)shar.sh 1.9" #! /bin/sh # # This is a shell archive. # Remove everything above this line and run sh on the resulting file. # If this archive is complete, you will see this message at the end: # "All files extracted" # # Created: Thu Feb 6 17:14:13 PST 1997 by johnl at Informix Software Ltd. # Files archived in this archive: # 721UC1.OnLine # 503UC1.OnLine # 503UC1.SE # 412UE1.OnLine # clnpath # dbenv # #-------------------- if [ -f 721UC1.OnLine -a "$1" != "-c" ] then echo shar: 721UC1.OnLine already exists else echo 'x - 721UC1.OnLine (853 characters)' sed -e 's/^X//' >721UC1.OnLine <<'SHAR-EOF' X: "%W% %E%" X# X# Set Informix environment for 7.21.UC1 OnLine operation X Xold_ixd=${INFORMIXDIR:-/usr/informix} Xold_bin=$old_ixd/bin Xold_lib=$old_ixd/lib Xold_libpath=$old_lib:$old_lib/esql:$old_lib/tools:$old_lib/newera X Xexport INFORMIXDIR=/usr/informix/7.21.UC1 Xexport SQLEXEC=sqlrm Xexport ONCONFIG=onconfig.anubis.43 Xexport INFORMIXSERVER=anubis_43 Xexport INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts X Xnew_bin=$INFORMIXDIR/bin Xnew_lib=$INFORMIXDIR/lib Xnew_libpath=$new_lib:$new_lib/esql:$new_lib/tools:$new_lib/newera X Xif [ $old_bin = $new_bin ] Xthen X old_bin="" X old_libpath="" Xfi X Xexport PATH=`clnpath :$new_bin:$PATH $old_bin` Xexport LD_LIBRARY_PATH=`clnpath $new_libpath:$LD_LIBRARY_PATH $old_libpath` Xunset new_bin Xunset new_lib Xunset new_libpath Xunset old_bin Xunset old_ixd Xunset old_lib Xunset old_libpath X Xunset SQLRM Xunset SQLRMDIR Xunset TBCONFIG SHAR-EOF chmod 664 721UC1.OnLine if [ `wc -c <721UC1.OnLine` -ne 853 ] then echo shar: 721UC1.OnLine unpacked with wrong size fi # end of overwriting check fi #-------------------- if [ -f 503UC1.OnLine -a "$1" != "-c" ] then echo shar: 503UC1.OnLine already exists else echo 'x - 503UC1.OnLine (610 characters)' sed -e 's/^X//' >503UC1.OnLine <<'SHAR-EOF' X: "@(#)503UC1.OnLine 1.1 96/06/11" X# X# Set Informix environment for 5.03.UC1 OnLine operation X Xold_informixdir_bin=${INFORMIXDIR:-/usr/informix}/bin X Xexport INFORMIXDIR=/usr/informix/5.03.UC1 Xexport SQLEXEC=sqlturbo Xexport TBCONFIG=tbconfig.anubis.23 X Xnew_informixdir_bin=$INFORMIXDIR/bin Xif [ $old_informixdir_bin = $new_informixdir_bin ] Xthen X old_informixdir_bin="" Xfi X Xexport PATH=`clnpath :$new_informixdir_bin:$PATH $old_informixdir_bin` Xunset old_informixdir_bin Xunset new_informixdir_bin X Xunset COLLCHAR Xunset DBNLS Xunset INFORMIXSE