Changeset 8424 for trunk/tools


Ignore:
Timestamp:
May 16, 2002, 1:50:23 PM (23 years ago)
Author:
bird
Message:

Merged in lastest changes.

Location:
trunk/tools/bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/CreatePath.cmd

    r5030 r8424  
    1 /* $Id: CreatePath.cmd,v 1.3 2001-01-26 21:33:13 phaller Exp $
     1/* $Id: CreatePath.cmd,v 1.4 2002-05-16 11:50:22 bird Exp $
    22 *
    33 * Createpath.cmd <pathname>
     
    1111
    1212    parse arg sArgs
    13     return createpath(sArgs);
     13    return createpath(strip(sArgs));
    1414
    1515createpath: procedure
     
    2727     */
    2828    rc = SysMkDir(sDir);
     29    /*say 'dir:' sDir '- rc='rc;*/
    2930
    3031    return 0;
  • trunk/tools/bin/Exists.cmd

    r5718 r8424  
    1 /* $Id: Exists.cmd,v 1.2 2001-05-16 01:17:03 bird Exp $
     1/* $Id: Exists.cmd,v 1.3 2002-05-16 11:50:23 bird Exp $
    22 *
    33 * Simple rexx util which checks if a file or directory exists.
     
    77 *              1 - file doesn't exist.
    88 *
    9  * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     9 * Copyright (c) 2000-2002 knut st. osmundsen (bird@anduin.net)
    1010 *
    11  * Project Odin Software License can be found in LICENSE.TXT
     11 * GPL
    1212 *
    1313 */
     
    2121        if (RxFuncQuery('SysFileTree') = 1) then
    2222            call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree';
    23         rc = SysFileTree(sFile, sDirs, 'DO');
     23        rc = SysFileTree(sFile, 'sDirs', 'DO');
    2424        if (rc = 0 & sDirs.0 = 1) then
    2525            exit(0);
  • trunk/tools/bin/buildenv.cmd

    r8357 r8424  
    1 /* $Id: buildenv.cmd,v 1.6 2002-04-30 19:52:51 bird Exp $
     1/* $Id: buildenv.cmd,v 1.7 2002-05-16 11:50:22 bird Exp $
    22 *
    33 * This is the master environment script. It contains settings for many
     
    1010 *
    1111 *
    12  * Change the QueryPath function to fit you local environment.
    13  * Change the QueryPath function to fit you local environment.
    14  * Change the QueryPath function to fit you local environment.
    15  *
    16  *
    1712 * Known problems:
    1813 *     - LANG is set to en_US by both VAC36 and TOOLKIT45. When unsetting
     
    2116
    2217    Address CMD '@echo off';
     18
     19    signal on novalue name NoValueHandler
    2320
    2421    /*
     
    5350
    5451    /*
     52     * Configuration - sorted please!
     53     */
     54    parse source . . sPathFile .
     55    sPathFile = sPathFile||'.paths';
     56    aPath.0 = 0;
     57
     58    i = 1;
     59    /* environment id               The function with args.                 Optional verify data.                       increment index */
     60    aCfg.i.sId = 'cvs';             aCfg.i.sSet = 'CVS';                    aCfg.i.sDesc = 'CVS v1.10 or later';        i = i + 1;
     61    aCfg.i.sId = 'db2v52';          aCfg.i.sSet = 'db2v52';                 aCfg.i.sDesc = 'DB2 v5.2 Dev Edition';      i = i + 1;
     62    aCfg.i.sId = 'ddkbase';         aCfg.i.sSet = 'DDKBase';                aCfg.i.sDesc = 'DDK base (recent)';  i = i + 1;
     63    aCfg.i.sId = 'emx';             aCfg.i.sSet = 'EMX';                    aCfg.i.sDesc = 'EMX v0.9d fixpack 04';      i = i + 1;
     64    aCfg.i.sId = 'emxpgcc';         aCfg.i.sSet = 'EMXPGCC';                aCfg.i.sDesc = 'Pentium Optimized GCC/EMX v1.1.1 r2 with binutils 2.9.1'; i = i + 1;
     65    aCfg.i.sId = 'icatgam';         aCfg.i.sSet = 'ICATGam';                aCfg.i.sDesc = 'ICAT for OS/2 latest'; i = i + 1;
     66    aCfg.i.sId = 'icatgam406rc1';   aCfg.i.sSet = 'ICATGam406RC1';          aCfg.i.sDesc = 'ICAT for OS/2 v4.0.6 release candidate 1'; i = i + 1;
     67    aCfg.i.sId = 'icatpe';          aCfg.i.sSet = 'ICATPe';                 aCfg.i.sDesc = 'ICAT for OS/2 with PE support (test version)'; i = i + 1;
     68    aCfg.i.sId = 'ida';             aCfg.i.sSet = 'IDA414';                 aCfg.i.sDesc = 'Interactive DisAssembler (IDA) (latest)'; i = i + 1;
     69    aCfg.i.sId = 'ida38';           aCfg.i.sSet = 'IDA38';                  aCfg.i.sDesc = 'Interactive DisAssembler (IDA) v3.80 (historical)'; i = i + 1;
     70    aCfg.i.sId = 'ida40';           aCfg.i.sSet = 'IDA40';                  aCfg.i.sDesc = 'Interactive DisAssembler (IDA) v4.0 (historical)'; i = i + 1;
     71    aCfg.i.sId = 'ida414';          aCfg.i.sSet = 'IDA414';                 aCfg.i.sDesc = 'Interactive DisAssembler (IDA) v4.14'; i = i + 1;
     72    aCfg.i.sId = 'idasdk';          aCfg.i.sSet = 'IDASDK';                 aCfg.i.sDesc = 'Interactive DisAssembler (IDA) SDK'; i = i + 1;
     73    aCfg.i.sId = 'mode12050';       aCfg.i.sSet = 'Mode,120,50';            aCfg.i.sDesc = 'mode 120,50'; i = i + 1;
     74    aCfg.i.sId = 'mode8050';        aCfg.i.sSet = 'Mode,80,50';             aCfg.i.sDesc = 'mode 80,50'; i = i + 1;
     75/* obsolete id   aCfg.i.sId = 'msc60';           aCfg.i.sSet = 'MSCV6_16';               aCfg.i.sDesc = 'MicroSoft C v6.0a 16-bit'; i = i + 1; */
     76    aCfg.i.sId = 'mscv6';           aCfg.i.sSet = 'MSCV6_32';               aCfg.i.sDesc = 'MicroSoft C v6.0 32-bit'; i = i + 1;
     77    aCfg.i.sId = 'mscv6-16';        aCfg.i.sSet = 'MSCV6_16';               aCfg.i.sDesc = 'MicroSoft C v6.0a 16-bit'; i = i + 1;
     78    aCfg.i.sId = 'mysql';           aCfg.i.sSet = 'mySQL';                  aCfg.i.sDesc = 'MySql any version (latest from Yuri is recommended)'; i = i + 1;
     79    aCfg.i.sId = 'netqos2';         aCfg.i.sSet = 'NetQOS2';                aCfg.i.sDesc = 'NetQOS2 - help system for VAC40,VAC365,DB2 and more.'; i = i + 1;
     80    aCfg.i.sId = 'odin32testcase';  aCfg.i.sSet = 'Odin32Testcase';         aCfg.i.sDesc = 'Odin32 testcase setup'; i = i + 1;
     81    aCfg.i.sId = 'perl';            aCfg.i.sSet = 'Perl';                   aCfg.i.sDesc = 'Perl v5.0053'; i = i + 1;
     82    aCfg.i.sId = 'python';          aCfg.i.sSet = 'Python';                 aCfg.i.sDesc = 'Python v1.5'; i = i + 1;
     83    aCfg.i.sId = 'toolkit40';       aCfg.i.sSet = 'Toolkit40';              aCfg.i.sDesc = 'Toolkit v4.0 CSD 4'; i = i + 1;
     84    aCfg.i.sId = 'toolkit45';       aCfg.i.sSet = 'Toolkit45';              aCfg.i.sDesc = 'Toolkit v4.5'; i = i + 1;
     85    aCfg.i.sId = 'toolkit451';      aCfg.i.sSet = 'Toolkit451';             aCfg.i.sDesc = 'Toolkit v4.5.1'; i = i + 1;
     86    aCfg.i.sId = 'unix';            aCfg.i.sSet = 'Unix';                   aCfg.i.sDesc = 'Misc unix stuff.'; i = i + 1;
     87/* obsolete id   aCfg.i.sId = 'vac30';           aCfg.i.sSet = 'VAC308';                 aCfg.i.sDesc = 'VisualAge for C++ v3.08'; i = i + 1; */
     88    aCfg.i.sId = 'vac308';           aCfg.i.sSet = 'VAC308';                 aCfg.i.sDesc = 'VisualAge for C++ v3.08'; i = i + 1;
     89/* osbolete id    aCfg.i.sId = 'vac36';           aCfg.i.sSet = 'VAC365';                 aCfg.i.sDesc = ''; i = i + 1; */
     90    aCfg.i.sId = 'vac365';          aCfg.i.sSet = 'VAC365';                 aCfg.i.sDesc = 'VisualAge for C++ v3.6.5 FP2 with latest optimizer fixes.'; i = i + 1;
     91    aCfg.i.sId = 'vac40';           aCfg.i.sSet = 'VAC40';                  aCfg.i.sDesc = 'VisualAge for C++ v4.0 FP2(??)'; i = i + 1;
     92    aCfg.i.sId = 'warpin';          aCfg.i.sSet = 'WarpIn';                 aCfg.i.sDesc = 'WarpIn 0.9.18+ (for Odin32 18 with fix is required)'; i = i + 1;
     93    aCfg.i.sId = 'watcomc11';       aCfg.i.sSet = 'WatComC11,32,';          aCfg.i.sDesc = 'Watcom C/C++ v11.0 32-bit (no fixes)'; i = i + 1;
     94    aCfg.i.sId = 'watcomc11-16';    aCfg.i.sSet = 'WatComC11,16';           aCfg.i.sDesc = 'Watcom C/C++ v11.0 16-bit (no fixes)'; i = i + 1;
     95    aCfg.i.sId = 'watcomc11c';      aCfg.i.sSet = 'WatComC11c,32';          aCfg.i.sDesc = 'Watcom C/C++ v11.0c 32-bit (beta)'; i = i + 1;
     96    aCfg.i.sId = 'watcomc11c-16';   aCfg.i.sSet = 'WatComC11c,16';          aCfg.i.sDesc = 'Watcom C/C++ v11.0c 16-bit (beta)'; i = i + 1;
     97    aCfg.0 = i - 1;
     98
     99
     100
     101    /*
    55102     * Parse arguments
    56103     */
     
    62109        /*
    63110         * Get last char.
    64          * Dash means remove, pluss means add.
     111         * Dash means remove, pluss means add, asterix means verify and configure.
    65112         * Pluss is default and optional.
     113         *
    66114         */
    67115        ch = substr(sEnv.i, length(sEnv.i), 1);
    68         if ch = '-' then
    69             fRM = 1;
    70         else
    71             fRM = 0;
    72         if (ch = '-' | ch = '+') then
     116        if (ch = '-' | ch = '+' | ch = '*') then
    73117            sEnv.i = substr(sEnv.i, 1, length(sEnv.i) - 1);
     118        fRM = (ch = '-');
     119        fCfg = (ch = '*');
    74120
    75121        /*
     
    78124        rc = 0;
    79125        select
    80             when (sEnv.i = 'mode8050') then     Address CMD '@mode 80,50'
    81             when (sEnv.i = 'mode12050') then    Address CMD '@mode 120,50'
    82             when (sEnv.i = 'cvs') then          rc = CVS(fRM);
    83             when (sEnv.i = 'db2v52') then       rc = db2v52(fRM);
    84126            when (sEnv.i = 'debug') then do
    85127                rc = EnvVar_Set(0, 'DEBUG','1');
     
    87129                rc = EnvVar_Set(0, 'BUILD_MODE','DEBUG');
    88130            end
    89             when (sEnv.i = 'ddkbase') then      rc = DDKBase(fRM);
    90             when (sEnv.i = 'emx') then          rc = EMX(fRM);
    91             when (sEnv.i = 'emxpgcc') then      rc = EMXPGCC(fRM);
    92             when (sEnv.i = 'icatgam') then      rc = ICATGam(fRM);
    93             when (sEnv.i = 'icatgam406rc1')then rc = ICATGam406RC1(fRM);
    94             when (sEnv.i = 'icatpe') then       rc = ICATPe(fRM);
    95             when (sEnv.i = 'ida') then          rc = IDA414(fRM);
    96             when (sEnv.i = 'ida414') then       rc = IDA414(fRM);
    97             when (sEnv.i = 'ida38') then        rc = IDA38(fRM);
    98             when (sEnv.i = 'ida40') then        rc = IDA40(fRM);
    99             when (sEnv.i = 'idasdk') then       rc = IDASDK(fRM);
    100             when (sEnv.i = 'mscv6') then        rc = MSCV6_32(fRM);
    101             when (sEnv.i = 'mscv6-16') then     rc = MSCV6_16(fRM);
    102             when (sEnv.i = 'msc60') then        rc = MSCV6_16(fRM);
    103             when (sEnv.i = 'mysql') then        rc = mySQL(fRM);
    104             when (sEnv.i = 'netqos2') then      rc = NetQOS2(fRM);
    105             when (sEnv.i = 'python') then       rc = Python(fRM);
    106             when (sEnv.i = 'perl') then         rc = Perl(fRM);
    107131            when (sEnv.i = 'profile') then do
    108132                rc = EnvVar_Set(0, 'DEBUG','1');
     
    115139                rc = EnvVar_Set(0, 'BUILD_MODE','RELEASE');
    116140            end
    117             when (sEnv.i = 'toolkit45') then    rc = Toolkit45(fRM);
    118             when (sEnv.i = 'toolkit40') then    rc = Toolkit40(fRM);
    119             when (sEnv.i = 'unix') then         rc = Unix(fRM);
    120             when (sEnv.i = 'vac30') then        rc = VAC308(fRM);
    121             when (sEnv.i = 'vac308') then       rc = VAC308(fRM);
    122             when (sEnv.i = 'vac36') then        rc = VAC365(fRM);
    123             when (sEnv.i = 'vac365') then       rc = VAC365(fRM);
    124             when (sEnv.i = 'vac40') then        rc = VAC40(fRM);
    125             when (sEnv.i = 'warpin') then       rc = WarpIn(fRM);
    126             when (sEnv.i = 'watcomc11') then    rc = WatComC11(fRM, 32);
    127             when (sEnv.i = 'watcomc11c') then   rc = WatComC11c(fRM, 32);
    128             when (sEnv.i = 'watcomc11-16') then rc = WatComC11(fRM, 16);
    129             when (sEnv.i = 'watcomc11c-16') then rc = WatComC11c(fRM, 16);
    130             when (sEnv.i = 'odin32testcase') then rc = Odin32Testcase(fRM);
     141
     142            when (sEnv.i = 'buildsetup') then
     143                rc = EnvVar_Set(0, 'BUILD_SETUP_MAK','make\setup.mak');
    131144
    132145            otherwise
    133                 say 'error: unknown environment! - 'sEnv.i;
    134                 exit(1)
    135         end
    136 
    137         /*
    138          * Check for errors.
    139          */
    140         if (rc <> 0) then
    141         do
    142             say 'Processing '''sEnv.i''' failed with rc='rc'.';
    143             SysSleep(10);
    144             exit(rc);
    145         end
    146     end
     146            do
     147                fFound = 0;
     148                do j = 1 to aCfg.0
     149                    if (aCfg.j.sId = sEnv.i) then
     150                    do
     151                        /*
     152                         * Found the environment.
     153                         */
     154                        fFound = 1;
     155                        if (fCfg) then; say 'Verify & Config of the 'sEnv.i' ('CfgDesc(sEnv.i)') environment...';
     156                        if (pos(',', aCfg.j.sSet) > 0) then
     157                            sRexx = substr(aCfg.j.sSet, 1, pos(',', aCfg.j.sSet) - 1) || '(aCfg.j.sSet,fRM,fCfg',
     158                                 || substr(aCfg.j.sSet, pos(',', aCfg.j.sSet)) || ')';
     159                        else
     160                            sRexx = aCfg.j.sSet || '(sEnv.i,fRM,fCfg)';
     161                        interpret 'rc = '||sRexx;
     162
     163                        /*
     164                         * Loop till rc=0 or leave.
     165                         */
     166                        do while (rc <> 0)
     167                            select
     168                                when (rc = 1) then
     169                                do
     170                                    if (fCfg = 0) then
     171                                    do
     172                                        say 'fatal error: One of the paths for environment '''sEnv.i''' wasn'' found.';
     173                                        say '             Please (re-)configure the environment.';
     174                                        call SysSleep 5;
     175                                        exit(16);
     176                                    end
     177                                    say 'warning: The user refused to give a path, continuing.';
     178                                end
     179
     180                                when (rc = 2) then
     181                                    say 'error: verify failed ''cause some vital file wasn''t found.';
     182
     183                                when (rc = 49) then
     184                                    say 'error: verify failed ''cause some vital command didn''t return as expected.';
     185
     186                                when (rc = 99) then
     187                                    say 'error: verify failed ''cause some vital command didn''t return the expected output.';
     188
     189                                otherwise
     190                                do
     191                                    say 'internal error: bad return code from '''sRexx''' rc=' rc'.';
     192                                    call SysSleep 5;
     193                                    exit(16);
     194                                end
     195                            end
     196
     197                            /*
     198                             * Retry the config if the user wan't so.
     199                             */
     200                            fCfg = 3; /* forced reconfig. */
     201                            say '(Re)Try to config the environment' sEnv.i '('CfgDesc(sEnv.i)')? (y/N)';
     202                            sAnswer = PullUser(1);
     203                            if (substr(strip(sAnswer),1,1) <> 'Y') then
     204                                leave;
     205                            interpret 'rc = '||sRexx;
     206                        end
     207                        rc = 0;
     208                        leave;
     209                    end
     210                end
     211
     212                if (\fFound) then
     213                do
     214                    say 'error: unknown environment! - 'sEnv.i;
     215                    call SysSleep 5;
     216                    exit(16)
     217                end
     218            end /* otherwise */
     219        end /* select */
     220    end /* sEnv.i loop */
    147221
    148222
     
    175249
    176250/**
     251 * No value handler
     252 */
     253NoValueHandler:
     254    say 'NoValueHandler: line 'SIGL;
     255return
     256
     257
     258/**
    177259 * The Directory Configuration Function.
    178260 *
    179261 * @returns Lower cased, absolute, backward slashed, path to program.
    180  * @param   sProgram    Program identifier. (lowercase!)
     262 * @param   sPathId     Program identifier. (lowercase!)
    181263 *
    182264 * @remark
     
    186268 *
    187269 */
    188 QueryPath: procedure
    189     parse arg sProgram
    190 
    191     select
    192         when (sProgram = 'cvs') then        return 'f:\cvs';
    193         when (sProgram = 'emx') then        return 'f:\emx';
    194         when (sProgram = 'emxpgcc') then    return 'f:\emxpgcc';
    195         when (sProgram = 'db2v52') then     return 'f:\sqllib52';
    196         when (sProgram = 'icatgam') then    return 'f:\icatos2';
    197         when (sProgram = 'icatgam406rc1') then return 'f:\icatos2.4.0.6.rc1';
    198         when (sProgram = 'icatpe') then     return 'f:\icatpe';
    199         when (sProgram = 'ida38') then      return 'f:\ida38';
    200         when (sProgram = 'ida40') then      return 'f:\ida401';
    201         when (sProgram = 'ida414') then     return 'f:\ida414';
    202         when (sProgram = 'idasdk') then     return 'f:\idasdk';
    203         when (sProgram = 'ddkbase') then    return 'f:\ddk\base';
    204         when (sProgram = 'mscv6-16') then   return 'f:\ddktools\toolkits\msc60';
    205         when (sProgram = 'mysql') then      return 'f:\mysql2';
    206         when (sProgram = 'netqos2') then    return 'f:\netqos2';
    207         when (sProgram = 'perl') then       return 'f:\perllib';
    208         when (sProgram = 'python') then     return 'f:\python';
    209         when (sProgram = 'toolkit40') then  return 'f:\toolkit';
    210         when (sProgram = 'toolkit45') then  return 'f:\toolkit45';
    211         when (sProgram = 'unixroot') then   return 'e:\unix';
    212         when (sProgram = 'xfree86') then    return 'e:\xfree86';
    213         when (sProgram = 'vac308') then     return 'f:\ibmcpp';
    214         when (sProgram = 'vac365') then     return 'f:\ibmcxxo';
    215         when (sProgram = 'vac40') then      return 'f:\ibmcpp40';
    216         when (sProgram = 'warpin') then     return 'f:\warpin';
    217         when (sProgram = 'watcom11') then   return 'f:\watcom';
    218         when (sProgram = 'watcom11c') then  return 'f:\watcom11c';
     270PathQuery: procedure expose aCfg. aPath. sPathFile
     271    parse arg sPathId, sEnvId, fCfg, fOptional
     272
     273    if (fOptional = '') then
     274        fOptional = 0;
     275
     276    if (aPath.0 = 0) then
     277    do  /*
     278         * Read path config file
     279         */
     280        call PathRead;
    219281
    220282        /*
    221          * Testcase stuff for odin.
     283         * If no data found fill in defaults.
    222284         */
    223         when (sProgram = 'testcase_drive_unused')   then  return 'l'; /* reqired */
    224         when (sProgram = 'testcase_drive_fixed')    then  return 'c'; /* reqired */
    225         when (sProgram = 'testcase_drive_floppy')   then  return 'a'; /* reqired */
    226         when (sProgram = 'testcase_drive_cdrom')    then  return 'k'; /* optional */
    227         when (sProgram = 'testcase_drive_network')  then  return 's'; /* optional */
    228         when (sProgram = 'testcase_drive_ramdisk')  then  return '';  /* optional */
    229 /*        when (sProgram = '') then  return '';
    230         when (sProgram = '') then  return '';
    231         when (sProgram = '') then  return '';
    232         when (sProgram = '') then  return '';*/
    233 
    234 
    235         otherwise
     285        if (aPath.0 = 0) then
    236286        do
    237             say 'Fatal error: Path information for program '''sProgram''' was not found.';
    238             exit(16);
     287            say 'Info: No or empty path file, using defaults.';
     288            i = 1;
     289            aPath.i.sPId = 'cvs';                       aPath.i.sPath = 'f:\cvs';                       i = i + 1;
     290            aPath.i.sPId = 'emx';                       aPath.i.sPath = 'f:\emx';                       i = i + 1;
     291            aPath.i.sPId = 'emxpgcc';                   aPath.i.sPath = 'f:\emxpgcc';                   i = i + 1;
     292            aPath.i.sPId = 'db2v52';                    aPath.i.sPath = 'f:\sqllib52';                  i = i + 1;
     293            aPath.i.sPId = 'icatgam';                   aPath.i.sPath = 'f:\icatos2';                   i = i + 1;
     294            aPath.i.sPId = 'icatgam406rc1';             aPath.i.sPath = 'f:\icatos2.4.0.6.rc1';         i = i + 1;
     295            aPath.i.sPId = 'icatpe';                    aPath.i.sPath = 'f:\icatpe';                    i = i + 1;
     296            aPath.i.sPId = 'ida38';                     aPath.i.sPath = 'f:\ida38';                     i = i + 1;
     297            aPath.i.sPId = 'ida40';                     aPath.i.sPath = 'f:\ida401';                    i = i + 1;
     298            aPath.i.sPId = 'ida414';                    aPath.i.sPath = 'f:\ida414';                    i = i + 1;
     299            aPath.i.sPId = 'idasdk';                    aPath.i.sPath = 'f:\idasdk';                    i = i + 1;
     300            aPath.i.sPId = 'ddkbase';                   aPath.i.sPath = 'f:\ddk\base';                  i = i + 1;
     301            aPath.i.sPId = 'home';                      aPath.i.sPath = 'e:\user\kso';                  i = i + 1;
     302            aPath.i.sPId = 'mscv6-16';                  aPath.i.sPath = 'f:\ddktools\toolkits\msc60';   i = i + 1;
     303            aPath.i.sPId = 'mysql';                     aPath.i.sPath = 'f:\mysql2';                    i = i + 1;
     304            aPath.i.sPId = 'netqos2';                   aPath.i.sPath = 'f:\netqos2';                   i = i + 1;
     305            aPath.i.sPId = 'perl';                      aPath.i.sPath = 'f:\perllib';                   i = i + 1;
     306            aPath.i.sPId = 'python';                    aPath.i.sPath = 'f:\python';                    i = i + 1;
     307            aPath.i.sPId = 'toolkit40';                 aPath.i.sPath = 'f:\toolkit';                   i = i + 1;
     308            aPath.i.sPId = 'toolkit45';                 aPath.i.sPath = 'f:\toolkit45';                 i = i + 1;
     309            aPath.i.sPId = 'toolkit451';                aPath.i.sPath = 'f:\toolkit451';                i = i + 1;
     310            aPath.i.sPId = 'unixroot';                  aPath.i.sPath = 'e:\unix';                      i = i + 1;
     311            aPath.i.sPId = 'xfree86';                   aPath.i.sPath = 'e:\xfree86';                   i = i + 1;
     312            aPath.i.sPId = 'vac308';                    aPath.i.sPath = 'f:\ibmcpp';                    i = i + 1;
     313            aPath.i.sPId = 'vac365';                    aPath.i.sPath = 'f:\ibmcxxo';                   i = i + 1;
     314            aPath.i.sPId = 'vac40';                     aPath.i.sPath = 'f:\ibmcpp40';                  i = i + 1;
     315            aPath.i.sPId = 'warpin';                    aPath.i.sPath = 'f:\warpin';                    i = i + 1;
     316            aPath.i.sPId = 'watcom11';                  aPath.i.sPath = 'f:\watcom';                    i = i + 1;
     317            aPath.i.sPId = 'watcom11c';                 aPath.i.sPath = 'f:\watcom11c';                 i = i + 1;
     318            aPath.i.sPId = 'testcase_drive_unused';     aPath.i.sPath = 'l'; /* reqired */              i = i + 1;
     319            aPath.i.sPId = 'testcase_drive_fixed';      aPath.i.sPath = 'c'; /* reqired */              i = i + 1;
     320            aPath.i.sPId = 'testcase_drive_floppy';     aPath.i.sPath = 'a'; /* reqired */              i = i + 1;
     321            aPath.i.sPId = 'testcase_drive_cdrom';      aPath.i.sPath = 'k'; /* optional */             i = i + 1;
     322            aPath.i.sPId = 'testcase_drive_network';    aPath.i.sPath = 's'; /* optional */             i = i + 1;
     323            /*aPath.i.sPId = 'testcase_drive_ramdisk';    aPath.i.sPath = '';  /* optional */             i = i + 1;*/
     324            /*aPath.i.sPId = '';          aPath.i.sPath =      i = i + 1;*/
     325            aPath.0 = i - 1;
     326
     327            /*
     328             * Write to file.
     329             */
     330            call PathWrite;
    239331        end
    240332    end
    241333
    242     /* Should never get here */
     334    /*
     335     * Check for forced config.
     336     */
     337    if (fCfg = 3) then
     338        call PathRemove sPathId;
     339    else
     340    do
     341        /*
     342         * Search for the path.
     343         */
     344        do i = 1 to aPath.0
     345            if (aPath.i.sPId = sPathId) then
     346            do
     347                return aPath.i.sPath;
     348                leave;
     349            end
     350        end
     351    end
     352
     353    /*
     354     * Configure then we'll ask the user.
     355     */
     356    if (fCfg > 0) then
     357        return PathConfig(fCfg, sPathId, sEnvId);
     358
     359    /*
     360     * Error
     361     */
     362    if (\fOptional) then
     363    do
     364        say 'Fatal error: Path information for program '''sPathId''' was not found.';
     365        call SysSleep 5;
     366        exit(16);
     367    end
     368
    243369return '';
    244370
     371
     372/**
     373 * Reads the path file into the 'aPath.' stem.
     374 */
     375PathRead: procedure expose aCfg. aPath. sPathFile
     376
     377    i = 1;                              /* Path index */
     378    iLine = 0;                          /* Line # in file */
     379
     380    /*
     381     * Read loop.
     382     */
     383    do while (lines(sPathFile) > 0)
     384        iLine = iLine + 1;
     385        sLine = strip(linein(sPathFile));
     386
     387        /*
     388         * Skip empty lines and comment lines, ie. starting with '#' or ';'.
     389         */
     390        if ((sLine <> '') & (substr(sLine, 1, 1) <> '#') & (substr(sLine, 1, 1) <> ';')) then
     391        do
     392            /*
     393             * Parse the line.
     394             */
     395            parse var sLine aPath.i.sPId '=' aPath.i.sPath
     396            aPath.i.sPId = strip(aPath.i.sPId);
     397            aPath.i.sPath = strip(aPath.i.sPath);
     398
     399            /*
     400             * Validate the input.
     401             */
     402            if ((aPath.i.sPath = '') | (aPath.i.sPId = '') | (translate(sLine,'','#!$@%|<>;õ&Ï') <> sLine) ) then
     403            do
     404                say 'fatal error: missformed line in path file at line 'iLine'!'
     405                call stream sPathFile, 'c', 'close';
     406                call SysSleep 5;
     407                exit(16);
     408            end
     409            i = i + 1;
     410        end
     411    end
     412    call stream sPathFile, 'c', 'close';
     413    aPath.0 = i - 1;
     414return 0;
     415
     416
     417/**
     418 * Writes the path file from what's in the 'aPath.' stem.
     419 */
     420PathWrite: procedure expose aCfg. aPath. sPathFile
     421    call SysFileDelete(sPathFile);
     422    do i = 1 to aPath.0
     423        /* skip if already written */
     424        j = 1;
     425        do while (aPath.j.sPId <> aPath.i.sPId)
     426            j = j + 1;
     427        end
     428        if (j >= i) then
     429            call lineout sPathFile, aPath.i.sPId'='aPath.i.sPath;
     430    end
     431    call stream sPathFile, 'c', 'close';
     432return 0;
     433
     434
     435/**
     436 * Remove a path from the 'aPath.' stem.
     437 * @returns 0
     438 * @param   sPathId     The id of the path to remove.
     439 */
     440PathRemove: procedure expose aCfg. aPath. sPathFile
     441    parse arg sPathId
     442
     443    /*
     444     * Find.
     445     */
     446    i = 1;
     447    do while (i <= aPath.0)
     448        if (aPath.i.sPId = sPathId) then
     449            leave;
     450        i = i + 1;
     451    end
     452
     453    /*
     454     * Move.
     455     */
     456    if (i <= aPath.0) then
     457    do
     458        j = i + 1;
     459        do while (j <= aPath.0)
     460            aPath.i.sPId = aPath.j.sPId;
     461            aPath.i.sPath = aPath.j.sPath;
     462            j = j + 1;
     463            i = i + 1;
     464        end
     465        aPath.0 = aPath.0 - 1;
     466    end
     467return 0;
     468
     469
     470/**
     471 * Configure a path.
     472 * @returns Path on success.
     473 *          '' on failure.
     474 * @param   fCfg        The config flags.
     475 *                      1 = configure if needed.
     476 *                      3 = force config.
     477 * @param   sPathId     The path to configure.
     478 * @param   sEnvId      The environment Id.
     479 */
     480PathConfig: procedure expose aCfg. aPath. sPathFile
     481    parse arg fCfg, sPathId, sEnvId
     482
     483    /*
     484     * Config loop.
     485     */
     486    if (fCfg = 1) then
     487    do
     488        say 'Do you want to configure the path '''sPathId''' for the '''sEnvId'''('CfgDesc(sEnvId)') environment? (y/N)';
     489        sAnswer = PullUser(1);
     490        if (substr(strip(sAnswer),1,1) <> 'Y') then
     491            return '';
     492    end
     493    do i = 1 to 128
     494
     495        say 'Give us the path then:'
     496        sThePath = translate(strip(strip(strip(PullUser()), 'T','\'),'T','/'), '\', '/');
     497        /*say 'Debug: sThePath='sThePath;*/
     498        if ((sThePath <> '') & (sThePath = translate(sThePath,'','#!$@%|<>;õ&Ï='))) then
     499        do
     500            /*
     501             * Add it to internal struct.
     502             */
     503            call PathRemove(sPathId);
     504            j = aPath.0 + 1;
     505            aPath.j.sPId = strip(sPathId);
     506            aPath.j.sPath = translate(strip(strip(strip(sThePath), 'T','\'),'T','/'), '\', '/');
     507            aPath.0 = j;
     508
     509            /*
     510             * Write to file and return successfully.
     511             */
     512            call PathWrite;
     513            return sThePath;
     514        end
     515        else
     516            say 'error: invalid path name.';
     517
     518        /* ask if retry */
     519        if (i >= 2) then
     520            say 'You''re not trying hard, are you?';
     521        say 'Wanna try giving us an *valid* path for the path '''sPathId''' for the '''sEnvId'''('CfgDesc(sEnvId)') environment? (y/N)';
     522        sAnswer = PullUser(1);
     523        if (substr(strip(sAnswer),1,1) <> 'Y') then
     524            leave;
     525    end
     526
     527    say 'Giving up!';
     528return '';
     529
     530
     531/**
     532 * Get the description of an environment.
     533 * @returns Description string.
     534 *          '' if not found.
     535 * @param   sEnvId      Environment id.
     536 */
     537CfgDesc: procedure expose aCfg. aPath. sPathFile
     538    parse arg sEnvId
     539    do i = 1 to aCfg.0
     540        if (aCfg.i.sId = sEnvId) then
     541            return aCfg.i.sDesc;
     542    end
     543return sEnvId;
     544
     545
     546/**
     547 * Lookups up an env. config in the aCfg. array.
     548 * @return  Index of sEnvId.
     549 *          aCfg.0+1 on error.
     550 * @param   sEnvId      Environment id.
     551 */
     552CfgLookup: procedure expose aCfg. aPath. sPathFile
     553    parse arg sEnvId
     554    iEnv = 1;
     555    do while ((iEnv <= aCfg.0) & (aCfg.iEnv.sId <> sEnvId))
     556        iEnv = iEnv + 1;
     557    end
     558return iEnv;
     559
     560
     561/**
     562 * Get user response and empties the input queue.
     563 * @returns     User input.
     564 * @param       fUpper  If present and set uppercase the user response.
     565 */
     566PullUser: procedure
     567    parse arg fUpper
     568    if (fUpper = '') then
     569        fUpper = 0;
     570
     571    if (fUpper) then
     572        pull sAnswer;
     573    else
     574        parse pull sAnswer;
     575
     576    do while (Queued())
     577        pull dummy;
     578    end
     579return sAnswer;
     580
     581
     582/**
     583 * Checks if a file exists.
     584 * @param   sFile       Name of the file to look for.
     585 * @param   sComplain   Complaint text. Complain if non empty and not found.
     586 * @returns TRUE if file exists.
     587 *          FALSE if file doesn't exists.
     588 */
     589FileExists: procedure
     590    parse arg sFile, sComplain
     591    rc = stream(sFile, 'c', 'query exist');
     592    if ((rc = '') & (sComplain <> '')) then
     593        say sComplain ''''sFile'''.';
     594return rc <> '';
     595
     596
     597/**
     598 * Checks if a directory exists.
     599 * @param   sDir        Name of the directory to look for.
     600 * @param   sComplain   Complaint text. Complain if non empty and not found.
     601 * @returns TRUE if file exists.
     602 *          FALSE if file doesn't exists.
     603 */
     604DirExists: procedure
     605    parse arg sDir, sComplain
     606    rc = SysFileTree(sDir, 'sDirs', 'DO');
     607    if (rc = 0 & sDirs.0 = 1) then
     608        return 1;
     609    say sComplain ''''sDir'''.';
     610return 0;
     611
     612
     613/**
     614 * Execute a command and match output and return code.
     615 *
     616 * @returns  0 on match.
     617 *          49 on return code mismatch.
     618 *          99 on output mistmatch.
     619 * @param   sCmd                    The command to execute.
     620 * @param   rcCmdExepcted           The expected return code from the command.
     621 * @param   sOutputPartExpected     A 'needle' of the output 'haystack'.
     622 */
     623CheckCmdOutput: procedure
     624    parse arg sCmd, rcCmdExpected, sOutputPartExpected
     625
     626    /*
     627     * Try execute the command
     628     */
     629    queTmp = RxQueue('Create');
     630    queOld = RxQueue('Set', queTmp);
     631    Address CMD sCmd || ' 2>&1 | RxQueue' queTmp;
     632    rcCmd = rc;
     633
     634    /* get output */
     635    sOutput = '';
     636    do while (queued() > 0)
     637        parse pull sLine
     638        sOutput = sOutput || sLine || '0d0a'x
     639    end
     640    call RxQueue 'Delete', RxQueue('Set', queOld);
     641
     642    /*
     643     * If command
     644     */
     645    rc = 0
     646    if (rcCmd = rcCmdExpected) then
     647    do
     648        if (pos(sOutputPartExpected, sOutput) <= 0) then
     649        do
     650            say 'Debug - start'
     651            say 'Debug:' sOutputPartExpected
     652            say 'Debug: not found in:'
     653            say sOutput
     654            say 'Debug - end'
     655            rc = 99
     656        end
     657    end
     658    else
     659        rc = 49
     660    if (rc <> 0) then
     661        say 'Debug:' sCmd 'rc='rc' rcCmd='rcCmd;
     662return rc;
    245663
    246664
    247665/**
    248666 * Environment procedures section
     667 * @returns 0 on success.
     668 *          1 if PathQuery() failed.
     669 *          2 if some vital file wasn't found in the config verify.
     670 *          49 if verify command rc mismatched.
     671 *          99 if verify command output mismatched.
    249672 **/
    250673
     
    253676 * Concurrent Versions System (CVS)
    254677 */
    255 CVS: procedure
    256     parse arg fRM
     678CVS: procedure expose aCfg. aPath. sPathFile
     679    parse arg sEnvId,fRM,fCfg
     680
    257681
    258682    /*
    259683     * Concurrent Versions System (CVS) main directory.
    260684     */
    261     sPathCVS    = QueryPath('cvs');
     685    sPathCVS    = PathQuery('cvs', sEnvId, fCfg);
     686    if (sPathCVS = '') then
     687        return 1;
     688    sPathHome   = PathQuery('home', sEnvId, fCfg);
     689    if (sPathHome = '') then
     690        return 1;
     691
    262692    call EnvVar_Set      fRM, 'PATH_CVS',    sPathCVS;
    263693    call EnvVar_AddFront fRM, 'path',        sPathCVS'\bin;'
    264694    call EnvVar_AddFront fRM, 'bookshelf',   sPathCVS'\book;'
     695    call EnvVar_AddFront fRM, 'bookshelf',   sPathCVS'\book;'
     696    call EnvVar_Set      fRM, 'home',        translate(sPathHome, '/','\');
     697
     698    /* verify */
     699    if (fCfg > 0) then
     700    do
     701        if (\FileExists(sPathCVS'\bin\cvs.exe', 'error: verify didn''t find')) then
     702            return 2;
     703        if (length(sPathHome) <= 2) then
     704        do
     705            say 'Error: The home directory is to short!';
     706            return 2;
     707        end
     708        if (\DirExists(sPathHome)) then
     709        do
     710            say 'Error: The home directory must exist!';
     711            return 2;
     712        end
     713        return CheckCmdOutput('cvs --version', 0, 'Concurrent Versions System (CVS) 1.1');
     714    end
    265715return 0;
    266716
     
    269719 * EMX
    270720 */
    271 EMX: procedure
    272     parse arg fRM
     721EMX: procedure expose aCfg. aPath. sPathFile
     722    parse arg sEnvId,fRM,fCfg
    273723
    274724    /*
    275725     * EMX/GCC main directory.
    276726     */
    277     sEMX        = QueryPath('emx');
     727    sEMX        = PathQuery('emx', sEnvId, fCfg);
     728    if (sEMX = '') then
     729        return 1;
     730
    278731    sEMXBack    = translate(sEMX, '\', '/');
    279732    sEMXForw    = translate(sEMX, '/', '\');
     
    304757    end
    305758
     759    /* verify */
     760    if (fCfg > 0) then
     761    do
     762        if (    \FileExists(sEmxBack'\bin\gcc.exe', 'error: verify didn''t find'),
     763            |   \FileExists(sEmxBack'\bin\emxomf.exe', 'error: verify didn''t find'),
     764            |   \FileExists(sEmxBack'\bin\emxrev.cmd', 'error: verify didn''t find'),
     765            |   \FileExists(sEmxBack'\lib\mt\c.a', 'error: verify didn''t find'),
     766            |   \FileExists(sEmxBack'\lib\mt\c.lib', 'error: verify didn''t find'),
     767            |   \FileExists(sEmxBack'\lib\mt\sys.lib', 'error: verify didn''t find'),
     768            |   \FileExists(sEmxBack'\lib\mt\emx.a', 'error: verify didn''t find'),
     769            |   \FileExists(sEmxBack'\lib\mt\emx.lib', 'error: verify didn''t find'),
     770            |   \FileExists(sEmxBack'\lib\mt\c_import.a', 'error: verify didn''t find'),
     771            |   \FileExists(sEmxBack'\lib\mt\c_import.lib', 'error: verify didn''t find'),
     772            |   \FileExists(sEmxBack'\lib\c_alias.a', 'error: verify didn''t find'),
     773            |   \FileExists(sEmxBack'\lib\c_alias.lib', 'error: verify didn''t find'),
     774            |   \FileExists(sEmxBack'\lib\emx2.a', 'error: verify didn''t find'),
     775            |   \FileExists(sEmxBack'\lib\emx2.lib', 'error: verify didn''t find'),
     776            ) then
     777            return 2;
     778        rc = CheckCmdOutput('gcc --version', 0, '2.8.1');
     779        if (rc = 0) then
     780            rc = CheckCmdOutput('emxrev.cmd', 0,,
     781                                'EMX : revision = 61'||'0d0a'x ||,
     782                                'EMXIO : revision = 60'||'0d0a'x||,
     783                                'EMXLIBC : revision = 63'||'0d0a'x||,
     784                                'EMXLIBCM : revision = 64'||'0d0a'x||,
     785                                'EMXLIBCS : revision = 64'||'0d0a'x||,
     786                                'EMXWRAP : revision = 60'||'0d0a'x);
     787        return rc;
     788    end
    306789return 0;
    307790
     
    310793 * EMX PGCC - must be installed on to the ordinar EMX.
    311794 */
    312 EMXPGCC: procedure
    313     parse arg fRM
     795EMXPGCC: procedure expose aCfg. aPath. sPathFile
     796    parse arg sEnvId,fRM,fCfg
    314797
    315798    /*
    316799     * EMX/GCC main directory.
    317800     */
    318     sEMXPGCC    = QueryPath('emxpgcc');
     801    sEMXPGCC    = PathQuery('emxpgcc', sEnvId, fCfg);
     802    if (sEMXPGCC = '') then
     803        return 1;
    319804    sEMXBack    = translate(sEMXPGCC, '\', '/');
    320805    sEMXForw    = translate(sEMXPGCC, '/', '\');
     
    338823    call EnvVar_AddFront fRM, 'HELPNDX',            'emxbook.ndx', '+', 1
    339824
     825    /* verify */
     826    if (fCfg > 0) then
     827    do
     828        if (    \FileExists(sEmxBack'\bin\gcc.exe', 'error: verify didn''t find'),
     829            |   \FileExists(sEmxBack'\bin\g++.exe', 'error: verify didn''t find'),
     830            |   \FileExists(sEmxBack'\bin\as.exe', 'error: verify didn''t find'),
     831            |   \FileExists(sEmxBack'\bin\emxomf.exe', 'error: verify didn''t find'),
     832            |   \FileExists(sEmxBack'\lib\gcc29160.a', 'error: verify didn''t find'),
     833            |   \FileExists(sEmxBack'\lib\gcc29160.lib', 'error: verify didn''t find'),
     834            |   \FileExists(sEmxBack'\lib\iberty.a', 'error: verify didn''t find'),
     835            |   \FileExists(sEmxBack'\lib\iberty.lib', 'error: verify didn''t find'),
     836            |   \FileExists(sEmxBack'\lib\iberty_s.a', 'error: verify didn''t find'),
     837            |   \FileExists(sEmxBack'\lib\iberty_s.lib', 'error: verify didn''t find'),
     838            |   \FileExists(sEmxBack'\lib\opcodes.a', 'error: verify didn''t find'),
     839            |   \FileExists(sEmxBack'\lib\opcodes.lib', 'error: verify didn''t find'),
     840            |   \FileExists(sEmxBack'\lib\opcodes_s.a', 'error: verify didn''t find'),
     841            |   \FileExists(sEmxBack'\lib\opcodes_s.lib', 'error: verify didn''t find'),
     842            ) then
     843            return 2;
     844        rc = CheckCmdOutput('gcc --version', 0, 'pgcc-2.95.2');
     845        if (rc = 0) then
     846            rc = CheckCmdOutput('g++ --version', 0, 'pgcc-2.95.2');
     847        if (rc = 0) then
     848            rc = CheckCmdOutput('as --version', 0, 'GNU assembler 2.9.1');
     849        return rc;
     850    end
    340851return 0;
    341852
     
    343854 * IBM DB2 v5.2
    344855 */
    345 db2v52: procedure
    346     parse arg fRM
    347     sPathDB2   = QueryPath('db2v52');
     856db2v52: procedure expose aCfg. aPath. sPathFile
     857    parse arg sEnvId,fRM,fCfg
     858    sPathDB2   = PathQuery('db2v52', sEnvId, fCfg);
     859    if (sPathDB2 = '') then
     860        return 1;
    348861    call EnvVar_Set      fRm, 'PATH_DB2',    sPathDB2;
    349862    call EnvVar_Set      fRm, 'db2path',     sPathDB2;
     
    359872    call EnvVar_AddFront fRM, 'include',     sPathDB2'\include;'
    360873    call EnvVar_AddFront fRM, 'lib',         sPathDB2'\lib;'
     874
     875    /* verify */
     876    if (fCfg > 0) then
     877    do
     878        if (    \FileExists(sPathDB2'\bin\db2.exe', 'error: verify didn''t find'),
     879            |   \FileExists(sPathDB2'\bin\sqlbind.exe', 'error: verify didn''t find'),
     880            |   \FileExists(sPathDB2'\bin\sqlprep.exe', 'error: verify didn''t find'),
     881            |   \FileExists(sPathDB2'\lib\db2api.lib', 'error: verify didn''t find'),
     882            |   \FileExists(sPathDB2'\lib\db2cli.lib', 'error: verify didn''t find'),
     883            |   \FileExists(sPathDB2'\lib\db2gmf32.lib', 'error: verify didn''t find'),
     884            |   \FileExists(sPathDB2'\include\sql.h', 'error: verify didn''t find'),
     885            |   \FileExists(sPathDB2'\include\sqlcodes.h', 'error: verify didn''t find'),
     886            |   \FileExists(sPathDB2'\include\sqlsystm.h', 'error: verify didn''t find'),
     887            |   \FileExists(sPathDB2'\include\sqlcli.h', 'error: verify didn''t find'),
     888            ) then
     889            return 2;
     890        rc = CheckCmdOutput('echo quit | db2', 0, 'Command Line Processor for DB2 SDK 5.2.0');
     891        return rc;
     892    end
     893return 0;
     894
     895
     896/*
     897 *  Device Driver Kit (DDK) base.
     898 */
     899DDKBase: procedure expose aCfg. aPath. sPathFile
     900    parse arg sEnvId,fRM,fCfg
     901
     902    /*
     903     * Device Driver Kit (DDK) (v4.0+) base (important not main) directory.
     904     */
     905    sPathDDKBase    = PathQuery('ddkbase', sEnvId, fCfg);
     906    if (sPathDDKBase = '') then
     907        return 1;
     908    call EnvVar_Set      fRM, 'PATH_DDKBASE',sPathDDKBase;
     909    call EnvVar_AddFront fRM, 'path',        sPathDDKBase'\tools;'
     910    call EnvVar_AddFront fRM, 'include',     sPathDDKBase'\h;'sPathDDKBase'\inc;'sPathDDKBase'\inc32;'
     911    call EnvVar_AddFront fRM, 'include16',   sPathDDKBase'\h;'
     912    call EnvVar_AddFront fRM, 'lib',         sPathDDKBase'\lib;'
     913    call EnvVar_AddFront fRM, 'bookshelf',   sPathDDKBase'\..\docs;'
     914
     915    /* verify */
     916    if (fCfg > 0) then
     917    do
     918        if (    \FileExists(sPathDDKBase'\tools\link.exe', 'error: verify didn''t find'),
     919            |   \FileExists(sPathDDKBase'\tools\link386.exe', 'error: verify didn''t find'),
     920            |   \FileExists(sPathDDKBase'\tools\cl386.exe', 'error: verify didn''t find'),
     921            |   \FileExists(sPathDDKBase'\tools\masm.exe', 'error: verify didn''t find'),
     922            |   \FileExists(sPathDDKBase'\tools\h2inc.exe', 'error: verify didn''t find'),
     923            |   \FileExists(sPathDDKBase'\tools\lib.exe', 'error: verify didn''t find'),
     924            |   \FileExists(sPathDDKBase'\lib\os2286.lib', 'error: verify didn''t find'),
     925            |   \FileExists(sPathDDKBase'\lib\os2286p.lib', 'error: verify didn''t find'),
     926            |   \FileExists(sPathDDKBase'\lib\os2386.lib', 'error: verify didn''t find'),
     927            |   \FileExists(sPathDDKBase'\lib\os2386p.lib', 'error: verify didn''t find'),
     928            |   \FileExists(sPathDDKBase'\lib\doscalls.lib', 'error: verify didn''t find'),
     929            |   \FileExists(sPathDDKBase'\lib\dhcalls.lib', 'error: verify didn''t find'),
     930            |   \FileExists(sPathDDKBase'\lib\addcalls.lib', 'error: verify didn''t find'),
     931            |   \FileExists(sPathDDKBase'\lib\rmcalls.lib', 'error: verify didn''t find'),
     932            |   \FileExists(sPathDDKBase'\lib\vdh.lib', 'error: verify didn''t find'),
     933            |   \FileExists(sPathDDKBase'\h\infoseg.h', 'error: verify didn''t find'),
     934            |   \FileExists(sPathDDKBase'\h\include.h', 'error: verify didn''t find'),
     935            |   \FileExists(sPathDDKBase'\h386\pmddi.h', 'error: verify didn''t find'),
     936            |   \FileExists(sPathDDKBase'\h386\pmddim.h', 'error: verify didn''t find'),
     937            |   \FileExists(sPathDDKBase'\h386\limits.h', 'error: verify didn''t find'),
     938            |   \FileExists(sPathDDKBase'\h386\string.h', 'error: verify didn''t find'),
     939            |   \FileExists(sPathDDKBase'\inc\v8086.inc', 'error: verify didn''t find'),
     940            |   \FileExists(sPathDDKBase'\inc\sas.inc', 'error: verify didn''t find'),
     941            |   \FileExists(sPathDDKBase'\inc\pmwinx.inc', 'error: verify didn''t find'),
     942            |   \FileExists(sPathDDKBase'\inc\infoseg.inc', 'error: verify didn''t find'),
     943            |   \FileExists(sPathDDKBase'\inc\devhlp.inc', 'error: verify didn''t find'),
     944            |   \FileExists(sPathDDKBase'\inc\devhlpp.inc', 'error: verify didn''t find'),
     945            ) then
     946            return 2;
     947        rc = CheckCmdOutput('cl386', 0, 'Microsoft (R) Microsoft 386 C Compiler. Version 6.00.054');
     948        if (rc = 0) then
     949            rc = CheckCmdOutput('masm nul,nul,nul,nul;', 2, 'Microsoft (R) Macro Assembler Version 5.10A.15 Jul 07 15:25:03 1989');
     950        if (rc = 0) then
     951            rc = CheckCmdOutput('h2inc -?', 0, 'h2inc - .H to .INC file translator (version 13.29)');
     952        if (rc = 0) then
     953            rc = CheckCmdOutput('type' sPathDDKBase'\inc\devhlp.inc', 0, 'DevHlp_ReadFileAt');
     954        return rc;
     955    end
    361956return 0;
    362957
     
    365960 * ICAT Debugger
    366961 */
    367 ICATGam: procedure
    368     parse arg fRM
    369     sPathICAT   = QueryPath('icatgam');
     962ICATGam: procedure expose aCfg. aPath. sPathFile
     963    parse arg sEnvId,fRM,fCfg
     964    sPathICAT   = PathQuery('icatgam', sEnvId, fCfg);
     965    if (sPathICAT = '') then
     966        return 1;
    370967    call EnvVar_Set      fRm, 'PATH_ICATGAM', sPathICAT;
    371968    call EnvVar_AddFront fRm, 'beginlibpath',sPathICAT'\dll;'
     
    373970    call EnvVar_AddFront fRm, 'dpath',       sPathICAT'\help;'
    374971    call EnvVar_AddFront fRm, 'help',        sPathICAT'\help;'
     972
     973    /* verify */
     974    if (fCfg > 0) then
     975    do
     976        if (    \FileExists(sPathICAT'\bin\icatgam.exe', 'error: verify didn''t find'),
     977            |   \FileExists(sPathICAT'\dll\gamoou3.dll', 'error: verify didn''t find'),
     978            |   \FileExists(sPathICAT'\dll\gam5lde.dll', 'error: verify didn''t find'),
     979            |   \FileExists(sPathICAT'\dll\gam5cx.dll', 'error: verify didn''t find'),
     980            ) then
     981            return 2;
     982        return 0;
     983    end
    375984return 0;
    376985
     
    379988 * ICAT Debugger
    380989 */
    381 ICATGam406RC1: procedure
    382     parse arg fRM
    383     sPathICAT   = QueryPath('icatgam406rc1');
     990ICATGam406RC1: procedure expose aCfg. aPath. sPathFile
     991    parse arg sEnvId,fRM,fCfg
     992    sPathICAT   = PathQuery('icatgam406rc1', sEnvId, fCfg);
     993    if (sPathICAT = '') then
     994        return 1;
    384995    call EnvVar_Set      fRm, 'PATH_ICATGAM', sPathICAT;
    385996    call EnvVar_AddFront fRm, 'beginlibpath',sPathICAT'\dll;'
     
    387998    call EnvVar_AddFront fRm, 'dpath',       sPathICAT'\help;'
    388999    call EnvVar_AddFront fRm, 'help',        sPathICAT'\help;'
     1000
     1001    /* verify */
     1002    if (fCfg > 0) then
     1003    do
     1004        if (    \FileExists(sPathICAT'\bin\icatgam.exe', 'error: verify didn''t find'),
     1005            |   \FileExists(sPathICAT'\dll\gamoou3.dll', 'error: verify didn''t find'),
     1006            |   \FileExists(sPathICAT'\dll\gam5lde.dll', 'error: verify didn''t find'),
     1007            |   \FileExists(sPathICAT'\dll\gam5cx.dll', 'error: verify didn''t find'),
     1008            ) then
     1009            return 2;
     1010        return 0;
     1011    end
    3891012return 0;
    3901013
     
    3941017 * ICAT Debugger for PE images.
    3951018 */
    396 ICATPe: procedure
    397     parse arg fRM
    398     sPathICAT   = QueryPath('icatgam');
    399     sPathICATPe = QueryPath('icatpe');
     1019ICATPe: procedure expose aCfg. aPath. sPathFile
     1020    parse arg sEnvId,fRM,fCfg
     1021    sPathICAT   = PathQuery('icatgam', sEnvId, fCfg);
     1022    if (sPathICAT = '') then
     1023        return 1;
     1024    sPathICATPe = PathQuery('icatpe', sEnvId, fCfg);
     1025    if (sPathICATPe = '') then
     1026        return 1;
    4001027    call EnvVar_Set      fRm, 'PATH_ICATGAM',sPathICAT;
    4011028    call EnvVar_Set      fRm, 'PATH_ICATPE', sPathICATPe;
     
    4041031    call EnvVar_AddFront fRm, 'dpath',       sPathICATPe'\bin;'sPathICAT'\help;'
    4051032    call EnvVar_AddFront fRm, 'help',        sPathICATPe'\bin;'sPathICAT'\help;'
     1033
     1034    /* verify */
     1035    if (fCfg > 0) then
     1036    do
     1037        if (    \FileExists(sPathICAT'\bin\icatgam.exe', 'error: verify didn''t find'),
     1038            |   \FileExists(sPathICAT'\dll\gamoou3.dll', 'error: verify didn''t find'),
     1039            |   \FileExists(sPathICAT'\dll\gam5lde.dll', 'error: verify didn''t find'),
     1040            |   \FileExists(sPathICAT'\dll\gam5cx.dll', 'error: verify didn''t find'),
     1041            |   \FileExists(sPathICATPe'\bin\icatgam.exe', 'error: verify didn''t find'),
     1042            |   \FileExists(sPathICATPe'\bin\gamoou3.dll', 'error: verify didn''t find'),
     1043            |   \FileExists(sPathICATPe'\bin\gam5lde.dll', 'error: verify didn''t find'),
     1044            |   \FileExists(sPathICATPe'\bin\gam5cx.dll', 'error: verify didn''t find'),
     1045            ) then
     1046            return 2;
     1047        return 0;
     1048    end
    4061049return 0;
    4071050
     
    4111054 * Interactive Disassembler (IDA) v3.80a
    4121055 */
    413 IDA38: procedure
    414     parse arg fRM
     1056IDA38: procedure expose aCfg. aPath. sPathFile
     1057    parse arg sEnvId,fRM,fCfg
    4151058    /*
    4161059     * IDA main directory.
    4171060     */
    418     sPathIDA = QueryPath('ida38');
     1061    sPathIDA = PathQuery('ida38', sEnvId, fCfg);
     1062    if (sPathIDA = '') then
     1063        return 1;
    4191064    call EnvVar_Set      fRM, 'PATH_IDA',       sPathIDA
    4201065    call EnvVar_AddFront fRM, 'path',           sPathIDA
    4211066    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDA
     1067
     1068    /* verify */
     1069    if (fCfg > 0) then
     1070    do
     1071        if (    \FileExists(sPathIDA'\ida2.exe', 'error: verify didn''t find'),
     1072            |   \FileExists(sPathIDA'\idaw.exe', 'error: verify didn''t find'),
     1073            |   \FileExists(sPathIDA'\ida.dll', 'error: verify didn''t find'),
     1074            |   \FileExists(sPathIDA'\pc.dll', 'error: verify didn''t find'),
     1075            ) then
     1076            return 2;
     1077        return 0;
     1078    end
    4221079return 0;
    4231080
     
    4261083 * Interactive Disassembler (IDA) v4.01
    4271084 */
    428 IDA40: procedure
    429     parse arg fRM
     1085IDA40: procedure expose aCfg. aPath. sPathFile
     1086    parse arg sEnvId,fRM,fCfg
    4301087    /*
    4311088     * IDA main directory.
    4321089     */
    433     sPathIDA = QueryPath('ida40');
     1090    sPathIDA = PathQuery('ida40', sEnvId, fCfg);
     1091    if (sPathIDA = '') then
     1092        return 1;
    4341093    call EnvVar_Set      fRM, 'PATH_IDA',       sPathIDA
    4351094    call EnvVar_AddFront fRM, 'path',           sPathIDA
    4361095    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDA
     1096
     1097    /* verify */
     1098    if (fCfg > 0) then
     1099    do
     1100        if (    \FileExists(sPathIDA'\ida2.exe', 'error: verify didn''t find'),
     1101            |   \FileExists(sPathIDA'\idaw.exe', 'error: verify didn''t find'),
     1102            |   \FileExists(sPathIDA'\ida.dll', 'error: verify didn''t find'),
     1103            |   \FileExists(sPathIDA'\pc.dll', 'error: verify didn''t find'),
     1104            ) then
     1105            return 2;
     1106        return 0;
     1107    end
    4371108return 0;
    4381109
     
    4411112 * Interactive Disassembler (IDA) v4.14
    4421113 */
    443 IDA414: procedure
    444     parse arg fRM
     1114IDA414: procedure expose aCfg. aPath. sPathFile
     1115    parse arg sEnvId,fRM,fCfg
    4451116    /*
    4461117     * IDA main directory.
    4471118     */
    448     sPathIDA = QueryPath('ida414');
     1119    sPathIDA = PathQuery('ida414', sEnvId, fCfg);
     1120    if (sPathIDA = '') then
     1121        return 1;
    4491122    call EnvVar_Set      fRM, 'PATH_IDA',       sPathIDA
    4501123    call EnvVar_AddFront fRM, 'path',           sPathIDA
    4511124    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDA
     1125
     1126    /* verify */
     1127    if (fCfg > 0) then
     1128    do
     1129        if (    \FileExists(sPathIDA'\ida2.exe', 'error: verify didn''t find'),
     1130            |   \FileExists(sPathIDA'\idaw.exe', 'error: verify didn''t find'),
     1131            |   \FileExists(sPathIDA'\ida.dll', 'error: verify didn''t find'),
     1132            |   \FileExists(sPathIDA'\pc.dll', 'error: verify didn''t find'),
     1133            ) then
     1134            return 2;
     1135        return 0;
     1136    end
    4521137return 0;
    4531138
     
    4561141 * Interactive Disassembler (IDA) Plugin SDK (v5.0?)
    4571142 */
    458 IDASDK: procedure
    459     parse arg fRM
     1143IDASDK: procedure expose aCfg. aPath. sPathFile
     1144    parse arg sEnvId,fRM,fCfg
    4601145    /*
    4611146     * IDA main directory.
    4621147     */
    463     sPathIDASDK = QueryPath('idasdk');
     1148    sPathIDASDK = PathQuery('idasdk', sEnvId, fCfg);
     1149    if (sPathIDASDK = '') then
     1150        return 1;
    4641151    call EnvVar_Set      fRM, 'PATH_IDASDK',    sPathIDASDK
    4651152    call EnvVar_AddFront fRM, 'include',        sPathIDASDK'\include;'
     
    4671154    call EnvVar_AddFront fRM, 'path',           sPathIDASDK'\bin\os2;'
    4681155    call EnvVar_AddFront fRM, 'beginlibpath',   sPathIDASDK'\bin\os2;'
    469 return 0;
    470 
    471 
    472 /*
    473  *  Device Driver Kit (DDK) base.
    474  */
    475 DDKBase: procedure
    476     parse arg fRM
    477 
    478     /*
    479      * Device Driver Kit (DDK) (v4.0+) base (important not main) directory.
    480      */
    481     sPathDDKBase    = QueryPath('ddkbase');
    482     call EnvVar_Set      fRM, 'PATH_DDKBASE',sPathDDKBase;
    483     call EnvVar_AddFront fRM, 'path',        sPathDDKBase'\tools;'
    484     call EnvVar_AddFront fRM, 'include',     sPathDDKBase'\h;'sPathDDKBase'\inc;'sPathDDKBase'\inc32;'
    485     call EnvVar_AddFront fRM, 'include16',   sPathDDKBase'\h;'
    486     call EnvVar_AddFront fRM, 'lib',         sPathDDKBase'\lib;'
    487     call EnvVar_AddFront fRM, 'bookshelf',   sPathDDKBase'\..\docs;'
    488 
    489 return 0;
    490 
     1156
     1157    /* verify */
     1158    if (fCfg > 0) then
     1159    do
     1160        if (    \FileExists(sPathIDASDK'\os2wat.cfg', 'error: verify didn''t find'),
     1161            |   \FileExists(sPathIDASDK'\d32wat.cfg', 'error: verify didn''t find'),
     1162            |   \FileExists(sPathIDASDK'\include\exehdr.h', 'error: verify didn''t find'),
     1163            |   \FileExists(sPathIDASDK'\include\ida.hpp', 'error: verify didn''t find'),
     1164            |   \FileExists(sPathIDASDK'\include\vm.hpp', 'error: verify didn''t find'),
     1165            |   \FileExists(sPathIDASDK'\libwat.os2\ida.lib', 'error: verify didn''t find'),
     1166            |   \FileExists(sPathIDASDK'\libwat.d32\ida.lib', 'error: verify didn''t find'),
     1167            |   \FileExists(sPathIDASDK'\libwat.d32\INIRT386.OBJ', 'error: verify didn''t find'),
     1168            |   \FileExists(sPathIDASDK'\libbor.d32\ida.lib', 'error: verify didn''t find'),
     1169            ) then
     1170            return 2;
     1171        return 0;
     1172    end
     1173return 0;
     1174
     1175
     1176/*
     1177 * Mode commandline.
     1178 */
     1179Mode: procedure expose aCfg. aPath. sPathFile
     1180    parse arg sEnvId,fRM,fCfg,cols,rows
     1181    if (fRM) then
     1182    do
     1183        cols = 80;
     1184        rows = 25;
     1185    end
     1186    Address CMD 'mode' cols','rows
     1187return 0;
    4911188
    4921189
     
    4941191 * Microsoft C v6.0a 16-bit
    4951192 */
    496 MSCV6_16: procedure
    497     parse arg fRM
     1193MSCV6_16: procedure expose aCfg. aPath. sPathFile
     1194    parse arg sEnvId,fRM,fCfg
    4981195
    4991196    /*
    5001197     * Microsoft C v6.0a main directory.
    5011198     */
    502     sPathMSC    = QueryPath('mscv6-16');
     1199    sPathMSC    = PathQuery('mscv6-16', sEnvId, fCfg);
     1200    if (sPathMSC = '') then
     1201        return 1;
    5031202    call EnvVar_Set      fRM, 'BUILD_ENV',  'MSCV6-16'
    5041203    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
     
    5091208    call EnvVar_AddFront fRM, 'lib',        sPathMSC'\lib;'
    5101209
     1210    /* verify */
     1211    if (fCfg > 0) then
     1212    do
     1213        if (    \FileExists(sPathMSC'\binp\cl.exe', 'error: verify didn''t find'),
     1214            |   \FileExists(sPathMSC'\lib\clibcep.lib', 'error: verify didn''t find'),
     1215            |   \FileExists(sPathMSC'\lib\llibcep.lib', 'error: verify didn''t find'),
     1216            |   \FileExists(sPathMSC'\lib\mlibcep.lib', 'error: verify didn''t find'),
     1217            |   \FileExists(sPathMSC'\lib\slibcep.lib', 'error: verify didn''t find'),
     1218            |   \FileExists(sPathMSC'\include\sysbits.h', 'error: verify didn''t find'),
     1219            |   \FileExists(sPathMSC'\include\dos.h', 'error: verify didn''t find'),
     1220            |   \FileExists(sPathMSC'\include\bios.h', 'error: verify didn''t find'),
     1221            |   \FileExists(sPathMSC'\include\string.h', 'error: verify didn''t find'),
     1222            |   \FileExists(sPathMSC'\include\stdio.h', 'error: verify didn''t find'),
     1223            ) then
     1224            return 2;
     1225        rc = CheckCmdOutput('cl', 0, 'Microsoft (R) C Optimizing Compiler Version 6.00A.04');
     1226        return rc;
     1227    end
    5111228return 0;
    5121229
     
    5151232 * Microsoft C v6.0a 32-bit
    5161233 */
    517 MSCV6_32: procedure
    518     parse arg fRM
     1234MSCV6_32: procedure expose aCfg. aPath. sPathFile
     1235    parse arg sEnvId,fRM,fCfg
    5191236
    5201237    /*
    5211238     * This is where the compiler really is.
    5221239     */
    523     call DDKBase fRM;
     1240    call DDKBase 'ddkbase',fRM,fCfg;
    5241241
    5251242    /*
    5261243     * Microsoft C v6.0a 32-bit main directory.
    5271244     */
    528     sPathDDKBase    = QueryPath('ddkbase');
     1245    sPathDDKBase    = PathQuery('ddkbase', sEnvId, fCfg);
     1246    if (sPathDDKBase = '') then
     1247        return 1;
    5291248    call EnvVar_Set      fRM, 'BUILD_ENV',  'MSCV6'
    5301249    call EnvVar_Set      fRM, 'BUILD_PLATFORM', 'OS2'
    5311250    call EnvVar_Set      fRM, 'PATH_MSC',   sPathDDKBase;
    532     call EnvVar_AddFront fRM, 'include',    sPathDDKBase'\h32;'
     1251    call EnvVar_AddFront fRM, 'include',    sPathDDKBase'\h386;'
    5331252    call EnvVar_AddFront fRM, 'lib',        sPathDDKBase'\lib;'
     1253
     1254    /* verify */
     1255    if (fCfg > 0) then
     1256    do
     1257        if (    \FileExists(sPathDDKBase'\tools\cl386.exe', 'error: verify didn''t find'),
     1258            |   \FileExists(sPathDDKBase'\h386\limits.h', 'error: verify didn''t find'),
     1259            |   \FileExists(sPathDDKBase'\h386\string.h', 'error: verify didn''t find'),
     1260            ) then
     1261            return 2;
     1262        rc = CheckCmdOutput('cl386', 0, 'Microsoft (R) Microsoft 386 C Compiler. Version 6.00.054');
     1263        return rc;
     1264    end
    5341265return 0;
    5351266
     
    5381269 * mySQL Database system
    5391270 */
    540 mySQL: procedure
    541     parse arg fRM
     1271mySQL: procedure expose aCfg. aPath. sPathFile
     1272    parse arg sEnvId,fRM,fCfg
    5421273
    5431274    /*
    5441275     * mySQL Database system main directory.
    5451276     */
    546     sPathMySQL    = QueryPath('mysql');
     1277    sPathMySQL    = PathQuery('mysql', sEnvId, fCfg);
     1278    if (sPathMySQL = '') then
     1279        return 1;
    5471280    call EnvVar_Set      fRM, 'PATH_MYSQL',     sPathMySQL;
    5481281    call EnvVar_AddFront fRM, 'path',           sPathMySQL'\bin;'
     
    5511284    call EnvVar_AddFront fRM, 'bookshelf',      sPathMySQL'\doc;'sPathMySQL'\book';
    5521285    /*call EnvVar_AddFront fRM, 'lib',            sPathMySQL'\lib;'*/
     1286
     1287    /* verify */
     1288    if (fCfg > 0) then
     1289    do
     1290        if (    \FileExists(sPathMySQL'\bin\mysql.exe', 'error: verify didn''t find'),
     1291            |   \FileExists(sPathMySQL'\bin\mysqld.exe', 'error: verify didn''t find'),
     1292            |   \FileExists(sPathMySQL'\bin\mysqladmin.exe', 'error: verify didn''t find'),
     1293            |   \FileExists(sPathMySQL'\dll\mysql.dll', 'error: verify didn''t find'),
     1294            |   \FileExists(sPathMySQL'\include\mysql.h', 'error: verify didn''t find'),
     1295            |   \FileExists(sPathMySQL'\include\mysql_com.h', 'error: verify didn''t find'),
     1296            |   \FileExists(sPathMySQL'\include\mysql_version.h', 'error: verify didn''t find'),
     1297            ) then
     1298            return 2;
     1299        rc = CheckCmdOutput('mysql --version', 0, ', for ');
     1300        return rc;
     1301    end
    5531302return 0;
    5541303
     
    5581307 * NetQOS2 - help subsystem++ for VAC 3.6.5 and VAC 4.0
    5591308 */
    560 NetQOS2: procedure
    561     sPathNetQOS2 = QueryPath('netqos2');
     1309NetQOS2: procedure expose aCfg. aPath. sPathFile
     1310    parse arg sEnvId,fRM,fCfg
     1311    sPathNetQOS2 = PathQuery('netqos2', sEnvId, fCfg);
     1312    if (sPathNetQOS2 = '') then
     1313        return 1;
    5621314    call EnvVar_Set      fRM, 'PATH_NETQOS2',   sPathNetQOS2
    5631315    call EnvVar_AddFront fRM, 'path',           sPathNetQOS2';'
     
    5741326    call EnvVar_Set      fRM, 'imqconfigsrv',   sPathNetQOS2'\instance'
    5751327    call EnvVar_Set      fRM, 'imqconfigcl',    sPathNetQOS2'\instance\dbcshelp'
     1328
     1329    /* verify */
     1330    if (fCfg > 0) then
     1331    do
     1332        if (    \FileExists(sPathNetQOS2'\netq.exe', 'error: verify didn''t find'),
     1333            ) then
     1334            return 2;
     1335        rc = CheckCmdOutput('netq', 999, 'NETQ {START | STOP');
     1336        return rc;
     1337    end
    5761338return 0;
    5771339
     
    5801342 * Odin32 testcase setup.
    5811343 */
    582 Odin32Testcase: procedure
    583     parse arg fRM
    584     call EnvVar_Set      fRM, 'odin32_testcase_drive_unused',       QueryPath('testcase_drive_unused');
    585     call EnvVar_Set      fRM, 'odin32_testcase_drive_fixed',        QueryPath('testcase_drive_fixed')
    586     call EnvVar_Set      fRM, 'odin32_testcase_drive_floppy',       QueryPath('testcase_drive_floppy')
    587     call EnvVar_Set      fRM, 'odin32_testcase_drive_cdrom',        QueryPath('testcase_drive_cdrom')
    588     call EnvVar_Set      fRM, 'odin32_testcase_drive_network',      QueryPath('testcase_drive_network')
    589     call EnvVar_Set      fRM, 'odin32_testcase_drive_ramdisk',      QueryPath('testcase_drive_ramdisk')
     1344Odin32Testcase: procedure expose aCfg. aPath. sPathFile
     1345    parse arg sEnvId,fRM,fCfg
     1346    if (  PathQuery('testcase_drive_unused', sEnvId, fCfg) = '',
     1347        | PathQuery('testcase_drive_fixed', sEnvId, fCfg) = '',
     1348        | PathQuery('testcase_drive_floppy', sEnvId, fCfg) = '',
     1349        | PathQuery('testcase_drive_cdrom', sEnvId, fCfg) = '',
     1350        ) then
     1351        return 1;
     1352
     1353    call EnvVar_Set      fRM, 'odin32_testcase_drive_unused',       PathQuery('testcase_drive_unused', sEnvId, fCfg);
     1354    call EnvVar_Set      fRM, 'odin32_testcase_drive_fixed',        PathQuery('testcase_drive_fixed', sEnvId, fCfg);
     1355    call EnvVar_Set      fRM, 'odin32_testcase_drive_floppy',       PathQuery('testcase_drive_floppy', sEnvId, fCfg);
     1356    call EnvVar_Set      fRM, 'odin32_testcase_drive_cdrom',        PathQuery('testcase_drive_cdrom', sEnvId, fCfg);
     1357    call EnvVar_Set      fRM, 'odin32_testcase_drive_network',      PathQuery('testcase_drive_network', sEnvId, fCfg, 1);
     1358    call EnvVar_Set      fRM, 'odin32_testcase_drive_ramdisk',      PathQuery('testcase_drive_ramdisk', sEnvId, fCfg, 1);
    5901359return 0;
    5911360
     
    5931362 * PERL 5005_53
    5941363 */
    595 Perl: procedure
    596     parse arg fRM
     1364Perl: procedure expose aCfg. aPath. sPathFile
     1365    parse arg sEnvId,fRM,fCfg
    5971366
    5981367    /*
     
    6001369     */
    6011370/* BAD
    602     sPathPerl       = QueryPath('perl');
     1371    sPathPerl       = PathQuery('perl', sEnvId, fCfg);
     1372    if (sPathPerl = '') then
     1373        return 1;
    6031374    sPathPerlForw   = translate(sPathPerl, '/', '\');
    6041375    call EnvVar_Set      fRM, 'PATH_PERL',      sPathPerl;
     
    6151386*/
    6161387/* seems ok */
    617     sPathPerl       = QueryPath('perl');
     1388    sPathPerl       = PathQuery('perl', sEnvId, fCfg);
     1389    if (sPathPerl = '') then
     1390        return 1;
    6181391    sPathPerlForw   = translate(sPathPerl, '/', '\');
    6191392    call EnvVar_Set      fRM, 'PATH_PERL',      sPathPerl;
     
    6261399    call EnvVar_Set      fRM, 'perl5lib',       sPathPerlForw'/lib'
    6271400    call EnvVar_Set      fRM, 'perl_badlang',   '0'
     1401
     1402    /* verify */
     1403    if (fCfg > 0) then
     1404    do
     1405        if (    \FileExists(sPathPerl'\bin\perl.exe', 'error: verify didn''t find'),
     1406            |   \FileExists(sPathPerl'\dll\perlE0AC.dll', 'error: verify didn''t find'),
     1407            ) then
     1408            return 2;
     1409        rc = CheckCmdOutput('perl --version', 0, 'This is perl, version 5.005_53 built for os2');
     1410        return rc;
     1411    end
    6281412return 0;
    6291413
     
    6321416 * Python/2 v1.5.2
    6331417 */
    634 Python: procedure
    635     parse arg fRM
     1418Python: procedure expose aCfg. aPath. sPathFile
     1419    parse arg sEnvId,fRM,fCfg
    6361420
    6371421    /*
    6381422     * The Python Home directory
    6391423     */
    640     sPythonHome = QueryPath('python');
     1424    sPythonHome = PathQuery('python', sEnvId, fCfg);
     1425    if (sPythonHome = '') then
     1426        return 1;
    6411427    call EnvVar_Set      fRM, 'PATH_PYTHON',    sPythonHome
    6421428    call EnvVar_Set      fRM, 'pythonhome',     sPythonHome
     
    6451431    call EnvVar_AddFront fRM, 'path',           sPythonHome
    6461432
     1433    /* verify */
     1434    if (fCfg > 0) then
     1435    do
     1436        if (    \FileExists(sPythonHome'\Python.exe', 'error: verify didn''t find'),
     1437            |   \FileExists(sPythonHome'\Python15.dll', 'error: verify didn''t find'),
     1438            ) then
     1439            return 2;
     1440        rc = CheckCmdOutput('echo print "hello world" | python', 0, 'hello world');
     1441        return rc;
     1442    end
    6471443return 0;
    6481444
     
    6511447 * OS/2 Programmers Toolkit v4.0 (CSD1/4)
    6521448 */
    653 Toolkit40: procedure
    654     parse arg fRM
     1449Toolkit40: procedure expose aCfg. aPath. sPathFile
     1450    parse arg sEnvId,fRM,fCfg
    6551451
    6561452    /*
    6571453     * Toolkit (4.0) main directory.
    6581454     */
    659     sPathTK    = QueryPath('toolkit40');
     1455    sPathTK    = PathQuery('toolkit40', sEnvId, fCfg);
     1456    if (sPathTK = '') then
     1457        return 1;
    6601458    call EnvVar_Set      fRM, 'PATH_TOOLKIT',  sPathTK;
    6611459
     
    7011499    call EnvVar_AddFront fRM, 'CAT_HOST_SOURCE_PATH='sPathTK'\BIN;'
    7021500    */
     1501
     1502    /* verify */
     1503    if (fCfg > 0) then
     1504    do
     1505        if (    \FileExists(sPathTK'\bin\alp.exe', 'error: verify didn''t find'),
     1506            |   \FileExists(sPathTK'\bin\rc.exe', 'error: verify didn''t find'),
     1507            |   \FileExists(sPathTK'\bin\ipfc.exe', 'error: verify didn''t find'),
     1508            |   \FileExists(sPathTK'\bin\implib.exe', 'error: verify didn''t find'),
     1509            |   \FileExists(sPathTK'\bin\mkmsgf.exe', 'error: verify didn''t find'),
     1510            |   \FileExists(sPathTK'\bin\mapsym.exe', 'error: verify didn''t find'),
     1511            |   \FileExists(sPathTK'\lib\os2386.lib', 'error: verify didn''t find'),
     1512            |   \FileExists(sPathTK'\lib\pmbidi.lib', 'error: verify didn''t find'),
     1513            |   \FileExists(sPathTK'\lib\tcpip32.lib', 'error: verify didn''t find'),
     1514            |   \FileExists(sPathTK'\h\os2.h', 'error: verify didn''t find'),
     1515            |   \FileExists(sPathTK'\h\os2win.h', 'error: verify didn''t find'),
     1516            |   \FileExists(sPathTK'\h\stack16\pmwsock.h', 'error: verify didn''t find'),
     1517            |   \FileExists(sPathTK'\som\bin\sc.exe', 'error: verify didn''t find'),
     1518            ) then
     1519            return 2;
     1520        rc = CheckCmdOutput('syslevel '||sPathTK||'\bin', 0, 'IBM Developer''s Toolkit for OS/2 Warp Version 4'||'0d0a'x||'Version 4.00.');
     1521        if (rc = 0) then
     1522            rc = CheckCmdOutput('sc -V', -1, '", Version: 2.54.');
     1523        if (rc = 0) then
     1524            rc = CheckCmdOutput('rc', 0, 'IBM RC (Resource Compiler) Version 5.00.00');
     1525        if (rc = 0) then
     1526            rc = CheckCmdOutput('ipfc', 0, 'Version 4.00.00');
     1527
     1528        return rc;
     1529    end
    7031530return 0;
    7041531
     
    7081535 * OS/2 Programmers Toolkit v4.5
    7091536 */
    710 Toolkit45: procedure
    711     parse arg fRM
     1537Toolkit45: procedure expose aCfg. aPath. sPathFile
     1538    parse arg sEnvId,fRM,fCfg
    7121539
    7131540    /*
    7141541     * Toolkit (4.5) main directory.
    7151542     */
    716      sPathTK    = QueryPath('toolkit45');
     1543     sPathTK    = PathQuery('toolkit45', sEnvId, fCfg);
     1544    if (sPathTK = '') then
     1545        return 1;
    7171546    call EnvVar_Set      fRM, 'PATH_TOOLKIT',  sPathTK;
    7181547
     
    7531582    */
    7541583
    755 return 0;
     1584    /* verify */
     1585    if (fCfg > 0) then
     1586    do
     1587        if (    \FileExists(sPathTK'\bin\alp.exe', 'error: verify didn''t find'),
     1588            |   \FileExists(sPathTK'\bin\rc.exe', 'error: verify didn''t find'),
     1589            |   \FileExists(sPathTK'\bin\ipfc.exe', 'error: verify didn''t find'),
     1590            |   \FileExists(sPathTK'\bin\implib.exe', 'error: verify didn''t find'),
     1591            |   \FileExists(sPathTK'\bin\mkmsgf.exe', 'error: verify didn''t find'),
     1592            |   \FileExists(sPathTK'\bin\mapsym.exe', 'error: verify didn''t find'),
     1593            |   \FileExists(sPathTK'\lib\os2386.lib', 'error: verify didn''t find'),
     1594            |   \FileExists(sPathTK'\lib\pmbidi.lib', 'error: verify didn''t find'),
     1595            |   \FileExists(sPathTK'\lib\tcpip32.lib', 'error: verify didn''t find'),
     1596            |   \FileExists(sPathTK'\h\os2.h', 'error: verify didn''t find'),
     1597            |   \FileExists(sPathTK'\h\os2win.h', 'error: verify didn''t find'),
     1598            |   \FileExists(sPathTK'\h\stack16\pmwsock.h', 'error: verify didn''t find'),
     1599            |    FileExists(sPathTK'\som\bin\sc.exe'),
     1600            ) then
     1601            return 2;
     1602        rc = CheckCmdOutput('syslevel '||sPathTK||'\bin', 0, 'IBM OS/2 Developer''s Toolkit Version 4.5'||'0d0a'x||'Version 4.50     Component ID 5639F9300');
     1603        if (rc = 0) then
     1604            rc = CheckCmdOutput('rc', 0, 'IBM RC (Resource Compiler) Version 5.00.004');
     1605        if (rc = 0) then
     1606            rc = CheckCmdOutput('ipfc', 0, 'Version 4.00.006 July 21 1998');
     1607        return rc;
     1608    end
     1609return 0;
     1610
     1611
     1612/*
     1613 * OS/2 Programmers Toolkit v4.5.1
     1614 */
     1615Toolkit451: procedure expose aCfg. aPath. sPathFile
     1616    parse arg sEnvId,fRM,fCfg
     1617
     1618    /*
     1619     * Toolkit (4.5.1) main directory.
     1620     */
     1621     sPathTK    = PathQuery('toolkit451', sEnvId, fCfg);
     1622    if (sPathTK = '') then
     1623        return 1;
     1624    call EnvVar_Set      fRM, 'PATH_TOOLKIT',  sPathTK;
     1625
     1626    call EnvVar_AddFront fRM, 'path',        sPathTK'\bin;'sPathTK'\som\common;'sPathTK'\som\bin'
     1627    call EnvVar_AddFront fRM, 'dpath',       sPathTK'\msg;'sPathTK'\book;'sPathTK'\SOM\COMMON\SYSTEM;'sPathTK'\SOM\MSG;'
     1628    call EnvVar_AddFront fRM, 'beginlibpath', sPathTK'\dll;'sPathTK'\som\common\dll;'sPathTK'\som\lib;'
     1629    call EnvVar_AddFront fRM, 'help',        sPathTK'\help;'
     1630    call EnvVar_AddFront fRM, 'bookshelf',   sPathTK'\book;'sPathTK'\archived;'
     1631    call EnvVar_AddFront fRM, 'somir',       sPathTK'\SOM\COMMON\ETC\214\SOM.IR;'
     1632    call EnvVar_AddEnd   fRM, 'somir',       sPathTK'\SAMPLES\REXX\SOM\ANIMAL\ORXSMP.IR;'
     1633    call EnvVar_AddFront fRM, 'nlspath',     sPathTK'\msg\%N;'
     1634    call EnvVar_AddEnd   fRM, 'ulspath',     sPathTK'\language;'
     1635    call EnvVar_AddFront fRM, 'include',     sPathTK'\H\ARPA;'sPathTK'\H\NET;'sPathTK'\H\NETINET;'sPathTK'\H\NETNB;'sPathTK'\H\RPC;'sPathTK'\SPEECH\H;'sPathTK'\H\GL;'sPathTK'\H;'sPathTK'\SOM\INCLUDE;'sPathTK'\INC;'
     1636    call EnvVar_AddFront fRM, 'lib',         sPathTK'\lib;'
     1637    call EnvVar_AddEnd   fRM, 'lib',         sPathTK'\SAMPLES\MM\LIB;'sPathTK'\SPEECH\LIB;'
     1638    call EnvVar_AddFront fRM, 'helpndx',     'EPMKWHLP.NDX+', '+'
     1639    call EnvVar_AddFront fRM, 'ipfc',        sPathTK'\ipfc;'
     1640    call EnvVar_Set      fRM, 'sombase',     sPathTK'\SOM'
     1641    call EnvVar_Set      fRM, 'somruntime',  sPathTK'\SOM\COMMON'
     1642    call EnvVar_Set      fRM, 'LANG',        'en_us'
     1643
     1644    call EnvVar_Set      fRM, 'CPREF',       'CP1.INF+CP2.INF+CP3.INF'
     1645    call EnvVar_Set      fRM, 'GPIREF',      'GPI1.INF+GPI2.INF+GPI3.INF+GPI4.INF'
     1646    call EnvVar_Set      fRM, 'MMREF',       'MMREF1.INF+MMREF2.INF+MMREF3.INF'
     1647    call EnvVar_Set      fRM, 'PMREF',       'PM1.INF+PM2.INF+PM3.INF+PM4.INF+PM5.INF'
     1648    call EnvVar_Set      fRM, 'WPSREF',      'WPS1.INF+WPS2.INF+WPS3.INF'
     1649    call EnvVar_AddFront fRM, 'sminclude',   sPathTK'\H;'sPathTK'\IDL;'sPathTK'\SOM\INCLUDE;.;'
     1650    call EnvVar_Set      fRM, 'smaddstar',   '1'
     1651    call EnvVar_Set      fRM, 'smemit',      'h;ih;c'
     1652    call EnvVar_Set      fRM, 'smtmp',       EnvVar_Get('tmp');
     1653    call EnvVar_Set      fRM, 'smclasses',   'WPTYPES.IDL'
     1654    /*
     1655    call EnvVar_Set      fRM, 'CAT_MACHINE', 'COM1:57600'
     1656    call EnvVar_Set      fRM, 'CAT_HOST_BIN_PATH', TKMAIN'\BIN'
     1657    call EnvVar_Set      fRM, 'CAT_COMMUNICATION_TYPE', 'ASYNC_SIGBRK'
     1658    call EnvVar_Set      fRM, 'CAT_HOST_SOURCE_PATH',TKMAIN'\BIN;'
     1659    */
     1660
     1661    /* verify */
     1662    if (fCfg > 0) then
     1663    do
     1664        if (    \FileExists(sPathTK'\bin\alp.exe', 'error: verify didn''t find'),
     1665            |   \FileExists(sPathTK'\bin\rc.exe', 'error: verify didn''t find'),
     1666            |   \FileExists(sPathTK'\bin\ipfc.exe', 'error: verify didn''t find'),
     1667            |   \FileExists(sPathTK'\bin\implib.exe', 'error: verify didn''t find'),
     1668            |   \FileExists(sPathTK'\bin\mkmsgf.exe', 'error: verify didn''t find'),
     1669            |   \FileExists(sPathTK'\bin\mapsym.exe', 'error: verify didn''t find'),
     1670            |   \FileExists(sPathTK'\bin\nmake.exe', 'error: verify didn''t find'),
     1671            |   \FileExists(sPathTK'\bin\nmake32.exe', 'error: verify didn''t find'),
     1672            |   \FileExists(sPathTK'\lib\os2386.lib', 'error: verify didn''t find'),
     1673            |   \FileExists(sPathTK'\lib\pmbidi.lib', 'error: verify didn''t find'),
     1674            |   \FileExists(sPathTK'\lib\tcpip32.lib', 'error: verify didn''t find'),
     1675            |   \FileExists(sPathTK'\h\os2.h', 'error: verify didn''t find'),
     1676            |   \FileExists(sPathTK'\h\os2win.h', 'error: verify didn''t find'),
     1677            |   \FileExists(sPathTK'\h\stack16\pmwsock.h', 'error: verify didn''t find'),
     1678            |   \FileExists(sPathTK'\som\bin\sc.exe', 'error: verify didn''t find'),
     1679            ) then
     1680            return 2;
     1681        rc = CheckCmdOutput('syslevel '||sPathTK||'\bin', 0, 'IBM OS/2 Developer''s Toolkit Version 4.5'||'0d0a'x||'Version 4.50.1     Component ID 5639F9300');
     1682        if (rc = 0) then
     1683            rc = CheckCmdOutput('sc -V', -1, '", Version: 2.54.');
     1684        if (rc = 0) then
     1685            rc = CheckCmdOutput('rc', 0, 'IBM RC (Resource Compiler) Version 5.00.006 Oct 20 2000');
     1686        if (rc = 0) then
     1687            rc = CheckCmdOutput('ipfc', 0, 'Version 4.00.007 Oct 02 2000');
     1688        if (rc = 0) then
     1689            rc = CheckCmdOutput('nmake', 2, 'Version 4.00.000 Oct 20 2000');
     1690        if (rc = 0) then
     1691            rc = CheckCmdOutput('nmake32', 0, 'Version 5.00.003 Oct 20 2000');
     1692        return rc;
     1693    end
     1694return 0;
     1695
    7561696
    7571697
     
    7591699 * This will envolve into an full UNIX like environment some day perhaps...
    7601700 */
    761 Unix: procedure
    762     parse arg fRM
     1701Unix: procedure expose aCfg. aPath. sPathFile
     1702    parse arg sEnvId,fRM,fCfg
    7631703
    7641704    /*
    7651705     * Unix root directory.
    7661706     */
    767     sUnixBack = QueryPath('unixroot');
     1707    sUnixBack = PathQuery('unixroot', sEnvId, fCfg);
     1708    if (sUnixBack = '') then
     1709        return 1;
    7681710    sUnixForw = translate(sUnixBack, '/', '\');
    7691711    call EnvVar_Set      fRM, 'PATH_UNIX',          sUnixBack
     
    7801722     * XFree86 main directory.
    7811723     */
    782     sXF86Back = QueryPath('xfree86');
     1724    sXF86Back = PathQuery('xfree86', sEnvId, fCfg);
     1725    if (sXF86Back = '') then
     1726        return 1;
    7831727    sXF86Forw = translate(sXF86Back, '/', '\');
    7841728    call EnvVar_Set      fRM, 'PATH_XFREE86',       sXF86Back
     
    7881732    call EnvVar_AddFront fRM, 'LIBRARY_PATH',       sXF86Forw'/lib'
    7891733
     1734    /* verify */
     1735    if (fCfg > 0) then
     1736    do
     1737        if (    \FileExists(sUnixBack'\bin\bash.exe', 'error: verify didn''t find'),
     1738            |   \FileExists(sUnixBack'\bin\sh.exe', 'error: verify didn''t find'),
     1739            |   \FileExists(sUnixBack'\bin\yes.exe', 'error: verify didn''t find'),
     1740            |   \FileExists(sUnixBack'\bin\rm.exe', 'error: verify didn''t find'),
     1741            |   \FileExists(sUnixBack'\bin\cp.exe', 'error: verify didn''t find'),
     1742            |   \FileExists(sUnixBack'\bin\mv.exe', 'error: verify didn''t find'),
     1743            |   \FileExists(sXF86Back'\bin\xf86config.exe', 'error: verify didn''t find'),
     1744            ) then
     1745            return 2;
     1746        return rc;
     1747    end
    7901748return EMX(fRM);
    7911749
     
    7951753 * IBM Visual Age for C++ v3.08 for OS/2
    7961754 */
    797 VAC308: procedure
    798     parse arg fRM
     1755VAC308: procedure expose aCfg. aPath. sPathFile
     1756    parse arg sEnvId,fRM,fCfg
    7991757
    8001758    /*
    8011759     * IBM Visual Age for C++ Version 3.08 main directory.
    8021760     */
    803     sPathCPP = QueryPath('vac308');
     1761    sPathCPP = PathQuery('vac308', sEnvId, fCfg);
     1762    if (sPathCPP = '') then
     1763        return 1;
    8041764    call EnvVar_Set      fRM, 'PATH_VAC308',    sPathCPP
    8051765    call EnvVar_Set      fRM, 'CCENV',      'VAC3'
     
    8441804    call EnvVar_Set      fRM, 'smclasses',      'WPTYPES.IDL'
    8451805
    846     /* FIXME THESE USES '+' AS SEPERATOR NOT ';'!!! */
    8471806    call EnvVar_AddFront fRM, 'helpndx',        'EPMKWHLP.NDX+CPP.NDX+CPPBRS.NDX', '+'
    8481807    call EnvVar_AddFront fRM, 'ipf_keys',       'SHOWNAV'
    8491808
    850 
     1809    /* verify */
     1810    if (fCfg > 0) then
     1811    do
     1812        if (    \FileExists(sPathCPP'\bin\icc.exe', 'error: verify didn''t find'),
     1813            |   \FileExists(sPathCPP'\bin\ilib.exe', 'error: verify didn''t find'),
     1814            |   \FileExists(sPathCPP'\bin\ilink.exe', 'error: verify didn''t find'),
     1815            |   \FileExists(sPathCPP'\bin\icsperf.exe', 'error: verify didn''t find'),
     1816            |   \FileExists(sPathCPP'\bin\icsdebug.exe', 'error: verify didn''t find'),
     1817            |   \FileExists(sPathCPP'\bin\cppfilt.exe', 'error: verify didn''t find'),
     1818            |   \FileExists(sPathCPP'\bin\dllrname.exe', 'error: verify didn''t find'),
     1819            |   \FileExists(sPathCPP'\lib\demangl.lib', 'error: verify didn''t find'),
     1820            |   \FileExists(sPathCPP'\lib\cppom30.lib', 'error: verify didn''t find'),
     1821            |   \FileExists(sPathCPP'\lib\cppom30i.lib', 'error: verify didn''t find'),
     1822            |   \FileExists(sPathCPP'\lib\cppom30o.lib', 'error: verify didn''t find'),
     1823            |   \FileExists(sPathCPP'\lib\cppon30i.lib', 'error: verify didn''t find'),
     1824            |   \FileExists(sPathCPP'\lib\cppon30o.lib', 'error: verify didn''t find'),
     1825            |   \FileExists(sPathCPP'\lib\_doscall.lib', 'error: verify didn''t find'),
     1826            |   \FileExists(sPathCPP'\lib\_pmwin.lib', 'error: verify didn''t find'),
     1827            |   \FileExists(sPathCPP'\include\builtin.h', 'error: verify didn''t find'),
     1828            |   \FileExists(sPathCPP'\include\conio.h', 'error: verify didn''t find'),
     1829            |   \FileExists(sPathCPP'\include\ismkss.h', 'error: verify didn''t find'),
     1830            |    FileExists(sPathCPP'\include\os2.h'),
     1831            |    FileExists(sPathCPP'\include\os2win.h'),
     1832            |    FileExists(sPathCPP'\include\pm.h'),
     1833            |   \FileExists(sPathCPP'\include\sys\utime.h', 'error: verify didn''t find'),
     1834            |   \FileExists(sPathCPP'\help\cpplib.inf', 'error: verify didn''t find'),
     1835            ) then
     1836            return 2;
     1837        rc = CheckCmdOutput('syslevel '||sPathCPP||'\syslevel', 0, 'Version 3.00     Component ID 562201703'||'0d0a'x||'Current CSD level: CTC308');
     1838        if (rc = 0) then
     1839            rc = CheckCmdOutput('syslevel '||sPathCPP||'\syslevel', 0, 'Version 3.00     Component ID 562201704'||'0d0a'x||'Current CSD level: CTU308');
     1840        if (rc = 0) then
     1841            rc = CheckCmdOutput('syslevel '||sPathCPP||'\syslevel', 0, 'Version 3.00     Component ID 562201707'||'0d0a'x||'Current CSD level: CTV308');
     1842        if (rc = 0) then
     1843            rc = CheckCmdOutput('syslevel '||sPathCPP||'\syslevel', 0, 'Version 3.00     Component ID 562201708'||'0d0a'x||'Current CSD level: CTD308');
     1844        if (rc = 0) then
     1845            rc = CheckCmdOutput('syslevel '||sPathCPP||'\syslevel', 0, 'Version 3.00     Component ID 562201605'||'0d0a'x||'Current CSD level: CTC308');
     1846        if (rc = 0) then
     1847            rc = CheckCmdOutput('syslevel '||sPathCPP||'\syslevel', 0, 'Version 3.00     Component ID 562201602'||'0d0a'x||'Current CSD level: CTO308');
     1848        if (rc = 0) then
     1849            rc = CheckCmdOutput('icc', 0, 'IBM VisualAge C++ for OS/2, Version 3');
     1850        if (rc = 0) then
     1851            rc = CheckCmdOutput('ilink', 16, 'IBM(R) Linker for OS/2(R), Version 01.08.r1a_CTC308c');
     1852        if (rc = 0) then
     1853            rc = CheckCmdOutput('ilib /?', 8, 'IBM(R) Library Manager for OS/2(R), Version 01.00.03 cc_CTC308c');
     1854        return rc;
     1855    end
    8511856return 0;
    8521857
     
    8561861 * Visual Age / C and C++ tools v3.6.5 for OS/2
    8571862 */
    858 VAC365: procedure
    859     parse arg fRM
     1863VAC365: procedure expose aCfg. aPath. sPathFile
     1864    parse arg sEnvId,fRM,fCfg
    8601865
    8611866    /*
    8621867     * IBM C/C++ Compiler and Tools Version 3.6.5 main directory.
    8631868     */
    864     sPathCxx    = QueryPath('vac365');
     1869    sPathCxx    = PathQuery('vac365', sEnvId, fCfg);
     1870    if (sPathCxx = '') then
     1871        return 1;
    8651872    call EnvVar_Set      fRM, 'PATH_VAC365', sPathCxx;
    8661873    call EnvVar_Set      fRM, 'CCENV',      'VAC36'
     
    8791886    call EnvVar_Set      fRM, 'CPP_DBG_LANG', 'CPP'
    8801887
     1888    /* verify */
     1889    if (fCfg > 0) then
     1890    do
     1891        if (    \FileExists(sPathCxx'\bin\icc.exe', 'error: verify didn''t find'),
     1892            |   \FileExists(sPathCxx'\bin\ilib.exe', 'error: verify didn''t find'),
     1893            |   \FileExists(sPathCxx'\bin\ilink.exe', 'error: verify didn''t find'),
     1894            |   \FileExists(sPathCxx'\bin\idebug.exe', 'error: verify didn''t find'),
     1895            |   \FileExists(sPathCxx'\bin\cppfilt.exe', 'error: verify didn''t find'),
     1896            |   \FileExists(sPathCxx'\bin\dllrname.exe', 'error: verify didn''t find'),
     1897            |   \FileExists(sPathCxx'\bin\cppcbe36.exe', 'error: verify didn''t find'),
     1898            |   \FileExists(sPathCxx'\lib\cpprms36.lib', 'error: verify didn''t find'),
     1899            |   \FileExists(sPathCxx'\lib\cpprmi36.lib', 'error: verify didn''t find'),
     1900            |   \FileExists(sPathCxx'\lib\cpprmo36.lib', 'error: verify didn''t find'),
     1901            |   \FileExists(sPathCxx'\lib\cpprni36.lib', 'error: verify didn''t find'),
     1902            |   \FileExists(sPathCxx'\lib\cpprds36.lib', 'error: verify didn''t find'),
     1903            |   \FileExists(sPathCxx'\include\builtin.h', 'error: verify didn''t find'),
     1904            |   \FileExists(sPathCxx'\include\conio.h', 'error: verify didn''t find'),
     1905            |   \FileExists(sPathCxx'\include\ismavl.h', 'error: verify didn''t find'),
     1906            |    FileExists(sPathCxx'\include\os2.h'),
     1907            |    FileExists(sPathCxx'\include\os2win.h'),
     1908            |    FileExists(sPathCxx'\include\pm.h'),
     1909            |   \FileExists(sPathCxx'\include\sys\utime.h', 'error: verify didn''t find'),
     1910            |   \FileExists(sPathCxx'\help\cpplbm36.msg', 'error: verify didn''t find'),
     1911            ) then
     1912            return 2;
     1913        rc = CheckCmdOutput('icc', 0, 'IBM* C and C++ Compilers for OS/2*, AIX* and for Windows NT**, Version 3.6');
     1914        if (rc = 0) then
     1915            rc = CheckCmdOutput('ilink', 16, 'IBM(R) Linker for OS/2(R), Version 03.06.PPK1990125');
     1916        if (rc = 0) then
     1917            rc = CheckCmdOutput('ilib /?', 0, 'IBM Librarian for OS/2(R) Version 03.99.PPK1990310');
     1918        if (stream(sPathCxx'\bin\cppcbe36.exe', 'c', 'query size') <> 603122) then
     1919        do
     1920            say 'Error!!! Get latest vac365 optimizer fixes from the OS2 Mozilla project.';
     1921            say '         http://www.mozilla.org/ports/os2/setup.html';
     1922            rc = 99;
     1923        end
     1924        return rc;
     1925    end
    8811926return 0;
    8821927
     
    8851930 * Visual Age for C++ v4.0 for OS/2
    8861931 */
    887 VAC40: procedure
    888     parse arg fRM
     1932VAC40: procedure expose aCfg. aPath. sPathFile
     1933    parse arg sEnvId,fRM,fCfg
    8891934
    8901935    /*
    8911936     * IBM VisualAge for C++ v4.0 main directory.
    8921937     */
    893     sPathCPP    = QueryPath('vac40');
     1938    sPathCPP    = PathQuery('vac40', sEnvId, fCfg);
     1939    if (sPathCPP = '') then
     1940        return 1;
    8941941    call EnvVar_Set      fRM, 'PATH_VAC40',  sPathCPP;
    8951942    call EnvVar_Set      fRM, 'CCENV',      'VAC40'
     
    9121959    call EnvVar_Set      fRM, 'os2',         '1'
    9131960
     1961    /* verify */
     1962    if (fCfg > 0) then
     1963    do
     1964        if (    \FileExists(sPathCPP'\bin\iccv4.exe', 'error: verify didn''t find'),
     1965            |   \FileExists(sPathCPP'\bin\ilib.exe', 'error: verify didn''t find'),
     1966            |   \FileExists(sPathCPP'\bin\ire.exe', 'error: verify didn''t find'),
     1967            |   \FileExists(sPathCPP'\bin\vacide.exe', 'error: verify didn''t find'),
     1968            |   \FileExists(sPathCPP'\bin\cppfilt.exe', 'error: verify didn''t find'),
     1969            |   \FileExists(sPathCPP'\bin\dllrname.exe', 'error: verify didn''t find'),
     1970            |   \FileExists(sPathCPP'\bin\patrace.exe', 'error: verify didn''t find'),
     1971            |   \FileExists(sPathCPP'\lib\cpprms40.lib', 'error: verify didn''t find'),
     1972            |   \FileExists(sPathCPP'\lib\cpprmi40.lib', 'error: verify didn''t find'),
     1973            |   \FileExists(sPathCPP'\lib\cpprmo40.lib', 'error: verify didn''t find'),
     1974            |   \FileExists(sPathCPP'\lib\cpprni40.lib', 'error: verify didn''t find'),
     1975            |   \FileExists(sPathCPP'\lib\cpprds40.lib', 'error: verify didn''t find'),
     1976            |   \FileExists(sPathCPP'\include\builtin.h', 'error: verify didn''t find'),
     1977            |   \FileExists(sPathCPP'\include\conio.h', 'error: verify didn''t find'),
     1978            |   \FileExists(sPathCPP'\include\ismavl.h', 'error: verify didn''t find'),
     1979            |    FileExists(sPathCPP'\include\os2.h'),
     1980            |    FileExists(sPathCPP'\include\os2win.h'),
     1981            |    FileExists(sPathCPP'\include\pm.h'),
     1982            |   \FileExists(sPathCPP'\include\sys\utime.h', 'error: verify didn''t find'),
     1983            |   \FileExists(sPathCPP'\help\cpplbm40.msg', 'error: verify didn''t find'),
     1984            ) then
     1985            return 2;
     1986        rc = CheckCmdOutput('iccv4', 0, 'IBM VisualAge for C++ Version 4.0 C Compiler');
     1987        if (rc = 0) then
     1988            rc = CheckCmdOutput('ilib /?', 0, 'IBM Librarian for OS/2(R) Version 03.99.cc_981110'); /* is this really FP2?????? */
     1989        if (rc = 0) then
     1990            rc = CheckCmdOutput('vacbld -?', 0, 'IBM(R) VisualAge(R) C++ Professional, Version 4.0 (981117)'); /* is this really FP2?????? */
     1991        return rc;
     1992    end
    9141993return 0;
    9151994
     
    9201999 * WarpIn
    9212000 */
    922 WarpIn: procedure
    923     parse arg fRM
     2001WarpIn: procedure expose aCfg. aPath. sPathFile
     2002    parse arg sEnvId,fRM,fCfg
    9242003
    9252004    /*
    9262005     * WarpIn main directory.
    9272006     */
    928     sPathWarpIn = QueryPath('warpin');
     2007    sPathWarpIn = PathQuery('warpin', sEnvId, fCfg);
     2008    if (sPathWarpIn = '') then
     2009        return 1;
    9292010    call EnvVar_Set      fRM, 'PATH_WARPIN', sPathWarpIn;
    9302011    call EnvVar_AddFront fRM, 'path',        sPathWarpIn';'
     2012    call EnvVar_AddFront fRM, 'beginlibpath',sPathWarpIn';'
    9312013    call EnvVar_AddFront fRM, 'bookshelf',   sPathWarpIn';'
     2014
     2015    /* verify */
     2016    if (fCfg > 0) then
     2017    do
     2018        if (    \FileExists(sPathWarpIn'\wic.exe', 'error: verify didn''t find'),
     2019            |   \FileExists(sPathWarpIn'\wpirtl.dll', 'error: verify didn''t find'),
     2020            |   \FileExists(sPathWarpIn'\warpin.exe', 'error: verify didn''t find'),
     2021            ) then
     2022            return 2;
     2023        rc = CheckCmdOutput('wic', 1, '2002 - WarpIn archive creation and maintenance');
     2024        return rc;
     2025    end
    9322026return 0;
    9332027
     
    9372031 * WatCom C/C++ v11.0
    9382032 */
    939 WatComC11: procedure
    940     parse arg fRM, iBits
     2033WatComC11: procedure expose aCfg. aPath. sPathFile
     2034    parse arg sEnvId,fRM,fCfg, iBits
    9412035
    9422036    /*
    9432037     * Watcom C/C++ v11.0 main directory
    9442038     */
    945     sPathWatcom = QueryPath('watcom11');
     2039    sPathWatcom = PathQuery('watcom11', sEnvId, fCfg);
     2040    if (sPathWatcom = '') then
     2041        return 1;
    9462042    call EnvVar_Set      fRM, 'PATH_WATCOM', sPathWatcom
    9472043    call EnvVar_Set      fRM, 'CCENV',      'WAT'
     
    9642060    */
    9652061
     2062    /* verify */
     2063    if (fCfg > 0) then
     2064    do
     2065        if (    \FileExists(sPathWatcom'\binp\wpp.exe', 'error: verify didn''t find'),
     2066            |   \FileExists(sPathWatcom'\binp\wcc.exe', 'error: verify didn''t find'),
     2067            |   \FileExists(sPathWatcom'\binp\wcc386.exe', 'error: verify didn''t find'),
     2068            |   \FileExists(sPathWatcom'\binp\wpp386.exe', 'error: verify didn''t find'),
     2069            |   \FileExists(sPathWatcom'\binp\wlink.exe', 'error: verify didn''t find'),
     2070            |   \FileExists(sPathWatcom'\lib286\os2\os2.lib', 'error: verify didn''t find'),
     2071            |   \FileExists(sPathWatcom'\lib386\os2\clbrdll.lib', 'error: verify didn''t find'),
     2072            |   \FileExists(sPathWatcom'\lib386\os2\clib3r.lib', 'error: verify didn''t find'),
     2073            |   \FileExists(sPathWatcom'\lib386\nt\kernel32.lib', 'error: verify didn''t find'),
     2074            |   \FileExists(sPathWatcom'\lib386\nt\clbrdll.lib', 'error: verify didn''t find'),
     2075            |   \FileExists(sPathWatcom'\lib386\nt\clib3r.lib', 'error: verify didn''t find'),
     2076            ) then
     2077            return 2;
     2078        rc = CheckCmdOutput('wcc', 8, 'Watcom C16 Optimizing Compiler  Version 11.0 '||'0d0a'x);
     2079        if (rc = 0) then
     2080            rc = CheckCmdOutput('wpp', 8, 'Watcom C++16 Optimizing Compiler  Version 11.0 '||'0d0a'x);
     2081        if (rc = 0) then
     2082            rc = CheckCmdOutput('wcc386', 8, 'Watcom C32 Optimizing Compiler  Version 11.0 '||'0d0a'x);
     2083        if (rc = 0) then
     2084            rc = CheckCmdOutput('wpp386', 8, 'Watcom C++32 Optimizing Compiler  Version 11.0 '||'0d0a'x);
     2085        if (rc = 0) then
     2086            rc = CheckCmdOutput('wlink form ELF', 1, 'WATCOM Linker Version 11.0'||'0d0a'x);
     2087        return rc;
     2088    end
    9662089return 0;
    9672090
     
    9692092 * WatCom C/C++ v11.0c
    9702093 */
    971 WatComC11c: procedure
    972     parse arg fRM, iBits
     2094WatComC11c: procedure expose aCfg. aPath. sPathFile
     2095    parse arg sEnvId,fRM,fCfg, iBits
    9732096
    9742097    /*
    9752098     * Watcom C/C++ v11.0c main directory
    9762099     */
    977     sPathWatcom = QueryPath('watcom11c');
     2100    sPathWatcom = PathQuery('watcom11c', sEnvId, fCfg);
     2101    if (sPathWatcom = '') then
     2102        return 1;
     2103
    9782104    call EnvVar_Set      fRM, 'PATH_WATCOM', sPathWatcom
    9792105    call EnvVar_Set      fRM, 'CCENV',      'WAT'
     
    9882114    call EnvVar_AddFront fRM, 'help',        sPathWatcom'\binp\help;'
    9892115    call EnvVar_AddEnd   fRM, 'bookshelf',   sPathWatcom'\binp\help;'
    990     call EnvVar_AddFront fRM, 'include',     sPathWatcom'\h;'sPathWatcom'\h\os2;'sPathWatcom'\h\nt;'
     2116    if (iBits = 16) then
     2117        call EnvVar_AddFront fRM, 'include',     sPathWatcom'\h;'sPathWatcom'\h\os21x;'
     2118    else
     2119        call EnvVar_AddFront fRM, 'include',     sPathWatcom'\h;'sPathWatcom'\h\os2;'sPathWatcom'\h\nt;'
    9912120    call EnvVar_AddFront fRM, 'lib',         sPathWatcom'\lib386;'sPathWatcom'\lib386\os2;'sPathWatcom'\lib286;'sPathWatcom'\lib286\os2;'
    9922121    call EnvVar_Set      fRM, 'edpath',      sPathWatcom'EDDAT;'
     
    9962125    */
    9972126
     2127    /* verify */
     2128    if (fCfg > 0) then
     2129    do
     2130        if (    \FileExists(sPathWatcom'\binp\wpp.exe', 'error: verify didn''t find'),
     2131            |   \FileExists(sPathWatcom'\binp\wcc.exe', 'error: verify didn''t find'),
     2132            |   \FileExists(sPathWatcom'\binp\wcc386.exe', 'error: verify didn''t find'),
     2133            |   \FileExists(sPathWatcom'\binp\wpp386.exe', 'error: verify didn''t find'),
     2134            |   \FileExists(sPathWatcom'\binp\wlink.exe', 'error: verify didn''t find'),
     2135            |   \FileExists(sPathWatcom'\lib286\os2\os2.lib', 'error: verify didn''t find'),
     2136            |   \FileExists(sPathWatcom'\lib386\os2\clbrdll.lib', 'error: verify didn''t find'),
     2137            |   \FileExists(sPathWatcom'\lib386\os2\clib3r.lib', 'error: verify didn''t find'),
     2138            |   \FileExists(sPathWatcom'\lib386\nt\kernel32.lib', 'error: verify didn''t find'),
     2139            |   \FileExists(sPathWatcom'\lib386\nt\clbrdll.lib', 'error: verify didn''t find'),
     2140            |   \FileExists(sPathWatcom'\lib386\nt\clib3r.lib', 'error: verify didn''t find'),
     2141            ) then
     2142            return 2;
     2143        rc = CheckCmdOutput('wcc', 8, 'Watcom C16 Optimizing Compiler  Version 11.0c');
     2144        if (rc = 0) then
     2145            rc = CheckCmdOutput('wpp', 8, 'Watcom C++16 Optimizing Compiler  Version 11.0c');
     2146        if (rc = 0) then
     2147            rc = CheckCmdOutput('wcc386', 8, 'Watcom C32 Optimizing Compiler  Version 11.0c');
     2148        if (rc = 0) then
     2149            rc = CheckCmdOutput('wpp386', 8, 'Watcom C++32 Optimizing Compiler  Version 11.0c');
     2150        if (rc = 0) then
     2151            rc = CheckCmdOutput('wlink form ELF', 1, 'WATCOM Linker Version 11.0c');
     2152        return rc;
     2153    end
    9982154return 0;
    9992155
Note: See TracChangeset for help on using the changeset viewer.