Changeset 19

Show
Ignore:
Timestamp:
03/15/05 21:50:39 (7 years ago)
Author:
Derek Parnell
Message:

Upload on version 1.13 (Build #443)

See Docs/CHANGE_LOG.htm for details
deleted downloads/build_1.10.zip
deleted downloads/build_1.11.zip
deleted 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.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
modified trunk/Docs/AUTO_BUILD_NUMBER.htm
modified trunk/Docs/CHANGE_LOG.htm
modified trunk/Docs/COMMAND_LINE.htm
modified trunk/Docs/index.htm
modified trunk/Docs/PRAGMA.htm
modified trunk/Docs/RESPONSE_FILE.htm
modified trunk/Docs/SWITCHES.htm
modified trunk/Docs/TO_DO.htm
modified trunk/Source/build.d
modified trunk/Source/build_bn.d
modified trunk/Source/debug.brf
modified trunk/Source/source.d
modified trunk/Source/source_bn.d
modified trunk/Source/util/fdt.d
modified trunk/Source/util/fdt_bn.d
modified trunk/Source/util/pathex.d
modified trunk/Source/util/pathex_bn.d
modified trunk/Source/util/str.d
modified trunk/Source/util/str_bn.d
added downloads/build_1.13.zip
added downloads/build_win_1.13.exe

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Docs/AUTO_BUILD_NUMBER.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
  • trunk/Docs/CHANGE_LOG.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1313</h3><br> 
    1414<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 
     18now added to the dmd command line. 
     19 <li> ** <strong>FIX</strong>: Explictly excluded modules (via -X) were only checking package 
     20names. They also check for module names now. 
     21 <li> ** <strong>FIX</strong>: Imported files are now looked for relative to the current directory 
     22before the import paths are checked. 
     23 <li> ** <strong>FIX</strong>: The utility now checks the DFLAG environment symbol in 
     24non-DigitalMars D compilers. 
     25 <li> ** <strong>CHG</strong>: The switch -nounittest is now deprecated and ignored if used. 
     26The default setting is no longer to compile with unittests turned on. 
     27 </ul>  
    1528 <strong> -- v1.12 -- 6/Mar/2005 </strong> 
    1629<ul> 
     
    5366 <li> ** <strong>FIX</strong>: <em>Thanks to Anders F Bjoerklund:</em> Changed version(GDC) to version(GNU) 
    5467 <li> ** <strong>FIX</strong>: Changed compiler name for GNU versions from 'dmd' to 'gdc' 
    55  <li> ** <strong>FIX</strong>: <em>Thanks to Carlos.</em> Build was 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. 
    5669 <li> ** <strong>ENH</strong>: <em>Thanks to Anders F Bjoerklund:</em> Provided a Makefile for the initial 
    5770compile of the application. 
     
    6679 <strong> -- v1.6 -- 28/Feb/2005 </strong> 
    6780<ul> 
    68  <li> ** <strong>FIX</strong>: <em>Thanks to Kris.</em> Build was not including the DCPATH value 
     81 <li> ** <strong>FIX</strong>: <em>Thanks to Kris.</em> The utility was not including the DCPATH value 
    6982when invoking the compiler. 
    7083 <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. 
    7285 <li> ** <strong>ENH</strong>: The command line switch <strong>-gui</strong> can now have an optional 
    7386version 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 #. 
     87The default Windows Version used is the one for the version running 
     88this utility. 
     89 <li> ** <strong>ENH</strong>: New command line switch -info to display the utility's version #. 
    7690 </ul>  
    7791 <strong> -- v1.5 -- 25/Feb/2005 </strong> 
     
    8195 <li> ** <strong>FIX</strong>: <em>Thanks to kris.</em> Hardcoded default for DMD path was 
    8296misleading when dmd.exe was not in the Windows PATH. 
    83  <li> ** <strong>FIX</strong>: Build was not correctly parsing empty raw strings ``. 
     97 <li> ** <strong>FIX</strong>: The utility was not correctly parsing empty raw strings ``. 
    8498 <li> ** <strong>ENH</strong>: <em>Thanks to kris.</em> If the -DCPATH switch is used, then 
    8599if the existing DCPATH and CFPATH are the same, this switch changes both. 
     
    104118<ul> 
    105119 <li> ** <strong>ENH</strong>: Put in a workaround for DMD (Windows) not using the sc.ini 
    106 file correctly. Build now explicitly adds any DFLAG options from 
     120file correctly. The utility now explicitly adds any DFLAG options from 
    107121the sc.ini file into the .rsp file. 
    108  <li> ** <strong>FIX</strong>: Build now correctly handles ';' delimited DFLAG options 
     122 <li> ** <strong>FIX</strong>: The utility now correctly handles ';' delimited DFLAG options 
    109123in the sc.ini file. 
    110124 <li> ** <strong>ENH</strong>: Now supports the use of 'response' files on the command line 
  • trunk/Docs/COMMAND_LINE.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    5656                library. 
    5757                (Normally only those in the same directory are added.) 
    58      <strong>-nounittest</strong> Ensures that the compiler does not include any 
    59                 unit tests in the executable.); 
    6058     <strong>-cleanup</strong>   Ensures that all object files created during the run 
    6159                are removed at the end of the run, plus other work files. 
     
    6866                (Only needed if WinMain is not found in the source files 
    6967                or if you wish to override the default Windows version) 
    70      <strong>-X&lt;module&gt;</strong> Modules to ignore (eg. -Xmylib) 
    71      <strong>-M&lt;module&gt;</strong> Modules to notice (eg. -Mphobos) 
     68     <strong>-X&lt;module&gt;</strong> Packages and Modules to ignore (eg. -Xmylib) 
     69     <strong>-M&lt;module&gt;</strong> Packages and Modules to notice (eg. -Mphobos) 
    7270     <strong>-T&lt;targetname&gt;</strong> The name of the target file to create. Normally 
    7371                the target name istaken from the first or only name 
  • trunk/Docs/PRAGMA.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
  • trunk/Docs/RESPONSE_FILE.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    2727Example: (contents of final.brf) 
    2828<pre> 
    29     -nounittest 
    3029    -release 
    3130    -full 
  • trunk/Docs/SWITCHES.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    2323<li><a href="#_LIB"><i>switch</i> -lib</a> &nbsp;&nbsp;Forces the object files to be placed in a library. 
    2424<li><a href="#_LINK"><i>switch</i> -link</a> &nbsp;&nbsp;Forces the linker to be called instead of the librarian. 
    25 <li><a href="#_M"><i>switch</i> -M</a> &nbsp;&nbsp;Identifies a module to notice (not ignore) 
     25<li><a href="#_M"><i>switch</i> -M</a> &nbsp;&nbsp;Identifies a module or a package to notice (not ignore) 
    2626<li><a href="#_NOLIB"><i>switch</i> -nolib</a> &nbsp;&nbsp;Ensures that the object files are not used to form a library. 
    2727<li><a href="#_NOLINK"><i>switch</i> -nolink</a> &nbsp;&nbsp; Ensures that the linker is not called. 
    28 <li><a href="#_NOUNITTEST"><i>switch</i> -nounittest</a> &nbsp;&nbsp;Ensures that the compiler does not include any unit tests in the executable. 
    2928<li><a href="#_R"><i>switch</i> -R</a> &nbsp;&nbsp;Determines if the compiler tools use a response file or not. 
    3029<li><a href="#_T"><i>switch</i> -T</a> &nbsp;&nbsp;Identifies the target name to build. 
    3130<li><a href="#_TEST"><i>switch</i> -test</a> &nbsp;&nbsp;Does a test run only. No compiling, linking or library work is done. 
     31<li><a href="#_V"><i>switch</i> -V</a> &nbsp;&nbsp; Set <em>verbose</em> mode on for just <em>build</em> and not for the compiler 
    3232<li><a href="#_V"><i>switch</i> -v</a> &nbsp;&nbsp; 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> &nbsp;&nbsp; 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> &nbsp;&nbsp;Identifies a module to ignore 
     33<li><a href="#_X"><i>switch</i> -X</a> &nbsp;&nbsp;Identifies a module or package to ignore 
    3534<hr> 
    3635<h4><br> 
     
    5554<a href="#_NOLIB">-nolib</a>, 
    5655<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>, 
    6361<a href="#_X">-X</a> 
    6462<hr> 
     
    8987<a href="#_NOLIB">-nolib</a>, 
    9088<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>, 
    9794<a href="#_X">-X</a> 
    9895<hr> 
     
    118115<a href="#_NOLIB">-nolib</a>, 
    119116<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>, 
    126122<a href="#_X">-X</a> 
    127123<hr> 
     
    158154<a href="#_NOLIB">-nolib</a>, 
    159155<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>, 
    166161<a href="#_X">-X</a> 
    167162<hr> 
     
    188183<a href="#_NOLIB">-nolib</a>, 
    189184<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>, 
    196190<a href="#_X">-X</a> 
    197191<hr> 
     
    225219<a href="#_NOLIB">-nolib</a>, 
    226220<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>, 
    233226<a href="#_X">-X</a> 
    234227<hr> 
     
    250243<a href="#_NOLIB">-nolib</a>, 
    251244<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>, 
    258250<a href="#_X">-X</a> 
    259251<hr> 
     
    282274<a href="#_NOLIB">-nolib</a>, 
    283275<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>, 
    290281<a href="#_X">-X</a> 
    291282<hr> 
     
    314305<a href="#_NOLIB">-nolib</a>, 
    315306<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>, 
    322312<a href="#_X">-X</a> 
    323313<hr> 
     
    325315<a href="index.htm#makedocTOC">Table of Contents</a></h4> 
    326316<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> 
    328318Category: <a href="#SWITCHES">Switches</a><br> 
    329319<p><p>You would use this to name any module that is not part of the target's 
     
    332322 You can use this switch to recompile <em>phobos</em>. 
    333323<p> 
    334 Example (notice the Phobos modules): 
     324Example (notice the Phobos package): 
    335325<pre> 
    336326  -Mphobos 
     
    348338<a href="#_NOLIB">-nolib</a>, 
    349339<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>, 
    356345<a href="#_X">-X</a> 
    357346<hr> 
     
    379368<a href="#_M">-M</a>, 
    380369<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>, 
    387375<a href="#_X">-X</a> 
    388376<hr> 
     
    412400<a href="#_M">-M</a>, 
    413401<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>, 
    451407<a href="#_X">-X</a> 
    452408<hr> 
     
    506462<a href="#_NOLIB">-nolib</a>, 
    507463<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>, 
    513468<a href="#_X">-X</a> 
    514469<hr> 
     
    539494<a href="#_NOLIB">-nolib</a>, 
    540495<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>, 
    546500<a href="#_X">-X</a> 
    547501<hr> 
     
    566520<a href="#_NOLIB">-nolib</a>, 
    567521<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> 
     532Category: <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>, 
    573550<a href="#_X">-X</a> 
    574551<hr> 
     
    591568<a href="#_NOLIB">-nolib</a>, 
    592569<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>, 
    623574<a href="#_X">-X</a> 
    624575<hr> 
     
    626577<a href="index.htm#makedocTOC">Table of Contents</a></h4> 
    627578<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> 
    629580Category: <a href="#SWITCHES">Switches</a><br> 
    630581<p><p> Normally, <em>build</em> assumes that all imported modules are available 
     
    632583 did not want <em>build</em> to recompile a module. 
    633584<p> 
    634  <strong>Note:</strong> The <em>Phobos</em> set of modules is automatically ignored. This 
     585 <strong>Note:</strong> The <em>Phobos</em> package of modules is automatically ignored. This 
    635586 means that <em>build</em> does not try to recompile phobos. 
    636587<p> 
    637 Example (ignore the 'parser' module) 
     588Example - ignore the 'parser' module (or package) 
    638589<pre> 
    639590      -Xparser 
     
    652603<a href="#_NOLIB">-nolib</a>, 
    653604<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  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    3232This block would be replaced by the stdout data of calling 'tool <params>' and 
    3333sending it the content of <body> via stdin. 
     34 <li> Support for compiling C sources as well as D sources. eg. Calling GCC 
     35before DMD. 
    3436 
    3537</p> 
  • trunk/Docs/index.htm

    r18 r19  
    22<head> 
    33<!-- 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 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    5151<a href="SWITCHES.htm#_LIB">-lib</a>  [<i><code>switch</code></i>] Forces the object files to be placed in a library.<br> 
    5252<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> 
    5454<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> 
    5555<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> 
    5756<a href="SWITCHES.htm#_R">-R</a>  [<i><code>switch</code></i>] Determines if the compiler tools use a response file or not.<br> 
    5857<a href="SWITCHES.htm#_T">-T</a>  [<i><code>switch</code></i>] Identifies the target name to build.<br> 
     
    6059<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> 
    6160<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> 
    6362<a href="AUTO_BUILD_NUMBER.htm#AUTO_BUILD_NUMBER">Auto Build Number</a> <br> 
    6463<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/************************************************************************** 
    22 
    33        @file build.d 
     
    3232 
    3333        @version        Initial version, January 2005 
    34         @author         Derek Parnell 
     34        @author         Derek Parnell, Melbourne, Australia. 
    3535 
    3636 
    3737**************************************************************************/ 
    3838 
    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. 
    4342 
    4443   This examines a set of D source code files to determine what 
     
    5554//A list of changes and fixes that have been made. 
    5655// 
     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> 
    5769// /b"-- v1.12 -- 6/Mar/2005" 
    5870//<ul> 
     
    8294// /b"-- v1.9 -- 3/Mar/2005" 
    8395//<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 
    8597//separators when parsing the configuration file lines. 
    8698///li ** /b FIX: /i"Thanks to Carlos." The default location for the configuration 
     
    95107///li ** /b FIX: /i"Thanks to Anders F Bjoerklund:" Changed version(GDC) to version(GNU) 
    96108///li ** /b FIX: Changed compiler name for GNU versions from 'dmd' to 'gdc' 
    97 ///li ** /b FIX: /i"Thanks to Carlos." Build was 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. 
    98110///li ** /b ENH: /i"Thanks to Anders F Bjoerklund:" Provided a Makefile for the initial 
    99111//compile of the application. 
     
    108120// /b"-- v1.6 -- 28/Feb/2005" 
    109121//<ul> 
    110 ///li ** /b FIX: /i"Thanks to Kris." Build was not including the DCPATH value 
     122///li ** /b FIX: /i"Thanks to Kris." The utility was not including the DCPATH value 
    111123//when invoking the compiler. 
    112124///li ** /b ENH: When building a Windows app, the .DEF file now includes the 
    113 //version of windows that /i Build is being run on. 
     125//version of windows that /i this application is being run on. 
    114126///li ** /b ENH: The command line switch /b"-gui" can now have an optional 
    115127// 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 #. 
    118131//</ul> 
    119132// /b"-- v1.5 -- 25/Feb/2005" 
     
    123136///li ** /b FIX: /i"Thanks to kris." Hardcoded default for DMD path was 
    124137//misleading when dmd.exe was not in the Windows PATH. 
    125 ///li ** /b FIX: Build was not correctly parsing empty raw strings ``. 
     138///li ** /b FIX: The utility was not correctly parsing empty raw strings ``. 
    126139///li ** /b ENH: /i"Thanks to kris." If the -DCPATH switch is used, then 
    127140//if the existing DCPATH and CFPATH are the same, this switch changes both. 
     
    146159//<ul> 
    147160///li ** /b ENH: Put in a workaround for DMD (Windows) not using the sc.ini 
    148 //file correctly. Build now explicitly adds any DFLAG options from 
     161//file correctly. The utility now explicitly adds any DFLAG options from 
    149162//the sc.ini file into the .rsp file. 
    150 ///li ** /b FIX: Build now correctly handles ';' delimited DFLAG options 
     163///li ** /b FIX: The utility now correctly handles ';' delimited DFLAG options 
    151164//in the sc.ini file. 
    152165///li ** /b ENH: Now supports the use of 'response' files on the command line 
     
    163176 
    164177 
    165 module build; 
    166178private import build_bn;    // This module's build number 
    167179 
     
    175187    version(Windows) { 
    176188        // OptLink Definition File 
    177         pragma (build_def, "VERSION 1.12"); 
     189        pragma (build_def, "VERSION 1.13"); 
    178190        pragma (build_def, "EXETYPE DOS"); 
    179191    } 
     
    196208    import std.stream; 
    197209    import std.string; 
     210     
    198211    version(Windows) { 
    199212        import std.c.windows.windows; 
    200213    } 
    201     version(linux) { 
     214    else version(linux) { 
    202215        import std.c.linux.linux; 
    203216    } 
    204     version(darwin) { 
     217    else version(darwin) { 
    205218        import std.c.darwin.darwin; 
    206219    } 
    207  
     220     
    208221    // --------- C externals ---------------- 
    209222    extern (C) 
     
    254267        char[]     vLibrarian = `lib`; 
    255268        char[]     vVersionSwitch = "-version="; 
    256         char[]     vUnitTestSwitch = "-unittest"; 
    257269        char[]     vKeepPathSwitch = "-op"; 
    258270        char[]     vOutFileSwitch = "-of"; 
     
    280292        char[]     vLibrarian = `lib`; 
    281293        char[]     vVersionSwitch = "-fversion="; 
    282         char[]     vUnitTestSwitch = "-funittest"; 
    283294        char[]     vOutFileSwitch = "-o "; 
    284295        char[]     vKeepPathSwitch = ""; 
     
    287298    } 
    288299 
    289     char[]       vUnitTest; 
    290300    bool         vTestRun = false; 
    291301    bool         vNoLink = false; 
     
    301311    char[][]     vDefaultCompArgs; 
    302312    bool[char[]] vActiveVersions; 
    303     int          vVersionLevel = 0; 
     313    long         vVersionLevel = 0; 
    304314    LibOpt       vLibraryAction = LibOpt.Implicit; 
    305315    char[]       vAppPath; 
    306316    char[]       vAppName; 
    307     char[]       vAppVersion = "1.12"; 
     317    char[]       vAppVersion = "1.13"; 
    308318    char[]       vTargetName;           // Output name. 
    309319    char[][]     vCmdLineFiles;         // List of source files from command line 
     
    312322    char[][]     vCompilerArgs;         // Arguments passed to compiler 
    313323    bool         vUseResponseFile; 
    314      
     324 
    315325 version(Windows) { 
    316326    char[]       vWinVer = ""; 
     
    327337{ 
    328338    vDefaultCompArgs ~= vKeepPathSwitch;     // Keep object files in same folder as source. 
    329     vUnitTest = vUnitTestSwitch; 
    330339    vModulesToIgnore ~= "phobos";  // Assume phobos will be ignored. 
    331      
     340 
    332341    version(Posix){ 
    333342        vDefaultCompArgs ~= vVersionSwitch ~ "Posix"; // Until such time as this is standard in dmd. 
    334343    } 
    335      
     344 
    336345    version(Windows) { 
    337346        vWinVerNum = cast(ubyte)(GetVersion() & 0xFF); 
    338347        vWinVer = std.string.format("%d.0", vWinVerNum); 
    339348     } 
    340       
     349 
    341350    version(DigitalMars) { 
    342351        version(Windows) { 
     
    364373    if (pFull == false) 
    365374        return; 
     375    else { 
    366376 
    367377    writefln( 
     
    395405    writefln("              library."); 
    396406    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.)"); 
    399407    writefln("  -cleanup   Ensures that all object files created during the run"); 
    400408    writefln("              are removed at the end of the run, plus other work files."); 
     
    408416 
    409417    writefln("  -test      Does everything as normal except it displays the commands"); 
    410     writefln("              instead of running them.");     
     418    writefln("              instead of running them."); 
    411419    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."); 
    413421    writefln("               -Ry will cause a response to be used."); 
    414422    writefln("               -Rn will cause command line arguments to be used."); 
    415423    writefln("               -R will reverse the current usage."); 
    416      
     424 
    417425  version(DigitalMars) { 
    418426   version(Windows) { 
    419427    writefln("               ** The default is to use a response file"); } 
    420    else {  
     428   else { 
    421429    writefln("               ** The default is to use command line arguments"); } 
    422430  } 
    423431  else { 
    424432    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)"); 
    428436    writefln("  -T~<targetname~> The name of the target file to create. Normally"); 
    429437    writefln("              the target name istaken from the first or only name"); 
     
    441449    writefln("   If the response file reference is just a single '@' then"); 
    442450    writefln("   build looks for a file called 'build.brf'"); 
    443  
     451
    444452} 
    445453 
     
    453461        writefln("Command: '%s'",pCommand); 
    454462        return 0; 
    455     }  
    456      
     463    } else { 
     464 
     465 
    457466    if(vVerbose) { 
    458467        writefln("Running '%s'",pCommand); 
     
    469478    } 
    470479    return lRC; 
     480} 
    471481} 
    472482 
     
    495505 
    496506        if(vVerbose) { 
    497             writefln("source file[%d] %s", i,  
     507            writefln("source file[%d] %s", i, 
    498508                    lFileName); 
    499509        } 
     
    507517                    ); 
    508518            } 
    509              
     519 
    510520            lModsTime = lSource.DependantsTime; 
    511521        } 
     
    605615 
    606616        } else if(lCurrentSource.DependantsTime > lCurrentSource.ObjectsTime) { 
    607             if (vVerbose)  
     617            if (vVerbose) 
    608618                    writefln("%s has newer dependants than its object file.", 
    609619                                lFileName); 
    610                                  
     620 
    611621            lNeedsCompiling=true; 
    612622        } 
     
    616626            lFilesToLink ~= ReplaceExtention(lFileName, "d"); 
    617627            lCompiling = true; 
    618             if (! vTestRun)  
     628            if (! vTestRun) 
    619629            { 
    620630                if (lCurrentSource.IncrementBuildNumber()) 
     
    624634                               lCurrentSource.BuildNumber, 
    625635                               lCurrentSource.ModuleName); 
    626      
     636 
    627637                } 
    628638            } 
     
    637647        vCompilerArgs ~= lArg; 
    638648    } 
    639     vCompilerArgs ~= vUnitTest; 
    640649 
    641650    char[] lResponseFileName; 
     
    648657        return 0; 
    649658    } 
    650  
     659    else { 
    651660    // Build command files for compilation. 
    652661    foreach (char[] arg; vCompilerArgs) 
     
    723732        if(lLinking) { 
    724733            // 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            } 
    726740 
    727741            // Include the default libraries. 
     
    738752            std.file.write(lResponseFileName,lOutText); 
    739753            command = vCompilerPath ~ vCompiler ~ " @" ~ lResponseFileName; 
    740         }  
    741         else  
     754        } 
     755        else 
    742756        {   // using commandline, may run into limits 
    743757            lOutText=std.string.replace(lOutText, "\n"," "); 
     
    784798            command = vLibrarian ~ " " ~ lOutText; 
    785799        } 
    786          
     800 
    787801        if (vVerbose) { 
    788802            writefln("Librarian with ..........\n%s\n", lOutText); 
     
    831845    return lRunResult; 
    832846} 
     847} 
    833848 
    834849 
     
    844859// ------------------------------------------- 
    845860{ 
    846     return ( (pID in vActiveVersions) != null )
     861    return (pID in vActiveVersions) !== null ? true : false
    847862} 
    848863 
     
    880895        return pRootName; 
    881896    } 
    882  
     897    else { 
    883898    lFullName = util.pathex.CanonicalPath(pRootName); 
    884899    version(Windows) lSearchName = std.string.tolower(lFullName); 
     
    889904        return lFullName; 
    890905    } 
    891  
    892     return ""; 
     906    else 
     907        return ""; 
     908
    893909} 
    894910 
     
    942958    char[]   lSwitch; 
    943959    char[]   lRootName; 
    944     char[][] lRoots;     
    945      
     960    char[][] lRoots; 
     961 
    946962    lPos = 0; 
    947963    while(lPos < pText.length) 
     
    978994            lPos = lEndPos+1; 
    979995        } 
    980          
     996 
    981997        if ((lSwitch.length > 0) && (lSwitch[0] == '-')) 
    982998        { 
     
    9871003                { 
    9881004                    lRootName = AddRoot(lRoot); 
    989                     vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 
     1005                    version(Posix) 
     1006                        vDefaultCompArgs ~= vImportPathSwitch ~ "\"" ~ lRoot ~ "\""; 
     1007                    else 
     1008                        vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 
    9901009                    if(vVerbose) { 
    9911010                        if (lRootName.length > 0){ 
     
    10021021 
    10031022// ------------------------------------------- 
     1023void 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// ------------------------------------------- 
    10041038void ReadConfigFile() { 
    10051039// ------------------------------------------- 
     
    10081042    int      lPos; 
    10091043 
    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          
    10191044    if (vConfigFile is null) 
    10201045    { 
    10211046        // There is no configuration file to process 
    1022       return;  
    1023     } 
    1024  
     1047      return; 
     1048    } 
     1049    else { 
    10251050    lPath = vConfigPath ~ vConfigFile ; 
    10261051    lTextLines = source.GetFileTextLines(lPath); 
     
    10751100    } 
    10761101} 
     1102} 
    10771103 
    10781104// Display each entry in the supplied list. 
     
    10961122{ 
    10971123    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    } 
    10981130 
    10991131    // Examine each known import root to see if the file lives there. 
     
    11031135            return lPossiblePath; 
    11041136        } 
    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; 
    11111137    } 
    11121138 
     
    12211247        } 
    12221248    } 
    1223      
     1249 
    12241250    args=args[1..args.length]; 
    12251251    if (args.length == 0) { 
     
    12281254        return 0; 
    12291255    } 
    1230  
     1256    else { 
    12311257    SetKnownVersions(); 
    12321258    foreach(char[] arg; args) { 
     
    12451271        throw new Exception("No target name supplied."); 
    12461272    } 
     1273    else { 
    12471274    util.pathex.MakePath(vTargetName); 
    12481275 
     
    12631290    } 
    12641291 
     1292    ReadEnviron(); 
    12651293    version(DigitalMars) ReadConfigFile(); 
    12661294 
     
    12801308    // Each file must already exist. If any does not exist, then 
    12811309    // the application will abort. 
     1310    bool lAllExist = true; 
     1311 
     1312    // List all missing files (if any). 
     1313    foreach( int i, char[] lFile; vCmdLineFiles) 
    12821314    { 
    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 ) ) 
    12871316        { 
    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) 
    12961328        { 
    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
    13241353} 
    13251354 
     
    14141443 
    14151444            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."); 
    14191447                break; 
    14201448 
     
    14691497 
    14701498                    } 
    1471                      
     1499 
    14721500                    if (util.str.IsLike(pArg,  cast(dchar[])"-CFPATH*")) 
    14731501                    { 
     
    14791507 
    14801508                    } 
    1481                      
     1509 
    14821510                    if (util.str.IsLike(pArg,  std.utf.toUTF32(vImportPathSwitch ~ "*"))) 
    14831511                    { 
    14841512                        char [] lRoot; 
    14851513                        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); 
    14891521                            } 
    14901522                        } 
    14911523                        break; 
    14921524                    } 
    1493                      
     1525 
    14941526                    if (util.str.IsLike(pArg,  cast(dchar[])"-X*")) 
    14951527                    { 
     
    14991531                        break; 
    15001532                    } 
    1501                      
     1533 
    15021534                    if (util.str.IsLike(pArg,  cast(dchar[])"-M*")) 
    15031535                    { 
     
    15071539                        break; 
    15081540                    } 
    1509                      
     1541 
    15101542                    if (util.str.IsLike(pArg,  cast(dchar[])"-T*")) 
    15111543                    { 
     
    15151547                        break; 
    15161548                    } 
    1517                      
     1549 
    15181550                    if (util.str.IsLike(pArg,  cast(dchar[])"-R*")) 
    15191551                    { 
    15201552                        // Response file usage (eg. -Ry) 
    15211553                        if (pArg.length == 2) 
    1522                             vUseResponseFile = !vUseResponseFile
    1523                              
     1554                            vUseResponseFile = (vUseResponseFile ? false : true)
     1555 
    15241556                        else if (pArg[2] == 'y') 
    15251557                            vUseResponseFile = true; 
    1526                              
     1558 
    15271559                        else 
    15281560                            vUseResponseFile = false; 
    1529                              
     1561 
    15301562                        vBuildArgs ~= pArg; 
    15311563                        break; 
    15321564                    } 
    1533                      
     1565 
    15341566                    version(Windows) { 
    15351567                    if (util.str.IsLike(pArg,  cast(dchar[])"-gui*")) 
     
    15461578                    } 
    15471579                    } 
    1548                      
     1580 
    15491581                    vCompilerArgs ~= pArg; 
    15501582 
     
    17981830//                library. 
    17991831//                (Normally only those in the same directory are added.) 
    1800 //    /b"-nounittest" Ensures that the compiler does not include any 
    1801 //                unit tests in the executable.); 
    18021832//    /b"-cleanup"   Ensures that all object files created during the run 
    18031833//                are removed at the end of the run, plus other work files. 
     
    18101840//                (Only needed if WinMain is not found in the source files 
    18111841//                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) 
    18141844//    /b"-T~<targetname~>" The name of the target file to create. Normally 
    18151845//                the target name istaken from the first or only name 
    18161846//                of the command line. 
    18171847//    /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. 
    18191849//                 /b"-Ry" will cause a response to be used. 
    18201850//                 /b"-Rn" will cause command line arguments to be used. 
     
    19361966 
    19371967///topic switches 
    1938 ///switch -nounittest 
    1939 ///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 is 
    1941 //usually not a problem as most compiles are done to create a non-production 
    1942 //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 the 
    1945 // application. You might also want to use the compiler's -release switch. 
    1946  
    1947 ///topic switches 
    19481968///switch -cleanup 
    19491969///desc Ensures that all working files created during the run are removed. 
     
    19681988//arguments are going to be more than the operating system can handle 
    19691989//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. 
    19711991// 
    19721992//A response file contains all the arguments that would have gone on the 
    19731993//command line. They are arranged as one argument per line. 
    19741994// 
    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 
    19761996// DigitalMars tools do understand it. 
    19771997// 
     
    19972017///switch -test 
    19982018///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 
    20002020//to see what would happen without actually building anything. 
    20012021 
     
    20102030// 
    20112031//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 
    20132033//-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. 
    20152035// 
    20162036//By default, /i build uses the version of Windows it is running under. 
     
    20222042///topic switches 
    20232043///switch -X 
    2024 ///desc Identifies a module to ignore 
     2044///desc Identifies a module or package to ignore 
    20252045//Normally, /i build assumes that all imported modules are available 
    20262046//to be recompiled if required. You would use this switch if you explictly 
    20272047// did not want /i build to recompile a module. 
    20282048// 
    2029 ///b"Note:" The /i Phobos set of modules is automatically ignored. This 
     2049///b"Note:" The /i Phobos package of modules is automatically ignored. This 
    20302050// means that /i build does not try to recompile phobos. 
    20312051// 
    2032 //Example (ignore the 'parser' module) 
     2052//Example - ignore the 'parser' module (or package) 
    20332053///code 
    20342054//      -Xparser 
     
    20372057///topic switches 
    20382058///switch -M 
    2039 ///desc Identifies a module to notice (not ignore) 
     2059///desc Identifies a module or a package to notice (not ignore) 
    20402060//You would use this to name any module that is not part of the target's 
    20412061//dependancies, or is one of the /i ignored modules. 
     
    20432063//You can use this switch to recompile /i phobos. 
    20442064// 
    2045 //Example (notice the Phobos modules): 
     2065//Example (notice the Phobos package): 
    20462066///code 
    20472067//  -Mphobos 
     
    20782098//Example: (contents of final.brf) 
    20792099///code 
    2080 //    -nounittest 
    20812100//    -release 
    20822101//    -full 
     
    21162135///li Support the concept of a 'Plugin' block of code. /n 
    21172136///code 
    2118 // version (build) pragma(plugin, <tool>[,delim=xxx],[, <parms>] ) { [body] }  
     2137// version (build) pragma(plugin, <tool>[,delim=xxx],[, <parms>] ) { [body] } 
    21192138///endcode 
    21202139//This block would be replaced by the stdout data of calling 'tool <params>' and 
    21212140// 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  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 387
     4long auto_build_number = 443
  • trunk/Source/debug.brf

    r15 r19  
    22-info 
    33-Tbuild_dbg 
     4-w 
     5-g 
     6-unittest 
    47 
     8 
  • trunk/Source/source.d

    r16 r19  
    22 
    33        @file source.d 
    4          
     4 
    55        Copyright (c) 2005 Derek Parnell 
    6          
     6 
    77        This software is provided 'as-is', without any express or implied 
    88        warranty. In no event will the authors be held liable for damages 
    99        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 
    1313        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 
    1818           said product would be appreciated but is not required. 
    1919 
    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 
    2121           not be misrepresented as being the original software. 
    2222 
     
    4949    import util.fdt; 
    5050    import util.pathex; 
    51          
     51 
    5252    import std.stdio; 
    5353    import std.path; 
    5454    import std.ctype; 
    5555    import std.file; 
    56     import std.string;     
    57          
     56    import std.string; 
     57 
    5858    const { 
    5959        version(Windows) { 
     
    6262            char[] ObjExt=`obj`; 
    6363        } 
    64          
     64 
    6565        version(Posix) { 
    6666            char[] ExeExt=``; 
     
    6868            char[] ObjExt=`o`; 
    6969        } 
    70          
     70 
    7171    } 
    7272 
     
    7474    bool mainFound; 
    7575    bool mainGUI; 
    76      
     76 
    7777} 
    7878 
    7979public { 
    80      
     80 
    8181    char[] function(char[] pPath) AddRoot; 
    8282    void function(char[] pPath) AddLink; 
     
    8686    bool function(char[] pID) IsActiveVersion; 
    8787    char[] function(char[] pFile) GetFullPathname; 
    88      
     88 
    8989    bool mVerboseMode = false; 
    90      
     90 
    9191} 
    9292    debug(1) 
     
    9494        private import std.stdio; 
    9595    } 
    96      
     96 
    9797static this() 
    9898{ 
     
    110110public class Source { 
    111111    private static Source[char[]] SourceIndex; 
    112      
     112 
    113113    private { 
    114     char[] mFileName;       
     114    char[] mFileName; 
    115115    char[] mModuleName; 
    116116    char[] mObjectName; 
     
    123123    char[][] mReferencedImports; 
    124124    } 
    125      
     125 
    126126    public { 
    127     // FileName  
     127    // FileName 
    128128    char[] FileName () { return mFileName.dup; } 
    129      
     129 
    130130    // DependantsTime 
    131131    FileDateTime DependantsTime() { return mDependantsTime; } 
    132      
     132 
    133133    // ObjectsTime 
    134134    FileDateTime ObjectsTime() { return mObjectTime; } 
    135              
     135 
    136136    // FilesTime 
    137137    FileDateTime FilesTime() { return mFileTime; } 
    138              
     138 
    139139    // ModuleName 
    140140    char[] ModuleName() { return mModuleName.dup; } 
    141141    void ModuleName(char[] pValue) { mModuleName = pValue.dup; } 
    142              
     142 
    143143    // ObjectName 
    144144    char[] ObjectName() { return mObjectName.dup; } 
    145145    void ObjectName(char[] pValue) { mObjectName = pValue.dup; } 
    146              
     146 
    147147    // NoLink 
    148148    bool NoLink() { return mNoLink; } 
    149      
     149 
    150150    // BuildNumber 
    151151    int BuildNumber() { return mBuildNumber; } 
    152      
     152 
    153153    this(char[] pFileName) { 
    154154        mReferencedImports.length = 0; 
     
    158158        mModuleName = FileToModulename(pFileName); 
    159159        mObjectName = addExt(pFileName,ObjExt); 
    160         mBuildNumber = -1;  
    161          
     160        mBuildNumber = -1; 
     161 
    162162        mFileTime = GetFileTime(pFileName); 
    163163        mDependantsTime  = mFileTime; 
    164          
     164 
    165165        mObjectTime   = GetFileTime(mObjectName); 
    166166        UpdateDependantTime(mObjectTime); 
    167          
     167 
    168168        if(mVerboseMode) { 
    169169            writefln("Time %s for %s",mFileTime.toString(),mFileName); 
    170170            writefln("Time %s for %s",mObjectTime.toString(),mObjectName); 
    171171        } 
    172              
     172 
    173173        // Store this instantiation in the list of known files. 
    174174        SourceIndex[pFileName] = this; 
    175          
     175 
    176176        // Add this pFileName's directory as a potential import root. 
    177177        if (AddRoot != null) 
    178178            AddRoot(std.path.getDirName(pFileName)); 
    179          
     179 
    180180        search(); 
    181181    } 
     
    186186        bool lCanUse; 
    187187        int lTextPos = 0; 
    188          
     188 
    189189        if(mHasBeenSearched) { 
    190190            return; 
    191191        } 
    192          
     192        else { 
    193193        if(mVerboseMode) { 
    194194          writefln("Scanning %s", mFileName); 
     
    196196        // Extract all the module references. 
    197197        ProcessTokens(GetFileText(mFileName), lTextPos); 
    198          
     198 
    199199        lCurFileTime = new FileDateTime(); 
    200200        // Examine each extracted module file. 
     
    209209                    foreach(char[] lNextModule; ModulesToIgnore() ){ 
    210210                        int lFindPos; 
     211                        char[] lType = "package"; 
    211212                        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); 
    214217                           /* Only when ifind() is fixed! 
    215218                             lFindPos = std.string.ifind(lNextFile, std.path.sep ~ lNextModule ~ std.path.sep); 
    216219                           */ 
     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                            } 
    217237                        } 
    218238                        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                            } 
    220254                        } 
    221                          
     255 
    222256                        if( lFindPos >= 0) { 
    223257                            if (mVerboseMode) 
    224                                 writefln("Ignoring %s (module: %s)", lNextFile, lNextModule); 
    225                                  
     258                                writefln("Ignoring %s (%s: %s)", lNextFile, lType, lNextModule); 
     259 
    226260                            lCanUse = false; 
    227261                            break; 
     
    233267                    lCurFileTime = (new Source(lNextFile)).DependantsTime; 
    234268                } 
    235      
    236             } 
    237              
     269 
     270            } 
     271 
    238272            // Ensure we get the most recent mod time. 
    239273            UpdateDependantTime (lCurFileTime); 
    240274        } 
    241          
     275 
    242276        mHasBeenSearched = true; 
    243     } 
    244      
     277        } 
     278    } 
     279 
    245280    void UpdateDependantTime(FileDateTime pDateTime) 
    246281    { 
     
    250285            { 
    251286                writefln("Updating %s dependants time from %s to %s", 
    252                     mFileName,  
     287                    mFileName, 
    253288                    mDependantsTime.toString(), 
    254289                    pDateTime.toString() 
     
    258293        } 
    259294    } 
    260      
     295 
    261296    static bool WasMainFound() { return mainFound; } 
    262297    static void WasMainFound(bool pValue) { mainFound = pValue; } 
    263      
     298 
    264299    static bool WasMainGUI() { return mainGUI; } 
    265300    static void WasMainGUI(bool pValue) { mainGUI = pValue; } 
    266      
     301 
    267302    bool IncrementBuildNumber() 
    268303    { 
    269304        char[] lFileName; 
    270305        Source lBNSource; 
    271          
     306 
    272307        if (mBuildNumber < 0) 
    273308            return false; 
    274              
     309        else { 
    275310        lFileName = ModuleToFilename(mModuleName ~ "_bn"); 
    276311        if (std.file.exists(lFileName)) 
     
    278313            std.file.remove(lFileName); 
    279314        } 
    280          
     315 
    281316        mBuildNumber++; 
    282317 
    283         std.file.write(lFileName,  
     318        std.file.write(lFileName, 
    284319            std.string.format( 
    285             "module %s;\n"  
     320            "module %s;\n" 
    286321            "// This file is automatically maintained by the BUILD utility,\n" 
    287322            "// Please refrain from manually editing it.\n" 
    288             "long auto_build_number = %d;\n",  
     323            "long auto_build_number = %d;\n", 
    289324                    FileToModulename(lFileName), 
    290325                    mBuildNumber) 
    291326            ); 
    292327 
    293         if (! (lFileName in SourceIndex) )             
     328        if (! (lFileName in SourceIndex) ) 
    294329        { 
    295330            lBNSource = new Source(lFileName); 
     
    303338        lBNSource.mObjectTime = new FileDateTime(); 
    304339        return true; 
     340        } 
    305341    } 
    306342 
    307343    } // End public 
    308      
     344 
    309345    //---------------------------------------------------------- 
    310346  private { 
    311347    void ProcessTokens (char[] pFileText, inout int pPos, char[] pEndStmt = "}") 
    312348    { 
    313         /* This scans the source text for specific tokens until the 'pEndStmt'  
     349        /* This scans the source text for specific tokens until the 'pEndStmt' 
    314350           token is found, or end of text. 
    315351        */ 
     
    317353        char[] lPrevToken; 
    318354        int lLastPos; 
    319      
     355 
    320356        lCurToken = ""; 
    321357        lLastPos = pFileText.length-1; 
    322          
     358 
    323359        lblNextToken: 
    324360        while ((lPrevToken = lCurToken.dup, lCurToken = GetNextToken (pFileText, pPos)) !== null) { 
    325              
     361 
    326362            switch(lCurToken) { 
    327363                case "{": 
    328364                    ProcessTokens (pFileText, pPos); 
    329365                    break; 
    330      
     366 
    331367                case "\\": 
    332368                    // Ignore escaped tokens. 
     
    334370                        pPos++; 
    335371                    break; 
    336      
     372 
    337373                case "\"": 
    338374                    // ** drop through ** 
     
    346382                    pPos++; 
    347383                    break; 
    348              
     384 
    349385                case "`": // Skip over a raw string 
    350386                    while ( (pPos <= lLastPos) && (pFileText[pPos] != '`')) 
     
    352388                    pPos++; 
    353389                    break; 
    354      
    355                 case "r":                 
    356                     if ( (pPos <= lLastPos) && (pFileText[pPos] == '\"') )  
     390 
     391                case "r": 
     392                    if ( (pPos <= lLastPos) && (pFileText[pPos] == '\"') ) 
    357393                    {   // Skip over a raw string 
    358394                        pPos++; 
     
    362398                    } 
    363399                    break; 
    364      
     400 
    365401                case "main", "WinMain": 
    366                     if ( (lPrevToken != "class") &&  
    367                          (lPrevToken != "template")  
     402                    if ( (lPrevToken != "class") && 
     403                         (lPrevToken != "template") 
    368404                        ) { 
    369405                        doMain(pFileText, pPos, lCurToken); 
    370406                    } 
    371407                    break; 
    372                      
     408 
    373409                case "version": 
    374410                    doVersion(pFileText, pPos); 
    375411                    break; 
    376              
     412 
    377413                case "import": 
    378414                    doImport(pFileText, pPos); 
    379415                    break; 
    380                  
     416 
    381417                case "module": 
    382418                    doModule(pFileText, pPos); 
    383419                    break; 
    384                  
     420 
    385421                case "pragma": 
    386422                    doPragma(pFileText, pPos); 
    387                     break;  
    388              
     423                    break; 
     424 
    389425                default: 
    390426                    if (lCurToken in AttributeBlocks) { 
    391427                        doAttribute(pFileText, pPos, lCurToken); 
    392                          
     428 
    393429                    } else if (lCurToken == pEndStmt) { 
    394430                        break lblNextToken; 
    395431                    } 
    396             } // end switch     
     432            } // end switch 
    397433        } // end while 
    398434    } 
     
    403439        int lSavedPos; 
    404440        char[] lToken; 
    405          
     441 
    406442        lSavedPos = pPos; 
    407443        lToken = GetNextToken(pFileText,pPos); 
     
    410446            version(Windows) { 
    411447                if (pCurrentToken == "WinMain") { 
    412                     mainGUI = true;    
     448                    mainGUI = true; 
    413449                } 
    414450            } 
     
    416452            pPos = lSavedPos; 
    417453        } 
    418          
     454 
    419455    } 
    420456 
     
    424460        char[] lCurrentToken; 
    425461        int lSavedPos; 
    426          
     462 
    427463        lCurrentToken = GetNextToken (pFileText, pPos); 
    428464        if (lCurrentToken == "=") { 
     
    432468            return; 
    433469        } 
    434          
     470        else { 
    435471        if (lCurrentToken != "("){ 
    436472            return; // Not likely as this is bad syntax. 
    437473        } 
    438          
     474        else { 
    439475        // Pick out the version identifier and skip over the closing parenthesis. 
    440476        lCurrentToken = GetNextToken (pFileText, pPos); 
    441477        GetNextToken (pFileText, pPos); 
    442          
     478 
    443479        if ( IsActiveVersion(lCurrentToken) ) { 
    444480            // thus the following tokens must be processed. 
    445              
     481 
    446482            lSavedPos = pPos; // Remember where we are. 
    447             lCurrentToken = GetNextToken (pFileText, pPos);  
    448             if (lCurrentToken == "{") { 
     483            lCurrentToken = GetNextToken (pFileText, pPos); 
     484            if (lCurrentToken == "{") 
     485            { 
    449486                // process the stuff in the block 
    450487                ProcessTokens (pFileText, pPos); 
    451                  
     488 
    452489                /* If the next token is an 'else', I must skip over the statement 
    453490                   or block that follows the 'else'. Otherwise this marks the 
     
    467504                    } 
    468505                } 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 
    470507                    // routine handle it. 
    471508                    pPos = lSavedPos; 
     
    478515            return; 
    479516        } 
    480              
     517        else { 
    481518        /* Not an active version so therefore the following statement/block 
    482519           must not be processed. 
    483520        */ 
    484521        lCurrentToken = GetNextToken(pFileText, pPos); 
    485          
     522 
    486523        if ( lCurrentToken != "{") { 
    487524            skipContent(pFileText, pPos, ";"); 
    488525            return; 
    489526        } 
    490      
     527        else { 
    491528        skipContent(pFileText, pPos); 
    492          
     529 
    493530        lSavedPos = pPos; 
    494531        lCurrentToken = GetNextToken(pFileText, pPos); 
     
    497534            return; 
    498535        } 
    499      
     536        else { 
    500537        lSavedPos = pPos; 
    501538        lCurrentToken = GetNextToken(pFileText, pPos); 
     
    506543            ProcessTokens(pFileText, pPos, ";"); 
    507544        } 
     545        } 
     546    } 
     547    } 
     548    } 
     549 
     550    } 
    508551    } 
    509552    //---------------------------------------------------------- 
     
    512555        char[] lCurrentToken; 
    513556        char[] lModName; 
    514          
     557 
    515558        // import lModName.lModName, lModName, lModName.lModName.lModName; 
    516          
     559 
    517560        while ((lCurrentToken = GetNextToken (pFileText, pPos)) !== null && (lCurrentToken != ";")) { 
    518561            if ( (lCurrentToken == ",") && (lModName.length > 0)) { 
     
    527570            mReferencedImports ~= ModuleToFilename(lModName); 
    528571        } 
    529          
     572 
    530573    } 
    531574    //---------------------------------------------------------- 
     
    534577        char[] lCurrentToken; 
    535578        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 != ";")) 
    539582        { 
    540583            lModName ~= lCurrentToken; 
    541584        } 
    542      
     585 
    543586        if (lModName.length > 0 ) 
    544587        { 
    545588            mModuleName = lModName; 
    546             if (mVerboseMode)  
     589            if (mVerboseMode) 
    547590            { 
    548591                writefln("Module name set to '%s'", mModuleName); 
    549592            } 
    550593        } 
    551          
     594 
    552595    } 
    553596 
     
    561604        char[] lCurrentToken; 
    562605        char[] lPragmaId; 
    563          
     606 
    564607        lPragmaId.length = 0; 
    565608        if (GetNextToken(pFileText, pPos) == "(" ){ 
     
    569612                while ( (lCurrentToken = GetNextToken(pFileText,pPos)) !== null) 
    570613                { 
    571                     if ((lCurrentToken != ",") && (lCurrentToken != ")")) {  
     614                    if ((lCurrentToken != ",") && (lCurrentToken != ")")) { 
    572615                        lPragmaId ~= lCurrentToken; 
    573616                    } 
    574617                    else if (lPragmaId.length > 0) { 
    575                         if ((lPragmaId.length <= ObjExt.length) ||  
     618                        if ((lPragmaId.length <= ObjExt.length) || 
    576619                            (lPragmaId[length-ObjExt.length-1..length] != ("."~ObjExt))) 
    577620                        { 
    578621                            version(Windows) { 
    579                                 if (std.string.tolower(getExt(lPragmaId)) ==  
     622                                if (std.string.tolower(getExt(lPragmaId)) == 
    580623                                    std.string.tolower(LibExt)) { 
    581624                                    lPragmaId.length = lPragmaId.length - LibExt.length - 1; 
     
    598641                } 
    599642            } else if (lCurrentToken == "build_def"){ 
    600                 // Collect records for the optlink module definition file.             
     643                // Collect records for the optlink module definition file. 
    601644                lPragmaId = ""; 
    602645                while ( (lCurrentToken = GetNextToken(pFileText,pPos)) !== null) 
     
    604647                    if (lCurrentToken == "\"") 
    605648                        lCurrentToken = GetStringLit(pFileText, pPos); 
    606                          
    607                     if ((lCurrentToken != ",") && (lCurrentToken != ")")) {  
     649 
     650                    if ((lCurrentToken != ",") && (lCurrentToken != ")")) { 
    608651                        if (AddBuildDef != null) 
    609652                            AddBuildDef(lCurrentToken); 
     
    611654                    if (lCurrentToken == ")"){ 
    612655                        break;} 
    613                 }             
    614              
     656                } 
     657 
    615658            } else if (lCurrentToken == "nolink"){ 
    616                 // This source file is NOT to be linked                 
     659                // This source file is NOT to be linked 
    617660                mNoLink = true; 
    618                  
     661 
    619662                // Skip over the trailing parenthesis. 
    620                 GetNextToken(pFileText,pPos);                 
    621             }             
    622         } 
    623     } 
    624          
     663                GetNextToken(pFileText,pPos); 
     664            } 
     665        } 
     666    } 
     667 
    625668    //---------------------------------------------------------- 
    626669    void doAttribute (in char[] pFileText, inout int pPos, char[] pAttrType) 
     
    629672        char[] lNextToken; 
    630673        int lSavedPos; 
    631          
     674 
    632675        // Handle private/public/etc... blocks. 
    633676        lSavedPos = pPos; 
    634677        lCurrentToken = GetNextToken(pFileText,pPos); 
    635          
     678 
    636679        if (lCurrentToken == "{") // read a block statement 
    637680        { 
    638681            ProcessTokens (pFileText, pPos); 
    639      
     682 
    640683        } else { 
    641684            // Check for special auto build number import. 
     
    647690                    lCurrentToken ~= lNextToken; 
    648691                } 
    649                  
     692 
    650693                if (lCurrentToken == mModuleName ~ "_bn") 
    651694                { 
     
    657700            pPos = lSavedPos; 
    658701        } 
    659          
    660     } 
    661      
     702 
     703    } 
     704 
    662705    //---------------------------------------------------------- 
    663706    /* Get the next token, skipping over comments. */ 
     
    665708    { 
    666709        int lLastPos; 
    667          
     710 
    668711        lLastPos = pFileText.length - 1; 
    669         while (pPos <= lLastPos)  
     712        while (pPos <= lLastPos) 
    670713        { 
    671714            // Check for comments ... 
     
    680723                            break; 
    681724                        } 
    682                         pPos++; 
     725                        else 
     726                            pPos++; 
    683727                    } 
    684728                } else 
     
    689733                        pPos++; 
    690734                        } 
    691                      
     735 
    692736                } else 
    693737                // Check for multiline nested comments 
    694738                if (pFileText [pPos+1] == '+') { 
    695739                    int lDepth = 1; 
    696                      
     740 
    697741                    pPos += 2; 
    698742                    while (pPos < lLastPos) { 
     
    718762                        } 
    719763                    } 
    720                      
     764 
    721765                    if (pPos >= lLastPos) { throw new Exception("Mismatched nested comments in " ~ mFileName); } 
    722766                } 
    723             } // else  
     767            } // else 
    724768            // Check for 'words' 
    725769            if (isalpha (pFileText [pPos])) { 
     
    730774                } 
    731775                return pFileText[lStart .. pPos]; 
    732                  
     776 
    733777            } else 
    734778            // Check for whitespace 
    735779            if (isspace (pFileText [pPos])) { 
    736780                pPos++; 
    737                  
    738             } else  
     781 
     782            } else 
    739783            { 
    740784            // Return whatever character we have discovered. 
     
    743787            } 
    744788        } 
    745      
     789 
    746790        return null; 
    747791    } 
    748      
     792 
    749793    //---------------------------------------------------------- 
    750794    void skipContent (in  char[] pFileText, inout int pPos, char[] pEndStmt = "}") 
    751795    { 
    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 
    755799           the first token inside a '{' '}' pair. 
    756800           */ 
    757801        char[] lCurrentToken; 
    758      
     802 
    759803        while ((lCurrentToken = GetNextToken (pFileText, pPos)) !== null) 
    760804        { 
     
    763807                return; 
    764808            } 
    765              
    766             if (lCurrentToken == "{") 
     809            else if (lCurrentToken == "{") 
    767810                skipContent (pFileText, pPos); 
    768         } 
    769     } 
    770      
     811 
     812        } 
     813    } 
     814 
    771815    //---------------------------------------------------------- 
    772816    char[] GetStringLit (in  char[] pFileText, inout int pPos, char pEndStmt = '"') 
     
    774818        int lStartLit; 
    775819        int lEndLit; 
    776          
     820 
    777821        lStartLit = pPos; 
    778          
     822 
    779823        while( (pPos < pFileText.length) && (pFileText[pPos] != pEndStmt) ) 
    780824        { 
     
    784828        if (pPos < pFileText.length) 
    785829            pPos++; // Skip over lit end char. 
    786              
     830 
    787831        return pFileText[lStartLit .. lEndLit]; 
    788      
    789     } 
    790      
     832 
     833    } 
     834 
    791835 
    792836  } // end private 
    793      
     837 
    794838} // end class 
    795              
     839 
    796840char[] ModuleToFilename(char[] pModuleName) 
    797841{ 
    798842    char[] lFileName; 
    799      
     843 
    800844    // Replace dots with the opsys path separator 
    801845    lFileName = util.str.ReplaceChar(pModuleName.dup, '.', std.path.sep[0]); 
    802846    // Add the 'd' extention and append the full path 
    803847    lFileName = GetFullPathname( addExt( lFileName, "d" ) ); 
    804      
     848 
    805849    if(mVerboseMode) { 
    806850        writefln(" module->file %s => %s",pModuleName,lFileName); 
     
    814858    char[] lTemp; 
    815859 
    816     // Copy the name     
     860    // Copy the name 
    817861    lModuleName = pFileName.dup; 
    818      
     862 
    819863    // Remove DOS/Windows drive spec. 
    820864    version(Windows) { 
     
    830874        } 
    831875    } 
    832      
     876 
    833877    if (lModuleName[1] == ':') 
    834878    { 
     
    836880        lModuleName = lTemp.dup; 
    837881    } 
    838      
     882 
    839883    if (lModuleName[0] ==  std.path.sep[0]) 
    840884    { 
     
    842886        lModuleName = lTemp.dup; 
    843887    } 
    844      
     888 
    845889    // Remove file extension. 
    846890    if (lModuleName[length-2 .. length] == ".d") 
     
    848892        lModuleName.length = lModuleName.length - 2; 
    849893    } 
    850      
     894 
    851895    // Replace opsys path separators with dots. 
    852896    lModuleName = util.str.ReplaceChar(lModuleName, std.path.sep[0], '.'); 
    853      
     897 
    854898    if(mVerboseMode) { 
    855899        writefln(" file->module %s => %s",pFileName,lModuleName); 
     
    862906{ 
    863907    char[] lFileText; 
    864      
     908 
    865909    if (! std.file.exists( pFileName)) 
    866910    { 
    867911        return ""; 
    868912    } 
    869      
     913    else { 
    870914    lFileText = cast(char[]) std.file.read(pFileName); 
    871915    if ( (lFileText.length == 0) || 
    872916         (lFileText[length-1] != '\n')) 
    873917         lFileText ~= '\n'; 
    874           
     918 
    875919    return lFileText; 
    876      
     920    } 
     921 
    877922} 
    878923 
     
    882927    char[][] lLines; 
    883928    char[]   lText; 
    884      
    885     if (! std.file.exists(pFileName))  
     929 
     930    if (! std.file.exists(pFileName)) 
    886931    { 
    887932        throw new Exception( std.string.format("File '%s' not found.", pFileName)); 
    888933    } 
    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    } 
    893939} 
    894940 
     
    899945    char[] lFileName; 
    900946    int lBuildNumber = 0; 
    901      
     947 
    902948    lFileName = ModuleToFilename(pModuleName ~ "_bn"); 
    903949    if (std.file.exists(lFileName)) 
     
    933979} 
    934980 
    935      
  • trunk/Source/source_bn.d

    r18 r19  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 202
     4long auto_build_number = 258
  • trunk/Source/util/fdt.d

    r17 r19  
    5252        import std.c.windows.windows; 
    5353    } 
    54     version(linux) { 
     54    else version(linux) { 
    5555        import std.c.linux.linux; 
    5656        alias std.c.linux.linux posix; 
    5757    } 
    58     version(darwin) { 
     58    else version(darwin) { 
    5959        import std.c.darwin.darwin; 
    6060        alias std.c.darwin.darwin posix; 
    6161    } 
    62     version(Unix) { 
     62    else version(Unix) { 
    6363        import std.c.unix; 
    6464        alias std.c.unix posix; 
    6565    } 
     66     
    6667    version(Posix) { 
    6768        import std.string; 
     
    99100            SYSTEMTIME lATime; 
    100101            SYSTEMTIME lBTime; 
     102            int lResult; 
    101103             
    102104            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; 
    144150          } 
    145151           
     
    153159            if ( mSet == false ) 
    154160                return "not recorded"; 
    155  
     161            else { 
    156162            // Convert the file's time into the user's local timezone.                 
    157163            FileTimeToSystemTime(&mDT, &lSystemTime); 
     
    175181           
    176182        } 
     183    } 
    177184   
    178185    } 
  • trunk/Source/util/fdt_bn.d

    r18 r19  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 161
     4long auto_build_number = 217
  • trunk/Source/util/pathex.d

    r9 r19  
    208208    if (lNewPath.length == 0) 
    209209        return false; 
    210      
     210    else {     
    211211    // extract out the parent directory 
    212212    for (int i = lNewPath.length-1; i >= 0; i--) 
     
    240240    } 
    241241    return lResult; 
    242 
     242    } 
     243
  • trunk/Source/util/pathex_bn.d

    r18 r19  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 180
     4long auto_build_number = 234
  • trunk/Source/util/str.d

    r6 r19  
    110110    if (pFrom == pTo) 
    111111        return pText; 
    112              
     112    else {             
    113113    foreach( uint i, inout ubyte lTestChar; pText){ 
    114114        if(lTestChar == pFrom) { 
     
    122122            return lTemp; 
    123123        } 
    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; 
    128131        } 
    129132         
    130133    } 
     134} 
     135    assert(0); 
    131136} 
    132137 
     
    171176    if (pFrom == pTo) 
    172177        return pText; 
    173              
     178 
     179    else {             
    174180    foreach( uint i, inout dchar lTestChar; pText){ 
    175181        if(lTestChar == pFrom) { 
     
    188194    // If I get here, no changes were done. 
    189195    return pText; 
     196} 
    190197} 
    191198 
     
    502509            if (lPatternIndex == pPattern.length) 
    503510                return true; 
     511            else { 
    504512            if (pPattern[lPatternIndex] != kExactlyOne) 
    505513                while( (lTextIndex < pText.length) &&  
     
    509517                        ) 
    510518                    lTextIndex++; 
     519                } 
    511520        } 
    512521        else if ((lTextIndex < pText.length) &&  
  • trunk/Source/util/str_bn.d

    r18 r19  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 144
     4long auto_build_number = 198