Changeset 5371 for trunk/tools/install


Ignore:
Timestamp:
Mar 24, 2001, 7:14:43 PM (24 years ago)
Author:
bird
Message:

Change to support new build pattern. Changed version labeling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/install/odin.cmd

    r5047 r5371  
    1 /* $Id: odin.cmd,v 1.29 2001-02-01 18:06:56 sandervl Exp $
     1/* $Id: odin.cmd,v 1.30 2001-03-24 18:14:43 bird Exp $
    22 *
    33 * Odin32 API WarpIn installation script generator.
     
    2424
    2525/*
     26 * Defaults.
     27 */
     28sType = 'Daily Build';
     29
     30
     31/*
    2632 * Parse arguments.
    2733 */
     
    4551     */
    4652    ch = substr(asArg.i, 1, 1);
    47     if (ch = '-' || ch = '/') then
     53    if (ch = '-' | ch = '/') then
    4854    do  /* option */
    49         call Syntax;
    50         exit(1);
     55        sOption = translate(substr(asArg.i, 2));
     56        select
     57            when (sOption = 'WEEKLY') then
     58                sType = 'Weekly Build';
     59            when (sOption = 'DAILY') then
     60                sType = 'Daily Build';
     61            when (sOption = 'ALPHA') then
     62                sType = 'Alpha Release';
     63            otherwise
     64                call Syntax;
     65                exit(1);
     66        end
     67        i = i + 1;
     68        iterate;
    5169    end
    5270
     
    5573     * Make distribution.
    5674     */
    57     if (CreateWarpInScript('Odin32Inst.wis', asArg.i) <> 0) then
     75    if (CreateWarpInScript('Odin32Inst.wis', asArg.i, sType) <> 0) then
    5876    do
    5977        say 'failed to create WarpIn script.'
     
    7997Syntax: procedure;
    8098say 'Util to build WarpIn archive.';
    81 say 'Syntax: Odin.cmd <dlldir> [dlldir2] [dlldir3] [dlldir4]';
     99say 'Syntax: Odin.cmd [options] <dlldir> [options] [dlldir2] [options] [dlldir3]';
    82100say '    Where <dlldir> is the subdirectory name in /bin.';
     101say '    And options is -Daily, -Weekly or -Alpha. Default: -Daily';
    83102return;
    84103
     
    88107 */
    89108CreateWarpInScript: procedure
    90 parse arg sInstFile, sDlldir
    91 
     109parse arg sInstFile, sDlldir, sType
     110
     111/* Find include directory */
     112sCurDir = directory();
     113sMainDir = filespec('path', sCurDir);
     114sMainDir = filespec('path', substr(sMainDir, 1, length(sMainDir) - 1));
     115sMainDir = filespec('drive', sCurDir) || substr(sMainDir, 1, length(sMainDir) - 1);
     116sDocDir = sMainDir||'\include';
     117
     118/* Odin32 version and build number */
     119sVerMajor = LookupDefine('#define=ODIN32_VERSION_MAJOR,'sDocDir'\odinbuild.h');
     120sVerMinor = LookupDefine('#define=ODIN32_VERSION_MINOR,'sDocDir'\odinbuild.h');
     121sVerBuild = LookupDefine('#define=ODIN32_BUILD_NR,'sDocDir'\odinbuild.h');
     122sPackVer = sVerMajor'\'sVerMinor'\'sVerBuild
     123sVer = 'Version 'sVerMajor'.'sVerMinor' Build no.'sVerBuild
     124
     125/* remove any previous script */
    92126call SysFileDelete sInstFile;
    93127
     
    97131rc = lineout(sInstFile, 'OS=OS2_3x');
    98132rc = lineout(sInstFile, '<HEAD>');
     133rc = lineout(sInstFile, '<TITLE>Odin32 'sType' - 'sVer'</TITLE>');
    99134rc = lineout(sInstFile, '<PCK INDEX=1');
    100 rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Odin Core Files\0\0\5"');
     135rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Odin Core Files\'sPackVer'"');
    101136rc = lineout(sInstFile, '     TARGET="C:\ODIN" BASE');
    102 title = "     TITLE=""Odin Daily Build ("date()")""";
     137title = "     TITLE=""Odin "sType" ("date()")""";
    103138rc = lineout(sInstFile, title);
    104139rc = lineout(sInstFile, '     SELECT NODESELECT');
    105 rc = lineout(sInstFile, '     >Installation of Odin Daily Build .</PCK>');
     140rc = lineout(sInstFile, '     >Installation of Odin 'sType' .</PCK>');
    106141rc = lineout(sInstFile, '');
    107142rc = lineout(sInstFile, '<PCK INDEX=2');
    108 rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Odin System Files\0\0\5"');
     143rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Odin System Files\'sPackVer'"');
    109144rc = lineout(sInstFile, '     TARGET="C:\ODIN\SYSTEM32"');
    110145rc = lineout(sInstFile, '     FIXED SELECT NODESELECT');
    111 title = "     TITLE=""Odin Daily Build System Files ("date()")""";
     146title = "     TITLE=""Odin "sType" System Files ("date()")""";
    112147rc = lineout(sInstFile, title);
    113148rc = lineout(sInstFile, '     EXECUTE="odininst.exe"');
     
    117152rc = lineout(sInstFile, '');
    118153rc = lineout(sInstFile, '<PCK INDEX=3');
    119 rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Add Win32k.sys to Config.sys\0\0\5"');
     154rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Add Win32k.sys to Config.sys\'sPackVer'"');
    120155rc = lineout(sInstFile, '     TARGET="C:\ODIN\SYSTEM32"');
    121156rc = lineout(sInstFile, '     FIXED');
     
    132167do
    133168    rc = lineout(sInstFile, '<PCK INDEX=4');
    134     rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Odin .sym files\0\0\5"');
     169    rc = lineout(sInstFile, '     PACKAGEID="Odin\Odin\Odin .sym files\'sPackVer'"');
    135170    rc = lineout(sInstFile, '     TARGET="C:\ODIN\SYSTEM32"');
    136171    rc = lineout(sInstFile, '     FIXED');
    137     title = "     TITLE=""Odin Daily Build .sym Files ("date()")""";
     172    title = "     TITLE=""Odin "sType" .sym Files ("date()")""";
    138173    rc = lineout(sInstFile, title);
    139174    rc = lineout(sInstFile, '     >Installation of Odin .sym files.</PCK>');
     
    149184rc = lineout(sInstFile, '========================');
    150185rc = lineout(sInstFile, '');
    151 rc = lineout(sInstFile, 'Odin is a free Open Source project with the goal to eventually');
    152 rc = lineout(sInstFile, 'provide a fully working Win32 (Win 95/98/NT/2000) runtime environment, ');
    153 rc = lineout(sInstFile, 'making it possible to run your favorite Windows programs under OS/2, ');
    154 rc = lineout(sInstFile, 'as if they were native OS/2 programs. The second goal of Odin is to');
    155 rc = lineout(sInstFile, 'provide the full Win32 application programming interface (API) so');
    156 rc = lineout(sInstFile, 'that it is possible to build OS/2 programs using Windows source');
    157 rc = lineout(sInstFile, 'code. This is also refered to as Odin32 whereas Odin is the name');
     186rc = charout(sInstFile, 'Odin is a free Open Source project with the goal to eventually ');
     187rc = charout(sInstFile, 'provide a fully working Win32 (Win 95/98/NT/2000) runtime environment, ');
     188rc = charout(sInstFile, 'making it possible to run your favorite Windows programs under OS/2, ');
     189rc = charout(sInstFile, 'as if they were native OS/2 programs. The second goal of Odin is to ');
     190rc = charout(sInstFile, 'provide the full Win32 application programming interface (API) so ');
     191rc = charout(sInstFile, 'that it is possible to build OS/2 programs using Windows source ');
     192rc = charout(sInstFile, 'code. This is also refered to as Odin32 whereas Odin is the name ');
    158193rc = lineout(sInstFile, 'of the Win32 binary emulator.');
    159194rc = lineout(sInstFile, '');
     
    203238rc = lineout(sInstFile, 'Project Odin Software License');
    204239rc = lineout(sInstFile, '');
    205 rc = lineout(sInstFile, 'You may, without charge, royalty, or other payment, copy and');
    206 rc = lineout(sInstFile, 'distribute copies of this work and derivative works of this work');
     240rc = lineout(sInstFile, 'You may, without charge, royalty, or other payment, copy and ');
     241rc = lineout(sInstFile, 'distribute copies of this work and derivative works of this work ');
    207242rc = lineout(sInstFile, 'in source or binary form provided that:');
    208 rc = lineout(sInstFile, '(1) you appropriately publish on each copy an appropriate');
    209 rc = lineout(sInstFile, 'copyright notice; (2) faithfully reproduce all prior copyright');
    210 rc = lineout(sInstFile, 'included in the original work; and (3) agree to indemnify and');
    211 rc = lineout(sInstFile, 'hold all prior authors, copyright holders and licensors of the');
    212 rc = lineout(sInstFile, 'work harmless from and against all damages arising from use of');
     243rc = lineout(sInstFile, '(1) you appropriately publish on each copy an appropriate ');
     244rc = lineout(sInstFile, 'copyright notice; (2) faithfully reproduce all prior copyright ');
     245rc = lineout(sInstFile, 'included in the original work; and (3) agree to indemnify and ');
     246rc = lineout(sInstFile, 'hold all prior authors, copyright holders and licensors of the ');
     247rc = lineout(sInstFile, 'work harmless from and against all damages arising from use of ');
    213248rc = lineout(sInstFile, 'or the inability to use the work.');
    214249rc = lineout(sInstFile, '');
    215 rc = lineout(sInstFile, 'You may distribute binaries and sources of derivative works of');
    216 rc = lineout(sInstFile, 'the work provided that: (1) all modifications to the original');
    217 rc = lineout(sInstFile, 'source code are publically available; (2) all modifications are');
    218 rc = lineout(sInstFile, 'released under this license; (3) all copyrights of the original');
    219 rc = lineout(sInstFile, 'work are included; (4) the modifications are a direct advantage');
    220 rc = lineout(sInstFile, 'for the functionality and completeness of the product or improve');
    221 rc = lineout(sInstFile, 'interoperability of the product with another product and do not');
    222 rc = lineout(sInstFile, 'interfere with the goal of an open source and free emulation');
     250rc = lineout(sInstFile, 'You may distribute binaries and sources of derivative works of ');
     251rc = lineout(sInstFile, 'the work provided that: (1) all modifications to the original ');
     252rc = lineout(sInstFile, 'source code are publically available; (2) all modifications are ');
     253rc = lineout(sInstFile, 'released under this license; (3) all copyrights of the original ');
     254rc = lineout(sInstFile, 'work are included; (4) the modifications are a direct advantage ');
     255rc = lineout(sInstFile, 'for the functionality and completeness of the product or improve ');
     256rc = lineout(sInstFile, 'interoperability of the product with another product and do not ');
     257rc = lineout(sInstFile, 'interfere with the goal of an open source and free emulation ');
    223258rc = lineout(sInstFile, 'product.');
    224259rc = lineout(sInstFile, '');
    225 rc = lineout(sInstFile, 'You may NOT use the work as base of another work that is');
    226 rc = lineout(sInstFile, 'not released under this license agreement meaning that you');
    227 rc = lineout(sInstFile, 'especially are not allowed to develop any other product which');
     260rc = lineout(sInstFile, 'You may NOT use the work as base of another work that is ');
     261rc = lineout(sInstFile, 'not released under this license agreement meaning that you ');
     262rc = lineout(sInstFile, 'especially are not allowed to develop any other product which ');
    228263rc = lineout(sInstFile, 'is based on the sources and/or binaries of the work.');
    229264rc = lineout(sInstFile, '');
    230 rc = lineout(sInstFile, 'However, you are encouraged to use the work for porting your');
    231 rc = lineout(sInstFile, 'free or commercial applications. You can ship software');
    232 rc = lineout(sInstFile, 'converted using the work as long as the original copyright');
    233 rc = lineout(sInstFile, 'for the work is mentioned and you do not charge for');
    234 rc = lineout(sInstFile, 'using any part of the work. You may also ship the work in');
    235 rc = lineout(sInstFile, 'binaries and sources for use with your applications as long');
     265rc = lineout(sInstFile, 'However, you are encouraged to use the work for porting your ');
     266rc = lineout(sInstFile, 'free or commercial applications. You can ship software ');
     267rc = lineout(sInstFile, 'converted using the work as long as the original copyright ');
     268rc = lineout(sInstFile, 'for the work is mentioned and you do not charge for ');
     269rc = lineout(sInstFile, 'using any part of the work. You may also ship the work in ');
     270rc = lineout(sInstFile, 'binaries and sources for use with your applications as long ');
    236271rc = lineout(sInstFile, 'as you do not violate the distribution regulations of this license.');
    237272rc = lineout(sInstFile, '');
    238 rc = lineout(sInstFile, 'These license terms can be amended by a custom license');
    239 rc = lineout(sInstFile, 'agreement between a third party and the administration');
    240 rc = lineout(sInstFile, 'team. Such a custom license might only limit the above terms');
    241 rc = lineout(sInstFile, 'if the changes cause a direct advantage for the functionality');
    242 rc = lineout(sInstFile, 'or completeness of the product and do not interfere with the');
     273rc = lineout(sInstFile, 'These license terms can be amended by a custom license ');
     274rc = lineout(sInstFile, 'agreement between a third party and the administration ');
     275rc = lineout(sInstFile, 'team. Such a custom license might only limit the above terms ');
     276rc = lineout(sInstFile, 'if the changes cause a direct advantage for the functionality ');
     277rc = lineout(sInstFile, 'or completeness of the product and do not interfere with the ');
    243278rc = lineout(sInstFile, 'goal of an open-source and free emulation product.');
    244279rc = lineout(sInstFile, '');
    245 rc = lineout(sInstFile, 'Parts of the work may be governed by a license other than');
    246 rc = lineout(sInstFile, 'this one, if the source directory of the part contains a');
    247 rc = lineout(sInstFile, 'license file called "LICENSE.TXT" of its own. If a different');
    248 rc = lineout(sInstFile, 'license exists, it supercedes this license. Removing the');
    249 rc = lineout(sInstFile, 'the part specific license will automatically put back the');
    250 rc = lineout(sInstFile, 'part under the terms of this license. Only the Odin management');
    251 rc = lineout(sInstFile, 'team is allowed to put parts of the work under a different');
    252 rc = lineout(sInstFile, 'license and remove the part specific licenses. The purpose');
    253 rc = lineout(sInstFile, 'of using different licenses is solely for allowing code');
    254 rc = lineout(sInstFile, 'sharing of certain parts of the work with other projects that');
    255 rc = lineout(sInstFile, 'have incompatible licenses. These parts should either have');
    256 rc = lineout(sInstFile, 'this license in a version that makes it compatible with the');
    257 rc = lineout(sInstFile, 'license of the second project, or the license of the second');
    258 rc = lineout(sInstFile, 'project as long as it conforms to the goals of an open source');
     280rc = lineout(sInstFile, 'Parts of the work may be governed by a license other than ');
     281rc = lineout(sInstFile, 'this one, if the source directory of the part contains a ');
     282rc = lineout(sInstFile, 'license file called "LICENSE.TXT" of its own. If a different ');
     283rc = lineout(sInstFile, 'license exists, it supercedes this license. Removing the ');
     284rc = lineout(sInstFile, 'the part specific license will automatically put back the ');
     285rc = lineout(sInstFile, 'part under the terms of this license. Only the Odin management ');
     286rc = lineout(sInstFile, 'team is allowed to put parts of the work under a different ');
     287rc = lineout(sInstFile, 'license and remove the part specific licenses. The purpose ');
     288rc = lineout(sInstFile, 'of using different licenses is solely for allowing code ');
     289rc = lineout(sInstFile, 'sharing of certain parts of the work with other projects that ');
     290rc = lineout(sInstFile, 'have incompatible licenses. These parts should either have ');
     291rc = lineout(sInstFile, 'this license in a version that makes it compatible with the ');
     292rc = lineout(sInstFile, 'license of the second project, or the license of the second ');
     293rc = lineout(sInstFile, 'project as long as it conforms to the goals of an open source ');
    259294rc = lineout(sInstFile, 'and free emulation software.');
    260295rc = lineout(sInstFile, '');
     
    273308rc = lineout(sInstFile, '<NEXTBUTTON TARGET=4>~Next</NEXTBUTTON>');
    274309rc = lineout(sInstFile, '<TEXT>');
    275 rc = lineout(sInstFile, 'List of changes and bugfixes for this Odin daily build ('date()')');
     310rc = lineout(sInstFile, 'List of changes and bugfixes for this Odin 'sType);
     311rc = lineout(sInstFile, '('sVer'  - 'date()')');
    276312rc = lineout(sInstFile, '</TEXT>');
    277313rc = lineout(sInstFile, '<README>');
     
    400436return rc;
    401437
     438
     439/**
     440 * Search for a #define in an C/C++ header or source file.
     441 *
     442 * @returns String containing the defined value
     443 *          found for the define in the header file.
     444 *          Quits on fatal errors.
     445 * @param   A string on the form: "#define=DEFINETOFIND,includefile.h"
     446 * @remark  Write only code... - let's hope it works.
     447 *          (From bldlevelinf.cmd)
     448 */
     449LookupDefine: procedure
     450    parse arg '#'sDefine'='sMacro','sIncludeFile
     451
     452    /*
     453     * Validate parameters.
     454     */
     455    sMacro = strip(sMacro);
     456    sIncludeFile = strip(sIncludeFile);
     457    if (sMacro = '') then
     458    do
     459        say 'syntax error: #define=<DEFINE_NAME>,<includefile.h>.';
     460        say '    <DEFINE_NAME> was empty.';
     461        exit(-20);
     462    end
     463    if (sIncludeFile = '') then
     464    do
     465        say 'syntax error: #define=<DEFINE_NAME>,<includefile.h>.';
     466        say '    <includefile.h> was empty.';
     467        exit(-20);
     468    end
     469
     470
     471    sIllegal = translate(translate(sMacro),,
     472                         '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',,
     473                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_');
     474
     475    if (strip(translate(sIllegal, ' ', '!')) <> '') then
     476    do
     477        say 'syntax error: #define=<DEFINE_NAME>,<includefile.h>.';
     478        say '    <DEFINE_NAME> contains illegal charater(s).'
     479        say '        'sMacro;
     480        say '        'translate(sIllegal, ' ', '!');
     481        exit(-20);
     482    end
     483
     484    /*
     485     * Open include file.
     486     */
     487    sRc = stream(sIncludeFile, 'c', 'open read');
     488    if (pos('READY', sRc) <> 1) then
     489    do  /* search INCLUDE variable */
     490        sFile = SysSearchPath('INCLUDE', sIncludeFile);
     491        if (sFile = '') then
     492        do
     493            say 'Can''t find include file 'sIncludeFile'.';
     494            exit(-20);
     495        end
     496        sIncludeFile = sFile;
     497
     498        sRc = stream(sIncludeFile, 'c', 'open read');
     499        if (pos('READY', sRc) <> 1) then
     500        do
     501            say 'Failed to open include file' sIncludeFile'.';
     502            exit(-20);
     503        end
     504    end
     505
     506    /*
     507     * Search the file line by line.
     508     *  We'll check for lines starting with a hash (#) char.
     509     *  Then check that the word after the hash is 'define'.
     510     *  Then match the next word with the macro name.
     511     *  Then then get the next rest of the line to comment or continuation char.
     512     *      (continuation is not supported)
     513     *  Finally strip quotes.
     514     */
     515    sValue = '';
     516    do while (lines(sIncludeFile) > 0)
     517        sLine = strip(linein(sIncludeFile));
     518        if (sLine = '') then
     519            iterate;
     520        if (substr(sLine, 1, 1) <> '#') then
     521            iterate;
     522        sLine = substr(sLine, 2);
     523        if (word(sLine, 1) <> 'define') then
     524            iterate;
     525        sLine = strip(substr(sLine, wordpos(sLine, 1) + length('define')+1));
     526        if (  substr(sLine, 1, length(sMacro)) <> sMacro,
     527            | substr(sLine, length(sMacro)+1, 1) <> ' ') then
     528            iterate;
     529        sLine = strip(substr(sLine, length(sMacro) + 1));
     530        if (sLine = '') then
     531        do
     532            say 'error: #define' sMacro' is empty.';
     533            call stream sIncludeFile, 'c', 'close';
     534            exit(-20);
     535        end
     536
     537        chQuote = substr(sLine, 1, 1);
     538        if (chQuote = '"' | chQuote = "'") then
     539        do  /* quoted string */
     540            iLastQuote = 0;
     541            do forever
     542                iLast = pos(chQuote, sLine, 2);
     543                if (iLast <= 0) then
     544                    leave;
     545                if (substr(sLine, iLast, 1) = '\') then
     546                    iterate;
     547                iLastQuote = iLast;
     548                leave;
     549            end
     550
     551            if (iLastQuote <= 0) then
     552            do
     553                say 'C/C++ syntax error in 'sIncludefile': didn''t find end quote.';
     554                call stream sIncludeFile, 'c', 'close';
     555                exit(-20);
     556            end
     557
     558            call stream sIncludeFile, 'c', 'close';
     559            sValue = substr(sLine, 2, iLastQuote - 2);
     560            say 'Found 'sMacro'='sValue;
     561            return sValue;
     562        end
     563        else
     564        do
     565            iCommentCPP = pos('//',sLine);
     566            iCommentC   = pos('/*',sLine);
     567            if (iCommentC > 0 & iCommentCPP > 0 & iCommentC > iCommentCPP) then
     568                iComment = iCommentCPP;
     569            else if (iCommentC > 0 & iCommentCPP > 0 & iCommentC < iCommentCPP) then
     570                iComment = iCommentC;
     571            else if (iCommentCPP > 0) then
     572                iComment = iCommentCPP;
     573            else if (iCommentC > 0) then
     574                iComment = iCommentC;
     575            else
     576                iComment = 0;
     577
     578            if (iComment > 0) then
     579                sValue = strip(substr(sLine, 1, iComment-1));
     580            else
     581                sValue = strip(sLine);
     582
     583            if (sValue <> '') then
     584            do
     585                if (substr(sValue, length(sValue)) = '\') then
     586                do
     587                    say 'Found continuation char: Multiline definitions are not supported!\n';
     588                    call stream sIncludeFile, 'c', 'close';
     589                    exit(-20);
     590                end
     591            end
     592
     593            if (sValue = '') then
     594                say 'warning: The #define has no value.';
     595
     596            call stream sIncludeFile, 'c', 'close';
     597            say 'Found 'sMacro'='sValue;
     598            return sValue;
     599        end
     600    end
     601
     602    call stream sIncludeFile, 'c', 'close';
     603    say 'error: didn''t find #define' sMacro'.';
     604    exit(-20);
     605
Note: See TracChangeset for help on using the changeset viewer.