Changeset 19
- Timestamp:
- 03/15/05 21:50:39 (7 years ago)
- Files:
-
- downloads/build_1.10.zip (deleted)
- downloads/build_1.11.zip (deleted)
- downloads/build_1.13.zip (added)
- downloads/build_1.5.zip (deleted)
- downloads/build_1.6.zip (deleted)
- downloads/build_1.7.zip (deleted)
- downloads/build_1.8.zip (deleted)
- downloads/build_1.9.zip (deleted)
- downloads/build_win_1.10.exe (deleted)
- downloads/build_win_1.11.exe (deleted)
- downloads/build_win_1.13.exe (added)
- downloads/build_win_1.2.exe (deleted)
- downloads/build_win_1.3.exe (deleted)
- downloads/build_win_1.4.exe (deleted)
- downloads/build_win_1.5.exe (deleted)
- downloads/build_win_1.6.exe (deleted)
- downloads/build_win_1.7.exe (deleted)
- downloads/build_win_1.8.exe (deleted)
- downloads/build_win_1.9.exe (deleted)
- trunk/Docs/AUTO_BUILD_NUMBER.htm (modified) (1 diff)
- trunk/Docs/CHANGE_LOG.htm (modified) (6 diffs)
- trunk/Docs/COMMAND_LINE.htm (modified) (3 diffs)
- trunk/Docs/PRAGMA.htm (modified) (1 diff)
- trunk/Docs/RESPONSE_FILE.htm (modified) (2 diffs)
- trunk/Docs/SWITCHES.htm (modified) (23 diffs)
- trunk/Docs/TO_DO.htm (modified) (2 diffs)
- trunk/Docs/index.htm (modified) (3 diffs)
- trunk/Source/build.d (modified) (68 diffs)
- trunk/Source/build_bn.d (modified) (1 diff)
- trunk/Source/debug.brf (modified) (1 diff)
- trunk/Source/source.d (modified) (61 diffs)
- trunk/Source/source_bn.d (modified) (1 diff)
- trunk/Source/util/fdt.d (modified) (4 diffs)
- trunk/Source/util/fdt_bn.d (modified) (1 diff)
- trunk/Source/util/pathex.d (modified) (2 diffs)
- trunk/Source/util/pathex_bn.d (modified) (1 diff)
- trunk/Source/util/str.d (modified) (6 diffs)
- trunk/Source/util/str_bn.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Docs/AUTO_BUILD_NUMBER.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> trunk/Docs/CHANGE_LOG.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 13 13 </h3><br> 14 14 <p> 15 <strong> -- v1.13 -- 13/Mar/2005 </strong> 16 <ul> 17 <li> ** <strong>FIX</strong>: Explictly included paths entered on the -I switch are 18 now added to the dmd command line. 19 <li> ** <strong>FIX</strong>: Explictly excluded modules (via -X) were only checking package 20 names. They also check for module names now. 21 <li> ** <strong>FIX</strong>: Imported files are now looked for relative to the current directory 22 before the import paths are checked. 23 <li> ** <strong>FIX</strong>: The utility now checks the DFLAG environment symbol in 24 non-DigitalMars D compilers. 25 <li> ** <strong>CHG</strong>: The switch -nounittest is now deprecated and ignored if used. 26 The default setting is no longer to compile with unittests turned on. 27 </ul> 15 28 <strong> -- v1.12 -- 6/Mar/2005 </strong> 16 29 <ul> … … 53 66 <li> ** <strong>FIX</strong>: <em>Thanks to Anders F Bjoerklund:</em> Changed version(GDC) to version(GNU) 54 67 <li> ** <strong>FIX</strong>: Changed compiler name for GNU versions from 'dmd' to 'gdc' 55 <li> ** <strong>FIX</strong>: <em>Thanks to Carlos.</em> Buildwas incorrectly parsing the DFLAGS sc.ini line.68 <li> ** <strong>FIX</strong>: <em>Thanks to Carlos.</em> The application was incorrectly parsing the DFLAGS sc.ini line. 56 69 <li> ** <strong>ENH</strong>: <em>Thanks to Anders F Bjoerklund:</em> Provided a Makefile for the initial 57 70 compile of the application. … … 66 79 <strong> -- v1.6 -- 28/Feb/2005 </strong> 67 80 <ul> 68 <li> ** <strong>FIX</strong>: <em>Thanks to Kris.</em> Buildwas not including the DCPATH value81 <li> ** <strong>FIX</strong>: <em>Thanks to Kris.</em> The utility was not including the DCPATH value 69 82 when invoking the compiler. 70 83 <li> ** <strong>ENH</strong>: When building a Windows app, the .DEF file now includes the 71 version of windows that <em> Build</em>is being run on.84 version of windows that <em>this</em> application is being run on. 72 85 <li> ** <strong>ENH</strong>: The command line switch <strong>-gui</strong> can now have an optional 73 86 version information to specify which Windows version to build for. 74 The default Windows Version used is the one for the version running build. 75 <li> ** <strong>ENH</strong>: New command line switch -info to display build version #. 87 The default Windows Version used is the one for the version running 88 this utility. 89 <li> ** <strong>ENH</strong>: New command line switch -info to display the utility's version #. 76 90 </ul> 77 91 <strong> -- v1.5 -- 25/Feb/2005 </strong> … … 81 95 <li> ** <strong>FIX</strong>: <em>Thanks to kris.</em> Hardcoded default for DMD path was 82 96 misleading when dmd.exe was not in the Windows PATH. 83 <li> ** <strong>FIX</strong>: Buildwas not correctly parsing empty raw strings ``.97 <li> ** <strong>FIX</strong>: The utility was not correctly parsing empty raw strings ``. 84 98 <li> ** <strong>ENH</strong>: <em>Thanks to kris.</em> If the -DCPATH switch is used, then 85 99 if the existing DCPATH and CFPATH are the same, this switch changes both. … … 104 118 <ul> 105 119 <li> ** <strong>ENH</strong>: Put in a workaround for DMD (Windows) not using the sc.ini 106 file correctly. Buildnow explicitly adds any DFLAG options from120 file correctly. The utility now explicitly adds any DFLAG options from 107 121 the sc.ini file into the .rsp file. 108 <li> ** <strong>FIX</strong>: Buildnow correctly handles ';' delimited DFLAG options122 <li> ** <strong>FIX</strong>: The utility now correctly handles ';' delimited DFLAG options 109 123 in the sc.ini file. 110 124 <li> ** <strong>ENH</strong>: Now supports the use of 'response' files on the command line trunk/Docs/COMMAND_LINE.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 56 56 library. 57 57 (Normally only those in the same directory are added.) 58 <strong>-nounittest</strong> Ensures that the compiler does not include any59 unit tests in the executable.);60 58 <strong>-cleanup</strong> Ensures that all object files created during the run 61 59 are removed at the end of the run, plus other work files. … … 68 66 (Only needed if WinMain is not found in the source files 69 67 or if you wish to override the default Windows version) 70 <strong>-X<module></strong> Modules to ignore (eg. -Xmylib)71 <strong>-M<module></strong> Modules to notice (eg. -Mphobos)68 <strong>-X<module></strong> Packages and Modules to ignore (eg. -Xmylib) 69 <strong>-M<module></strong> Packages and Modules to notice (eg. -Mphobos) 72 70 <strong>-T<targetname></strong> The name of the target file to create. Normally 73 71 the target name istaken from the first or only name trunk/Docs/PRAGMA.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> trunk/Docs/RESPONSE_FILE.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 27 27 Example: (contents of final.brf) 28 28 <pre> 29 -nounittest30 29 -release 31 30 -full trunk/Docs/SWITCHES.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 23 23 <li><a href="#_LIB"><i>switch</i> -lib</a> Forces the object files to be placed in a library. 24 24 <li><a href="#_LINK"><i>switch</i> -link</a> Forces the linker to be called instead of the librarian. 25 <li><a href="#_M"><i>switch</i> -M</a> Identifies a module to notice (not ignore)25 <li><a href="#_M"><i>switch</i> -M</a> Identifies a module or a package to notice (not ignore) 26 26 <li><a href="#_NOLIB"><i>switch</i> -nolib</a> Ensures that the object files are not used to form a library. 27 27 <li><a href="#_NOLINK"><i>switch</i> -nolink</a> Ensures that the linker is not called. 28 <li><a href="#_NOUNITTEST"><i>switch</i> -nounittest</a> Ensures that the compiler does not include any unit tests in the executable.29 28 <li><a href="#_R"><i>switch</i> -R</a> Determines if the compiler tools use a response file or not. 30 29 <li><a href="#_T"><i>switch</i> -T</a> Identifies the target name to build. 31 30 <li><a href="#_TEST"><i>switch</i> -test</a> Does a test run only. No compiling, linking or library work is done. 31 <li><a href="#_V"><i>switch</i> -V</a> Set <em>verbose</em> mode on for just <em>build</em> and not for the compiler 32 32 <li><a href="#_V"><i>switch</i> -v</a> Set <em>verbose</em> mode on for both <em>build</em> and for the compiler 33 <li><a href="#_V"><i>switch</i> -V</a> Set <em>verbose</em> mode on for just <em>build</em> and not for the compiler 34 <li><a href="#_X"><i>switch</i> -X</a> Identifies a module to ignore 33 <li><a href="#_X"><i>switch</i> -X</a> Identifies a module or package to ignore 35 34 <hr> 36 35 <h4><br> … … 55 54 <a href="#_NOLIB">-nolib</a>, 56 55 <a href="#_NOLINK">-nolink</a>, 57 <a href="#_NOUNITTEST">-nounittest</a>, 58 <a href="#_R">-R</a>, 59 <a href="#_T">-T</a>, 60 <a href="#_TEST">-test</a>, 61 <a href="#_V">-v</a>, 62 <a href="#_V">-V</a>, 56 <a href="#_R">-R</a>, 57 <a href="#_T">-T</a>, 58 <a href="#_TEST">-test</a>, 59 <a href="#_V">-V</a>, 60 <a href="#_V">-v</a>, 63 61 <a href="#_X">-X</a> 64 62 <hr> … … 89 87 <a href="#_NOLIB">-nolib</a>, 90 88 <a href="#_NOLINK">-nolink</a>, 91 <a href="#_NOUNITTEST">-nounittest</a>, 92 <a href="#_R">-R</a>, 93 <a href="#_T">-T</a>, 94 <a href="#_TEST">-test</a>, 95 <a href="#_V">-v</a>, 96 <a href="#_V">-V</a>, 89 <a href="#_R">-R</a>, 90 <a href="#_T">-T</a>, 91 <a href="#_TEST">-test</a>, 92 <a href="#_V">-V</a>, 93 <a href="#_V">-v</a>, 97 94 <a href="#_X">-X</a> 98 95 <hr> … … 118 115 <a href="#_NOLIB">-nolib</a>, 119 116 <a href="#_NOLINK">-nolink</a>, 120 <a href="#_NOUNITTEST">-nounittest</a>, 121 <a href="#_R">-R</a>, 122 <a href="#_T">-T</a>, 123 <a href="#_TEST">-test</a>, 124 <a href="#_V">-v</a>, 125 <a href="#_V">-V</a>, 117 <a href="#_R">-R</a>, 118 <a href="#_T">-T</a>, 119 <a href="#_TEST">-test</a>, 120 <a href="#_V">-V</a>, 121 <a href="#_V">-v</a>, 126 122 <a href="#_X">-X</a> 127 123 <hr> … … 158 154 <a href="#_NOLIB">-nolib</a>, 159 155 <a href="#_NOLINK">-nolink</a>, 160 <a href="#_NOUNITTEST">-nounittest</a>, 161 <a href="#_R">-R</a>, 162 <a href="#_T">-T</a>, 163 <a href="#_TEST">-test</a>, 164 <a href="#_V">-v</a>, 165 <a href="#_V">-V</a>, 156 <a href="#_R">-R</a>, 157 <a href="#_T">-T</a>, 158 <a href="#_TEST">-test</a>, 159 <a href="#_V">-V</a>, 160 <a href="#_V">-v</a>, 166 161 <a href="#_X">-X</a> 167 162 <hr> … … 188 183 <a href="#_NOLIB">-nolib</a>, 189 184 <a href="#_NOLINK">-nolink</a>, 190 <a href="#_NOUNITTEST">-nounittest</a>, 191 <a href="#_R">-R</a>, 192 <a href="#_T">-T</a>, 193 <a href="#_TEST">-test</a>, 194 <a href="#_V">-v</a>, 195 <a href="#_V">-V</a>, 185 <a href="#_R">-R</a>, 186 <a href="#_T">-T</a>, 187 <a href="#_TEST">-test</a>, 188 <a href="#_V">-V</a>, 189 <a href="#_V">-v</a>, 196 190 <a href="#_X">-X</a> 197 191 <hr> … … 225 219 <a href="#_NOLIB">-nolib</a>, 226 220 <a href="#_NOLINK">-nolink</a>, 227 <a href="#_NOUNITTEST">-nounittest</a>, 228 <a href="#_R">-R</a>, 229 <a href="#_T">-T</a>, 230 <a href="#_TEST">-test</a>, 231 <a href="#_V">-v</a>, 232 <a href="#_V">-V</a>, 221 <a href="#_R">-R</a>, 222 <a href="#_T">-T</a>, 223 <a href="#_TEST">-test</a>, 224 <a href="#_V">-V</a>, 225 <a href="#_V">-v</a>, 233 226 <a href="#_X">-X</a> 234 227 <hr> … … 250 243 <a href="#_NOLIB">-nolib</a>, 251 244 <a href="#_NOLINK">-nolink</a>, 252 <a href="#_NOUNITTEST">-nounittest</a>, 253 <a href="#_R">-R</a>, 254 <a href="#_T">-T</a>, 255 <a href="#_TEST">-test</a>, 256 <a href="#_V">-v</a>, 257 <a href="#_V">-V</a>, 245 <a href="#_R">-R</a>, 246 <a href="#_T">-T</a>, 247 <a href="#_TEST">-test</a>, 248 <a href="#_V">-V</a>, 249 <a href="#_V">-v</a>, 258 250 <a href="#_X">-X</a> 259 251 <hr> … … 282 274 <a href="#_NOLIB">-nolib</a>, 283 275 <a href="#_NOLINK">-nolink</a>, 284 <a href="#_NOUNITTEST">-nounittest</a>, 285 <a href="#_R">-R</a>, 286 <a href="#_T">-T</a>, 287 <a href="#_TEST">-test</a>, 288 <a href="#_V">-v</a>, 289 <a href="#_V">-V</a>, 276 <a href="#_R">-R</a>, 277 <a href="#_T">-T</a>, 278 <a href="#_TEST">-test</a>, 279 <a href="#_V">-V</a>, 280 <a href="#_V">-v</a>, 290 281 <a href="#_X">-X</a> 291 282 <hr> … … 314 305 <a href="#_NOLIB">-nolib</a>, 315 306 <a href="#_NOLINK">-nolink</a>, 316 <a href="#_NOUNITTEST">-nounittest</a>, 317 <a href="#_R">-R</a>, 318 <a href="#_T">-T</a>, 319 <a href="#_TEST">-test</a>, 320 <a href="#_V">-v</a>, 321 <a href="#_V">-V</a>, 307 <a href="#_R">-R</a>, 308 <a href="#_T">-T</a>, 309 <a href="#_TEST">-test</a>, 310 <a href="#_V">-V</a>, 311 <a href="#_V">-v</a>, 322 312 <a href="#_X">-X</a> 323 313 <hr> … … 325 315 <a href="index.htm#makedocTOC">Table of Contents</a></h4> 326 316 <h2><a name="_M">[<i>switch</i>]<br>-M</a> </h2> 327 <h3>Identifies a module to notice (not ignore)</h3>317 <h3>Identifies a module or a package to notice (not ignore)</h3> 328 318 Category: <a href="#SWITCHES">Switches</a><br> 329 319 <p><p>You would use this to name any module that is not part of the target's … … 332 322 You can use this switch to recompile <em>phobos</em>. 333 323 <p> 334 Example (notice the Phobos modules):324 Example (notice the Phobos package): 335 325 <pre> 336 326 -Mphobos … … 348 338 <a href="#_NOLIB">-nolib</a>, 349 339 <a href="#_NOLINK">-nolink</a>, 350 <a href="#_NOUNITTEST">-nounittest</a>, 351 <a href="#_R">-R</a>, 352 <a href="#_T">-T</a>, 353 <a href="#_TEST">-test</a>, 354 <a href="#_V">-v</a>, 355 <a href="#_V">-V</a>, 340 <a href="#_R">-R</a>, 341 <a href="#_T">-T</a>, 342 <a href="#_TEST">-test</a>, 343 <a href="#_V">-V</a>, 344 <a href="#_V">-v</a>, 356 345 <a href="#_X">-X</a> 357 346 <hr> … … 379 368 <a href="#_M">-M</a>, 380 369 <a href="#_NOLINK">-nolink</a>, 381 <a href="#_NOUNITTEST">-nounittest</a>, 382 <a href="#_R">-R</a>, 383 <a href="#_T">-T</a>, 384 <a href="#_TEST">-test</a>, 385 <a href="#_V">-v</a>, 386 <a href="#_V">-V</a>, 370 <a href="#_R">-R</a>, 371 <a href="#_T">-T</a>, 372 <a href="#_TEST">-test</a>, 373 <a href="#_V">-V</a>, 374 <a href="#_V">-v</a>, 387 375 <a href="#_X">-X</a> 388 376 <hr> … … 412 400 <a href="#_M">-M</a>, 413 401 <a href="#_NOLIB">-nolib</a>, 414 <a href="#_NOUNITTEST">-nounittest</a>, 415 <a href="#_R">-R</a>, 416 <a href="#_T">-T</a>, 417 <a href="#_TEST">-test</a>, 418 <a href="#_V">-v</a>, 419 <a href="#_V">-V</a>, 420 <a href="#_X">-X</a> 421 <hr> 422 <h4><br> 423 <a href="index.htm#makedocTOC">Table of Contents</a></h4> 424 <h2><a name="_NOUNITTEST">[<i>switch</i>]<br>-nounittest</a> </h2> 425 <h3>Ensures that the compiler does not include any unit tests in the executable.</h3> 426 Category: <a href="#SWITCHES">Switches</a><br> 427 <p><p> Normally, <em>build</em> compiles with the unittest option enabled. This is 428 usually not a problem as most compiles are done to create a non-production 429 version of the application in which any unittests are required. 430 <p> 431 Typically, you would use this switch to create a <em>production</em> version of the 432 application. You might also want to use the compiler's -release switch. 433 <p>See Also: 434 <a href="#_ALLOBJ">-allobj</a>, 435 <a href="#_CFPATH">-CFPATH</a>, 436 <a href="#_CLEANUP">-cleanup</a>, 437 <a href="#_DCPATH">-DCPATH</a>, 438 <a href="#_FULL">-full</a>, 439 <a href="#_GUI">-gui</a>, 440 <a href="#_INFO">-info</a>, 441 <a href="#_LIB">-lib</a>, 442 <a href="#_LINK">-link</a>, 443 <a href="#_M">-M</a>, 444 <a href="#_NOLIB">-nolib</a>, 445 <a href="#_NOLINK">-nolink</a>, 446 <a href="#_R">-R</a>, 447 <a href="#_T">-T</a>, 448 <a href="#_TEST">-test</a>, 449 <a href="#_V">-v</a>, 450 <a href="#_V">-V</a>, 402 <a href="#_R">-R</a>, 403 <a href="#_T">-T</a>, 404 <a href="#_TEST">-test</a>, 405 <a href="#_V">-V</a>, 406 <a href="#_V">-v</a>, 451 407 <a href="#_X">-X</a> 452 408 <hr> … … 506 462 <a href="#_NOLIB">-nolib</a>, 507 463 <a href="#_NOLINK">-nolink</a>, 508 <a href="#_NOUNITTEST">-nounittest</a>, 509 <a href="#_T">-T</a>, 510 <a href="#_TEST">-test</a>, 511 <a href="#_V">-v</a>, 512 <a href="#_V">-V</a>, 464 <a href="#_T">-T</a>, 465 <a href="#_TEST">-test</a>, 466 <a href="#_V">-V</a>, 467 <a href="#_V">-v</a>, 513 468 <a href="#_X">-X</a> 514 469 <hr> … … 539 494 <a href="#_NOLIB">-nolib</a>, 540 495 <a href="#_NOLINK">-nolink</a>, 541 <a href="#_NOUNITTEST">-nounittest</a>, 542 <a href="#_R">-R</a>, 543 <a href="#_TEST">-test</a>, 544 <a href="#_V">-v</a>, 545 <a href="#_V">-V</a>, 496 <a href="#_R">-R</a>, 497 <a href="#_TEST">-test</a>, 498 <a href="#_V">-V</a>, 499 <a href="#_V">-v</a>, 546 500 <a href="#_X">-X</a> 547 501 <hr> … … 566 520 <a href="#_NOLIB">-nolib</a>, 567 521 <a href="#_NOLINK">-nolink</a>, 568 <a href="#_NOUNITTEST">-nounittest</a>, 569 <a href="#_R">-R</a>, 570 <a href="#_T">-T</a>, 571 <a href="#_V">-v</a>, 572 <a href="#_V">-V</a>, 522 <a href="#_R">-R</a>, 523 <a href="#_T">-T</a>, 524 <a href="#_V">-V</a>, 525 <a href="#_V">-v</a>, 526 <a href="#_X">-X</a> 527 <hr> 528 <h4><br> 529 <a href="index.htm#makedocTOC">Table of Contents</a></h4> 530 <h2><a name="_V">[<i>switch</i>]<br>-V</a> </h2> 531 <h3> Set <em>verbose</em> mode on for just <em>build</em> and not for the compiler</h3> 532 Category: <a href="#SWITCHES">Switches</a><br> 533 <p><p><p>See Also: 534 <a href="#_ALLOBJ">-allobj</a>, 535 <a href="#_CFPATH">-CFPATH</a>, 536 <a href="#_CLEANUP">-cleanup</a>, 537 <a href="#_DCPATH">-DCPATH</a>, 538 <a href="#_FULL">-full</a>, 539 <a href="#_GUI">-gui</a>, 540 <a href="#_INFO">-info</a>, 541 <a href="#_LIB">-lib</a>, 542 <a href="#_LINK">-link</a>, 543 <a href="#_M">-M</a>, 544 <a href="#_NOLIB">-nolib</a>, 545 <a href="#_NOLINK">-nolink</a>, 546 <a href="#_R">-R</a>, 547 <a href="#_T">-T</a>, 548 <a href="#_TEST">-test</a>, 549 <a href="#_V">-v</a>, 573 550 <a href="#_X">-X</a> 574 551 <hr> … … 591 568 <a href="#_NOLIB">-nolib</a>, 592 569 <a href="#_NOLINK">-nolink</a>, 593 <a href="#_NOUNITTEST">-nounittest</a>, 594 <a href="#_R">-R</a>, 595 <a href="#_T">-T</a>, 596 <a href="#_TEST">-test</a>, 597 <a href="#_V">-V</a>, 598 <a href="#_X">-X</a> 599 <hr> 600 <h4><br> 601 <a href="index.htm#makedocTOC">Table of Contents</a></h4> 602 <h2><a name="_V">[<i>switch</i>]<br>-V</a> </h2> 603 <h3> Set <em>verbose</em> mode on for just <em>build</em> and not for the compiler</h3> 604 Category: <a href="#SWITCHES">Switches</a><br> 605 <p><p><p>See Also: 606 <a href="#_ALLOBJ">-allobj</a>, 607 <a href="#_CFPATH">-CFPATH</a>, 608 <a href="#_CLEANUP">-cleanup</a>, 609 <a href="#_DCPATH">-DCPATH</a>, 610 <a href="#_FULL">-full</a>, 611 <a href="#_GUI">-gui</a>, 612 <a href="#_INFO">-info</a>, 613 <a href="#_LIB">-lib</a>, 614 <a href="#_LINK">-link</a>, 615 <a href="#_M">-M</a>, 616 <a href="#_NOLIB">-nolib</a>, 617 <a href="#_NOLINK">-nolink</a>, 618 <a href="#_NOUNITTEST">-nounittest</a>, 619 <a href="#_R">-R</a>, 620 <a href="#_T">-T</a>, 621 <a href="#_TEST">-test</a>, 622 <a href="#_V">-v</a>, 570 <a href="#_R">-R</a>, 571 <a href="#_T">-T</a>, 572 <a href="#_TEST">-test</a>, 573 <a href="#_V">-V</a>, 623 574 <a href="#_X">-X</a> 624 575 <hr> … … 626 577 <a href="index.htm#makedocTOC">Table of Contents</a></h4> 627 578 <h2><a name="_X">[<i>switch</i>]<br>-X</a> </h2> 628 <h3>Identifies a module to ignore</h3>579 <h3>Identifies a module or package to ignore</h3> 629 580 Category: <a href="#SWITCHES">Switches</a><br> 630 581 <p><p> Normally, <em>build</em> assumes that all imported modules are available … … 632 583 did not want <em>build</em> to recompile a module. 633 584 <p> 634 <strong>Note:</strong> The <em>Phobos</em> setof modules is automatically ignored. This585 <strong>Note:</strong> The <em>Phobos</em> package of modules is automatically ignored. This 635 586 means that <em>build</em> does not try to recompile phobos. 636 587 <p> 637 Example (ignore the 'parser' module)588 Example - ignore the 'parser' module (or package) 638 589 <pre> 639 590 -Xparser … … 652 603 <a href="#_NOLIB">-nolib</a>, 653 604 <a href="#_NOLINK">-nolink</a>, 654 <a href="#_NOUNITTEST">-nounittest</a>, 655 <a href="#_R">-R</a>, 656 <a href="#_T">-T</a>, 657 <a href="#_TEST">-test</a>, 658 <a href="#_V">-v</a>, 659 <a href="#_V">-V</a> 660 <hr> 605 <a href="#_R">-R</a>, 606 <a href="#_T">-T</a>, 607 <a href="#_TEST">-test</a>, 608 <a href="#_V">-V</a>, 609 <a href="#_V">-v</a> 610 <hr> trunk/Docs/TO_DO.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 32 32 This block would be replaced by the stdout data of calling 'tool <params>' and 33 33 sending it the content of <body> via stdin. 34 <li> Support for compiling C sources as well as D sources. eg. Calling GCC 35 before DMD. 34 36 35 37 </p> trunk/Docs/index.htm
r18 r19 2 2 <head> 3 3 <!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 4 <!-- on 2005/03/ 07 at 16h32m35-->4 <!-- on 2005/03/16 at 13h45m02 --> 5 5 <style>h4 {text-align: right}</style> 6 6 <title></title> … … 51 51 <a href="SWITCHES.htm#_LIB">-lib</a> [<i><code>switch</code></i>] Forces the object files to be placed in a library.<br> 52 52 <a href="SWITCHES.htm#_LINK">-link</a> [<i><code>switch</code></i>] Forces the linker to be called instead of the librarian.<br> 53 <a href="SWITCHES.htm#_M">-M</a> [<i><code>switch</code></i>] Identifies a module to notice (not ignore)<br>53 <a href="SWITCHES.htm#_M">-M</a> [<i><code>switch</code></i>] Identifies a module or a package to notice (not ignore)<br> 54 54 <a href="SWITCHES.htm#_NOLIB">-nolib</a> [<i><code>switch</code></i>] Ensures that the object files are not used to form a library.<br> 55 55 <a href="SWITCHES.htm#_NOLINK">-nolink</a> [<i><code>switch</code></i>] Ensures that the linker is not called.<br> 56 <a href="SWITCHES.htm#_NOUNITTEST">-nounittest</a> [<i><code>switch</code></i>] Ensures that the compiler does not include any unit tests in the executable.<br>57 56 <a href="SWITCHES.htm#_R">-R</a> [<i><code>switch</code></i>] Determines if the compiler tools use a response file or not.<br> 58 57 <a href="SWITCHES.htm#_T">-T</a> [<i><code>switch</code></i>] Identifies the target name to build.<br> … … 60 59 <a href="SWITCHES.htm#_V">-V</a> [<i><code>switch</code></i>] Set <em>verbose</em> mode on for just <em>build</em> and not for the compiler<br> 61 60 <a href="SWITCHES.htm#_V">-v</a> [<i><code>switch</code></i>] Set <em>verbose</em> mode on for both <em>build</em> and for the compiler<br> 62 <a href="SWITCHES.htm#_X">-X</a> [<i><code>switch</code></i>] Identifies a module to ignore<br>61 <a href="SWITCHES.htm#_X">-X</a> [<i><code>switch</code></i>] Identifies a module or package to ignore<br> 63 62 <a href="AUTO_BUILD_NUMBER.htm#AUTO_BUILD_NUMBER">Auto Build Number</a> <br> 64 63 <a href="PRAGMA.htm#BUILD_DEF">build_def</a> [<i><code>pragma</code></i>] This supplies an option to be placed in an OptLink definition file.<br> trunk/Source/build.d
r18 r19 1 /**************************************************************************1 /************************************************************************** 2 2 3 3 @file build.d … … 32 32 33 33 @version Initial version, January 2005 34 @author Derek Parnell 34 @author Derek Parnell, Melbourne, Australia. 35 35 36 36 37 37 **************************************************************************/ 38 38 39 /* build.d 40 by Derek Parnell, Melbourne, Australia. 41 42 A build utility for the D programming language. 39 /* 40 A utility for building executables from source code written 41 with the D programming language. 43 42 44 43 This examines a set of D source code files to determine what … … 55 54 //A list of changes and fixes that have been made. 56 55 // 56 // /b"-- v1.13 -- 13/Mar/2005" 57 //<ul> 58 ///li ** /b FIX: Explictly included paths entered on the -I switch are 59 //now added to the dmd command line. 60 ///li ** /b FIX: Explictly excluded modules (via -X) were only checking package 61 //names. They also check for module names now. 62 ///li ** /b FIX: Imported files are now looked for relative to the current directory 63 //before the import paths are checked. 64 ///li ** /b FIX: The utility now checks the DFLAG environment symbol in 65 //non-DigitalMars D compilers. 66 ///li ** /b CHG: The switch -nounittest is now deprecated and ignored if used. 67 //The default setting is no longer to compile with unittests turned on. 68 //</ul> 57 69 // /b"-- v1.12 -- 6/Mar/2005" 58 70 //<ul> … … 82 94 // /b"-- v1.9 -- 3/Mar/2005" 83 95 //<ul> 84 ///li ** /b FIX: /i"Thanks to Carlos." For unix, it now uses ':' instead of ';' for path 96 ///li ** /b FIX: /i"Thanks to Carlos." For unix, it now uses ':' instead of ';' for path 85 97 //separators when parsing the configuration file lines. 86 98 ///li ** /b FIX: /i"Thanks to Carlos." The default location for the configuration … … 95 107 ///li ** /b FIX: /i"Thanks to Anders F Bjoerklund:" Changed version(GDC) to version(GNU) 96 108 ///li ** /b FIX: Changed compiler name for GNU versions from 'dmd' to 'gdc' 97 ///li ** /b FIX: /i"Thanks to Carlos." Buildwas incorrectly parsing the DFLAGS sc.ini line.109 ///li ** /b FIX: /i"Thanks to Carlos." The application was incorrectly parsing the DFLAGS sc.ini line. 98 110 ///li ** /b ENH: /i"Thanks to Anders F Bjoerklund:" Provided a Makefile for the initial 99 111 //compile of the application. … … 108 120 // /b"-- v1.6 -- 28/Feb/2005" 109 121 //<ul> 110 ///li ** /b FIX: /i"Thanks to Kris." Buildwas not including the DCPATH value122 ///li ** /b FIX: /i"Thanks to Kris." The utility was not including the DCPATH value 111 123 //when invoking the compiler. 112 124 ///li ** /b ENH: When building a Windows app, the .DEF file now includes the 113 //version of windows that /i Buildis being run on.125 //version of windows that /i this application is being run on. 114 126 ///li ** /b ENH: The command line switch /b"-gui" can now have an optional 115 127 // version information to specify which Windows version to build for. 116 //The default Windows Version used is the one for the version running build. 117 ///li ** /b ENH: New command line switch -info to display build version #. 128 //The default Windows Version used is the one for the version running 129 // this utility. 130 ///li ** /b ENH: New command line switch -info to display the utility's version #. 118 131 //</ul> 119 132 // /b"-- v1.5 -- 25/Feb/2005" … … 123 136 ///li ** /b FIX: /i"Thanks to kris." Hardcoded default for DMD path was 124 137 //misleading when dmd.exe was not in the Windows PATH. 125 ///li ** /b FIX: Buildwas not correctly parsing empty raw strings ``.138 ///li ** /b FIX: The utility was not correctly parsing empty raw strings ``. 126 139 ///li ** /b ENH: /i"Thanks to kris." If the -DCPATH switch is used, then 127 140 //if the existing DCPATH and CFPATH are the same, this switch changes both. … … 146 159 //<ul> 147 160 ///li ** /b ENH: Put in a workaround for DMD (Windows) not using the sc.ini 148 //file correctly. Buildnow explicitly adds any DFLAG options from161 //file correctly. The utility now explicitly adds any DFLAG options from 149 162 //the sc.ini file into the .rsp file. 150 ///li ** /b FIX: Buildnow correctly handles ';' delimited DFLAG options163 ///li ** /b FIX: The utility now correctly handles ';' delimited DFLAG options 151 164 //in the sc.ini file. 152 165 ///li ** /b ENH: Now supports the use of 'response' files on the command line … … 163 176 164 177 165 module build;166 178 private import build_bn; // This module's build number 167 179 … … 175 187 version(Windows) { 176 188 // OptLink Definition File 177 pragma (build_def, "VERSION 1.1 2");189 pragma (build_def, "VERSION 1.13"); 178 190 pragma (build_def, "EXETYPE DOS"); 179 191 } … … 196 208 import std.stream; 197 209 import std.string; 210 198 211 version(Windows) { 199 212 import std.c.windows.windows; 200 213 } 201 version(linux) {214 else version(linux) { 202 215 import std.c.linux.linux; 203 216 } 204 version(darwin) {217 else version(darwin) { 205 218 import std.c.darwin.darwin; 206 219 } 207 220 208 221 // --------- C externals ---------------- 209 222 extern (C) … … 254 267 char[] vLibrarian = `lib`; 255 268 char[] vVersionSwitch = "-version="; 256 char[] vUnitTestSwitch = "-unittest";257 269 char[] vKeepPathSwitch = "-op"; 258 270 char[] vOutFileSwitch = "-of"; … … 280 292 char[] vLibrarian = `lib`; 281 293 char[] vVersionSwitch = "-fversion="; 282 char[] vUnitTestSwitch = "-funittest";283 294 char[] vOutFileSwitch = "-o "; 284 295 char[] vKeepPathSwitch = ""; … … 287 298 } 288 299 289 char[] vUnitTest;290 300 bool vTestRun = false; 291 301 bool vNoLink = false; … … 301 311 char[][] vDefaultCompArgs; 302 312 bool[char[]] vActiveVersions; 303 intvVersionLevel = 0;313 long vVersionLevel = 0; 304 314 LibOpt vLibraryAction = LibOpt.Implicit; 305 315 char[] vAppPath; 306 316 char[] vAppName; 307 char[] vAppVersion = "1.1 2";317 char[] vAppVersion = "1.13"; 308 318 char[] vTargetName; // Output name. 309 319 char[][] vCmdLineFiles; // List of source files from command line … … 312 322 char[][] vCompilerArgs; // Arguments passed to compiler 313 323 bool vUseResponseFile; 314 324 315 325 version(Windows) { 316 326 char[] vWinVer = ""; … … 327 337 { 328 338 vDefaultCompArgs ~= vKeepPathSwitch; // Keep object files in same folder as source. 329 vUnitTest = vUnitTestSwitch;330 339 vModulesToIgnore ~= "phobos"; // Assume phobos will be ignored. 331 340 332 341 version(Posix){ 333 342 vDefaultCompArgs ~= vVersionSwitch ~ "Posix"; // Until such time as this is standard in dmd. 334 343 } 335 344 336 345 version(Windows) { 337 346 vWinVerNum = cast(ubyte)(GetVersion() & 0xFF); 338 347 vWinVer = std.string.format("%d.0", vWinVerNum); 339 348 } 340 349 341 350 version(DigitalMars) { 342 351 version(Windows) { … … 364 373 if (pFull == false) 365 374 return; 375 else { 366 376 367 377 writefln( … … 395 405 writefln(" library."); 396 406 writefln(" (Normally only those in the same directory are added.)"); 397 writefln(" -nounittest Ensures that the compiler does not include any ");398 writefln(" unit tests in the executable.)");399 407 writefln(" -cleanup Ensures that all object files created during the run"); 400 408 writefln(" are removed at the end of the run, plus other work files."); … … 408 416 409 417 writefln(" -test Does everything as normal except it displays the commands"); 410 writefln(" instead of running them."); 418 writefln(" instead of running them."); 411 419 writefln(" -R<y|n> Indicates whether to use a response file or command line"); 412 writefln(" arguments with the compiler tools."); 420 writefln(" arguments with the compiler tools."); 413 421 writefln(" -Ry will cause a response to be used."); 414 422 writefln(" -Rn will cause command line arguments to be used."); 415 423 writefln(" -R will reverse the current usage."); 416 424 417 425 version(DigitalMars) { 418 426 version(Windows) { 419 427 writefln(" ** The default is to use a response file"); } 420 else { 428 else { 421 429 writefln(" ** The default is to use command line arguments"); } 422 430 } 423 431 else { 424 432 writefln(" ** The default is to use command line arguments"); } 425 426 writefln(" -X<module> Modules to ignore (eg. -Xmylib)");427 writefln(" -M<module> Modules to notice (eg. -Mphobos)");433 434 writefln(" -X<module> Modules/Packages to ignore (eg. -Xmylib)"); 435 writefln(" -M<module> Modules/Packages to notice (eg. -Mphobos)"); 428 436 writefln(" -T~<targetname~> The name of the target file to create. Normally"); 429 437 writefln(" the target name istaken from the first or only name"); … … 441 449 writefln(" If the response file reference is just a single '@' then"); 442 450 writefln(" build looks for a file called 'build.brf'"); 443 451 } 444 452 } 445 453 … … 453 461 writefln("Command: '%s'",pCommand); 454 462 return 0; 455 } 456 463 } else { 464 465 457 466 if(vVerbose) { 458 467 writefln("Running '%s'",pCommand); … … 469 478 } 470 479 return lRC; 480 } 471 481 } 472 482 … … 495 505 496 506 if(vVerbose) { 497 writefln("source file[%d] %s", i, 507 writefln("source file[%d] %s", i, 498 508 lFileName); 499 509 } … … 507 517 ); 508 518 } 509 519 510 520 lModsTime = lSource.DependantsTime; 511 521 } … … 605 615 606 616 } else if(lCurrentSource.DependantsTime > lCurrentSource.ObjectsTime) { 607 if (vVerbose) 617 if (vVerbose) 608 618 writefln("%s has newer dependants than its object file.", 609 619 lFileName); 610 620 611 621 lNeedsCompiling=true; 612 622 } … … 616 626 lFilesToLink ~= ReplaceExtention(lFileName, "d"); 617 627 lCompiling = true; 618 if (! vTestRun) 628 if (! vTestRun) 619 629 { 620 630 if (lCurrentSource.IncrementBuildNumber()) … … 624 634 lCurrentSource.BuildNumber, 625 635 lCurrentSource.ModuleName); 626 636 627 637 } 628 638 } … … 637 647 vCompilerArgs ~= lArg; 638 648 } 639 vCompilerArgs ~= vUnitTest;640 649 641 650 char[] lResponseFileName; … … 648 657 return 0; 649 658 } 650 659 else { 651 660 // Build command files for compilation. 652 661 foreach (char[] arg; vCompilerArgs) … … 723 732 if(lLinking) { 724 733 // Ensure the linker gets the right executable name to create. 725 lOutText ~= std.string.format("\"%s\"\n",vOutFileSwitch ~ lTargetName); 734 version(Posix) { 735 lOutText ~= std.string.format("%s\"%s\"\n",vOutFileSwitch, lTargetName); 736 } 737 else { 738 lOutText ~= std.string.format("\"%s\"\n",vOutFileSwitch ~ lTargetName); 739 } 726 740 727 741 // Include the default libraries. … … 738 752 std.file.write(lResponseFileName,lOutText); 739 753 command = vCompilerPath ~ vCompiler ~ " @" ~ lResponseFileName; 740 } 741 else 754 } 755 else 742 756 { // using commandline, may run into limits 743 757 lOutText=std.string.replace(lOutText, "\n"," "); … … 784 798 command = vLibrarian ~ " " ~ lOutText; 785 799 } 786 800 787 801 if (vVerbose) { 788 802 writefln("Librarian with ..........\n%s\n", lOutText); … … 831 845 return lRunResult; 832 846 } 847 } 833 848 834 849 … … 844 859 // ------------------------------------------- 845 860 { 846 return ( (pID in vActiveVersions) != null );861 return (pID in vActiveVersions) !== null ? true : false ; 847 862 } 848 863 … … 880 895 return pRootName; 881 896 } 882 897 else { 883 898 lFullName = util.pathex.CanonicalPath(pRootName); 884 899 version(Windows) lSearchName = std.string.tolower(lFullName); … … 889 904 return lFullName; 890 905 } 891 892 return ""; 906 else 907 return ""; 908 } 893 909 } 894 910 … … 942 958 char[] lSwitch; 943 959 char[] lRootName; 944 char[][] lRoots; 945 960 char[][] lRoots; 961 946 962 lPos = 0; 947 963 while(lPos < pText.length) … … 978 994 lPos = lEndPos+1; 979 995 } 980 996 981 997 if ((lSwitch.length > 0) && (lSwitch[0] == '-')) 982 998 { … … 987 1003 { 988 1004 lRootName = AddRoot(lRoot); 989 vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 1005 version(Posix) 1006 vDefaultCompArgs ~= vImportPathSwitch ~ "\"" ~ lRoot ~ "\""; 1007 else 1008 vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 990 1009 if(vVerbose) { 991 1010 if (lRootName.length > 0){ … … 1002 1021 1003 1022 // ------------------------------------------- 1023 void ReadEnviron() { 1024 // ------------------------------------------- 1025 char[] lSymValue; 1026 1027 // Check for a environment flag before config file. 1028 lSymValue = GetEnv("DFLAGS"); 1029 if (lSymValue.length > 0 ) 1030 { 1031 if (vVerbose) 1032 writefln("Analyzing environment symbol DFLAGS=%s", lSymValue); 1033 Process_DFLAGS( lSymValue ); 1034 } 1035 } 1036 1037 // ------------------------------------------- 1004 1038 void ReadConfigFile() { 1005 1039 // ------------------------------------------- … … 1008 1042 int lPos; 1009 1043 1010 // Check for a environment flag before config file.1011 lPath = GetEnv("DFLAGS");1012 if (lPath.length > 0 )1013 {1014 if (vVerbose)1015 writefln("Analyzing environment symbol DFLAGS=%s", lPath);1016 Process_DFLAGS( lPath );1017 }1018 1019 1044 if (vConfigFile is null) 1020 1045 { 1021 1046 // There is no configuration file to process 1022 return; 1023 } 1024 1047 return; 1048 } 1049 else { 1025 1050 lPath = vConfigPath ~ vConfigFile ; 1026 1051 lTextLines = source.GetFileTextLines(lPath); … … 1075 1100 } 1076 1101 } 1102 } 1077 1103 1078 1104 // Display each entry in the supplied list. … … 1096 1122 { 1097 1123 char[] lPossiblePath; 1124 1125 // Look for file in current folder first. 1126 lPossiblePath = util.pathex.CanonicalPath(pFileName, false); 1127 if(std.file.exists(lPossiblePath)) { 1128 return lPossiblePath; 1129 } 1098 1130 1099 1131 // Examine each known import root to see if the file lives there. … … 1103 1135 return lPossiblePath; 1104 1136 } 1105 }1106 1107 // File not found in any of the imported roots.1108 lPossiblePath = util.pathex.CanonicalPath(pFileName, false);1109 if(std.file.exists(lPossiblePath)) {1110 return lPossiblePath;1111 1137 } 1112 1138 … … 1221 1247 } 1222 1248 } 1223 1249 1224 1250 args=args[1..args.length]; 1225 1251 if (args.length == 0) { … … 1228 1254 return 0; 1229 1255 } 1230 1256 else { 1231 1257 SetKnownVersions(); 1232 1258 foreach(char[] arg; args) { … … 1245 1271 throw new Exception("No target name supplied."); 1246 1272 } 1273 else { 1247 1274 util.pathex.MakePath(vTargetName); 1248 1275 … … 1263 1290 } 1264 1291 1292 ReadEnviron(); 1265 1293 version(DigitalMars) ReadConfigFile(); 1266 1294 … … 1280 1308 // Each file must already exist. If any does not exist, then 1281 1309 // the application will abort. 1310 bool lAllExist = true; 1311 1312 // List all missing files (if any). 1313 foreach( int i, char[] lFile; vCmdLineFiles) 1282 1314 { 1283 bool lAllExist = true; 1284 1285 // List all missing files (if any). 1286 foreach( int i, char[] lFile; vCmdLineFiles) 1315 if (! std.file.exists( lFile ) ) 1287 1316 { 1288 if (! std.file.exists( lFile ) ) 1289 { 1290 writefln("** File '%s' not found.", lFile); 1291 lAllExist = false; 1292 } 1293 } 1294 1295 if ( lAllExist == false) 1317 writefln("** File '%s' not found.", lFile); 1318 lAllExist = false; 1319 } 1320 } 1321 1322 if ( lAllExist == false) 1323 { 1324 throw new Exception ("Not all supplied files exist."); 1325 } 1326 else { 1327 foreach( char[] lFile; vCmdLineFiles) 1296 1328 { 1297 throw new Exception ("Not all supplied files exist."); 1298 } 1299 } 1300 1301 foreach( char[] lFile; vCmdLineFiles) 1302 { 1303 new Source(GetFullPathname(lFile)); 1304 } 1305 1306 version(Windows) { 1307 putenv(vLibPaths); 1308 } 1309 1310 lBuildResult = Build(); 1311 1312 if(vVerbose) { 1313 writefln(""); 1314 DisplayItems(vBuildArgs, "\nbuild args: ..............."); 1315 DisplayItems(vCompilerArgs, "\ncompiler args: ................"); 1316 DisplayItems(vCmdLineFiles, "\ncommand line files: ..............."); 1317 DisplayItems(Source.SourceIndex.keys, 1318 "\ndeclared source files: ..............."); 1319 DisplayItems(vLinkFiles.keys,"\nlink files: ..............."); 1320 DisplayItems(vImportRoots, "\nimport roots: ................."); 1321 } 1322 1323 return lBuildResult; 1329 new Source(GetFullPathname(lFile)); 1330 } 1331 1332 version(Windows) { 1333 putenv(vLibPaths); 1334 } 1335 1336 lBuildResult = Build(); 1337 1338 if(vVerbose) { 1339 writefln(""); 1340 DisplayItems(vBuildArgs, "\nbuild args: ..............."); 1341 DisplayItems(vCompilerArgs, "\ncompiler args: ................"); 1342 DisplayItems(vCmdLineFiles, "\ncommand line files: ..............."); 1343 DisplayItems(Source.SourceIndex.keys, 1344 "\ndeclared source files: ..............."); 1345 DisplayItems(vLinkFiles.keys,"\nlink files: ..............."); 1346 DisplayItems(vImportRoots, "\nimport roots: ................."); 1347 } 1348 1349 return lBuildResult; 1350 } 1351 } 1352 } 1324 1353 } 1325 1354 … … 1414 1443 1415 1444 case "-nounittest": 1416 vUnitTest = ""; 1417 vBuildArgs ~= pArg; 1418 // Not passed thru. 1445 // Not passed thru. Deprecated switch is now ignored. 1446 writefln("Note: '-nounittest' ignored. This switch is no longer used."); 1419 1447 break; 1420 1448 … … 1469 1497 1470 1498 } 1471 1499 1472 1500 if (util.str.IsLike(pArg, cast(dchar[])"-CFPATH*")) 1473 1501 { … … 1479 1507 1480 1508 } 1481 1509 1482 1510 if (util.str.IsLike(pArg, std.utf.toUTF32(vImportPathSwitch ~ "*"))) 1483 1511 { 1484 1512 char [] lRoot; 1485 1513 lRoot = AddRoot(pArg[2..length]); 1486 if(vVerbose) { 1487 if (lRoot.length > 0){ 1488 writefln("Added root from command line = %s",lRoot); 1514 if (lRoot.length > 0){ 1515 version(Posix) 1516 vDefaultCompArgs ~= vImportPathSwitch ~ "\"" ~ lRoot ~ "\""; 1517 else 1518 vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 1519 if(vVerbose) { 1520 writefln("Added root from command line = %s",lRoot); 1489 1521 } 1490 1522 } 1491 1523 break; 1492 1524 } 1493 1525 1494 1526 if (util.str.IsLike(pArg, cast(dchar[])"-X*")) 1495 1527 { … … 1499 1531 break; 1500 1532 } 1501 1533 1502 1534 if (util.str.IsLike(pArg, cast(dchar[])"-M*")) 1503 1535 { … … 1507 1539 break; 1508 1540 } 1509 1541 1510 1542 if (util.str.IsLike(pArg, cast(dchar[])"-T*")) 1511 1543 { … … 1515 1547 break; 1516 1548 } 1517 1549 1518 1550 if (util.str.IsLike(pArg, cast(dchar[])"-R*")) 1519 1551 { 1520 1552 // Response file usage (eg. -Ry) 1521 1553 if (pArg.length == 2) 1522 vUseResponseFile = !vUseResponseFile;1523 1554 vUseResponseFile = (vUseResponseFile ? false : true); 1555 1524 1556 else if (pArg[2] == 'y') 1525 1557 vUseResponseFile = true; 1526 1558 1527 1559 else 1528 1560 vUseResponseFile = false; 1529 1561 1530 1562 vBuildArgs ~= pArg; 1531 1563 break; 1532 1564 } 1533 1565 1534 1566 version(Windows) { 1535 1567 if (util.str.IsLike(pArg, cast(dchar[])"-gui*")) … … 1546 1578 } 1547 1579 } 1548 1580 1549 1581 vCompilerArgs ~= pArg; 1550 1582 … … 1798 1830 // library. 1799 1831 // (Normally only those in the same directory are added.) 1800 // /b"-nounittest" Ensures that the compiler does not include any1801 // unit tests in the executable.);1802 1832 // /b"-cleanup" Ensures that all object files created during the run 1803 1833 // are removed at the end of the run, plus other work files. … … 1810 1840 // (Only needed if WinMain is not found in the source files 1811 1841 // or if you wish to override the default Windows version) 1812 // /b"-X~<module~>" Modules to ignore (eg. -Xmylib)1813 // /b"-M~<module~>" Modules to notice (eg. -Mphobos)1842 // /b"-X~<module~>" Packages and Modules to ignore (eg. -Xmylib) 1843 // /b"-M~<module~>" Packages and Modules to notice (eg. -Mphobos) 1814 1844 // /b"-T~<targetname~>" The name of the target file to create. Normally 1815 1845 // the target name istaken from the first or only name 1816 1846 // of the command line. 1817 1847 // /b"-R~<y|n~>" Indicates whether to use a response file or command line 1818 // arguments with the compiler tools. 1848 // arguments with the compiler tools. 1819 1849 // /b"-Ry" will cause a response to be used. 1820 1850 // /b"-Rn" will cause command line arguments to be used. … … 1936 1966 1937 1967 ///topic switches 1938 ///switch -nounittest1939 ///desc Ensures that the compiler does not include any unit tests in the executable.1940 //Normally, /i build compiles with the unittest option enabled. This is1941 //usually not a problem as most compiles are done to create a non-production1942 //version of the application in which any unittests are required.1943 //1944 //Typically, you would use this switch to create a /i production version of the1945 // application. You might also want to use the compiler's -release switch.1946 1947 ///topic switches1948 1968 ///switch -cleanup 1949 1969 ///desc Ensures that all working files created during the run are removed. … … 1968 1988 //arguments are going to be more than the operating system can handle 1969 1989 //on a single command line. However, it is always a safe option, so if 1970 //in doubt you may as well use it. 1990 //in doubt you may as well use it. 1971 1991 // 1972 1992 //A response file contains all the arguments that would have gone on the 1973 1993 //command line. They are arranged as one argument per line. 1974 1994 // 1975 //Not all tools respect the response file idea however the Windows based 1995 //Not all tools respect the response file idea however the Windows based 1976 1996 // DigitalMars tools do understand it. 1977 1997 // … … 1997 2017 ///switch -test 1998 2018 ///desc Does a test run only. No compiling, linking or library work is done. 1999 //This will display the command lines instead of running them. It can be used 2019 //This will display the command lines instead of running them. It can be used 2000 2020 //to see what would happen without actually building anything. 2001 2021 … … 2010 2030 // 2011 2031 //This switch can also be used to specify which version of Windows to 2012 // build the application for. To do this, it takes the format of 2032 // build the application for. To do this, it takes the format of 2013 2033 //-gui:X.Y where /i"X.Y" is the Windows version number. Use 4.0 2014 // for Windows NT, 2000, and ME, and 5.0 for Windows XP. 2034 // for Windows NT, 2000, and ME, and 5.0 for Windows XP. 2015 2035 // 2016 2036 //By default, /i build uses the version of Windows it is running under. … … 2022 2042 ///topic switches 2023 2043 ///switch -X 2024 ///desc Identifies a module to ignore2044 ///desc Identifies a module or package to ignore 2025 2045 //Normally, /i build assumes that all imported modules are available 2026 2046 //to be recompiled if required. You would use this switch if you explictly 2027 2047 // did not want /i build to recompile a module. 2028 2048 // 2029 ///b"Note:" The /i Phobos setof modules is automatically ignored. This2049 ///b"Note:" The /i Phobos package of modules is automatically ignored. This 2030 2050 // means that /i build does not try to recompile phobos. 2031 2051 // 2032 //Example (ignore the 'parser' module)2052 //Example - ignore the 'parser' module (or package) 2033 2053 ///code 2034 2054 // -Xparser … … 2037 2057 ///topic switches 2038 2058 ///switch -M 2039 ///desc Identifies a module to notice (not ignore)2059 ///desc Identifies a module or a package to notice (not ignore) 2040 2060 //You would use this to name any module that is not part of the target's 2041 2061 //dependancies, or is one of the /i ignored modules. … … 2043 2063 //You can use this switch to recompile /i phobos. 2044 2064 // 2045 //Example (notice the Phobos modules):2065 //Example (notice the Phobos package): 2046 2066 ///code 2047 2067 // -Mphobos … … 2078 2098 //Example: (contents of final.brf) 2079 2099 ///code 2080 // -nounittest2081 2100 // -release 2082 2101 // -full … … 2116 2135 ///li Support the concept of a 'Plugin' block of code. /n 2117 2136 ///code 2118 // version (build) pragma(plugin, <tool>[,delim=xxx],[, <parms>] ) { [body] } 2137 // version (build) pragma(plugin, <tool>[,delim=xxx],[, <parms>] ) { [body] } 2119 2138 ///endcode 2120 2139 //This block would be replaced by the stdout data of calling 'tool <params>' and 2121 2140 // sending it the content of <body> via stdin. 2122 2141 ///li Support for compiling C sources as well as D sources. eg. Calling GCC 2142 //before DMD. 2143 trunk/Source/build_bn.d
r18 r19 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 387;4 long auto_build_number = 443; trunk/Source/debug.brf
r15 r19 2 2 -info 3 3 -Tbuild_dbg 4 -w 5 -g 6 -unittest 4 7 8 trunk/Source/source.d
r16 r19 2 2 3 3 @file source.d 4 4 5 5 Copyright (c) 2005 Derek Parnell 6 6 7 7 This software is provided 'as-is', without any express or implied 8 8 warranty. In no event will the authors be held liable for damages 9 9 of any kind arising from the use of this software. 10 11 Permission is hereby granted to anyone to use this software for any 12 purpose, including commercial applications, and to alter it and/or 10 11 Permission is hereby granted to anyone to use this software for any 12 purpose, including commercial applications, and to alter it and/or 13 13 redistribute it freely, subject to the following restrictions: 14 15 1. The origin of this software must not be misrepresented; you must 16 not claim that you wrote the original software. If you use this 17 software in a product, an acknowledgment within documentation of 14 15 1. The origin of this software must not be misrepresented; you must 16 not claim that you wrote the original software. If you use this 17 software in a product, an acknowledgment within documentation of 18 18 said product would be appreciated but is not required. 19 19 20 2. Altered source versions must be plainly marked as such, and must 20 2. Altered source versions must be plainly marked as such, and must 21 21 not be misrepresented as being the original software. 22 22 … … 49 49 import util.fdt; 50 50 import util.pathex; 51 51 52 52 import std.stdio; 53 53 import std.path; 54 54 import std.ctype; 55 55 import std.file; 56 import std.string; 57 56 import std.string; 57 58 58 const { 59 59 version(Windows) { … … 62 62 char[] ObjExt=`obj`; 63 63 } 64 64 65 65 version(Posix) { 66 66 char[] ExeExt=``; … … 68 68 char[] ObjExt=`o`; 69 69 } 70 70 71 71 } 72 72 … … 74 74 bool mainFound; 75 75 bool mainGUI; 76 76 77 77 } 78 78 79 79 public { 80 80 81 81 char[] function(char[] pPath) AddRoot; 82 82 void function(char[] pPath) AddLink; … … 86 86 bool function(char[] pID) IsActiveVersion; 87 87 char[] function(char[] pFile) GetFullPathname; 88 88 89 89 bool mVerboseMode = false; 90 90 91 91 } 92 92 debug(1) … … 94 94 private import std.stdio; 95 95 } 96 96 97 97 static this() 98 98 { … … 110 110 public class Source { 111 111 private static Source[char[]] SourceIndex; 112 112 113 113 private { 114 char[] mFileName; 114 char[] mFileName; 115 115 char[] mModuleName; 116 116 char[] mObjectName; … … 123 123 char[][] mReferencedImports; 124 124 } 125 125 126 126 public { 127 // FileName 127 // FileName 128 128 char[] FileName () { return mFileName.dup; } 129 129 130 130 // DependantsTime 131 131 FileDateTime DependantsTime() { return mDependantsTime; } 132 132 133 133 // ObjectsTime 134 134 FileDateTime ObjectsTime() { return mObjectTime; } 135 135 136 136 // FilesTime 137 137 FileDateTime FilesTime() { return mFileTime; } 138 138 139 139 // ModuleName 140 140 char[] ModuleName() { return mModuleName.dup; } 141 141 void ModuleName(char[] pValue) { mModuleName = pValue.dup; } 142 142 143 143 // ObjectName 144 144 char[] ObjectName() { return mObjectName.dup; } 145 145 void ObjectName(char[] pValue) { mObjectName = pValue.dup; } 146 146 147 147 // NoLink 148 148 bool NoLink() { return mNoLink; } 149 149 150 150 // BuildNumber 151 151 int BuildNumber() { return mBuildNumber; } 152 152 153 153 this(char[] pFileName) { 154 154 mReferencedImports.length = 0; … … 158 158 mModuleName = FileToModulename(pFileName); 159 159 mObjectName = addExt(pFileName,ObjExt); 160 mBuildNumber = -1; 161 160 mBuildNumber = -1; 161 162 162 mFileTime = GetFileTime(pFileName); 163 163 mDependantsTime = mFileTime; 164 164 165 165 mObjectTime = GetFileTime(mObjectName); 166 166 UpdateDependantTime(mObjectTime); 167 167 168 168 if(mVerboseMode) { 169 169 writefln("Time %s for %s",mFileTime.toString(),mFileName); 170 170 writefln("Time %s for %s",mObjectTime.toString(),mObjectName); 171 171 } 172 172 173 173 // Store this instantiation in the list of known files. 174 174 SourceIndex[pFileName] = this; 175 175 176 176 // Add this pFileName's directory as a potential import root. 177 177 if (AddRoot != null) 178 178 AddRoot(std.path.getDirName(pFileName)); 179 179 180 180 search(); 181 181 } … … 186 186 bool lCanUse; 187 187 int lTextPos = 0; 188 188 189 189 if(mHasBeenSearched) { 190 190 return; 191 191 } 192 192 else { 193 193 if(mVerboseMode) { 194 194 writefln("Scanning %s", mFileName); … … 196 196 // Extract all the module references. 197 197 ProcessTokens(GetFileText(mFileName), lTextPos); 198 198 199 199 lCurFileTime = new FileDateTime(); 200 200 // Examine each extracted module file. … … 209 209 foreach(char[] lNextModule; ModulesToIgnore() ){ 210 210 int lFindPos; 211 char[] lType = "package"; 211 212 version(Windows) { 212 lFindPos = std.string.find(std.string.tolower(lNextFile), 213 std.string.tolower(std.path.sep ~ lNextModule ~ std.path.sep)); 213 char[] lLowerFile; 214 char[] lLowerMod; 215 lLowerFile = std.string.tolower(lNextFile); 216 lLowerMod = std.string.tolower(lNextModule); 214 217 /* Only when ifind() is fixed! 215 218 lFindPos = std.string.ifind(lNextFile, std.path.sep ~ lNextModule ~ std.path.sep); 216 219 */ 220 221 // Check for package name 222 lFindPos = std.string.find(lLowerFile, 223 std.path.sep ~ lLowerMod ~ std.path.sep); 224 // Check for module in subdirectory 225 if (lFindPos == -1) { 226 lType = "module"; 227 lFindPos = std.string.find(lLowerFile, 228 std.path.sep ~ lLowerMod ~ ".d"); 229 } 230 // Check for module in current directory 231 if (lFindPos == -1) 232 { 233 lType = "module"; 234 if (lLowerFile == lLowerMod ~ ".d") 235 lFindPos = 0; 236 } 217 237 } 218 238 version(Posix) { 219 lFindPos = std.string.find(lNextFile, std.path.sep ~ lNextModule ~ std.path.sep ); 239 // Check for package name 240 lFindPos = std.string.find(lNextFile, 241 std.path.sep ~ lNextModule ~ std.path.sep); 242 // Check for module in subdirectory 243 if (lFindPos == -1) { 244 lType = "module"; 245 lFindPos = std.string.find(lNextFile, 246 std.path.sep ~ lNextModule ~ ".d"); 247 } 248 // Check for module in current directory 249 if (lFindPos == -1) { 250 lType = "module"; 251 if (lNextFile == lNextModule ~ ".d") 252 lFindPos = 0; 253 } 220 254 } 221 255 222 256 if( lFindPos >= 0) { 223 257 if (mVerboseMode) 224 writefln("Ignoring %s ( module: %s)", lNextFile, lNextModule);225 258 writefln("Ignoring %s (%s: %s)", lNextFile, lType, lNextModule); 259 226 260 lCanUse = false; 227 261 break; … … 233 267 lCurFileTime = (new Source(lNextFile)).DependantsTime; 234 268 } 235 236 } 237 269 270 } 271 238 272 // Ensure we get the most recent mod time. 239 273 UpdateDependantTime (lCurFileTime); 240 274 } 241 275 242 276 mHasBeenSearched = true; 243 } 244 277 } 278 } 279 245 280 void UpdateDependantTime(FileDateTime pDateTime) 246 281 { … … 250 285 { 251 286 writefln("Updating %s dependants time from %s to %s", 252 mFileName, 287 mFileName, 253 288 mDependantsTime.toString(), 254 289 pDateTime.toString() … … 258 293 } 259 294 } 260 295 261 296 static bool WasMainFound() { return mainFound; } 262 297 static void WasMainFound(bool pValue) { mainFound = pValue; } 263 298 264 299 static bool WasMainGUI() { return mainGUI; } 265 300 static void WasMainGUI(bool pValue) { mainGUI = pValue; } 266 301 267 302 bool IncrementBuildNumber() 268 303 { 269 304 char[] lFileName; 270 305 Source lBNSource; 271 306 272 307 if (mBuildNumber < 0) 273 308 return false; 274 309 else { 275 310 lFileName = ModuleToFilename(mModuleName ~ "_bn"); 276 311 if (std.file.exists(lFileName)) … … 278 313 std.file.remove(lFileName); 279 314 } 280 315 281 316 mBuildNumber++; 282 317 283 std.file.write(lFileName, 318 std.file.write(lFileName, 284 319 std.string.format( 285 "module %s;\n" 320 "module %s;\n" 286 321 "// This file is automatically maintained by the BUILD utility,\n" 287 322 "// Please refrain from manually editing it.\n" 288 "long auto_build_number = %d;\n", 323 "long auto_build_number = %d;\n", 289 324 FileToModulename(lFileName), 290 325 mBuildNumber) 291 326 ); 292 327 293 if (! (lFileName in SourceIndex) ) 328 if (! (lFileName in SourceIndex) ) 294 329 { 295 330 lBNSource = new Source(lFileName); … … 303 338 lBNSource.mObjectTime = new FileDateTime(); 304 339 return true; 340 } 305 341 } 306 342 307 343 } // End public 308 344 309 345 //---------------------------------------------------------- 310 346 private { 311 347 void ProcessTokens (char[] pFileText, inout int pPos, char[] pEndStmt = "}") 312 348 { 313 /* This scans the source text for specific tokens until the 'pEndStmt' 349 /* This scans the source text for specific tokens until the 'pEndStmt' 314 350 token is found, or end of text. 315 351 */ … … 317 353 char[] lPrevToken; 318 354 int lLastPos; 319 355 320 356 lCurToken = ""; 321 357 lLastPos = pFileText.length-1; 322 358 323 359 lblNextToken: 324 360 while ((lPrevToken = lCurToken.dup, lCurToken = GetNextToken (pFileText, pPos)) !== null) { 325 361 326 362 switch(lCurToken) { 327 363 case "{": 328 364 ProcessTokens (pFileText, pPos); 329 365 break; 330 366 331 367 case "\\": 332 368 // Ignore escaped tokens. … … 334 370 pPos++; 335 371 break; 336 372 337 373 case "\"": 338 374 // ** drop through ** … … 346 382 pPos++; 347 383 break; 348 384 349 385 case "`": // Skip over a raw string 350 386 while ( (pPos <= lLastPos) && (pFileText[pPos] != '`')) … … 352 388 pPos++; 353 389 break; 354 355 case "r": 356 if ( (pPos <= lLastPos) && (pFileText[pPos] == '\"') ) 390 391 case "r": 392 if ( (pPos <= lLastPos) && (pFileText[pPos] == '\"') ) 357 393 { // Skip over a raw string 358 394 pPos++; … … 362 398 } 363 399 break; 364 400 365 401 case "main", "WinMain": 366 if ( (lPrevToken != "class") && 367 (lPrevToken != "template") 402 if ( (lPrevToken != "class") && 403 (lPrevToken != "template") 368 404 ) { 369 405 doMain(pFileText, pPos, lCurToken); 370 406 } 371 407 break; 372 408 373 409 case "version": 374 410 doVersion(pFileText, pPos); 375 411 break; 376 412 377 413 case "import": 378 414 doImport(pFileText, pPos); 379 415 break; 380 416 381 417 case "module": 382 418 doModule(pFileText, pPos); 383 419 break; 384 420 385 421 case "pragma": 386 422 doPragma(pFileText, pPos); 387 break; 388 423 break; 424 389 425 default: 390 426 if (lCurToken in AttributeBlocks) { 391 427 doAttribute(pFileText, pPos, lCurToken); 392 428 393 429 } else if (lCurToken == pEndStmt) { 394 430 break lblNextToken; 395 431 } 396 } // end switch 432 } // end switch 397 433 } // end while 398 434 } … … 403 439 int lSavedPos; 404 440 char[] lToken; 405 441 406 442 lSavedPos = pPos; 407 443 lToken = GetNextToken(pFileText,pPos); … … 410 446 version(Windows) { 411 447 if (pCurrentToken == "WinMain") { 412 mainGUI = true; 448 mainGUI = true; 413 449 } 414 450 } … … 416 452 pPos = lSavedPos; 417 453 } 418 454 419 455 } 420 456 … … 424 460 char[] lCurrentToken; 425 461 int lSavedPos; 426 462 427 463 lCurrentToken = GetNextToken (pFileText, pPos); 428 464 if (lCurrentToken == "=") { … … 432 468 return; 433 469 } 434 470 else { 435 471 if (lCurrentToken != "("){ 436 472 return; // Not likely as this is bad syntax. 437 473 } 438 474 else { 439 475 // Pick out the version identifier and skip over the closing parenthesis. 440 476 lCurrentToken = GetNextToken (pFileText, pPos); 441 477 GetNextToken (pFileText, pPos); 442 478 443 479 if ( IsActiveVersion(lCurrentToken) ) { 444 480 // thus the following tokens must be processed. 445 481 446 482 lSavedPos = pPos; // Remember where we are. 447 lCurrentToken = GetNextToken (pFileText, pPos); 448 if (lCurrentToken == "{") { 483 lCurrentToken = GetNextToken (pFileText, pPos); 484 if (lCurrentToken == "{") 485 { 449 486 // process the stuff in the block 450 487 ProcessTokens (pFileText, pPos); 451 488 452 489 /* If the next token is an 'else', I must skip over the statement 453 490 or block that follows the 'else'. Otherwise this marks the … … 467 504 } 468 505 } else { 469 // It wasn't an 'else' so be back up and let the calling 506 // It wasn't an 'else' so be back up and let the calling 470 507 // routine handle it. 471 508 pPos = lSavedPos; … … 478 515 return; 479 516 } 480 517 else { 481 518 /* Not an active version so therefore the following statement/block 482 519 must not be processed. 483 520 */ 484 521 lCurrentToken = GetNextToken(pFileText, pPos); 485 522 486 523 if ( lCurrentToken != "{") { 487 524 skipContent(pFileText, pPos, ";"); 488 525 return; 489 526 } 490 527 else { 491 528 skipContent(pFileText, pPos); 492 529 493 530 lSavedPos = pPos; 494 531 lCurrentToken = GetNextToken(pFileText, pPos); … … 497 534 return; 498 535 } 499 536 else { 500 537 lSavedPos = pPos; 501 538 lCurrentToken = GetNextToken(pFileText, pPos); … … 506 543 ProcessTokens(pFileText, pPos, ";"); 507 544 } 545 } 546 } 547 } 548 } 549 550 } 508 551 } 509 552 //---------------------------------------------------------- … … 512 555 char[] lCurrentToken; 513 556 char[] lModName; 514 557 515 558 // import lModName.lModName, lModName, lModName.lModName.lModName; 516 559 517 560 while ((lCurrentToken = GetNextToken (pFileText, pPos)) !== null && (lCurrentToken != ";")) { 518 561 if ( (lCurrentToken == ",") && (lModName.length > 0)) { … … 527 570 mReferencedImports ~= ModuleToFilename(lModName); 528 571 } 529 572 530 573 } 531 574 //---------------------------------------------------------- … … 534 577 char[] lCurrentToken; 535 578 char[] lModName; 536 537 // module lModName [.lModName]; 538 while ((lCurrentToken = GetNextToken (pFileText, pPos)) !== null && (lCurrentToken != ";")) 579 580 // module lModName [.lModName]; 581 while ((lCurrentToken = GetNextToken (pFileText, pPos)) !== null && (lCurrentToken != ";")) 539 582 { 540 583 lModName ~= lCurrentToken; 541 584 } 542 585 543 586 if (lModName.length > 0 ) 544 587 { 545 588 mModuleName = lModName; 546 if (mVerboseMode) 589 if (mVerboseMode) 547 590 { 548 591 writefln("Module name set to '%s'", mModuleName); 549 592 } 550 593 } 551 594 552 595 } 553 596 … … 561 604 char[] lCurrentToken; 562 605 char[] lPragmaId; 563 606 564 607 lPragmaId.length = 0; 565 608 if (GetNextToken(pFileText, pPos) == "(" ){ … … 569 612 while ( (lCurrentToken = GetNextToken(pFileText,pPos)) !== null) 570 613 { 571 if ((lCurrentToken != ",") && (lCurrentToken != ")")) { 614 if ((lCurrentToken != ",") && (lCurrentToken != ")")) { 572 615 lPragmaId ~= lCurrentToken; 573 616 } 574 617 else if (lPragmaId.length > 0) { 575 if ((lPragmaId.length <= ObjExt.length) || 618 if ((lPragmaId.length <= ObjExt.length) || 576 619 (lPragmaId[length-ObjExt.length-1..length] != ("."~ObjExt))) 577 620 { 578 621 version(Windows) { 579 if (std.string.tolower(getExt(lPragmaId)) == 622 if (std.string.tolower(getExt(lPragmaId)) == 580 623 std.string.tolower(LibExt)) { 581 624 lPragmaId.length = lPragmaId.length - LibExt.length - 1; … … 598 641 } 599 642 } else if (lCurrentToken == "build_def"){ 600 // Collect records for the optlink module definition file. 643 // Collect records for the optlink module definition file. 601 644 lPragmaId = ""; 602 645 while ( (lCurrentToken = GetNextToken(pFileText,pPos)) !== null) … … 604 647 if (lCurrentToken == "\"") 605 648 lCurrentToken = GetStringLit(pFileText, pPos); 606 607 if ((lCurrentToken != ",") && (lCurrentToken != ")")) { 649 650 if ((lCurrentToken != ",") && (lCurrentToken != ")")) { 608 651 if (AddBuildDef != null) 609 652 AddBuildDef(lCurrentToken); … … 611 654 if (lCurrentToken == ")"){ 612 655 break;} 613 } 614 656 } 657 615 658 } else if (lCurrentToken == "nolink"){ 616 // This source file is NOT to be linked 659 // This source file is NOT to be linked 617 660 mNoLink = true; 618 661 619 662 // Skip over the trailing parenthesis. 620 GetNextToken(pFileText,pPos); 621 } 622 } 623 } 624 663 GetNextToken(pFileText,pPos); 664 } 665 } 666 } 667 625 668 //---------------------------------------------------------- 626 669 void doAttribute (in char[] pFileText, inout int pPos, char[] pAttrType) … … 629 672 char[] lNextToken; 630 673 int lSavedPos; 631 674 632 675 // Handle private/public/etc... blocks. 633 676 lSavedPos = pPos; 634 677 lCurrentToken = GetNextToken(pFileText,pPos); 635 678 636 679 if (lCurrentToken == "{") // read a block statement 637 680 { 638 681 ProcessTokens (pFileText, pPos); 639 682 640 683 } else { 641 684 // Check for special auto build number import. … … 647 690 lCurrentToken ~= lNextToken; 648 691 } 649 692 650 693 if (lCurrentToken == mModuleName ~ "_bn") 651 694 { … … 657 700 pPos = lSavedPos; 658 701 } 659 660 } 661 702 703 } 704 662 705 //---------------------------------------------------------- 663 706 /* Get the next token, skipping over comments. */ … … 665 708 { 666 709 int lLastPos; 667 710 668 711 lLastPos = pFileText.length - 1; 669 while (pPos <= lLastPos) 712 while (pPos <= lLastPos) 670 713 { 671 714 // Check for comments ... … … 680 723 break; 681 724 } 682 pPos++; 725 else 726 pPos++; 683 727 } 684 728 } else … … 689 733 pPos++; 690 734 } 691 735 692 736 } else 693 737 // Check for multiline nested comments 694 738 if (pFileText [pPos+1] == '+') { 695 739 int lDepth = 1; 696 740 697 741 pPos += 2; 698 742 while (pPos < lLastPos) { … … 718 762 } 719 763 } 720 764 721 765 if (pPos >= lLastPos) { throw new Exception("Mismatched nested comments in " ~ mFileName); } 722 766 } 723 } // else 767 } // else 724 768 // Check for 'words' 725 769 if (isalpha (pFileText [pPos])) { … … 730 774 } 731 775 return pFileText[lStart .. pPos]; 732 776 733 777 } else 734 778 // Check for whitespace 735 779 if (isspace (pFileText [pPos])) { 736 780 pPos++; 737 738 } else 781 782 } else 739 783 { 740 784 // Return whatever character we have discovered. … … 743 787 } 744 788 } 745 789 746 790 return null; 747 791 } 748 792 749 793 //---------------------------------------------------------- 750 794 void skipContent (in char[] pFileText, inout int pPos, char[] pEndStmt = "}") 751 795 { 752 // Skips thru nested blocks. 753 754 /* The initial token is assumed to be 796 // Skips thru nested blocks. 797 798 /* The initial token is assumed to be 755 799 the first token inside a '{' '}' pair. 756 800 */ 757 801 char[] lCurrentToken; 758 802 759 803 while ((lCurrentToken = GetNextToken (pFileText, pPos)) !== null) 760 804 { … … 763 807 return; 764 808 } 765 766 if (lCurrentToken == "{") 809 else if (lCurrentToken == "{") 767 810 skipContent (pFileText, pPos); 768 } 769 } 770 811 812 } 813 } 814 771 815 //---------------------------------------------------------- 772 816 char[] GetStringLit (in char[] pFileText, inout int pPos, char pEndStmt = '"') … … 774 818 int lStartLit; 775 819 int lEndLit; 776 820 777 821 lStartLit = pPos; 778 822 779 823 while( (pPos < pFileText.length) && (pFileText[pPos] != pEndStmt) ) 780 824 { … … 784 828 if (pPos < pFileText.length) 785 829 pPos++; // Skip over lit end char. 786 830 787 831 return pFileText[lStartLit .. lEndLit]; 788 789 } 790 832 833 } 834 791 835 792 836 } // end private 793 837 794 838 } // end class 795 839 796 840 char[] ModuleToFilename(char[] pModuleName) 797 841 { 798 842 char[] lFileName; 799 843 800 844 // Replace dots with the opsys path separator 801 845 lFileName = util.str.ReplaceChar(pModuleName.dup, '.', std.path.sep[0]); 802 846 // Add the 'd' extention and append the full path 803 847 lFileName = GetFullPathname( addExt( lFileName, "d" ) ); 804 848 805 849 if(mVerboseMode) { 806 850 writefln(" module->file %s => %s",pModuleName,lFileName); … … 814 858 char[] lTemp; 815 859 816 // Copy the name 860 // Copy the name 817 861 lModuleName = pFileName.dup; 818 862 819 863 // Remove DOS/Windows drive spec. 820 864 version(Windows) { … … 830 874 } 831 875 } 832 876 833 877 if (lModuleName[1] == ':') 834 878 { … … 836 880 lModuleName = lTemp.dup; 837 881 } 838 882 839 883 if (lModuleName[0] == std.path.sep[0]) 840 884 { … … 842 886 lModuleName = lTemp.dup; 843 887 } 844 888 845 889 // Remove file extension. 846 890 if (lModuleName[length-2 .. length] == ".d") … … 848 892 lModuleName.length = lModuleName.length - 2; 849 893 } 850 894 851 895 // Replace opsys path separators with dots. 852 896 lModuleName = util.str.ReplaceChar(lModuleName, std.path.sep[0], '.'); 853 897 854 898 if(mVerboseMode) { 855 899 writefln(" file->module %s => %s",pFileName,lModuleName); … … 862 906 { 863 907 char[] lFileText; 864 908 865 909 if (! std.file.exists( pFileName)) 866 910 { 867 911 return ""; 868 912 } 869 913 else { 870 914 lFileText = cast(char[]) std.file.read(pFileName); 871 915 if ( (lFileText.length == 0) || 872 916 (lFileText[length-1] != '\n')) 873 917 lFileText ~= '\n'; 874 918 875 919 return lFileText; 876 920 } 921 877 922 } 878 923 … … 882 927 char[][] lLines; 883 928 char[] lText; 884 885 if (! std.file.exists(pFileName)) 929 930 if (! std.file.exists(pFileName)) 886 931 { 887 932 throw new Exception( std.string.format("File '%s' not found.", pFileName)); 888 933 } 889 890 lText = GetFileText(pFileName); 891 lLines = split( lText,"\n"); 892 return lLines; 934 else { 935 lText = GetFileText(pFileName); 936 lLines = split( lText,"\n"); 937 return lLines; 938 } 893 939 } 894 940 … … 899 945 char[] lFileName; 900 946 int lBuildNumber = 0; 901 947 902 948 lFileName = ModuleToFilename(pModuleName ~ "_bn"); 903 949 if (std.file.exists(lFileName)) … … 933 979 } 934 980 935 trunk/Source/source_bn.d
r18 r19 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 02;4 long auto_build_number = 258; trunk/Source/util/fdt.d
r17 r19 52 52 import std.c.windows.windows; 53 53 } 54 version(linux) {54 else version(linux) { 55 55 import std.c.linux.linux; 56 56 alias std.c.linux.linux posix; 57 57 } 58 version(darwin) {58 else version(darwin) { 59 59 import std.c.darwin.darwin; 60 60 alias std.c.darwin.darwin posix; 61 61 } 62 version(Unix) {62 else version(Unix) { 63 63 import std.c.unix; 64 64 alias std.c.unix posix; 65 65 } 66 66 67 version(Posix) { 67 68 import std.string; … … 99 100 SYSTEMTIME lATime; 100 101 SYSTEMTIME lBTime; 102 int lResult; 101 103 102 104 if (mSet == false) 103 return -1; 104 105 if (pOther.mSet == false) 106 return 1; 107 FileTimeToSystemTime(&mDT, &lATime); 108 FileTimeToSystemTime(&pOther.mDT, &lBTime); 109 110 if (lATime.wYear > lBTime.wYear) 111 return 2; 112 if (lATime.wYear < lBTime.wYear) 113 return -2; 114 if (lATime.wMonth > lBTime.wMonth) 115 return 3; 116 if (lATime.wMonth < lBTime.wMonth) 117 return -3; 118 if (lATime.wDay > lBTime.wDay) 119 return 4; 120 if (lATime.wDay < lBTime.wDay) 121 return -4; 122 if (lATime.wHour > lBTime.wHour) 123 return 5; 124 if (lATime.wHour < lBTime.wHour) 125 return -5; 126 if (lATime.wMinute > lBTime.wMinute) 127 return 6; 128 if (lATime.wMinute < lBTime.wMinute) 129 return -6; 130 if (lATime.wSecond > lBTime.wSecond) 131 return 7; 132 if (lATime.wSecond < lBTime.wSecond) 133 return -7; 134 135 if (pExact) 136 { 137 if (lATime.wMilliseconds > lBTime.wMilliseconds) 138 return 8; 139 if (lATime.wMilliseconds < lBTime.wMilliseconds) 140 return -8; 141 } 142 143 return 0; 105 lResult = -1; 106 107 else if (pOther.mSet == false) 108 lResult = 1; 109 110 else { 111 FileTimeToSystemTime(&mDT, &lATime); 112 FileTimeToSystemTime(&pOther.mDT, &lBTime); 113 114 if (lATime.wYear > lBTime.wYear) 115 lResult = 2; 116 else if (lATime.wYear < lBTime.wYear) 117 lResult = -2; 118 else if (lATime.wMonth > lBTime.wMonth) 119 lResult = 3; 120 else if (lATime.wMonth < lBTime.wMonth) 121 lResult = -3; 122 else if (lATime.wDay > lBTime.wDay) 123 lResult = 4; 124 else if (lATime.wDay < lBTime.wDay) 125 lResult = -4; 126 else if (lATime.wHour > lBTime.wHour) 127 lResult = 5; 128 else if (lATime.wHour < lBTime.wHour) 129 lResult = -5; 130 else if (lATime.wMinute > lBTime.wMinute) 131 lResult = 6; 132 else if (lATime.wMinute < lBTime.wMinute) 133 lResult = -6; 134 else if (lATime.wSecond > lBTime.wSecond) 135 lResult = 7; 136 else if (lATime.wSecond < lBTime.wSecond) 137 lResult = -7; 138 139 else if (pExact) 140 { 141 if (lATime.wMilliseconds > lBTime.wMilliseconds) 142 lResult = 8; 143 else if (lATime.wMilliseconds < lBTime.wMilliseconds) 144 lResult = -8; 145 else 146 lResult = 0; 147 } 148 } 149 return lResult; 144 150 } 145 151 … … 153 159 if ( mSet == false ) 154 160 return "not recorded"; 155 161 else { 156 162 // Convert the file's time into the user's local timezone. 157 163 FileTimeToSystemTime(&mDT, &lSystemTime); … … 175 181 176 182 } 183 } 177 184 178 185 } trunk/Source/util/fdt_bn.d
r18 r19 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 161;4 long auto_build_number = 217; trunk/Source/util/pathex.d
r9 r19 208 208 if (lNewPath.length == 0) 209 209 return false; 210 210 else { 211 211 // extract out the parent directory 212 212 for (int i = lNewPath.length-1; i >= 0; i--) … … 240 240 } 241 241 return lResult; 242 } 242 } 243 } trunk/Source/util/pathex_bn.d
r18 r19 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 180;4 long auto_build_number = 234; trunk/Source/util/str.d
r6 r19 110 110 if (pFrom == pTo) 111 111 return pText; 112 112 else { 113 113 foreach( uint i, inout ubyte lTestChar; pText){ 114 114 if(lTestChar == pFrom) { … … 122 122 return lTemp; 123 123 } 124 125 if (i == pText.length-1) 126 { 127 return pText; 124 else { 125 if (i == pText.length-1) 126 { 127 return pText; 128 } 129 else 130 continue; 128 131 } 129 132 130 133 } 134 } 135 assert(0); 131 136 } 132 137 … … 171 176 if (pFrom == pTo) 172 177 return pText; 173 178 179 else { 174 180 foreach( uint i, inout dchar lTestChar; pText){ 175 181 if(lTestChar == pFrom) { … … 188 194 // If I get here, no changes were done. 189 195 return pText; 196 } 190 197 } 191 198 … … 502 509 if (lPatternIndex == pPattern.length) 503 510 return true; 511 else { 504 512 if (pPattern[lPatternIndex] != kExactlyOne) 505 513 while( (lTextIndex < pText.length) && … … 509 517 ) 510 518 lTextIndex++; 519 } 511 520 } 512 521 else if ((lTextIndex < pText.length) && trunk/Source/util/str_bn.d
r18 r19 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 44;4 long auto_build_number = 198;
