Changeset 8231 for trunk/tools


Ignore:
Timestamp:
Apr 11, 2002, 6:27:03 PM (23 years ago)
Author:
bird
Message:

Updated to work on my home machine, Eniac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/DailyBuild/odin32env.cmd

    r8023 r8231  
    1 /* $Id: odin32env.cmd,v 1.23 2002-02-26 17:26:37 bird Exp $
     1/* $Id: odin32env.cmd,v 1.24 2002-04-11 16:27:03 bird Exp $
    22 *
    33 * Sets the build environment.
     
    2020     */
    2121    call EnvVar_Set 0, 'CVSROOT',   ':pserver:bird@www.netlabs.org:/netlabs.cvs/odin32'
    22     call EnvVar_Set 0, 'HOME',      'd:\knut\home'
     22    call EnvVar_Set 0, 'HOME',      'e:/user/kso'
    2323    call EnvVar_Set 0, 'USER',      'bird'
    24     call EnvVar_Set 0, 'HOSTNAME',  'Univac-Job'
     24    call EnvVar_Set 0, 'HOSTNAME',  'Eniac'
     25    call EnvVar_Set 0, 'MULTIJOBS', '1'
    2526
    2627
     
    2930     * (The order this is done is _very_ important!)
    3031     */
    31     call Jade 0;
    32     call DocBookXML 0;
     32    /*call Jade 0;
     33    call DocBookXML 0;*/
    3334    call WarpIn 0;
    3435    call mySQL 0;
     
    3637    call CVS 0;
    3738    call DDKBase 0;
    38     call MSC60 0;
     39    call MSCV6 0;
    3940    call EMX 0;
    4041    if (sCompiler = 'watcom') then
    4142    do /* watcom */
    4243        say 'Watcom';
    43         call VAC30 1;
    44         call VAC36 1;
     44        call VAC308 1;
     45        call VAC365 1;
    4546        call VAC40 1;
    46         call VAC36 0;
    47         call Watcom 0;
     47        call VAC365 0;
     48        call WatComC11c 0;
    4849        call Toolkit40 0;
    4950    end
     
    5152    do /* vac36 */
    5253        say 'VAC36(5)';
    53         call VAC30 1;
    54         call Watcom 1;
     54        call VAC308 1;
     55        call WatComC11c 1;
    5556        call NetQOS2 0;
    5657        call VAC40 1;
    57         call VAC36 0;
     58        call VAC365 0;
    5859        call Toolkit40 0;
    5960    end
     
    6162    do /* vac40 */
    6263        say 'VAC40';
    63         call VAC30 1;
    64         call Watcom 1;
     64        call VAC308 1;
     65        call WatComC11c 1;
    6566        call NetQOS2 0;
    66         call VAC36 0;
     67        call VAC365 0;
    6768        call Toolkit40 0;
    6869        call VAC40 0;
     
    7172    do /* default is vac30 */
    7273        say 'VAC30';
    73         call VAC36 1;
    74         call Watcom 1;
     74        call VAC365 1;
     75        call WatComC11c 1;
    7576        call VAC40 1;
    76         call VAC30 0;
     77        call VAC308 0;
    7778        call Toolkit40 0;
    7879    end
     
    8586
    8687
    87 
    88 
    8988/**
    90  * Individual tools configurations
     89 * The Directory Configuration Function.
     90 *
     91 * @returns Lower cased, absolute, backward slashed, path to program.
     92 * @param   sProgram    Program identifier. (lowercase!)
     93 *
     94 * @remark
     95 * Unless this causes a lot of trouble, we'll keep it in the script.
     96 * Having this externaly will slow down the script execution
     97 * somewhat I'm afraid. And the script is slow enought as it is.
     98 *
     99 */
     100QueryPath: procedure
     101    parse arg sProgram
     102
     103    select
     104        when (sProgram = 'cvs') then        return 'f:\cvs';
     105        when (sProgram = 'emx') then        return 'f:\emx';
     106        when (sProgram = 'emxpgcc') then    return 'f:\emxpgcc';
     107        when (sProgram = 'db2v52') then     return 'f:\sqllib52';
     108        when (sProgram = 'icatgam') then    return 'f:\icatos2';
     109        when (sProgram = 'icatgam406rc1') then return 'f:\icatos2.4.0.6.rc1';
     110        when (sProgram = 'icatpe') then     return 'f:\icatpe';
     111        when (sProgram = 'ida38') then      return 'f:\ida38';
     112        when (sProgram = 'ida40') then      return 'f:\ida401';
     113        when (sProgram = 'ida414') then     return 'f:\ida414';
     114        when (sProgram = 'idasdk') then     return 'f:\idasdk';
     115        when (sProgram = 'ddkbase') then    return 'f:\ddk\base';
     116        when (sProgram = 'mscv6') then      return 'f:\ddktools\toolkits\msc60';
     117        when (sProgram = 'mysql') then      return 'f:\mysql2';
     118        when (sProgram = 'netqos2') then    return 'f:\netqos2';
     119        when (sProgram = 'perl') then       return 'f:\perllib';
     120        when (sProgram = 'python') then     return 'f:\python';
     121        when (sProgram = 'toolkit40') then  return 'f:\toolkit';
     122        when (sProgram = 'toolkit45') then  return 'f:\toolkit45';
     123        when (sProgram = 'unixroot') then   return 'e:\unix';
     124        when (sProgram = 'xfree86') then    return 'e:\xfree86';
     125        when (sProgram = 'vac308') then     return 'f:\ibmcpp';
     126        when (sProgram = 'vac365') then     return 'f:\ibmcxxo';
     127        when (sProgram = 'vac40') then      return 'f:\ibmcpp40';
     128        when (sProgram = 'warpin') then     return 'f:\warpin';
     129        when (sProgram = 'watcom11') then   return 'f:\watcom';
     130        when (sProgram = 'watcom11c') then  return 'f:\watcom11c';
     131
     132        otherwise
     133        do
     134            say 'Fatal error: Path information for program '''sProgram''' was not found.';
     135            exit(16);
     136        end
     137    end
     138
     139    /* Should never get here */
     140return '';
     141
     142
     143
     144/**
     145 * Environment procedures section
    91146 **/
    92147
     
    101156     * Concurrent Versions System (CVS) main directory.
    102157     */
    103     sCVSMain    = 'd:\knut\tools\cvs';
    104     call EnvVar_Set      fRM, 'cvsmain',     sCVSMain;
    105     call EnvVar_AddFront fRM, 'path',        sCVSMain'\bin;'
    106     call EnvVar_AddFront fRM, 'bookshelf',   sCVSMain'\book;'
    107     return 0;
     158    sPathCVS    = QueryPath('cvs');
     159    call EnvVar_Set      fRM, 'PATH_CVS',    sPathCVS;
     160    call EnvVar_AddFront fRM, 'path',        sPathCVS'\bin;'
     161    call EnvVar_AddFront fRM, 'bookshelf',   sPathCVS'\book;'
     162return 0;
    108163
    109164
     
    117172     * EMX/GCC main directory.
    118173     */
    119     sEMXBack    = 'c:\emx';
    120     sEMXForw    = 'c:/emx';
    121 
    122     call EnvVar_Set      fRM, 'emx', sEMXBack;
     174    sEMX        = QueryPath('emx');
     175    sEMXBack    = translate(sEMX, '\', '/');
     176    sEMXForw    = translate(sEMX, '/', '\');
     177    call EnvVar_Set      fRM, 'PATH_EMX', sEMXBack;
     178    call EnvVar_Set      fRM, 'CCENV',      'EMX'
     179    call EnvVar_Set      fRM, 'BUILD_ENV',  'EMX'
     180    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
    123181
    124182    call EnvVar_AddFront fRM, 'BEGINLIBPATH',       sEMXBack'\dll;'
     
    142200        call EnvVar_Set  fRM, 'TERMCAP',            sEMXForw'/etc/termcap.dat'
    143201    end
    144     return 0;
     202
     203return 0;
     204
     205
     206/*
     207 * EMX PGCC - must be installed on to the ordinar EMX.
     208 */
     209EMXPGCC: procedure
     210    parse arg fRM
     211
     212    /*
     213     * EMX/GCC main directory.
     214     */
     215    sEMXPGCC    = QueryPath('emxpgcc');
     216    sEMXBack    = translate(sEMXPGCC, '\', '/');
     217    sEMXForw    = translate(sEMXPGCC, '/', '\');
     218    call EnvVar_Set      fRM, 'PATH_EMXPGCC',   sEMXBack;
     219    call EnvVar_Set      fRM, 'CCENV',          'EMX'
     220    call EnvVar_Set      fRM, 'BUILD_ENV',      'EMX'
     221    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     222
     223    call EnvVar_AddFront fRM, 'BEGINLIBPATH',       sEMXBack'\dll;'
     224    call EnvVar_AddFront fRM, 'PATH',               sEMXBack'\bin;'
     225    call EnvVar_AddFront fRM, 'DPATH',              sEMXBack'\book;'
     226    call EnvVar_AddFront fRM, 'BOOKSHELF',          sEMXBack'\book;'
     227    call EnvVar_AddFront fRM, 'HELP',               sEMXBack'\help;'
     228    call EnvVar_AddFront fRM, 'C_INCLUDE_PATH',     sEMXForw'/include'
     229    call EnvVar_AddFront fRM, 'LIBRARY_PATH',       sEMXForw'/lib'
     230    call EnvVar_AddFront fRM, 'CPLUS_INCLUDE_PATH', sEMXForw'/include/cpp;'sEMXForw'/include'
     231    call EnvVar_Set      fRM, 'PROTODIR',           sEMXForw'/include/cpp/gen'
     232    call EnvVar_Set      fRM, 'OBJC_INCLUDE_PATH',  sEMXForw'/include'
     233    call EnvVar_AddFront fRM, 'INFOPATH',           sEMXForw'/info'
     234    call EnvVar_Set      fRM, 'EMXBOOK',            'emxdev.inf+emxlib.inf+emxgnu.inf+emxbsd.inf'
     235    call EnvVar_AddFront fRM, 'HELPNDX',            'emxbook.ndx', '+', 1
     236
     237return 0;
     238
     239/*
     240 * IBM DB2 v5.2
     241 */
     242db2v52: procedure
     243    parse arg fRM
     244    sPathDB2   = QueryPath('db2v52');
     245    call EnvVar_Set      fRm, 'PATH_DB2',    sPathDB2;
     246    call EnvVar_Set      fRm, 'db2path',     sPathDB2;
     247    call EnvVar_AddFront fRm, 'beginlibpath',sPathDB2'\dll;'sPathDB2'\alt;'
     248    call EnvVar_AddFront fRm, 'path',        sPathDB2'\bin;'sPathDB2'\alt;'
     249    call EnvVar_AddFront fRm, 'dpath',       sPathDB2'\bin;'sPathDB2';'
     250    call EnvVar_AddFront fRm, 'help',        sPathDB2'\help;'
     251    call EnvVar_AddEnd   fRm, 'classpath',   '.;'sPathDB2'\JAVA\DB2JAVA.ZIP;'sPathDB2'\JAVA\RUNTIME.ZIP;'sPathDB2'\JAVA\SQLJ.ZIP;'
     252    call EnvVar_Set      fRM, 'db2instace',  'DB2'
     253    /*call EnvVar_Set      fRM, 'odbc_path',   'f:\odbc' -- huh? what's this? */
     254    call EnvVar_AddFront fRM, 'cobcpy',      sPathDB2'\include\cobol_mf'
     255    call EnvVar_Set      fRM, 'finclude',    sPathDB2'\include'
     256    call EnvVar_AddFront fRM, 'include',     sPathDB2'\include;'
     257    call EnvVar_AddFront fRM, 'lib',         sPathDB2'\lib;'
     258return 0;
     259
     260
     261/*
     262 * ICAT Debugger
     263 */
     264ICATGam: procedure
     265    parse arg fRM
     266    sPathICAT   = QueryPath('icatgam');
     267    call EnvVar_Set      fRm, 'PATH_ICATGAM', sPathICAT;
     268    call EnvVar_AddFront fRm, 'beginlibpath',sPathICAT'\dll;'
     269    call EnvVar_AddFront fRm, 'path',        sPathICAT'\bin;'
     270    call EnvVar_AddFront fRm, 'dpath',       sPathICAT'\help;'
     271    call EnvVar_AddFront fRm, 'help',        sPathICAT'\help;'
     272return 0;
     273
     274
     275/*
     276 * ICAT Debugger
     277 */
     278ICATGam406RC1: procedure
     279    parse arg fRM
     280    sPathICAT   = QueryPath('icatgam406rc1');
     281    call EnvVar_Set      fRm, 'PATH_ICATGAM', sPathICAT;
     282    call EnvVar_AddFront fRm, 'beginlibpath',sPathICAT'\dll;'
     283    call EnvVar_AddFront fRm, 'path',        sPathICAT'\bin;'
     284    call EnvVar_AddFront fRm, 'dpath',       sPathICAT'\help;'
     285    call EnvVar_AddFront fRm, 'help',        sPathICAT'\help;'
     286return 0;
     287
     288
     289
     290/*
     291 * ICAT Debugger for PE images.
     292 */
     293ICATPe: procedure
     294    parse arg fRM
     295    sPathICAT   = QueryPath('icatgam');
     296    sPathICATPe = QueryPath('icatpe');
     297    call EnvVar_Set      fRm, 'PATH_ICATGAM',sPathICAT;
     298    call EnvVar_Set      fRm, 'PATH_ICATPE', sPathICATPe;
     299    call EnvVar_AddFront fRm, 'beginlibpath',sPathICATPe'\bin;'sPathICAT'\dll;'
     300    call EnvVar_AddFront fRm, 'path',        sPathICATPe'\bin;'sPathICAT'\bin;'
     301    call EnvVar_AddFront fRm, 'dpath',       sPathICATPe'\bin;'sPathICAT'\help;'
     302    call EnvVar_AddFront fRm, 'help',        sPathICATPe'\bin;'sPathICAT'\help;'
     303return 0;
     304
     305
     306
     307/*
     308 * Interactive Disassembler (IDA) v3.80a
     309 */
     310IDA38: procedure
     311    parse arg fRM
     312    /*
     313     * IDA main directory.
     314     */
     315    sPathIDA = QueryPath('ida38');
     316    call EnvVar_Set      fRM, 'PATH_IDA',       sPathIDA
     317    call EnvVar_AddFront fRM, 'path',           sPathIDA
     318    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDA
     319return 0;
     320
     321
     322/*
     323 * Interactive Disassembler (IDA) v4.01
     324 */
     325IDA40: procedure
     326    parse arg fRM
     327    /*
     328     * IDA main directory.
     329     */
     330    sPathIDA = QueryPath('ida40');
     331    call EnvVar_Set      fRM, 'PATH_IDA',       sPathIDA
     332    call EnvVar_AddFront fRM, 'path',           sPathIDA
     333    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDA
     334return 0;
     335
     336
     337/*
     338 * Interactive Disassembler (IDA) v4.14
     339 */
     340IDA414: procedure
     341    parse arg fRM
     342    /*
     343     * IDA main directory.
     344     */
     345    sPathIDA = QueryPath('ida414');
     346    call EnvVar_Set      fRM, 'PATH_IDA',       sPathIDA
     347    call EnvVar_AddFront fRM, 'path',           sPathIDA
     348    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDA
     349return 0;
     350
     351
     352/*
     353 * Interactive Disassembler (IDA) Plugin SDK (v5.0?)
     354 */
     355IDASDK: procedure
     356    parse arg fRM
     357    /*
     358     * IDA main directory.
     359     */
     360    sPathIDASDK = QueryPath('idasdk');
     361    call EnvVar_Set      fRM, 'PATH_IDASDK',    sPathIDASDK
     362    call EnvVar_AddFront fRM, 'include',        sPathIDASDK'\include;'
     363    call EnvVar_AddFront fRM, 'lib',            sPathIDASDK'\libwat.os2;'
     364    call EnvVar_AddFront fRM, 'path',           sPathIDASDK'\bin\os2;'
     365    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDASDK'\bin\os2;'
     366return 0;
    145367
    146368
     
    154376     * Device Driver Kit (DDK) (v4.0+) base (important not main) directory.
    155377     */
    156     sDDKBase    = 'd:\knut\ddk\base';
    157     call EnvVar_Set      fRM, 'ddkbase', sDDKBase;
    158     call EnvVar_AddFront fRM, 'path',        sDDKBase'\tools;'
    159     call EnvVar_AddFront fRM, 'include',     sDDKBase'\h;'
    160     call EnvVar_AddFront fRM, 'lib',         sDDKBase'\lib;'
    161     call EnvVar_AddFront fRM, 'bookshelf',   sDDKBase'\..\docs;'
    162 
    163     return 0;
    164 
    165 
    166 /*
    167  * DocBook 4.1.x XML.
    168  */
    169 DocBookXML: procedure
    170     parse arg fRM
    171 
    172     /*
    173      * DocBook XML dir.
    174      */
    175     sDocBookXML = 'e:\coding\DocBook\XML'
    176 
    177     call EnvVar_Set      fRM, 'docbookxml',         sDocBookXML
    178     call EnvVar_AddFront fRM, 'SGML_CATALOG_FILES', sDocBookXML'\docbook.cat;'
    179 
    180     return 0;
    181 
    182 
    183 /*
    184  * Jade 1.2.1 for OS/2.
    185  */
    186 Jade: procedure
    187     parse arg fRM
    188 
    189     /*
    190      * Jade install dir.
    191      */
    192     sJadeMain = 'e:\apps\jade'
    193 
    194     call EnvVar_Set      fRM, 'jademain',           sJadeMain
    195     call EnvVar_AddFront fRM, 'path',               sJadeMain';'
    196     call EnvVar_AddFront fRM, 'SGML_CATALOG_FILES', sJadeMain'\catalog;'
    197     call EnvVar_AddEnd   fRM, 'SGML_CATALOG_FILES', '.\catalog;'
    198 
    199     return 0;
     378    sPathDDKBase    = QueryPath('ddkbase');
     379    call EnvVar_Set      fRM, 'PATH_DDKBASE',sPathDDKBase;
     380    call EnvVar_AddFront fRM, 'path',        sPathDDKBase'\tools;'
     381    call EnvVar_AddFront fRM, 'include',     sPathDDKBase'\h;'sPathDDKBase'\inc;'sPathDDKBase'\inc32;'
     382    call EnvVar_AddFront fRM, 'include16',   sPathDDKBase'\h;'
     383    call EnvVar_AddFront fRM, 'lib',         sPathDDKBase'\lib;'
     384    call EnvVar_AddFront fRM, 'bookshelf',   sPathDDKBase'\..\docs;'
     385
     386return 0;
     387
    200388
    201389
     
    203391 * Microsoft C v6.0a
    204392 */
    205 MSC60: procedure
     393MSCV6: procedure
    206394    parse arg fRM
    207395
     
    209397     * Microsoft C v6.0a main directory.
    210398     */
    211     sMSCMain    = 'd:\knut\ddk\ddktools\toolkits\msc60';
    212     call EnvVar_Set      fRM, 'mscmain',    sMSCMain;
    213     call EnvVar_AddFront fRM, 'path',       sMSCMain'\binp;'
    214     call EnvVar_AddFront fRM, 'include',    sMSCMain'\include;'
    215     call EnvVar_AddFront fRM, 'lib',        sMSCMain'\lib;'
    216     return 0;
     399    sPathMSC    = QueryPath('mscv6');
     400    call EnvVar_Set      fRM, 'BUILD_ENV',  'MSCV6'
     401    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     402    call EnvVar_Set      fRM, 'PATH_MSC',   sPathMSC;
     403    call EnvVar_AddFront fRM, 'path',       sPathMSC'\binp;'
     404    call EnvVar_AddFront fRM, 'include',    sPathMSC'\include;'
     405    call EnvVar_AddFront fRM, 'include16',  sPathMSC'\include;'
     406    call EnvVar_AddFront fRM, 'lib',        sPathMSC'\lib;'
     407return 0;
    217408
    218409
     
    227418     * mySQL Database system main directory.
    228419     */
    229     sMySQLMain    = 'd:\knut\apps\MySql-3.23.42-rel3';
    230     call EnvVar_Set      fRM, 'mysqlmain',      sMySQLMain;
    231     call EnvVar_AddFront fRM, 'path',           sMySQLMain'\bin;'
    232     call EnvVar_AddFront fRM, 'beginlibpath',   sMySQLMain'\dll;'
    233     call EnvVar_AddFront fRM, 'include',        sMySQLMain'\include;'
    234     call EnvVar_AddEnd   fRM, 'bookshelf',      sMySQLMain'\book;'
    235     /*call EnvVar_AddFront fRM, 'lib',            sMySQLMain'\lib;'*/
    236     return 0;
     420    sPathMySQL    = QueryPath('mysql');
     421    call EnvVar_Set      fRM, 'PATH_MYSQL',     sPathMySQL;
     422    call EnvVar_AddFront fRM, 'path',           sPathMySQL'\bin;'
     423    call EnvVar_AddFront fRM, 'beginlibpath',   sPathMySQL'\dll;'
     424    call EnvVar_AddFront fRM, 'include',        sPathMySQL'\include;'
     425    call EnvVar_AddFront fRM, 'bookshelf',      sPathMySQL'\doc;'sPathMySQL'\book';
     426    /*call EnvVar_AddFront fRM, 'lib',            sPathMySQL'\lib;'*/
     427return 0;
    237428
    238429
     
    242433 */
    243434NetQOS2: procedure
    244     parse arg fRM
    245     sNetQ11Main = 'e:\apps\imnnq';
    246     call EnvVar_Set      fRM, 'netq11main',     sNetQ11Main
    247     call EnvVar_AddFront fRM, 'beginlibpath',   sNetQ11Main';'
    248     call EnvVar_AddFront fRM, 'path',           sNetQ11Main';'
    249     call EnvVar_AddFront fRM, 'dpath',          sNetQ11Main';'
    250     call EnvVar_AddEnd   fRM, 'nlspath',        sNetQ11Main'\%N;'
    251     call EnvVar_Set      fRM, 'imndatasrv',     sNetQ11Main'\DATA'
    252     call EnvVar_Set      fRM, 'imndatacl',      sNetQ11Main'\DATA'
    253     call EnvVar_Set      fRM, 'imnworksrv',     sNetQ11Main'\WORK'
    254     call EnvVar_Set      fRM, 'imnworkcl',      sNetQ11Main'\WORK'
    255     call EnvVar_Set      fRM, 'imnnlpssrv',     sNetQ11Main
    256     call EnvVar_Set      fRM, 'imnnlpscl',      sNetQ11Main
     435    sPathNetQOS2 = QueryPath('netqos2');
     436    call EnvVar_Set      fRM, 'PATH_NETQOS2',   sPathNetQOS2
     437    call EnvVar_AddFront fRM, 'path',           sPathNetQOS2';'
     438    call EnvVar_AddFront fRM, 'dpath',          sPathNetQOS2';'
     439    call EnvVar_AddFront fRM, 'beginlibpath',   sPathNetQOS2';'
     440    call EnvVar_Set      fRM, 'imndatasrv',     sPathNetQOS2'\DATA'
     441    call EnvVar_Set      fRM, 'imndatacl',      sPathNetQOS2'\DATA'
     442    call EnvVar_Set      fRM, 'imnworksrv',     sPathNetQOS2'\WORK'
     443    call EnvVar_Set      fRM, 'imnworkcl',      sPathNetQOS2'\WORK'
     444    call EnvVar_Set      fRM, 'imnnlpssrv',     sPathNetQOS2
     445    call EnvVar_Set      fRM, 'imnnlpscl',      sPathNetQOS2
    257446    call EnvVar_Set      fRM, 'imncccfgfile',   'NETQ.CFG'
    258447    call EnvVar_Set      fRM, 'imncscfgfile',   'NETQ.CFG'
    259     call EnvVar_Set      fRM, 'imqconfigsrv',   sNetQ11Main'\instance'
    260     call EnvVar_Set      fRM, 'imqconfigcl',    sNetQ11Main'\instance\dbcshelp'
    261     call EnvVar_Set      fRM, 'lite_locales',   sNetQ11Main
    262     return 0;
     448    call EnvVar_Set      fRM, 'imqconfigsrv',   sPathNetQOS2'\instance'
     449    call EnvVar_Set      fRM, 'imqconfigcl',    sPathNetQOS2'\instance\dbcshelp'
     450return 0;
    263451
    264452
     
    273461     * Perl main directory.
    274462     */
    275     sPerlMain       = 'd:\perllib';
    276     sPerlMainForw   = 'd:/perllib';
    277     call EnvVar_Set      fRM, 'perlmain',       sPerlMain;
    278     call EnvVar_AddFront fRM, 'path',           sPerlMain'\bin;'
    279     call EnvVar_AddFront fRM, 'beginlibpath',   sPerlMain'\dll;'
    280     call EnvVar_AddEnd   fRM, 'bookshelf',      sPerlMain'\book;'
    281     call EnvVar_Set      fRM, 'perllib_prefix', sPerlMainForw'/lib;'sPerlMainForw'/lib'
    282     call EnvVar_Set      fRM, 'perl_sh_dir',    sPerlMainForw'/bin_sh'
    283     call EnvVar_Set      fRM, 'manpath',        sPerlMainForw'/man'
    284     call EnvVar_Set      fRM, 'perl5lib',       sPerlMainForw'/lib'
    285     return 0;
    286 
     463/* BAD
     464    sPathPerl       = QueryPath('perl');
     465    sPathPerlForw   = translate(sPathPerl, '/', '\');
     466    call EnvVar_Set      fRM, 'PATH_PERL',      sPathPerl;
     467    call EnvVar_AddFront fRM, 'path',           sPathPerl'\bin;'
     468    call EnvVar_AddFront fRM, 'beginlibpath',   sPathPerl'\dll;'
     469    call EnvVar_AddEnd   fRM, 'bookshelf',      sPathPerl'\book;'
     470    call EnvVar_Set      fRM, 'perllib_prefix', sPathPerlForw'/lib;'sPathPerl'\lib'
     471    call EnvVar_Set      fRM, 'perl5lib',       sPathPerlForw'/lib/site_perl/5.00553/os2;'sPathPerlForw'/lib/site_perl/5.00553'
     472    call EnvVar_Set      fRM, 'perl5load',      '2'
     473    call EnvVar_Set      fRM, 'perl_sh_dir',    sPathPerlForw'/bin_sh/sh.exe'
     474    call EnvVar_Set      fRM, 'manpath',        sPathPerlForw'/man'
     475    call EnvVar_Set      fRM, 'perl_badlang',   '0'
     476/*    call EnvVar_Set      fRM, 'LANG',           'en_US' /* dirty fix... */*/
     477*/
     478/* seems ok */
     479    sPathPerl       = QueryPath('perl');
     480    sPathPerlForw   = translate(sPathPerl, '/', '\');
     481    call EnvVar_Set      fRM, 'PATH_PERL',      sPathPerl;
     482    call EnvVar_AddFront fRM, 'path',           sPathPerl'\bin;'
     483    call EnvVar_AddFront fRM, 'beginlibpath',   sPathPerl'\dll;'
     484    call EnvVar_AddEnd   fRM, 'bookshelf',      sPathPerl'\book;'
     485    call EnvVar_Set      fRM, 'perllib_prefix', sPathPerlForw'/lib;'sPathPerlForw'/lib'
     486    call EnvVar_Set      fRM, 'perl_sh_dir',    sPathPerlForw'/bin_sh'
     487    call EnvVar_Set      fRM, 'manpath',        sPathPerlForw'/man'
     488    call EnvVar_Set      fRM, 'perl5lib',       sPathPerlForw'/lib'
     489    call EnvVar_Set      fRM, 'perl_badlang',   '0'
     490return 0;
     491
     492
     493/*
     494 * Python/2 v1.5.2
     495 */
     496Python: procedure
     497    parse arg fRM
     498
     499    /*
     500     * The Python Home directory
     501     */
     502    sPythonHome = QueryPath('python');
     503    call EnvVar_Set      fRM, 'PATH_PYTHON',    sPythonHome
     504    call EnvVar_Set      fRM, 'pythonhome',     sPythonHome
     505    call EnvVar_Set      fRM, 'pythonpath',     '.;'sPythonHome'\Lib;'sPythonHome'\Lib\plat-win;'sPythonHome'\Lib\lib-tk;'sPythonHome'\Lib\lib-dynload;'sPythonHome'\Lib\site-packages;'sPythonHome'\Lib\dos-8x3'
     506    call EnvVar_AddFront fRM, 'beginlibpath',   sPythonHome
     507    call EnvVar_AddFront fRM, 'path',           sPythonHome
     508
     509return 0;
    287510
    288511
     
    296519     * Toolkit (4.0) main directory.
    297520     */
    298      sTKMain    = 'c:\appl\os2\toolkt40';
    299 
    300     call EnvVar_Set      fRM, 'tkmain',  sTkMain;
    301 
    302     call EnvVar_AddFront fRM, 'beginlibpath',   sTkMain'\BETA\DLL;'sTkMain'\SAMPLES\MM\DLL;'sTkMain'\SAMPLES\OPENDOC\PARTS\DLL;'sTkMain'\SOM\COMMON\DLL;'sTkMain'\SOM\LIB;'sTkMain'\OPENDOC\BASE\DLL;'sTkMain'\OPENDOC\BASE\LOCALE\EN_US;'sTkMain'\DLL;'
    303     call EnvVar_AddFront fRM, 'path',           sTkMain'\BETA\BIN;'sTkMain'\SOM\COMMON;'sTkMain'\SOM\BIN;.;'sTkMain'\OPENDOC\BASE\BIN;'sTkMain'\BIN;'
    304     call EnvVar_AddFront fRM, 'dpath',          sTkMain'\SOM\COMMON\SYSTEM;'sTkMain'\SOM\MSG;'sTkMain'\OPENDOC\BASE\MSG;'sTkMain'\BOOK;'sTkMain'\MSG;'
    305     call EnvVar_AddFront fRM, 'help',           sTkMain'\BETA\HELP;'sTkMain'\OPENDOC\BASE\LOCALE\EN_US;'sTkMain'\HELP;'
    306     call EnvVar_AddFront fRM, 'bookshelf',      sTkMain'\BETA\BOOK;'sTkMain'\BOOK;'sTkMain'\ARCHIVED;'
    307     call EnvVar_AddFront fRM, 'somir',          sTkMain'\SOM\COMMON\ETC\214\SOM.IR;'sTkMain'\OPENDOC\BASE\AVLSHELL.IR;'
    308     call EnvVar_AddEnd   fRM, 'somir',          sTkMain'\OPENDOC\CUSTOM\OD.IR;'sTkMain'\SAMPLES\REXX\SOM\ANIMAL\ORXSMP.IR;'
    309     call EnvVar_AddFront fRM, 'include',        sTkMain'\SPEECH\H;'sTkMain'\BETA\H;'sTkMain'\SAMPLES\OPENDOC\PARTS\INCLUDE;'sTkMain'\SOM\INCLUDE;'sTkMain'\INC;'sTkMain'\H\GL;'sTkMain'\H;'
    310     call EnvVar_AddEnd   fRM, 'include',        sTkMain'\H\LIBC;.;'
    311     call EnvVar_AddFront fRM, 'lib',            sTkMain'\SPEECH\LIB;'sTkMain'\SAMPLES\MM\LIB;'sTkMain'\LIB;'sTkMain'\SOM\LIB;'sTkMain'\OPENDOC\BASE\LIB;'
    312     call EnvVar_AddFront fRM, 'nlspath',        sTkMain'\OPENDOC\BASE\LOCALE\EN_US\%N;'sTkMain'\MSG\%N;'
    313     call EnvVar_AddFront fRM, 'locpath',        sTkMain'\OPENDOC\BASE\LOCALE;'
    314     call EnvVar_AddFront fRM, 'ipfc',           sTkMain'\IPFC;'
    315     call EnvVar_Set      fRM, 'odbase',         sTkMain'\OPENDOC\BASE'
     521    sPathTK    = QueryPath('toolkit40');
     522    call EnvVar_Set      fRM, 'PATH_TOOLKIT',  sPathTK;
     523
     524    call EnvVar_AddFront fRM, 'beginlibpath',   sPathTK'\BETA\DLL;'sPathTK'\SAMPLES\MM\DLL;'sPathTK'\SAMPLES\OPENDOC\PARTS\DLL;'sPathTK'\SOM\COMMON\DLL;'sPathTK'\SOM\LIB;'sPathTK'\OPENDOC\BASE\DLL;'sPathTK'\OPENDOC\BASE\LOCALE\EN_US;'sPathTK'\DLL;'
     525    call EnvVar_AddFront fRM, 'path',           sPathTK'\BETA\BIN;'sPathTK'\SOM\COMMON;'sPathTK'\SOM\BIN;.;'sPathTK'\OPENDOC\BASE\BIN;'sPathTK'\BIN;'
     526    call EnvVar_AddFront fRM, 'dpath',          sPathTK'\SOM\COMMON\SYSTEM;'sPathTK'\SOM\MSG;'sPathTK'\OPENDOC\BASE\MSG;'sPathTK'\BOOK;'sPathTK'\MSG;'
     527    call EnvVar_AddFront fRM, 'help',           sPathTK'\BETA\HELP;'sPathTK'\OPENDOC\BASE\LOCALE\EN_US;'sPathTK'\HELP;'
     528    call EnvVar_AddFront fRM, 'bookshelf',      sPathTK'\BETA\BOOK;'sPathTK'\BOOK;'sPathTK'\ARCHIVED;'
     529    call EnvVar_AddFront fRM, 'somir',          sPathTK'\SOM\COMMON\ETC\214\SOM.IR;'sPathTK'\OPENDOC\BASE\AVLSHELL.IR;'
     530    call EnvVar_AddEnd   fRM, 'somir',          sPathTK'\OPENDOC\CUSTOM\OD.IR;'sPathTK'\SAMPLES\REXX\SOM\ANIMAL\ORXSMP.IR;'
     531    call EnvVar_AddFront fRM, 'include',        sPathTK'\SPEECH\H;'sPathTK'\BETA\H;'sPathTK'\SAMPLES\OPENDOC\PARTS\INCLUDE;'sPathTK'\SOM\INCLUDE;'sPathTK'\INC;'sPathTK'\H\GL;'sPathTK'\H;'
     532    call EnvVar_AddEnd   fRM, 'include',        sPathTK'\H\LIBC;.;'
     533    call EnvVar_AddFront fRM, 'lib',            sPathTK'\SPEECH\LIB;'sPathTK'\SAMPLES\MM\LIB;'sPathTK'\LIB;'sPathTK'\SOM\LIB;'sPathTK'\OPENDOC\BASE\LIB;'
     534    call EnvVar_AddFront fRM, 'nlspath',        sPathTK'\OPENDOC\BASE\LOCALE\EN_US\%N;'sPathTK'\MSG\%N;C:\MPTN\MSG\NLS\%N;C:\TCPIP\msg\ENUS850\%N;'
     535    call EnvVar_AddFront fRM, 'locpath',        sPathTK'\OPENDOC\BASE\LOCALE;'
     536    call EnvVar_AddFront fRM, 'ipfc',           sPathTK'\IPFC;'
     537    call EnvVar_Set      fRM, 'odbase',         sPathTK'\OPENDOC\BASE'
    316538    call EnvVar_Set      fRM, 'odlang',         'en_US'
    317     call EnvVar_AddFront fRM, 'odbasepaths',    sTkMain'\OPENDOC\BASE;'
    318     call EnvVar_Set      fRM, 'odcfg',          sTkMain'\OPENDOC\CUSTOM'
     539    call EnvVar_AddFront fRM, 'odbasepaths',    sPathTK'\OPENDOC\BASE;'
     540    call EnvVar_Set      fRM, 'odcfg',          sPathTK'\OPENDOC\CUSTOM'
    319541    call EnvVar_Set      fRM, 'odtmp',          EnvVar_Get('tmp');
    320     call EnvVar_Set      fRM, 'sombase',        sTkMain'\SOM'
    321     call EnvVar_Set      fRM, 'somruntime',     sTkMain'\SOM\COMMON'
    322     call EnvVar_AddEnd   fRM, 'helpndx',        'EPMKWHLP.NDX+', '+', 1
     542    call EnvVar_Set      fRM, 'sombase',        sPathTK'\SOM'
     543    call EnvVar_Set      fRM, 'somruntime',     sPathTK'\SOM\COMMON'
    323544
    324545    call EnvVar_Set      fRM, 'cpref',          'CP1.INF+CP2.INF+CP3.INF'
     
    327548    call EnvVar_Set      fRM, 'pmref',          'PM1.INF+PM2.INF+PM3.INF+PM4.INF+PM5.INF'
    328549    call EnvVar_Set      fRM, 'wpsref',         'WPS1.INF+WPS2.INF+WPS3.INF'
    329     call EnvVar_AddFront fRM, 'sminclude',      sTkMain'\H;'sTkMain'\IDL;'sTkMain'\SOM\INCLUDE;.;'sTkMain'\OPENDOC\BASE\INCLUDE;'sTkMain'\SAMPLES\OPENDOC\PARTS\INCLUDE;'
     550    call EnvVar_AddFront fRM, 'sminclude',      sPathTK'\H;'sPathTK'\IDL;'sPathTK'\SOM\INCLUDE;.;'sPathTK'\OPENDOC\BASE\INCLUDE;'sPathTK'\SAMPLES\OPENDOC\PARTS\INCLUDE;'
    330551    call EnvVar_Set      fRM, 'smaddstar',      '1'
    331552    call EnvVar_Set      fRM, 'smemit',         'h;ih;c'
    332553    call EnvVar_Set      fRM, 'smtmp',          EnvVar_Get('tmp');
    333554    call EnvVar_Set      fRM, 'smclasses',      'WPTYPES.IDL'
    334     call EnvVar_Set      fRM, 'odparts',        sTkMain'\SAMPLES\OPENDOC\PARTS'
    335     call EnvVar_Set      fRM, 'odsrc',          sTkMain'\SAMPLES\OPENDOC\PARTS'
    336     call EnvVar_AddFront fRM, 'odpartspaths',   sTkMain'\SAMPLES\OPENDOC\PARTS;'
    337     call EnvVar_AddFront fRM, 'odsrcpaths',     sTkMain'\SAMPLES\OPENDOC\PARTS;'
     555    call EnvVar_Set      fRM, 'odparts',        sPathTK'\SAMPLES\OPENDOC\PARTS'
     556    call EnvVar_Set      fRM, 'odsrc',          sPathTK'\SAMPLES\OPENDOC\PARTS'
     557    call EnvVar_AddFront fRM, 'odpartspaths',   sPathTK'\SAMPLES\OPENDOC\PARTS;'
     558    call EnvVar_AddFront fRM, 'odsrcpaths',     sPathTK'\SAMPLES\OPENDOC\PARTS;'
    338559    /*
    339560    call EnvVar_Set      fRM, 'CAT_MACHINE=COM1:57600'
    340     call EnvVar_Set      fRM, 'CAT_HOST_BIN_PATH='sTkMain'\BIN'
     561    call EnvVar_Set      fRM, 'CAT_HOST_BIN_PATH='sPathTK'\BIN'
    341562    call EnvVar_Set      fRM, 'CAT_COMMUNICATION_TYPE=ASYNC_SIGBRK'
    342     call EnvVar_AddFront fRM, 'CAT_HOST_SOURCE_PATH='sTkMain'\BIN;'
     563    call EnvVar_AddFront fRM, 'CAT_HOST_SOURCE_PATH='sPathTK'\BIN;'
    343564    */
    344     return 0;
     565return 0;
    345566
    346567
     
    355576     * Toolkit (4.5) main directory.
    356577     */
    357      sTKMain    = 'd:\knut\tools\toolkit45';
    358 
    359     call EnvVar_Set      fRM, 'tkmain',  sTkMain;
    360 
    361     call EnvVar_AddFront fRM, 'path',        sTkMain'\bin;'
    362     call EnvVar_AddFront fRM, 'dpath',       sTkMain'\book;'
    363     call EnvVar_AddFront fRM, 'dpath',       sTkMain'\msg;'
    364     call EnvVar_AddFront fRM, 'beginlibpath', sTkMain'\dll;'
    365     call EnvVar_AddFront fRM, 'help',        sTkMain'\help;'
    366     call EnvVar_AddFront fRM, 'bookshelf',   sTkMain'\archived;'
    367     call EnvVar_AddFront fRM, 'bookshelf',   sTkMain'\book;'
    368     call EnvVar_AddFront fRM, 'nlspath',     sTkMain'\msg\%N;'
    369     call EnvVar_AddEnd   fRM, 'ulspath',     sTkMain'\language;'
    370     call EnvVar_AddFront fRM, 'include',     sTkMain'\H;'
    371     call EnvVar_AddFront fRM, 'include',     sTkMain'\H\GL;'
    372     call EnvVar_AddFront fRM, 'include',     sTkMain'\SPEECH\H;'
    373     call EnvVar_AddFront fRM, 'include',     sTkMain'\H\RPC;'
    374     call EnvVar_AddFront fRM, 'include',     sTkMain'\H\NETNB;'
    375     call EnvVar_AddFront fRM, 'include',     sTkMain'\H\NETINET;'
    376     call EnvVar_AddFront fRM, 'include',     sTkMain'\H\NET;'
    377     call EnvVar_AddFront fRM, 'include',     sTkMain'\H\ARPA;'
    378     call EnvVar_AddFront fRM, 'include',     sTkMain'\INC;'
    379     call EnvVar_AddEnd   fRM, 'lib',         sTkMain'\SAMPLES\MM\LIB;'
    380     call EnvVar_AddEnd   fRM, 'lib',         sTkMain'\SPEECH\LIB;'
    381     call EnvVar_AddFront fRM, 'lib',         sTkMain'\lib;'
    382     call EnvVar_AddEnd   fRM, 'helpndx',     'EPMKWHLP.NDX', '+', 1
    383     call EnvVar_AddFront fRM, 'ipfc',        sTkMain'\ipfc;'
     578     sPathTK    = QueryPath('toolkit45');
     579    call EnvVar_Set      fRM, 'PATH_TOOLKIT',  sPathTK;
     580
     581    call EnvVar_AddFront fRM, 'path',        sPathTK'\bin;'
     582    call EnvVar_AddFront fRM, 'dpath',       sPathTK'\book;'
     583    call EnvVar_AddFront fRM, 'dpath',       sPathTK'\msg;'
     584    call EnvVar_AddFront fRM, 'beginlibpath', sPathTK'\dll;'
     585    call EnvVar_AddFront fRM, 'help',        sPathTK'\help;'
     586    call EnvVar_AddFront fRM, 'bookshelf',   sPathTK'\archived;'
     587    call EnvVar_AddFront fRM, 'bookshelf',   sPathTK'\book;'
     588    call EnvVar_AddFront fRM, 'nlspath',     sPathTK'\msg\%N;'
     589    call EnvVar_AddEnd   fRM, 'ulspath',     sPathTK'\language;'
     590    call EnvVar_AddFront fRM, 'include',     sPathTK'\H;'
     591    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\GL;'
     592    call EnvVar_AddFront fRM, 'include',     sPathTK'\SPEECH\H;'
     593    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\RPC;'
     594    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\NETNB;'
     595    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\NETINET;'
     596    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\NET;'
     597    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\ARPA;'
     598    call EnvVar_AddFront fRM, 'include',     sPathTK'\INC;'
     599    call EnvVar_AddEnd   fRM, 'lib',         sPathTK'\SAMPLES\MM\LIB;'
     600    call EnvVar_AddEnd   fRM, 'lib',         sPathTK'\SPEECH\LIB;'
     601    call EnvVar_AddFront fRM, 'lib',         sPathTK'\lib;'
     602    call EnvVar_AddFront fRM, 'helpndx',     'EPMKWHLP.NDX+', '+'
     603    call EnvVar_AddFront fRM, 'ipfc',        sPathTK'\ipfc;'
    384604    call EnvVar_Set      fRM, 'LANG',        'en_us'
    385605    call EnvVar_Set      fRM, 'CPREF',       'CP1.INF+CP2.INF+CP3.INF'
     
    395615    */
    396616
    397     return 0;
     617return 0;
     618
     619
     620/**
     621 * This will envolve into an full UNIX like environment some day perhaps...
     622 */
     623Unix: procedure
     624    parse arg fRM
     625
     626    /*
     627     * Unix root directory.
     628     */
     629    sUnixBack = QueryPath('unixroot');
     630    sUnixForw = translate(sUnixBack, '/', '\');
     631    call EnvVar_Set      fRM, 'PATH_UNIX',          sUnixBack
     632    call EnvVar_Set      fRM, 'unixroot',           sUnixBack
     633    call EnvVar_AddFront fRM, 'path',               sUnixBack'\bin;'sUnixBack'\usr\local\bin;'
     634    call EnvVar_AddFront fRM, 'beginlibpath',       sUnixBack'\dll;'
     635    call EnvVar_Set      fRM, 'groff_font_path',    sUnixForw'/lib/groff/font'
     636    call EnvVar_Set      fRM, 'groff_tmac_path',    sUnixForw'/lib/groff/tmac'
     637    call EnvVar_Set      fRM, 'refer',              sUnixForw'/lib/groff/dict/papers/ind'
     638
     639    call EnvVar_Set      fRM, 'editor',             'e:/verkty/boxer/b2.exe -Vr25'
     640
     641    /*
     642     * XFree86 main directory.
     643     */
     644    sXF86Back = QueryPath('xfree86');
     645    sXF86Forw = translate(sXF86Back, '/', '\');
     646    call EnvVar_Set      fRM, 'PATH_XFREE86',       sXF86Back
     647    call EnvVar_AddFront fRM, 'C_INCLUDE_PATH',     sXF86Forw'/include'
     648    call EnvVar_AddFront fRM, 'CPLUS_INCLUDE_PATH', sXF86Forw'/include'
     649    call EnvVar_Set      fRM, 'OBJC_INCLUDE_PATH',  sXF86Forw'/include'
     650    call EnvVar_AddFront fRM, 'LIBRARY_PATH',       sXF86Forw'/lib'
     651
     652return EMX(fRM);
    398653
    399654
     
    402657 * IBM Visual Age for C++ v3.08 for OS/2
    403658 */
    404 VAC30: procedure
     659VAC308: procedure
    405660    parse arg fRM
    406661
     
    408663     * IBM Visual Age for C++ Version 3.08 main directory.
    409664     */
    410     sCPPMain = 'c:\appl\os2\ibmcpp30'
    411     call EnvVar_Set      fRM, 'CCENV',      'VAC30'
    412     call EnvVar_Set      fRM, 'build_env',  'VAC308'
    413     call EnvVar_Set      fRM, 'CPPMAIN',        sCPPMain
    414     call EnvVar_AddFront fRM, 'beginlibpath',   sCPPMain'\DLL;'sCPPMain'\SAMPLES\TOOLKIT\DLL;'
    415     call EnvVar_AddFront fRM, 'path',           sCPPMain'\BIN;'sCPPMain'\SMARTS\SCRIPTS;'sCPPMain'\HELP;'
    416     call EnvVar_AddFront fRM, 'dpath',          sCPPMain'\HELP;'sCPPMain';'sCPPMain'\LOCALE;'sCPPMain'\MACROS;'sCPPMain'\BND;'
    417     call EnvVar_AddFront fRM, 'help',           sCPPMain'\HELP;'sCPPMain'\SAMPLES\TOOLKIT\HELP;'
    418     call EnvVar_AddFront fRM, 'bookshelf',      sCPPMain'\HELP;'
    419     call EnvVar_AddFront fRM, 'somir',          sCPPMain'\ETC\SOM.IR;'
     665    sPathCPP = QueryPath('vac308');
     666    call EnvVar_Set      fRM, 'PATH_VAC308',    sPathCPP
     667    call EnvVar_Set      fRM, 'CCENV',      'VAC3'
     668    call EnvVar_Set      fRM, 'BUILD_ENV',  'VAC308'
     669    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     670
     671    call EnvVar_AddFront fRM, 'beginlibpath',   sPathCPP'\DLL;'sPathCPP'\SAMPLES\TOOLKIT\DLL;'
     672    call EnvVar_AddFront fRM, 'path',           sPathCPP'\BIN;'sPathCPP'\SMARTS\SCRIPTS;'sPathCPP'\HELP;'
     673    call EnvVar_AddFront fRM, 'dpath',          sPathCPP'\HELP;'sPathCPP';'sPathCPP'\LOCALE;'sPathCPP'\MACROS;'sPathCPP'\BND;'
     674    call EnvVar_AddFront fRM, 'help',           sPathCPP'\HELP;'sPathCPP'\SAMPLES\TOOLKIT\HELP;'
     675    call EnvVar_AddFront fRM, 'bookshelf',      sPathCPP'\HELP;'
     676    call EnvVar_AddFront fRM, 'somir',          sPathCPP'\ETC\SOM.IR;'
    420677    call EnvVar_AddFront fRM, 'cpphelp_ini',    'C:\OS2\SYSTEM'
    421     call EnvVar_AddFront fRM, 'locpath',        sCPPMain'\LOCALE;%LOCPATH%;'
    422     call EnvVar_AddFront fRM, 'include',        sCPPMain'\INCLUDE;'sCPPMain'\INCLUDE\OS2;'sCPPMain'\INC;'sCPPMain'\INCLUDE\SOM;'
    423     call EnvVar_AddFront fRM, 'sminclude',      sCPPMain'\INCLUDE\OS2;'sCPPMain'\INCLUDE;'sCPPMain'\INCLUDE\SOM;'
    424 
    425     call EnvVar_AddFront fRM, 'vbpath',         '.;'sCPPMain'\DDE4VB;'
     678    call EnvVar_AddFront fRM, 'locpath',        sPathCPP'\LOCALE;%LOCPATH%;'
     679    call EnvVar_AddFront fRM, 'include',        sPathCPP'\INCLUDE;'sPathCPP'\INCLUDE\OS2;'sPathCPP'\INC;'sPathCPP'\INCLUDE\SOM;'
     680    call EnvVar_AddFront fRM, 'sminclude',      sPathCPP'\INCLUDE\OS2;'sPathCPP'\INCLUDE;'sPathCPP'\INCLUDE\SOM;'
     681
     682    call EnvVar_AddFront fRM, 'vbpath',         '.;'sPathCPP'\DDE4VB;'
    426683    call EnvVar_Set      fRM, 'tmpdir',         EnvVar_Get('tmp')
    427684    call EnvVar_Set      fRM, 'lxevfref',       'EVFELREF.INF+LPXCREF.INF'
    428685    call EnvVar_Set      fRM, 'lxevfhdi',       'EVFELHDI.INF+LPEXHDI.INF'
    429     call EnvVar_AddFront fRM, 'lpath',          sCPPMain'\MACROS;'
    430     call EnvVar_AddFront fRM, 'codelpath',      sCPPMain'\CODE\MACROS;'sCPPMain'\MACROS;'
     686    call EnvVar_AddFront fRM, 'lpath',          sPathCPP'\MACROS;'
     687    call EnvVar_AddFront fRM, 'codelpath',      sPathCPP'\CODE\MACROS;'sPathCPP'\MACROS;'
    431688    call EnvVar_Set      fRM, 'clref',          'CPPCLRF.INF+CPPDAT.INF+CPPAPP.INF+CPPWIN.INF+CPPCTL.INF+CPPADV.INF+CPP2DG.INF+CPPDDE.INF+CPPDM.INF+CPPMM.INF+CPPCLRB.INF'
    432     call EnvVar_AddFront fRM, 'ipfc',           sCPPMain'\IPFC'
    433     call EnvVar_AddFront fRM, 'lib',            sCPPMain'\LIB;'sCPPMain'\DLL;'
    434     call EnvVar_Set      fRM, 'cpplocal',       sCPPMain
    435     call EnvVar_Set      fRM, 'cppmain',        sCPPMain
    436     call EnvVar_Set      fRM, 'cppwork',        sCPPMain
     689    call EnvVar_AddFront fRM, 'ipfc',           sPathCPP'\IPFC'
     690    call EnvVar_AddFront fRM, 'lib',            sPathCPP'\LIB;'sPathCPP'\DLL;'
     691    call EnvVar_Set      fRM, 'cpplocal',       sPathCPP
     692    call EnvVar_Set      fRM, 'cppmain',        sPathCPP
     693    call EnvVar_Set      fRM, 'cppwork',        sPathCPP
    437694    call EnvVar_Set      fRM, 'iwf.default_prj','CPPDFTPRJ'
    438695
     
    440697    call EnvVar_Set      fRM, 'vacpp_shared'    'FALSE'
    441698    call EnvVar_Set      fRM, 'iwfhelp',        'IWFHDI.INF'
    442     call EnvVar_Set      fRM, 'iwfopt',         sCPPMain
    443 
    444     call EnvVar_Set      fRM, 'somruntime',     sCPPMain'\DLL'
     699    call EnvVar_Set      fRM, 'iwfopt',         sPathCPP
     700
     701    call EnvVar_Set      fRM, 'somruntime',     sPathCPP'\DLL'
    445702    call EnvVar_Set      fRM, 'smaddstar',      '1'
    446703    call EnvVar_Set      fRM, 'smemit',         'h;ih;c'
    447     call EnvVar_Set      fRM, 'sombase',        sCPPMain
     704    call EnvVar_Set      fRM, 'sombase',        sPathCPP
    448705    call EnvVar_Set      fRM, 'smtmp',          EnvVar_Get('tmp')
    449706    call EnvVar_Set      fRM, 'smclasses',      'WPTYPES.IDL'
    450707
    451708    /* FIXME THESE USES '+' AS SEPERATOR NOT ';'!!! */
    452     call EnvVar_AddFront fRM, 'helpndx',        'CPP.NDX+CPPBRS.NDX', '+',1
     709    call EnvVar_AddFront fRM, 'helpndx',        'EPMKWHLP.NDX+CPP.NDX+CPPBRS.NDX', '+'
    453710    call EnvVar_AddFront fRM, 'ipf_keys',       'SHOWNAV'
    454     return 0;
     711
     712
     713return 0;
    455714
    456715
     
    459718 * Visual Age / C and C++ tools v3.6.5 for OS/2
    460719 */
    461 VAC36: procedure
     720VAC365: procedure
    462721    parse arg fRM
    463722
     
    465724     * IBM C/C++ Compiler and Tools Version 3.6.5 main directory.
    466725     */
    467     sCxxMain    = 'e:\apps\ibmcxxo';
    468 
     726    sPathCxx    = QueryPath('vac365');
     727    call EnvVar_Set      fRM, 'PATH_VAC365', sPathCxx;
    469728    call EnvVar_Set      fRM, 'CCENV',      'VAC36'
    470     call EnvVar_Set      fRM, 'build_env',  'VAC365'
    471     call EnvVar_Set      fRM, 'cxxmain', sCxxMain;
    472     call EnvVar_AddFront fRM, 'beginlibpath', sCxxMain'\dll;'sCxxMain'\runtime;'
    473     call EnvVar_AddFront fRM, 'dpath',       sCxxMain'\help;'sCxxMain'\local;'
    474     call EnvVar_AddFront fRM, 'path',        sCxxMain'\bin;'
    475     call EnvVar_AddFront fRM, 'help',        sCxxMain'\help;'
    476     call EnvVar_AddFront fRM, 'locpath',     sCxxMain'\locale;'
    477     call EnvVar_AddFront fRM, 'nlspath',     sCxxMain'\msg\%N;'
    478     call EnvVar_AddFront fRM, 'include',     sCxxMain'\include;'
    479     call EnvVar_AddFront fRM, 'lib',         sCxxMain'\lib;'
    480     call EnvVar_AddFront fRM, 'ipfc',        sCxxMain'\bin;'
     729    call EnvVar_Set      fRM, 'BUILD_ENV',  'VAC365'
     730    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     731
     732    call EnvVar_Set      fRM, 'cxxmain',     sPathCxx;
     733    call EnvVar_AddFront fRM, 'path',        sPathCxx'\bin;'
     734    call EnvVar_AddFront fRM, 'dpath',       sPathCxx'\local;'sPathCxx'\help;'
     735    call EnvVar_AddFront fRM, 'beginlibpath',sPathCxx'\dll;'sPathCxx'\runtime;'
     736    call EnvVar_AddFront fRM, 'nlspath',     sPathCxx'\msg\%N;'
     737    call EnvVar_AddFront fRM, 'include',     sPathCxx'\include;'
     738    call EnvVar_AddFront fRM, 'lib',         sPathCxx'\lib;'
     739    call EnvVar_AddFront fRM, 'ipfc',        sPathCxx'\ipfc;'
    481740    call EnvVar_Set      fRM, 'LANG',        'en_us'
    482741    call EnvVar_Set      fRM, 'CPP_DBG_LANG', 'CPP'
    483     return 0;
    484 
    485 
    486 /*
    487  * Visual Age for C++ v4.0 for OS/2.
     742
     743return 0;
     744
     745
     746/*
     747 * Visual Age for C++ v4.0 for OS/2
    488748 */
    489749VAC40: procedure
     
    493753     * IBM VisualAge for C++ v4.0 main directory.
    494754     */
    495     sVACppMain    = 'e:\apps\ibmcpp40';
    496 
    497     call EnvVar_Set      fRM, 'vacppmain',  sVACppMain;
    498     call EnvVar_Set      fRM, 'build_env',  'VAC365' /* on purpose! */
    499     call EnvVar_Set      fRM, 'CCENV',      'VAC36'
    500 
    501     call EnvVar_AddFront fRM, 'beginlibpath', sVACppMain'\dll;'sVACppMain'\runtime;'
    502     call EnvVar_AddFront fRM, 'dpath',       sVACppMain'\etc;'sVACppMain'\help;'sVACppMain'\runtime;'
    503     call EnvVar_AddFront fRM, 'path',        sVACppMain'\bin;'
    504     call EnvVar_AddFront fRM, 'help',        sVACppMain'\help;'
    505     call EnvVar_AddFront fRM, 'locpath',     sVACppMain'\runtime\locale;'
    506     call EnvVar_AddFront fRM, 'nlspath',     sVACppMain'\msg\%N;'
    507     call EnvVar_AddFront fRM, 'include',     sVACppMain'\ivb;'sVACppMain'\include;'
    508     call EnvVar_AddFront fRM, 'lib',         sVACppMain'\lib;'
    509     call EnvVar_AddFront fRM, 'ipfc',        sVACppMain'\bin;'
    510     call EnvVar_Set      fRM, 'cpplpath4',   sVACppMain'\macros'
    511     call EnvVar_Set      fRM, 'system_ice',  sVACppMain'\etc\system.ice'
    512     call EnvVar_Set      fRM, 'vbpath',      sVACppMain'\ivb'
     755    sPathCPP    = QueryPath('vac40');
     756    call EnvVar_Set      fRM, 'PATH_VAC40',  sPathCPP;
     757    call EnvVar_Set      fRM, 'CCENV',      'VAC40'
     758    call EnvVar_Set      fRM, 'BUILD_ENV',  'VAC40'
     759    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     760
     761    call EnvVar_AddFront fRM, 'path',        sPathCPP'\bin;'
     762    call EnvVar_AddFront fRM, 'dpath',       sPathCPP'\etc;'sPathCPP'\help;'
     763    call EnvVar_AddFront fRM, 'beginlibpath',sPathCPP'\dll;'sPathCPP'\runtime;'
     764    call EnvVar_AddFront fRM, 'help',        sPathCPP'\help;'
     765    call EnvVar_AddFront fRM, 'nlspath',     sPathCPP'\msg\%N;'
     766    call EnvVar_AddFront fRM, 'locpath',     sPathCPP'\locale;'sPathCPP'\runtime\locale;'
     767    call EnvVar_AddFront fRM, 'include',     sPathCPP'\ivb;'sPathCPP'\include;'
     768    call EnvVar_AddFront fRM, 'lib',         sPathCPP'\lib;'
     769    call EnvVar_AddFront fRM, 'ipfc',        sPathCPP'\bin;'
     770    call EnvVar_AddFront fRM, 'cpplpath4',   sPathCPP'\macros;'
     771    call EnvVar_Set      fRM, 'system_ice',  sPathCPP'\etc\system.ice'
     772    call EnvVar_Set      fRM, 'vbpath',      sPathCPP'\ivb'
     773    call EnvVar_Set      fRM, 'vacppmain',   sPathCPP;
    513774    call EnvVar_Set      fRM, 'os2',         '1'
    514     call EnvVar_Set      fRM, 'LANG',        'en_us'
    515     return 0;
    516 
    517 
    518 /*
    519  * Watcom C/C++ 11.0
    520  */
    521 Watcom: procedure
    522     parse arg fRM
    523 
    524     /*
    525      * Watcom C/C++ 11.0 Main directory.
    526      */
    527     sWatcom = 'd:\knut\apps\Watcom';
    528 
     775
     776return 0;
     777
     778
     779
     780
     781/*
     782 * WarpIn
     783 */
     784WarpIn: procedure
     785    parse arg fRM
     786
     787    /*
     788     * WarpIn main directory.
     789     */
     790    sPathWarpIn = QueryPath('warpin');
     791    call EnvVar_Set      fRM, 'PATH_WARPIN', sPathWarpIn;
     792    call EnvVar_AddFront fRM, 'path',        sPathWarpIn';'
     793    call EnvVar_AddFront fRM, 'bookshelf',   sPathWarpIn';'
     794return 0;
     795
     796
     797
     798/*
     799 * WatCom C/C++ v11.0
     800 */
     801WatComC11: procedure
     802    parse arg fRM
     803
     804    /*
     805     * Watcom C/C++ v11.0 main directory
     806     */
     807    sPathWatcom = QueryPath('watcom11');
     808    call EnvVar_Set      fRM, 'PATH_WATCOM', sPathWatcom
    529809    call EnvVar_Set      fRM, 'CCENV',      'WAT'
    530     call EnvVar_Set      fRM, 'build_env',  'WATCOM'
    531     call EnvVar_Set      fRM, 'watcom', sWatcom;
    532     call EnvVar_Set      fRM, 'edpath',      sWatcom'\eddat'
    533     call EnvVar_AddFront fRM, 'beginlibpath', sWatcom'\binp\dll;'
    534     call EnvVar_AddFront fRM, 'path',        sWatcom'\binp;'sWatcom'\binw;'
    535     call EnvVar_AddFront fRM, 'help',        sWatcom'\binp\help;'
    536     call EnvVar_AddFront fRM, 'bookshelf',   sWatcom'\binp\help;'
    537     call EnvVar_AddFront fRM, 'include',     sWatcom'\h;'
    538   /*call EnvVar_AddFront fRM, 'include',     sWatcom'\h\os2;'sWatcom'\h;'*/ /* h\os2 ? */
    539 /*
    540     'detach' sWatcom'\binp\batserv.exe'
    541     'detach' sWatcom'\binp\nmpbind.exe'
    542 */
    543     return 0;
    544 
    545 
    546 /*
    547  * WarpIn
    548  */
    549 WarpIn: procedure
    550     parse arg fRM
    551 
    552     /*
    553      * Concurrent Versions System (CVS) main directory.
    554      */
    555     sWarpInMain = 'd:\knut\tools\WarpIn';
    556     call EnvVar_Set      fRM, 'sWarpInMain', sWarpInMain;
    557     call EnvVar_AddFront fRM, 'path',        sWarpInMain';'
    558     call EnvVar_AddFront fRM, 'beginlibpath', sWarpInMain';'
    559     call EnvVar_AddFront fRM, 'bookshelf',   sWarpInMain';'
    560     return 0;
     810    call EnvVar_Set      fRM, 'BUILD_ENV',  'WAT11'
     811    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     812
     813    call EnvVar_Set      fRM, 'watcom',      sPathWatcom
     814    call EnvVar_AddFront fRM, 'path',        sPathWatcom'\binp;'sPathWatcom'\binw;'
     815    call EnvVar_AddFront fRM, 'beginlibpath',sPathWatcom'\binp\dll;'
     816    call EnvVar_AddFront fRM, 'help',        sPathWatcom'\binp\help;'
     817    call EnvVar_AddEnd   fRM, 'bookshelf',   sPathWatcom'\binp\help;'
     818    call EnvVar_AddFront fRM, 'include',     sPathWatcom'\h;'sPathWatcom'\h\os2;'sPathWatcom'\h\nt;'
     819    call EnvVar_AddFront fRM, 'lib',         sPathWatcom'\lib386;'sPathWatcom'\lib386\os2;'sPathWatcom'\lib286;'sPathWatcom'\lib286\os2;'
     820    call EnvVar_Set      fRM, 'edpath',      sPathWatcom'EDDAT;'
     821    /*
     822    rem detach %watcom%\BINP\BATSERV.EXE
     823    rem detach %watcom%\BINP\NMPBIND.EXE
     824    */
     825
     826return 0;
     827
     828/*
     829 * WatCom C/C++ v11.0c
     830 */
     831WatComC11c: procedure
     832    parse arg fRM
     833
     834    /*
     835     * Watcom C/C++ v11.0c main directory
     836     */
     837    sPathWatcom = QueryPath('watcom11c');
     838    call EnvVar_Set      fRM, 'PATH_WATCOM', sPathWatcom
     839    call EnvVar_Set      fRM, 'CCENV',      'WAT'
     840    call EnvVar_Set      fRM, 'BUILD_ENV',  'WAT11'
     841    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     842
     843    call EnvVar_Set      fRM, 'watcom',      sPathWatcom
     844    call EnvVar_AddFront fRM, 'path',        sPathWatcom'\binp;'sPathWatcom'\binw;'
     845    call EnvVar_AddFront fRM, 'beginlibpath',sPathWatcom'\binp\dll;'
     846    call EnvVar_AddFront fRM, 'help',        sPathWatcom'\binp\help;'
     847    call EnvVar_AddEnd   fRM, 'bookshelf',   sPathWatcom'\binp\help;'
     848    call EnvVar_AddFront fRM, 'include',     sPathWatcom'\h;'sPathWatcom'\h\os2;'sPathWatcom'\h\nt;'
     849    call EnvVar_AddFront fRM, 'lib',         sPathWatcom'\lib386;'sPathWatcom'\lib386\os2;'sPathWatcom'\lib286;'sPathWatcom'\lib286\os2;'
     850    call EnvVar_Set      fRM, 'edpath',      sPathWatcom'EDDAT;'
     851    /*
     852    rem detach %watcom%\BINP\BATSERV.EXE
     853    rem detach %watcom%\BINP\NMPBIND.EXE
     854    */
     855
     856return 0;
     857
     858
     859
     860
     861
     862
     863
     864
     865
     866
    561867
    562868
     
    567873
    568874
    569 /*
     875/**
    570876 * Add sToAdd in front of sEnvVar.
    571877 * Note: sToAdd now is allowed to be alist!
     
    575881 */
    576882EnvVar_addFront: procedure
    577     parse arg fRM, sEnvVar, sToAdd, sSeparator, fNoEnd
    578 
    579     /* Sets default separator and fNoEnd if not specified. */
     883    parse arg fRM, sEnvVar, sToAdd, sSeparator
     884
     885    /* sets default separator if not specified. */
    580886    if (sSeparator = '') then sSeparator = ';';
    581     if (fNoEnd = '')     then fNoEnd = 0;
    582 
    583     /* Add evt. missing separator at end. */
     887
     888    /* checks that sToAdd ends with an ';'. Adds one if not. */
    584889    if (substr(sToAdd, length(sToAdd), 1) <> sSeparator) then
    585890        sToAdd = sToAdd || sSeparator;
    586891
    587     /* Check and evt. remove separator at start of sToAdd */
    588     if (substr(sToAdd, 1, 1) = cSeparator) then
     892    /* check and evt. remove ';' at start of sToAdd */
     893    if (substr(sToAdd, 1, 1) = ';') then
    589894        sToAdd = substr(sToAdd, 2);
    590895
    591     /* Loop thru sToAdd */
     896    /* loop thru sToAdd */
    592897    rc = 0;
    593898    i = length(sToAdd);
    594899    do while i > 1 & rc = 0
    595900        j = lastpos(sSeparator, sToAdd, i-1);
    596         rc = _EnvVar_AddFront2(fRM, sEnvVar, substr(sToAdd, j+1, i - j), sSeparator, fNoEnd);
     901        rc = EnvVar_AddFront2(fRM, sEnvVar, substr(sToAdd, j+1, i - j), sSeparator);
    597902        i = j;
    598903    end
     904
    599905return rc;
    600906
    601 
    602 /*
     907/**
    603908 * Add sToAdd in front of sEnvVar.
    604909 *
     
    606911 *                 is at the end and don't end with a ';'.
    607912 */
    608 _EnvVar_AddFront2: procedure
    609     parse arg fRM, sEnvVar, sToAdd, sSeparator, fNoEnd
    610 
    611     /* Add evt. missing separator at end. */
     913EnvVar_AddFront2: procedure
     914    parse arg fRM, sEnvVar, sToAdd, sSeparator
     915
     916    /* sets default separator if not specified. */
     917    if (sSeparator = '') then sSeparator = ';';
     918
     919    /* checks that sToAdd ends with a separator. Adds one if not. */
    612920    if (substr(sToAdd, length(sToAdd), 1) <> sSeparator) then
    613921        sToAdd = sToAdd || sSeparator;
    614922
    615     /* Check and evt. remove the separator at start of sToAdd */
     923    /* check and evt. remove the separator at start of sToAdd */
    616924    if (substr(sToAdd, 1, 1) = sSeparator) then
    617925        sToAdd = substr(sToAdd, 2);
    618926
    619     /* Get original variable without sToAdd. */
    620     sOrgEnvVar = _EnvVar_RemoveFrom(EnvVar_Get(sEnvVar),,
    621                                     sToAdd, sSeparator, fNoEnd);
    622 
    623     /* If only removing - nothing more to do */
     927    /* Get original variable value */
     928    sOrgEnvVar = EnvVar_Get(sEnvVar);
     929
     930    /* Remove previously sToAdd if exists. (Changing sOrgEnvVar). */
     931    i = pos(translate(sToAdd), translate(sOrgEnvVar));
     932    if (i > 0) then
     933        sOrgEnvVar = substr(sOrgEnvVar, 1, i-1) || substr(sOrgEnvVar, i + length(sToAdd));
     934
     935    /* set environment */
    624936    if (fRM) then
    625937        return EnvVar_Set(0, sEnvVar, sOrgEnvVar);
    626 
    627     /* Create new value */
    628     sNewValue = sToAdd || sOrgEnvVar;
    629 
    630     /* Remove or add separator if necessary */
    631     if (fNoEnd  & substr(sNewValue, length(sNewValue), 1) =  sSeparator) then
    632         sNewValue = substr(sNewValue, 1, length(sNewValue) - 1);
    633     if (\fNoEnd & substr(sNewValue, length(sNewValue), 1) <> sSeparator) then
    634         sNewValue = sNewValue || sSeparator;
    635 
    636     /* Set environment */
    637     return EnvVar_Set(0, sEnvVar, sNewValue);
    638 
    639 
    640 /*
     938return EnvVar_Set(0, sEnvVar, sToAdd||sOrgEnvVar);
     939
     940
     941/**
    641942 * Add sToAdd as the end of sEnvVar.
    642943 * Note: sToAdd now is allowed to be alist!
     
    646947 */
    647948EnvVar_addEnd: procedure
    648     parse arg fRM, sEnvVar, sToAdd, sSeparator, fNoEnd
    649 
    650     /* Sets default separator and fNoEnd if not specified. */
     949    parse arg fRM, sEnvVar, sToAdd, sSeparator
     950
     951    /* sets default separator if not specified. */
    651952    if (sSeparator = '') then sSeparator = ';';
    652     if (fNoEnd = '')     then fNoEnd = 0;
    653 
    654     /* Add evt. missing separator at end. */
     953
     954    /* checks that sToAdd ends with a separator. Adds one if not. */
    655955    if (substr(sToAdd, length(sToAdd), 1) <> sSeparator) then
    656956        sToAdd = sToAdd || sSeparator;
    657957
    658     /* Check and evt. remove separator at start of sToAdd */
     958    /* check and evt. remove ';' at start of sToAdd */
    659959    if (substr(sToAdd, 1, 1) = sSeparator) then
    660960        sToAdd = substr(sToAdd, 2);
    661961
    662     /* Loop thru sToAdd */
     962    /* loop thru sToAdd */
    663963    rc = 0;
    664964    i = length(sToAdd);
    665965    do while i > 1 & rc = 0
    666966        j = lastpos(sSeparator, sToAdd, i-1);
    667         rc = _EnvVar_AddEnd2(fRM, sEnvVar, substr(sToAdd, j+1, i - j), sSeparator, fNoEnd);
     967        rc = EnvVar_AddEnd2(fRM, sEnvVar, substr(sToAdd, j+1, i - j), sSeparator);
    668968        i = j;
    669969    end
    670970
    671     return rc;
    672 
    673 /*
     971return rc;
     972
     973/**
    674974 * Add sToAdd as the end of sEnvVar.
    675975 *
     
    677977 *                 is at the end and don't end with a ';'.
    678978 */
    679 _EnvVar_AddEnd2: procedure
    680     parse arg fRM, sEnvVar, sToAdd, sSeparator, fNoEnd
    681 
    682     /* Check and evt. remove separator at start of sToAdd */
     979EnvVar_AddEnd2: procedure
     980    parse arg fRM, sEnvVar, sToAdd, sSeparator
     981
     982    /* sets default separator if not specified. */
     983    if (sSeparator = '') then sSeparator = ';';
     984
     985    /* checks that sToAdd ends with a separator. Adds one if not. */
     986    if (substr(sToAdd, length(sToAdd), 1) <> sSeparator) then
     987        sToAdd = sToAdd || sSeparator;
     988
     989    /* check and evt. remove separator at start of sToAdd */
    683990    if (substr(sToAdd, 1, 1) = sSeparator) then
    684991        sToAdd = substr(sToAdd, 2);
    685992
    686     /* Get original variable without sToAdd. */
    687     sOrgEnvVar = _EnvVar_RemoveFrom(EnvVar_Get(sEnvVar),,
    688                                     sToAdd, sSeparator, fNoEnd);
    689 
    690     /* If we're only to remove the sToAdd value, we're finised now. */
    691     if (fRM) then
    692         return EnvVar_Set(0, sEnvVar, sOrgEnvVar);
    693 
    694     /* fNoEnd: remove separator at end (if any) and remove previously sToAdd. */
    695     if (fNoEnd & substr(sToAdd, length(sToAdd), 1) = sSeparator) then
    696         sToAdd = substr(sToAdd, 1, length(sToAdd) - 1);
    697 
    698     /* Add separator to sOrgEnvVar if fNoEnd and sOrgEnvVar is not empty */
    699     if (fNoEnd & length(sOrgEnvVar) > 0) then
    700         return EnvVar_Set(0, sEnvVar, sOrgEnvVar||sSeparator||sToAdd);
    701     return EnvVar_Set(0, sEnvVar, sOrgEnvVar||sToAdd);
    702 
    703 
    704 /*
    705  * Removes a value for a separated enviroment string.
    706  */
    707 _EnvVar_RemoveFrom: procedure
    708     parse arg sOrgValue, sValue, sSeparator, fNoEnd
    709 
    710     /* test for empty org value */
    711     if (sOrgValue = '') then
    712         return '';
    713 
    714     /* remove any separators in front or end of sValue. */
    715     if (substr(sValue, 1, 1) = sSeparator) then
    716         sValue = substr(sValue, 2);
    717     if (substr(sValue, length(sValue), 1) = sSeparator) then
    718         sValue = substr(sValue, 1, length(sValue) - 1);
    719 
    720     /* look for sValue */
    721     i = pos(translate(sValue), translate(sOrgValue));
    722     do while (i > 0)
    723         cch = length(sValue);
    724         fEnd = length(sOrgValue) <= cch + i;
    725 
    726         /* check if ok */
    727         if (i <= 1) then fOkFront = 1;
    728         else    fOkFront = (substr(sOrgValue, i - 1, 1) = sSeparator);
    729         if (fOkFront & (fEnd | substr(sOrgValue, i + cch, 1) = sSeparator)) then
    730         do
    731             /* addjust length / index to remove separators */
    732             if (i > 1)         then
    733             do
    734                 cch = cch + 1;
    735                 i = i - 1;
    736             end
    737             if (\fEnd & i = 1) then
    738                 cch = cch + 1;
    739 
    740             /* create new sOrgValue */
    741             if (i > 1) then
    742                 sOrgValue = substr(sOrgValue, 1, i - 1) || substr(sOrgValue, i + cch);
    743             else if (cch < length(sOrgValue)) then
    744                 sOrgValue = substr(sOrgValue, i + cch);
    745             else
    746                 sOrgValue = '';
    747         end
    748         else
    749             i = i + 1;
    750 
    751         /* more occurences? */
    752         j = i;
    753         i = pos(translate(sValue), translate(sOrgValue), i);
    754     end
    755 
    756     /* remove any start separator */
    757     do while (length(sOrgValue) > 0)
    758         if (substr(sOrgValue, 1, 1) <> sSeparator) then
    759             leave
    760         sOrgValue = substr(sOrgValue, 2);
    761     end
    762 
    763     /* Remove all separators at end */
    764     do while (length(sOrgValue) > 1)
    765         if (substr(sOrgValue, length(sOrgValue), 1) <> sSeparator) then
    766             leave;
    767         sOrgValue = substr(sOrgValue, 1, length(sOrgValue) - 1);
    768     end
    769 
    770     /* Just in case fix for value with only separator. (paranoia) */
    771     if (length(sOrgValue) = 1 & sOrgValue = sSeparator) then
    772         sOrgValue = '';
    773 
    774     /* Add end separator */
    775     if (length(sOrgValue) > 0 & \fNoEnd) then
    776         sOrgValue = sOrgValue || sSeparator;
    777 
    778     return sOrgValue;
    779 
    780 
    781 /*
     993    /* Get original variable value */
     994    sOrgEnvVar = EnvVar_Get(sEnvVar);
     995
     996    /* Remove previously sToAdd if exists. (Changing sOrgEnvVar). */
     997    i = pos(translate(sToAdd), translate(sOrgEnvVar));
     998    if (i > 0) then
     999        sOrgEnvVar = substr(sOrgEnvVar, 1, i-1) || substr(sOrgEnvVar, i + length(sToAdd));
     1000
     1001    /* checks that sOrgEnvVar ends with a separator. Adds one if not. */
     1002    if (substr(sOrgEnvVar, length(sOrgEnvVar), 1) <> sSeparator) then
     1003        sOrgEnvVar = sOrgEnvVar || sSeparator;
     1004
     1005    /* set environment */
     1006    if (fRM) then return EnvVar_Set(0, sEnvVar, sOrgEnvVar);
     1007return EnvVar_Set(0, sEnvVar, sOrgEnvVar||sToAdd);
     1008
     1009
     1010/**
    7821011 * Sets sEnvVar to sValue.
    7831012 */
     
    7861015
    7871016    /* if we're to remove this, make valuestring empty! */
    788     if fRM then
     1017    if (fRM) then
    7891018        sValue = '';
    7901019    sEnvVar = translate(sEnvVar);
     
    7961025     *      get it (with EnvVar_Get) again.
    7971026     */
    798     if sEnvVar = 'BEGINLIBPATH' | sEnvVar = 'ENDLIBPATH' then
    799         'set' sEnvVar'='sValue;
     1027    if ((sEnvVar = 'BEGINLIBPATH') | (sEnvVar = 'ENDLIBPATH')) then
     1028    do
     1029        if (length(sValue) >= 1024) then
     1030            say 'Warning: 'sEnvVar' is too long,' length(sValue)' char.';
     1031        return SysSetExtLibPath(sValue, substr(sEnvVar, 1, 1));
     1032    end
     1033
     1034    if (length(sValue) >= 1024) then
     1035    do
     1036        say 'Warning: 'sEnvVar' is too long,' length(sValue)' char.';
     1037        say '    This may make CMD.EXE unstable after a SET operation to print the environment.';
     1038    end
    8001039    sRc = VALUE(sEnvVar, sValue, 'OS2ENVIRONMENT');
    801     return 0;
    802 
    803 /*
     1040return 0;
     1041
     1042/**
    8041043 * Gets the value of sEnvVar.
    8051044 */
    8061045EnvVar_Get: procedure
    8071046    parse arg sEnvVar
    808     return value(sEnvVar,, 'OS2ENVIRONMENT');
    809 
    810 
    811 
     1047    if ((translate(sEnvVar) = 'BEGINLIBPATH') | (translate(sEnvVar) = 'ENDLIBPATH')) then
     1048        return SysQueryExtLibPath(substr(sEnvVar, 1, 1));
     1049return value(sEnvVar,, 'OS2ENVIRONMENT');
     1050
     1051
     1052/**
     1053 *  Workaround for bug in CMD.EXE.
     1054 *  It messes up when REXX have expanded the environment.
     1055 */
     1056FixCMDEnv: procedure
     1057    /* check for 4OS2 first */
     1058    Address CMD 'set 4os2test_env=%@eval[2 + 2]';
     1059    if (value('4os2test_env',, 'OS2ENVIRONMENT') = '4') then
     1060        return 0;
     1061
     1062    /* force environment expansion by setting a lot of variables and freeing them. */
     1063    do i = 1 to 100
     1064        Address CMD 'set dummyenvvar'||i'=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     1065    end
     1066    do i = 1 to 100
     1067        Address CMD 'set dummyenvvar'||i'=';
     1068    end
     1069return 0;
     1070
     1071
     1072
     1073/*
     1074 * DocBook 4.1.x XML.
     1075 */
     1076DocBookXML: procedure
     1077    parse arg fRM
     1078
     1079    /*
     1080     * DocBook XML dir.
     1081     */
     1082    sDocBookXML = 'e:\coding\DocBook\XML'
     1083
     1084    call EnvVar_Set      fRM, 'docbookxml',         sDocBookXML
     1085    call EnvVar_AddFront fRM, 'SGML_CATALOG_FILES', sDocBookXML'\docbook.cat;'
     1086
     1087    return 0;
     1088
     1089
     1090/*
     1091 * Jade 1.2.1 for OS/2.
     1092 */
     1093Jade: procedure
     1094    parse arg fRM
     1095
     1096    /*
     1097     * Jade install dir.
     1098     */
     1099    sJadeMain = 'e:\apps\jade'
     1100
     1101    call EnvVar_Set      fRM, 'jademain',           sJadeMain
     1102    call EnvVar_AddFront fRM, 'path',               sJadeMain';'
     1103    call EnvVar_AddFront fRM, 'SGML_CATALOG_FILES', sJadeMain'\catalog;'
     1104    call EnvVar_AddEnd   fRM, 'SGML_CATALOG_FILES', '.\catalog;'
     1105
     1106    return 0;
     1107
     1108
     1109
Note: See TracChangeset for help on using the changeset viewer.