Changeset 5371 for trunk/tools/install
- Timestamp:
- Mar 24, 2001, 7:14:43 PM (24 years ago)
- 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 sandervlExp $1 /* $Id: odin.cmd,v 1.30 2001-03-24 18:14:43 bird Exp $ 2 2 * 3 3 * Odin32 API WarpIn installation script generator. … … 24 24 25 25 /* 26 * Defaults. 27 */ 28 sType = 'Daily Build'; 29 30 31 /* 26 32 * Parse arguments. 27 33 */ … … 45 51 */ 46 52 ch = substr(asArg.i, 1, 1); 47 if (ch = '-' | |ch = '/') then53 if (ch = '-' | ch = '/') then 48 54 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; 51 69 end 52 70 … … 55 73 * Make distribution. 56 74 */ 57 if (CreateWarpInScript('Odin32Inst.wis', asArg.i ) <> 0) then75 if (CreateWarpInScript('Odin32Inst.wis', asArg.i, sType) <> 0) then 58 76 do 59 77 say 'failed to create WarpIn script.' … … 79 97 Syntax: procedure; 80 98 say 'Util to build WarpIn archive.'; 81 say 'Syntax: Odin.cmd <dlldir> [dlldir2] [dlldir3] [dlldir4]';99 say 'Syntax: Odin.cmd [options] <dlldir> [options] [dlldir2] [options] [dlldir3]'; 82 100 say ' Where <dlldir> is the subdirectory name in /bin.'; 101 say ' And options is -Daily, -Weekly or -Alpha. Default: -Daily'; 83 102 return; 84 103 … … 88 107 */ 89 108 CreateWarpInScript: procedure 90 parse arg sInstFile, sDlldir 91 109 parse arg sInstFile, sDlldir, sType 110 111 /* Find include directory */ 112 sCurDir = directory(); 113 sMainDir = filespec('path', sCurDir); 114 sMainDir = filespec('path', substr(sMainDir, 1, length(sMainDir) - 1)); 115 sMainDir = filespec('drive', sCurDir) || substr(sMainDir, 1, length(sMainDir) - 1); 116 sDocDir = sMainDir||'\include'; 117 118 /* Odin32 version and build number */ 119 sVerMajor = LookupDefine('#define=ODIN32_VERSION_MAJOR,'sDocDir'\odinbuild.h'); 120 sVerMinor = LookupDefine('#define=ODIN32_VERSION_MINOR,'sDocDir'\odinbuild.h'); 121 sVerBuild = LookupDefine('#define=ODIN32_BUILD_NR,'sDocDir'\odinbuild.h'); 122 sPackVer = sVerMajor'\'sVerMinor'\'sVerBuild 123 sVer = 'Version 'sVerMajor'.'sVerMinor' Build no.'sVerBuild 124 125 /* remove any previous script */ 92 126 call SysFileDelete sInstFile; 93 127 … … 97 131 rc = lineout(sInstFile, 'OS=OS2_3x'); 98 132 rc = lineout(sInstFile, '<HEAD>'); 133 rc = lineout(sInstFile, '<TITLE>Odin32 'sType' - 'sVer'</TITLE>'); 99 134 rc = lineout(sInstFile, '<PCK INDEX=1'); 100 rc = lineout(sInstFile, ' PACKAGEID="Odin\Odin\Odin Core Files\ 0\0\5"');135 rc = lineout(sInstFile, ' PACKAGEID="Odin\Odin\Odin Core Files\'sPackVer'"'); 101 136 rc = lineout(sInstFile, ' TARGET="C:\ODIN" BASE'); 102 title = " TITLE=""Odin Daily Build("date()")""";137 title = " TITLE=""Odin "sType" ("date()")"""; 103 138 rc = lineout(sInstFile, title); 104 139 rc = lineout(sInstFile, ' SELECT NODESELECT'); 105 rc = lineout(sInstFile, ' >Installation of Odin Daily Build.</PCK>');140 rc = lineout(sInstFile, ' >Installation of Odin 'sType' .</PCK>'); 106 141 rc = lineout(sInstFile, ''); 107 142 rc = lineout(sInstFile, '<PCK INDEX=2'); 108 rc = lineout(sInstFile, ' PACKAGEID="Odin\Odin\Odin System Files\ 0\0\5"');143 rc = lineout(sInstFile, ' PACKAGEID="Odin\Odin\Odin System Files\'sPackVer'"'); 109 144 rc = lineout(sInstFile, ' TARGET="C:\ODIN\SYSTEM32"'); 110 145 rc = lineout(sInstFile, ' FIXED SELECT NODESELECT'); 111 title = " TITLE=""Odin Daily BuildSystem Files ("date()")""";146 title = " TITLE=""Odin "sType" System Files ("date()")"""; 112 147 rc = lineout(sInstFile, title); 113 148 rc = lineout(sInstFile, ' EXECUTE="odininst.exe"'); … … 117 152 rc = lineout(sInstFile, ''); 118 153 rc = lineout(sInstFile, '<PCK INDEX=3'); 119 rc = lineout(sInstFile, ' PACKAGEID="Odin\Odin\Add Win32k.sys to Config.sys\ 0\0\5"');154 rc = lineout(sInstFile, ' PACKAGEID="Odin\Odin\Add Win32k.sys to Config.sys\'sPackVer'"'); 120 155 rc = lineout(sInstFile, ' TARGET="C:\ODIN\SYSTEM32"'); 121 156 rc = lineout(sInstFile, ' FIXED'); … … 132 167 do 133 168 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'"'); 135 170 rc = lineout(sInstFile, ' TARGET="C:\ODIN\SYSTEM32"'); 136 171 rc = lineout(sInstFile, ' FIXED'); 137 title = " TITLE=""Odin Daily Build.sym Files ("date()")""";172 title = " TITLE=""Odin "sType" .sym Files ("date()")"""; 138 173 rc = lineout(sInstFile, title); 139 174 rc = lineout(sInstFile, ' >Installation of Odin .sym files.</PCK>'); … … 149 184 rc = lineout(sInstFile, '========================'); 150 185 rc = 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');186 rc = charout(sInstFile, 'Odin is a free Open Source project with the goal to eventually '); 187 rc = charout(sInstFile, 'provide a fully working Win32 (Win 95/98/NT/2000) runtime environment, '); 188 rc = charout(sInstFile, 'making it possible to run your favorite Windows programs under OS/2, '); 189 rc = charout(sInstFile, 'as if they were native OS/2 programs. The second goal of Odin is to '); 190 rc = charout(sInstFile, 'provide the full Win32 application programming interface (API) so '); 191 rc = charout(sInstFile, 'that it is possible to build OS/2 programs using Windows source '); 192 rc = charout(sInstFile, 'code. This is also refered to as Odin32 whereas Odin is the name '); 158 193 rc = lineout(sInstFile, 'of the Win32 binary emulator.'); 159 194 rc = lineout(sInstFile, ''); … … 203 238 rc = lineout(sInstFile, 'Project Odin Software License'); 204 239 rc = 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 ');240 rc = lineout(sInstFile, 'You may, without charge, royalty, or other payment, copy and '); 241 rc = lineout(sInstFile, 'distribute copies of this work and derivative works of this work '); 207 242 rc = 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 ');243 rc = lineout(sInstFile, '(1) you appropriately publish on each copy an appropriate '); 244 rc = lineout(sInstFile, 'copyright notice; (2) faithfully reproduce all prior copyright '); 245 rc = lineout(sInstFile, 'included in the original work; and (3) agree to indemnify and '); 246 rc = lineout(sInstFile, 'hold all prior authors, copyright holders and licensors of the '); 247 rc = lineout(sInstFile, 'work harmless from and against all damages arising from use of '); 213 248 rc = lineout(sInstFile, 'or the inability to use the work.'); 214 249 rc = 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 ');250 rc = lineout(sInstFile, 'You may distribute binaries and sources of derivative works of '); 251 rc = lineout(sInstFile, 'the work provided that: (1) all modifications to the original '); 252 rc = lineout(sInstFile, 'source code are publically available; (2) all modifications are '); 253 rc = lineout(sInstFile, 'released under this license; (3) all copyrights of the original '); 254 rc = lineout(sInstFile, 'work are included; (4) the modifications are a direct advantage '); 255 rc = lineout(sInstFile, 'for the functionality and completeness of the product or improve '); 256 rc = lineout(sInstFile, 'interoperability of the product with another product and do not '); 257 rc = lineout(sInstFile, 'interfere with the goal of an open source and free emulation '); 223 258 rc = lineout(sInstFile, 'product.'); 224 259 rc = 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 ');260 rc = lineout(sInstFile, 'You may NOT use the work as base of another work that is '); 261 rc = lineout(sInstFile, 'not released under this license agreement meaning that you '); 262 rc = lineout(sInstFile, 'especially are not allowed to develop any other product which '); 228 263 rc = lineout(sInstFile, 'is based on the sources and/or binaries of the work.'); 229 264 rc = 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 ');265 rc = lineout(sInstFile, 'However, you are encouraged to use the work for porting your '); 266 rc = lineout(sInstFile, 'free or commercial applications. You can ship software '); 267 rc = lineout(sInstFile, 'converted using the work as long as the original copyright '); 268 rc = lineout(sInstFile, 'for the work is mentioned and you do not charge for '); 269 rc = lineout(sInstFile, 'using any part of the work. You may also ship the work in '); 270 rc = lineout(sInstFile, 'binaries and sources for use with your applications as long '); 236 271 rc = lineout(sInstFile, 'as you do not violate the distribution regulations of this license.'); 237 272 rc = 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 ');273 rc = lineout(sInstFile, 'These license terms can be amended by a custom license '); 274 rc = lineout(sInstFile, 'agreement between a third party and the administration '); 275 rc = lineout(sInstFile, 'team. Such a custom license might only limit the above terms '); 276 rc = lineout(sInstFile, 'if the changes cause a direct advantage for the functionality '); 277 rc = lineout(sInstFile, 'or completeness of the product and do not interfere with the '); 243 278 rc = lineout(sInstFile, 'goal of an open-source and free emulation product.'); 244 279 rc = 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 ');280 rc = lineout(sInstFile, 'Parts of the work may be governed by a license other than '); 281 rc = lineout(sInstFile, 'this one, if the source directory of the part contains a '); 282 rc = lineout(sInstFile, 'license file called "LICENSE.TXT" of its own. If a different '); 283 rc = lineout(sInstFile, 'license exists, it supercedes this license. Removing the '); 284 rc = lineout(sInstFile, 'the part specific license will automatically put back the '); 285 rc = lineout(sInstFile, 'part under the terms of this license. Only the Odin management '); 286 rc = lineout(sInstFile, 'team is allowed to put parts of the work under a different '); 287 rc = lineout(sInstFile, 'license and remove the part specific licenses. The purpose '); 288 rc = lineout(sInstFile, 'of using different licenses is solely for allowing code '); 289 rc = lineout(sInstFile, 'sharing of certain parts of the work with other projects that '); 290 rc = lineout(sInstFile, 'have incompatible licenses. These parts should either have '); 291 rc = lineout(sInstFile, 'this license in a version that makes it compatible with the '); 292 rc = lineout(sInstFile, 'license of the second project, or the license of the second '); 293 rc = lineout(sInstFile, 'project as long as it conforms to the goals of an open source '); 259 294 rc = lineout(sInstFile, 'and free emulation software.'); 260 295 rc = lineout(sInstFile, ''); … … 273 308 rc = lineout(sInstFile, '<NEXTBUTTON TARGET=4>~Next</NEXTBUTTON>'); 274 309 rc = lineout(sInstFile, '<TEXT>'); 275 rc = lineout(sInstFile, 'List of changes and bugfixes for this Odin daily build ('date()')'); 310 rc = lineout(sInstFile, 'List of changes and bugfixes for this Odin 'sType); 311 rc = lineout(sInstFile, '('sVer' - 'date()')'); 276 312 rc = lineout(sInstFile, '</TEXT>'); 277 313 rc = lineout(sInstFile, '<README>'); … … 400 436 return rc; 401 437 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 */ 449 LookupDefine: 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.