Changeset 5762 for trunk/src/win32k


Ignore:
Timestamp:
May 19, 2001, 10:53:04 PM (24 years ago)
Author:
bird
Message:

Fix from Rafal. Validate paths after they're found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/configure.cmd

    r5499 r5762  
    1 /* $Id: configure.cmd,v 1.18 2001-04-14 07:22:12 bird Exp $
     1/* $Id: configure.cmd,v 1.19 2001-05-19 20:53:04 bird Exp $
    22 *
    33 * Configuration script.
     
    3737                when (ch = '?' | ch = 'H' | substr(sArg, 1, 2) = '-H') then
    3838                do
    39                     say 'Odin32 Configure.cmd. $Revision: 1.18 $.'
     39                    say 'Odin32 Configure.cmd. $Revision: 1.19 $.'
    4040                    say 'syntax: Configure.cmd [-n] [-w]'
    4141                    say '  -n   Noninteractive.'
     
    6161    do
    6262        call lineout sIncFile, '################################################################################'
    63         call lineout sIncFile, '# Generated by 'directory()'configure.cmd'
    64         call lineout sIncFile, '################################################################################';
    65         call lineout sIncFile, ''
    66         call lineout sIncFile, '################################################################################'
    67         call lineout sIncFile, '# BASEDIRECTORIES - Win32K'
     63        call lineout sIncFile, '# Generated by 'directory()'\configure.cmd'
     64        call lineout sIncFile, '################################################################################'
     65        call lineout sIncFile, ''
     66        call lineout sIncFile, '################################################################################'
     67        call lineout sIncFile, '# BASE DIRECTORIES - Win32K'
    6868        call lineout sIncFile, '# Note! These should be absolute paths!'
    6969        call lineout sIncFile, '################################################################################'
     
    9292
    9393        call lineout sIncFile, '################################################################################'
    94         call lineout sIncFile, '# DDKPATH: base directory of ddk base. (ie. \DDK\BASE not \DDK for DDK v4.0+)'
     94        call lineout sIncFile, '# DDKPATH: base directory of ddk base (ie. \DDK\BASE not \DDK for DDK v4.0+).'
    9595        call lineout sIncFile, '################################################################################'
    9696        sDDK = SearchPaths('INCLUDE', '..\h\dhcalls.h', 'PATH', '..\h\dhcalls.h', 'BOOKSHELF', '..\base\.\h\dhcalls.h', 'Path to DDK "\BASE" directory (ie. F:\DDK\BASE):');
     97        sDDK = ValidatePath(sDDK, 'h\devhdr.h', 'DDK Base Path');
    9798        call lineout sIncFile, 'DDKPATH          =' sDDK
    9899        call lineout sIncFile, ''
     
    102103        call lineout sIncFile, '################################################################################'
    103104        sTLKT = SearchPaths('INCLUDE', '..\h\os2.h', 'PATH', '..\h\os2.h', 'BOOKSHELF', '..\h\os2.h', 'Path to OS/2 Toolkit directory:');
     105        sTLKT = ValidatePath(sTLKT, 'h\bsememf.h', 'OS/2 Toolkit Path');
    104106        call lineout sIncFile, 'TOOLKIT          =' sTLKT
    105107        call lineout sIncFile, ''
     
    108110        call lineout sIncFile, '# IBM VisualAge for C++ base path'
    109111        call lineout sIncFile, '################################################################################'
    110         sVA = Value('CPPMAIN',, 'OS2ENVIRONMENT'); /* no sure if CPPMAIN or CPPLOCAL is the one to search... */
     112        sVA = Value('CPPMAIN',, 'OS2ENVIRONMENT'); /* not sure if CPPMAIN or CPPLOCAL is the one to search... */
     113        if (sVA <> '' & stream(sVA'\bin\icc.exe', 'c', 'query exists') = '') then
     114            sVA = ''
    111115        if (sVA = '') then
    112116            sVA = SearchPaths('PATH', 'icc.exe', 'BOOKSHELF', '..\bin\icc.exe', 'Path to IBM VisualAge for C++ or IBM C and C++ Compilers, and set its environment you compile:');
     117        sVA = ValidatePath(sVA, 'bin\icc.exe', 'VisualAge Path');
    113118        call lineout sIncFile, 'VACPATH          =' sVA
    114119        call lineout sIncFile, ''
     
    118123        call lineout sIncFile, '################################################################################'
    119124        sMSC = SearchPaths('PATH', '..\binp\c3l.exe', 'INCLUDE', '..\binp\c3l.exe','LIB', '..\binp\c3l.exe', 'Path to Microsoft C v6.0, v6.0a or v7.0 directory:');
     125        sMSC = ValidatePath(sMSC, 'binp\cl.exe', 'Microsoft C Path');
    120126        call lineout sIncFile, 'MSCPATH          =' sMSC
    121127        call lineout sIncFile, ''
     
    126132        sGrep = SearchPaths('PATH', 'grep.exe', 'Path to UNIX-like grep utility which supports -v.');
    127133        if (sGrep <> '') then
    128             call lineout sIncFile, 'GREP             =' sGrep || 'grep.exe'
     134            call lineout sIncFile, 'GREP             =' sGrep || '\grep.exe'
    129135        call lineout sIncFile, ''
    130136
     
    149155         * Display output.
    150156         */
    151         if (0 /*fInteractive = 1*/) then /* currently disabled since we're now called from mail config. */
     157        if (0 /*fInteractive = 1*/) then /* currently disabled since we're now called from main config. */
    152158        do
    153159            say 'Configuration completed!'
     
    229235            say '!error! sFile:'sFile  'sPath:'sPath;
    230236        /* debug: say 'sPath:'sPath  'sFile:'sFile */
    231         sPath = substr(sPath, 1, i-1);
    232     end
    233 
    234     return sPath;
     237        sPath = strip(substr(sPath, 1, i-1), 'T', '\');
     238    end
     239
     240return sPath;
     241
     242
     243/**
     244 * Validate if a file exists to ensure that the given path is valid.
     245 * @returns The path if valid. If invalid an empty string is returned.
     246 */
     247ValidatePath: procedure
     248    parse arg sPath, sFile, sDesc
     249
     250    rc = stream(sPath'\'sFile, 'c', 'query exists')
     251    if (rc <> '') then
     252        return sPath;
     253    say 'Warning: Validatation of the' sPath 'failed. Win32k.sys will not be built.'
     254    say '         path='sPath;
     255return '';
     256
Note: See TracChangeset for help on using the changeset viewer.