Changeset 23
- Timestamp:
- 03/28/05 06:17:54 (4 years ago)
- Files:
-
- downloads/build_1.16.zip (added)
- downloads/build_win_1.16.exe (added)
- trunk/Docs/AUTO_BUILD_NUMBER.htm (modified) (1 diff)
- trunk/Docs/CHANGE_LOG.htm (modified) (3 diffs)
- trunk/Docs/COMMAND_LINE.htm (modified) (2 diffs)
- trunk/Docs/PRAGMA.htm (modified) (2 diffs)
- trunk/Docs/RESPONSE_FILE.htm (modified) (1 diff)
- trunk/Docs/RULE_DEFINITION_FILE.htm (modified) (2 diffs)
- trunk/Docs/SWITCHES.htm (modified) (22 diffs)
- trunk/Docs/TO_DO.htm (modified) (1 diff)
- trunk/Docs/index.htm (modified) (4 diffs)
- trunk/Source/Makefile.dos (modified) (1 diff)
- trunk/Source/build.d (modified) (23 diffs)
- trunk/Source/build_bn.d (modified) (1 diff)
- trunk/Source/source.d (modified) (7 diffs)
- trunk/Source/source_bn.d (modified) (1 diff)
- trunk/Source/util/fdt_bn.d (modified) (1 diff)
- trunk/Source/util/fileex.d (modified) (2 diffs)
- trunk/Source/util/fileex_bn.d (modified) (1 diff)
- trunk/Source/util/linetoken_bn.d (modified) (1 diff)
- trunk/Source/util/pathex_bn.d (modified) (1 diff)
- trunk/Source/util/str_bn.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Docs/AUTO_BUILD_NUMBER.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> trunk/Docs/CHANGE_LOG.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 13 13 </h3><br> 14 14 <p> 15 <strong> -- v1.16 -- 28/Mar/2005 </strong> 16 <ul> 17 <li> ** <strong>FIX</strong>: The utility now handles quotes around pragma(link) references. 18 <li> ** <strong>FIX</strong>: The utility now handles multiple references to the same module 19 even though they are using different 'path' specifications. 20 <li> ** <strong>ENH</strong>: The utility now has support for making Windows DLL files. 21 </ul> 22 <p> 15 23 <strong> -- v1.15 -- 24/Mar/2005 </strong> 16 24 <ul> … … 20 28 was present. 21 29 <li> ** <strong>FIX</strong>: The order of the librarian parameters was incorrect. 22 <li> ** <strong>FIX</strong>: Utility was not using the correct path name if importing30 <li> ** <strong>FIX</strong>: The utility was not using the correct path name if importing 23 31 modules from some Import paths. 24 32 <li> ** <strong>ENH</strong>: Verbose mode now shows the ignored and noticed packages. trunk/Docs/COMMAND_LINE.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 68 68 (Only needed if WinMain is not found in the source files 69 69 or if you wish to override the default Windows version) 70 <strong>-dll</strong> Forces a DLL library to be created. 71 (Only needed if DllMain is not found in the source files. 70 72 <strong>-X<module></strong> Packages and Modules to ignore (eg. -Xmylib) 71 73 <strong>-M<module></strong> Packages and Modules to notice (eg. -Mphobos) trunk/Docs/PRAGMA.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 110 110 Category: <a href="#PRAGMA">Pragma</a><br> 111 111 <p><p> You can have <em>build</em> create a customised OptLink definition file 112 by coding as many <em>build_def</em> pragmas as required. 112 by coding as many <em>build_def</em> pragmas as required. However, <em>build</em> will 113 only allow the first of each type of Definition File command to be used. THis 114 means that if you code ... <br> 115 <pre> 116 pragma (build_def, "EXETYPE DOS"); 117 pragma (build_def, "EXETYPE NT"); 118 </pre> 119 Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 120 explicit build_def pragmas to override the default ones generated by 121 <em>build</em> for Windows programs or DLL libraries. 113 122 <p> 114 123 The syntax for these pragma is <br> trunk/Docs/RESPONSE_FILE.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> trunk/Docs/RULE_DEFINITION_FILE.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 41 41 <pre> 42 42 ----- Windows Resource Compiler ----- 43 This uses ` pragma(build, <sourcefile>.rc); `43 This uses ` pragma(/b'build', <sourcefile>.rc); ` 44 44 ------------------------------------- 45 45 rule=Resources trunk/Docs/SWITCHES.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 18 18 <li><a href="#_CLEANUP"><i>switch</i> -cleanup</a> Ensures that all working files created during the run are removed. 19 19 <li><a href="#_DCPATH"><i>switch</i> -DCPATH</a> Identifies where the compiler has been installed. 20 <li><a href="#_DLL"><i>switch</i> -dll</a> Forces a DLL library to be created. 20 21 <li><a href="#_FULL"><i>switch</i> -full</a> Causes all source files, except ignored modules, to be compiled. 21 22 <li><a href="#_GUI"><i>switch</i> -gui</a> Forces a GUI application to be created. … … 48 49 <a href="#_CLEANUP">-cleanup</a>, 49 50 <a href="#_DCPATH">-DCPATH</a>, 51 <a href="#_DLL">-dll</a>, 50 52 <a href="#_FULL">-full</a>, 51 53 <a href="#_GUI">-gui</a>, … … 83 85 <a href="#_CLEANUP">-cleanup</a>, 84 86 <a href="#_DCPATH">-DCPATH</a>, 87 <a href="#_DLL">-dll</a>, 85 88 <a href="#_FULL">-full</a>, 86 89 <a href="#_GUI">-gui</a>, … … 113 116 <a href="#_CFPATH">-CFPATH</a>, 114 117 <a href="#_DCPATH">-DCPATH</a>, 118 <a href="#_DLL">-dll</a>, 115 119 <a href="#_FULL">-full</a>, 116 120 <a href="#_GUI">-gui</a>, … … 154 158 <a href="#_CFPATH">-CFPATH</a>, 155 159 <a href="#_CLEANUP">-cleanup</a>, 160 <a href="#_DLL">-dll</a>, 161 <a href="#_FULL">-full</a>, 162 <a href="#_GUI">-gui</a>, 163 <a href="#_INFO">-info</a>, 164 <a href="#_LIB">-lib</a>, 165 <a href="#_LINK">-link</a>, 166 <a href="#_M">-M</a>, 167 <a href="#_NAMES">-names</a>, 168 <a href="#_NOLIB">-nolib</a>, 169 <a href="#_NOLINK">-nolink</a>, 170 <a href="#_R">-R</a>, 171 <a href="#_RDF">-RDF</a>, 172 <a href="#_T">-T</a>, 173 <a href="#_TEST">-test</a>, 174 <a href="#_V">-v</a>, 175 <a href="#_V">-V</a>, 176 <a href="#_X">-X</a> 177 <hr> 178 <h4><br> 179 <a href="index.htm#makedocTOC">Table of Contents</a></h4> 180 <h2><a name="_DLL">[<i>switch</i>]<br>-dll</a> </h2> 181 <h3>Forces a DLL library to be created.</h3> 182 Category: <a href="#SWITCHES">Switches</a><br> 183 <p><p> <strong>Note:</strong> This only applies to Windows environment. 184 <p> 185 Normally, if <em>build</em> finds a DllMain() function it automatically 186 creates a DLL library. However, if you need to force a DLL 187 library, you would use this switch. 188 <p>See Also: 189 <a href="#_ALLOBJ">-allobj</a>, 190 <a href="#_CFPATH">-CFPATH</a>, 191 <a href="#_CLEANUP">-cleanup</a>, 192 <a href="#_DCPATH">-DCPATH</a>, 156 193 <a href="#_FULL">-full</a>, 157 194 <a href="#_GUI">-gui</a>, … … 186 223 <a href="#_CLEANUP">-cleanup</a>, 187 224 <a href="#_DCPATH">-DCPATH</a>, 225 <a href="#_DLL">-dll</a>, 188 226 <a href="#_GUI">-gui</a>, 189 227 <a href="#_INFO">-info</a>, … … 224 262 <a href="#_CLEANUP">-cleanup</a>, 225 263 <a href="#_DCPATH">-DCPATH</a>, 264 <a href="#_DLL">-dll</a>, 226 265 <a href="#_FULL">-full</a>, 227 266 <a href="#_INFO">-info</a>, … … 250 289 <a href="#_CLEANUP">-cleanup</a>, 251 290 <a href="#_DCPATH">-DCPATH</a>, 291 <a href="#_DLL">-dll</a>, 252 292 <a href="#_FULL">-full</a>, 253 293 <a href="#_GUI">-gui</a>, … … 283 323 <a href="#_CLEANUP">-cleanup</a>, 284 324 <a href="#_DCPATH">-DCPATH</a>, 325 <a href="#_DLL">-dll</a>, 285 326 <a href="#_FULL">-full</a>, 286 327 <a href="#_GUI">-gui</a>, … … 316 357 <a href="#_CLEANUP">-cleanup</a>, 317 358 <a href="#_DCPATH">-DCPATH</a>, 359 <a href="#_DLL">-dll</a>, 318 360 <a href="#_FULL">-full</a>, 319 361 <a href="#_GUI">-gui</a>, … … 351 393 <a href="#_CLEANUP">-cleanup</a>, 352 394 <a href="#_DCPATH">-DCPATH</a>, 395 <a href="#_DLL">-dll</a>, 353 396 <a href="#_FULL">-full</a>, 354 397 <a href="#_GUI">-gui</a>, … … 377 420 <a href="#_CLEANUP">-cleanup</a>, 378 421 <a href="#_DCPATH">-DCPATH</a>, 422 <a href="#_DLL">-dll</a>, 379 423 <a href="#_FULL">-full</a>, 380 424 <a href="#_GUI">-gui</a>, … … 409 453 <a href="#_CLEANUP">-cleanup</a>, 410 454 <a href="#_DCPATH">-DCPATH</a>, 455 <a href="#_DLL">-dll</a>, 411 456 <a href="#_FULL">-full</a>, 412 457 <a href="#_GUI">-gui</a>, … … 443 488 <a href="#_CLEANUP">-cleanup</a>, 444 489 <a href="#_DCPATH">-DCPATH</a>, 490 <a href="#_DLL">-dll</a>, 445 491 <a href="#_FULL">-full</a>, 446 492 <a href="#_GUI">-gui</a>, … … 506 552 <a href="#_CLEANUP">-cleanup</a>, 507 553 <a href="#_DCPATH">-DCPATH</a>, 554 <a href="#_DLL">-dll</a>, 508 555 <a href="#_FULL">-full</a>, 509 556 <a href="#_GUI">-gui</a>, … … 539 586 <a href="#_CLEANUP">-cleanup</a>, 540 587 <a href="#_DCPATH">-DCPATH</a>, 588 <a href="#_DLL">-dll</a>, 541 589 <a href="#_FULL">-full</a>, 542 590 <a href="#_GUI">-gui</a>, … … 580 628 <a href="#_CLEANUP">-cleanup</a>, 581 629 <a href="#_DCPATH">-DCPATH</a>, 630 <a href="#_DLL">-dll</a>, 582 631 <a href="#_FULL">-full</a>, 583 632 <a href="#_GUI">-gui</a>, … … 608 657 <a href="#_CLEANUP">-cleanup</a>, 609 658 <a href="#_DCPATH">-DCPATH</a>, 659 <a href="#_DLL">-dll</a>, 610 660 <a href="#_FULL">-full</a>, 611 661 <a href="#_GUI">-gui</a>, … … 634 684 <a href="#_CLEANUP">-cleanup</a>, 635 685 <a href="#_DCPATH">-DCPATH</a>, 686 <a href="#_DLL">-dll</a>, 636 687 <a href="#_FULL">-full</a>, 637 688 <a href="#_GUI">-gui</a>, … … 660 711 <a href="#_CLEANUP">-cleanup</a>, 661 712 <a href="#_DCPATH">-DCPATH</a>, 713 <a href="#_DLL">-dll</a>, 662 714 <a href="#_FULL">-full</a>, 663 715 <a href="#_GUI">-gui</a>, … … 697 749 <a href="#_CLEANUP">-cleanup</a>, 698 750 <a href="#_DCPATH">-DCPATH</a>, 751 <a href="#_DLL">-dll</a>, 699 752 <a href="#_FULL">-full</a>, 700 753 <a href="#_GUI">-gui</a>, trunk/Docs/TO_DO.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> trunk/Docs/index.htm
r21 r23 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/2 4 at 14h51m27-->4 <!-- on 2005/03/28 at 21h02m14 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 32 32 <tr><td><a href="COMMAND_LINE.htm#COMMAND_LINE">Command Line</a></td><td> The <em>build</em> utility supplies the source file and optional switches via the command line. 33 33 </td></tr> 34 <tr><td><a href="DLL_LIBRARIES.htm#DLL_LIBRARIES">DLL Libraries</a></td><td>How to create a DLL library using Build. 35 </td></tr> 34 36 <tr><td><a href="PRAGMA.htm#PRAGMA">Pragma</a></td><td> The <strong>build</strong> utility supports the use of various pragma statements. 35 37 </td></tr> … … 48 50 <a href="SWITCHES.htm#_CLEANUP">-cleanup</a> [<i><code>switch</code></i>] Ensures that all working files created during the run are removed.<br> 49 51 <a href="SWITCHES.htm#_DCPATH">-DCPATH</a> [<i><code>switch</code></i>] Identifies where the compiler has been installed.<br> 52 <a href="SWITCHES.htm#_DLL">-dll</a> [<i><code>switch</code></i>] Forces a DLL library to be created.<br> 50 53 <a href="SWITCHES.htm#_FULL">-full</a> [<i><code>switch</code></i>] Causes all source files, except ignored modules, to be compiled.<br> 51 54 <a href="SWITCHES.htm#_GUI">-gui</a> [<i><code>switch</code></i>] Forces a GUI application to be created.<br> … … 69 72 <a href="CHANGE_LOG.htm#CHANGE_LOG">Change Log</a> <br> 70 73 <a href="COMMAND_LINE.htm#COMMAND_LINE">Command Line</a> <br> 74 <a href="DLL_LIBRARIES.htm#DLL_LIBRARIES">DLL Libraries</a> <br> 71 75 <a href="PRAGMA.htm#INCLUDE">include</a> [<i><code>pragma</code></i>] This identifies a required file which is not otherwise imported.<br> 72 76 <a href="PRAGMA.htm#LINK">link</a> [<i><code>pragma</code></i>] This nominates one or more libraries that are required to be linked in.<br> trunk/Source/Makefile.dos
r15 r23 11 11 SOURCES=$(SOURCES) source.d 12 12 SOURCES=$(SOURCES) util/fdt.d 13 SOURCES=$(SOURCES) util/fileex.d 14 SOURCES=$(SOURCES) util/fileex_bn.d 15 SOURCES=$(SOURCES) util/linetoken.d 16 SOURCES=$(SOURCES) util/linetoken_bn.d 13 17 14 18 all: build trunk/Source/build.d
r21 r23 36 36 37 37 **************************************************************************/ 38 module build;39 version(build) pragma(macro, "calc majv 1", "calc minv 15");40 41 38 /* 42 39 A utility for building executables from source code written … … 55 52 ///info 56 53 //A list of changes and fixes that have been made. 54 // 55 // /b"-- v1.16 -- 28/Mar/2005" 56 //<ul> 57 ///li ** /b FIX: The utility now handles quotes around pragma(link) references. 58 ///li ** /b FIX: The utility now handles multiple references to the same module 59 //even though they are using different 'path' specifications. 60 ///li ** /b ENH: The utility now has support for making Windows DLL files. 61 //</ul> 57 62 // 58 63 // /b"-- v1.15 -- 24/Mar/2005" … … 63 68 //was present. 64 69 ///li ** /b FIX: The order of the librarian parameters was incorrect. 65 ///li ** /b FIX: Utility was not using the correct path name if importing70 ///li ** /b FIX: The utility was not using the correct path name if importing 66 71 //modules from some Import paths. 67 72 ///li ** /b ENH: Verbose mode now shows the ignored and noticed packages. … … 213 218 214 219 220 module build; 215 221 private import build_bn; // This module's build number 216 222 … … 224 230 version(Windows) { 225 231 // OptLink Definition File 226 pragma (build_def, "VERSION 1.1 5");232 pragma (build_def, "VERSION 1.16"); 227 233 pragma (build_def, "EXETYPE DOS"); 228 234 } … … 275 281 char[] kLibExtention=`lib`; 276 282 char[] kObjExtention=`obj`; 283 char[] kShrLibExtention=`dll`; 277 284 } 278 285 … … 281 288 char[] kLibExtention=`a`; 282 289 char[] kObjExtention=`o`; 290 char[] kShrLibExtention=`s`; 283 291 } 284 292 … … 361 369 char[] vAppPath; 362 370 char[] vAppName; 363 char[] vAppVersion = "1.1 5";371 char[] vAppVersion = "1.16"; 364 372 char[] vTargetName; // Output name from first file name. 365 373 char[] vPragmaTargetName; // Output name from pragma. … … 469 477 writefln(" (Only needed if WinMain is not found in the source files"); 470 478 writefln(" or if you wish to override the default Windows version)"); 479 writefln(" -dll Forces a DLL library to be created."); 480 writefln(" (Only needed if DllMain is not found in the source files.)"); 471 481 } 472 482 … … 585 595 foreach(int i, char[] lFileName; vLinkFiles.keys) 586 596 { 587 FileDateTime lLinkTime = new FileDateTime(lFileName);597 FileDateTime lLinkTime = GetFileTime(lFileName); 588 598 589 599 if(vVerbose) { 590 writefln("link file[%d] %s ", i,591 util.pathex.AbbreviateFileName(lFileName) );600 writefln("link file[%d] %s %s", i, 601 util.pathex.AbbreviateFileName(lFileName), lLinkTime.toString()); 592 602 } 593 603 else if(vNames) { … … 784 794 else if (vNoLink == false) 785 795 if (Source.WasMainFound) 786 lTargetName = ReplaceExtention(vTargetName, kExeExtention); 796 if (Source.WasMainDLL) 797 lTargetName = ReplaceExtention(vTargetName, kShrLibExtention); 798 else 799 lTargetName = ReplaceExtention(vTargetName, kExeExtention); 787 800 else 788 801 lTargetName = "not defined"; … … 938 951 vDefaultLibs ~= "gdi32.lib"; 939 952 } 953 else if (Source.WasMainDLL) { 954 AddBuildDef(`LIBRARY "` ~ std.path.getBaseName(lTargetName) ~ `"`); 955 AddBuildDef("EXETYPE NT"); 956 if (vWinVer.length != 0) 957 AddBuildDef("SUBSYSTEM WINDOWS," ~ vWinVer); 958 else 959 AddBuildDef("SUBSYSTEM WINDOWS"); 960 AddBuildDef("CODE PRELOAD DISCARDABLE SHARED EXECUTE"); 961 AddBuildDef("DATA PRELOAD SINGLE WRITE"); 962 } 940 963 } 941 964 … … 1010 1033 1011 1034 // Now build a library if requested to. 1012 if ( (vLibraryAction == LibOpt.Build) && (lRunResult == 0) ) 1035 if ( (Source.WasMainDLL) && (lRunResult == 0) ) 1036 { 1037 char[] lTargetFileName; 1038 char[] lImpLibPath; 1039 ulong[] lImpManf; 1040 1041 lImpLibPath = util.pathex.LocateFile("implib.exe", GetEnv("PATH")); 1042 if (std.file.exists(lImpLibPath)) 1043 { 1044 lImpManf = util.fileex.FindInFile(lImpLibPath, "Borland"); 1045 if (lImpManf.length != 0) 1046 lImpLibPath ~= " -a "; 1047 else 1048 lImpLibPath ~= " /system "; 1049 1050 lTargetFileName = std.path.getBaseName(lTargetName); 1051 lRunResult = RunCommand(lImpLibPath ~ std.path.addExt(lTargetFileName, "lib") 1052 ~ " " ~ std.path.addExt(lTargetFileName, "dll") ); 1053 } 1054 } 1055 else if ( (vLibraryAction == LibOpt.Build) && (lRunResult == 0) ) 1013 1056 { 1014 1057 lOutText.length = 0; … … 1168 1211 // ------------------------------------------- 1169 1212 { 1213 int lPos; 1214 lPos = std.string.find(pText, ' '); 1215 if (lPos == -1) 1216 lPos = pText.length; 1217 foreach(char[] lDef; vBuildDef) 1218 { 1219 if (lDef.length >= lPos) 1220 if (lDef[0..lPos] == pText[0..lPos]) 1221 return; 1222 } 1170 1223 vBuildDef ~= pText; 1171 1224 } … … 1412 1465 writefln("%s",pTitle); 1413 1466 1414 foreach(int lIndex, ExternRef lListEntry; pList) { 1467 foreach(int lIndex, ExternRef lListEntry; pList) 1468 { 1415 1469 writef(" [%2d]: %s",lIndex,lListEntry.FilePath); 1416 1470 if (lListEntry.ToolOpts.length > 0) … … 1427 1481 { 1428 1482 char[] lPossiblePath; 1483 char[] lLocalPath; 1429 1484 1430 1485 // Look for file in current folder first. 1431 lPossiblePath = util.pathex.CanonicalPath(pFileName, false); 1432 if(std.file.exists(lPossiblePath)) { 1433 return lPossiblePath; 1486 lLocalPath = util.pathex.CanonicalPath(pFileName, false); 1487 lLocalPath = util.pathex.AbbreviateFileName(lLocalPath); 1488 if(std.file.exists(lLocalPath)) { 1489 return lLocalPath; 1434 1490 } 1435 1491 … … 1438 1494 lPossiblePath = ( lNextRoot ~ pFileName ); 1439 1495 if(std.file.exists(lPossiblePath)) { 1440 return lPossiblePath;1441 } 1442 } 1443 1444 return pFileName;1496 return util.pathex.AbbreviateFileName(lPossiblePath); 1497 } 1498 } 1499 1500 return lLocalPath; 1445 1501 } 1446 1502 … … 1911 1967 1912 1968 version(Windows) { 1913 if (util.str.IsLike(pArg, cast(dchar[])"-gui*")) 1914 { 1915 Source.WasMainGUI = true; 1916 vBuildArgs ~= pArg; 1917 if (pArg.length == 4) 1969 if (util.str.IsLike(pArg, cast(dchar[])"-gui*")) 1970 { 1971 Source.WasMainGUI = true; 1972 vBuildArgs ~= pArg; 1973 if (pArg.length == 4) 1974 break; 1975 if (pArg[4] == ':') 1976 vWinVer = pArg[5..length]; 1977 else 1978 vWinVer = pArg[4..length]; 1918 1979 break; 1919 if (pArg[4] == ':') 1920 vWinVer = pArg[5..length]; 1921 else 1922 vWinVer = pArg[4..length]; 1923 break; 1924 } 1980 } 1981 if (pArg == "-dll") 1982 { 1983 Source.WasMainDLL = true; 1984 vBuildArgs ~= pArg; 1985 break; 1986 } 1925 1987 } 1926 1988 … … 2139 2201 ///code 2140 2202 // ----- Windows Resource Compiler ----- 2141 // This uses ` pragma( build, ~<sourcefile>.rc); `2203 // This uses ` pragma(/b'build', ~<sourcefile>.rc); ` 2142 2204 // ------------------------------------- 2143 2205 // rule=Resources … … 2161 2223 ///desc This supplies an option to be placed in an OptLink definition file. 2162 2224 //You can have /i build create a customised OptLink definition file 2163 //by coding as many /i build_def pragmas as required. 2225 //by coding as many /i build_def pragmas as required. However, /i build will 2226 //only allow the first of each type of Definition File command to be used. THis 2227 //means that if you code ... /n 2228 ///code 2229 // pragma (build_def, "EXETYPE DOS"); 2230 // pragma (build_def, "EXETYPE NT"); 2231 ///endcode 2232 //Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 2233 //explicit build_def pragmas to override the default ones generated by 2234 // /i build for Windows programs or DLL libraries. 2164 2235 // 2165 2236 //The syntax for these pragma is /n … … 2302 2373 // (Only needed if WinMain is not found in the source files 2303 2374 // or if you wish to override the default Windows version) 2375 // /b"-dll" Forces a DLL library to be created. 2376 // (Only needed if DllMain is not found in the source files. 2304 2377 // /b"-X~<module~>" Packages and Modules to ignore (eg. -Xmylib) 2305 2378 // /b"-M~<module~>" Packages and Modules to notice (eg. -Mphobos) … … 2498 2571 2499 2572 ///topic switches 2573 ///switch -dll 2574 ///desc Forces a DLL library to be created. 2575 ///b"Note:" This only applies to Windows environment. 2576 // 2577 //Normally, if /i build finds a DllMain() function it automatically 2578 // creates a DLL library. However, if you need to force a DLL 2579 // library, you would use this switch. 2580 2581 ///topic switches 2500 2582 ///switch -gui 2501 2583 ///desc Forces a GUI application to be created. … … 2632 2714 //source text of the form @{tokenname}@ with the value of the token. 2633 2715 2716 ///topic DLL Libraries 2717 ///info 2718 //How to create a DLL library using Build. 2719 //When Build finds a DllMain() function, or the -dll switch is used, it 2720 //creates a special type of Module Definition file, and sets the target to 2721 //to be a DLL file. The Module Definition file generated takes the form ... 2722 ///code 2723 // LIBRARY "~<targetname>.dll"; 2724 // EXETYPE NT 2725 // SUBSYSTEM WINDOWS,~<version> 2726 // CODE PRELOAD DISCARDABLE SHARED EXECUTE 2727 // DATA PRELOAD SINGLE WRITE 2728 ///endcode 2729 // 2730 //You can replace any of these by explicitly coding a pragma(build_def) 2731 //with different options than these defaults shown here. 2732 // 2733 //Also, if you have the program /b implib in your path, it will be run 2734 //after the DLL file is created, in order to also create a /b".lib" 2735 //library to interface with the DLL. Build currently supports both the 2736 //DigitalMars version and the Borland (Inprise) version of /b implib. trunk/Source/build_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 5 20;4 long auto_build_number = 566; trunk/Source/source.d
r21 r23 75 75 bool mainFound; 76 76 bool mainGUI; 77 bool mainDLL; 77 78 78 79 } … … 271 272 if (lCanUse){ 272 273 // Not known yet, so add it and grab its mod time 274 lNextFile = GetFullPathname(lNextFile); 273 275 lCurFileTime = (new Source(lNextFile)).DependantsTime; 274 276 } … … 306 308 static void WasMainGUI(bool pValue) { mainGUI = pValue; } 307 309 310 static bool WasMainDLL() { return mainDLL; } 311 static void WasMainDLL(bool pValue) { mainDLL = pValue; } 312 308 313 bool IncrementBuildNumber() 309 314 { … … 315 320 else { 316 321 lFileName = ModuleToFilename(mModuleName ~ "_bn"); 322 lFileName = GetFullPathname(lFileName); 323 317 324 if (std.file.exists(lFileName)) 318 325 { … … 405 412 break; 406 413 407 case "main", "WinMain": 414 case "main": 415 case "WinMain": 416 case "DllMain": 408 417 if ( (lPrevToken != "class") && 409 418 (lPrevToken != "template") … … 453 462 if (pCurrentToken == "WinMain") { 454 463 mainGUI = true; 464 } 465 else if (pCurrentToken == "DllMain") { 466 mainDLL = true; 455 467 } 456 468 } … … 623 635 while ( (lCurrentToken = GetNextToken(pFileText,pPos)) !== null) 624 636 { 637 if (lCurrentToken == "\"") 638 lCurrentToken = GetStringLit(pFileText, pPos); 639 625 640 if ((lCurrentToken != ",") && (lCurrentToken != ")")) 626 641 { trunk/Source/source_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 3 09;4 long auto_build_number = 355; trunk/Source/util/fdt_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 1 82;4 long auto_build_number = 196; trunk/Source/util/fileex.d
r20 r23 44 44 import std.string; 45 45 import std.path; 46 46 import std.ctype; 47 47 48 debug(1) 48 49 { … … 150 151 CreateTextFile(pFileName, lLines, pOpt); 151 152 } 153 154 ulong[] FindInFile(char[] pFileName, char[] pText, char[] pOptions = "", uint pMax=1) 155 { 156 bool lCaseSensitive; 157 bool lRegExp; 158 bool lWordOnly; 159 bool lCounting; 160 auto char[] lBuffer; 161 int lPos; 162 ulong[] lResult; 163 164 // TODO // 165 // Implement options. ---------------------------------- // 166 167 lCaseSensitive = true; 168 if (std.string.find(pOptions, 'i') != -1) 169 lCaseSensitive = true; 170 if (std.string.find(pOptions, 'I') != -1) 171 lCaseSensitive = true; 172 173 lRegExp = false; 174 if (std.string.find(pOptions, 'r') != -1) 175 lRegExp = true; 176 if (std.string.find(pOptions, 'R') != -1) 177 lRegExp = true; 178 179 lWordOnly = false; 180 if (std.string.find(pOptions, 'w') != -1) 181 lWordOnly = true; 182 if (std.string.find(pOptions, 'W') != -1) 183 lWordOnly = true; 184 185 lCounting = true; 186 if (std.string.find(pOptions, 'a') != -1) 187 lCounting = false; 188 if (std.string.find(pOptions, 'A') != -1) 189 lCounting = false; 190 191 lBuffer = cast(char[])std.file.read(pFileName); 192 lResult.length = 0; 193 lPos = 0; 194 195 while ( (lPos = std.string.find(lBuffer[lPos..$], pText)) != -1) 196 { 197 if (lWordOnly) 198 { 199 if (lPos > 0) 200 { 201 if (std.ctype.isalnum(lBuffer[lPos-1]) ) 202 { 203 lPos++; 204 continue; 205 } 206 } 207 if (lPos + pText.length < lBuffer.length) 208 { 209 if (std.ctype.isalnum(lBuffer[lPos + pText.length - 1]) ) 210 { 211 lPos++; 212 continue; 213 } 214 } 215 } 216 217 lResult.length = lResult.length + 1; 218 lResult[$-1] = lPos; 219 if (lCounting) 220 { 221 pMax--; 222 if (pMax == 0) 223 break; 224 } 225 226 lPos += pText.length; 227 if ((lBuffer.length - lPos) < pText.length) 228 break; 229 } 230 return lResult; 231 } 232 trunk/Source/util/fileex_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 1 18;4 long auto_build_number = 144; trunk/Source/util/linetoken_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 50;4 long auto_build_number = 64; trunk/Source/util/pathex_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 2 01;4 long auto_build_number = 215; trunk/Source/util/str_bn.d
r21 r23 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 1 77;4 long auto_build_number = 191;
