Changeset 44

Show
Ignore:
Timestamp:
06/06/06 00:14:41 (6 years ago)
Author:
Derek Parnell
Message:

Upload version 3.00 (Build #1964)
added downloads/build-3.00.doc.zip
added downloads/build-3.00.src.zip
added downloads/build_win_3.00.dbg.exe
added downloads/build_win_3.00.exe
modified trunk/Docs/autobuild.html
modified trunk/Docs/change_log.html
modified trunk/Docs/command_line.html
modified trunk/Docs/configuration_file.html
modified trunk/Docs/dlls.html
modified trunk/Docs/introduction.html
added trunk/Docs/macros.html
added trunk/Docs/none.css
modified trunk/Docs/pragmas.html
added trunk/Docs/profile_file.html
modified trunk/Docs/response_file.html
modified trunk/Docs/rules.html
modified trunk/Docs/style.css
modified trunk/Docs/switches.html
modified trunk/Docs/todo.html
modified trunk/Docs/User_Manual.html
modified trunk/Source/build.d
modified trunk/Source/build_bn.d
modified trunk/Source/docsrc/change_log.d
modified trunk/Source/docsrc/command_line.d
modified trunk/Source/docsrc/configuration_file.d
modified trunk/Source/docsrc/introduction.d
added trunk/Source/docsrc/macros.d
added trunk/Source/docsrc/none.css
added trunk/Source/docsrc/profile_file.d
modified trunk/Source/docsrc/style.css
modified trunk/Source/docsrc/switches.d
modified trunk/Source/docsrc/um.d
modified trunk/Source/docsrc/User_Manual.d
modified trunk/Source/docsrc/user_manual.ddoc
modified trunk/Source/example_build.cfg
added trunk/Source/example_build.mdf
modified trunk/Source/source.d
modified trunk/Source/source_bn.d
modified trunk/Source/util/booltype.d
modified trunk/Source/util/fdt_bn.d
modified trunk/Source/util/fileex.d
modified trunk/Source/util/fileex_bn.d
modified trunk/Source/util/linetoken_bn.d
modified trunk/Source/util/macro.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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Docs/User_Manual.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from User_Manual.d --> 
    711 
     
    4953    <li><a href="rules.html">Rule Definition File</a></li> 
    5054 
    51     <li><a href="commandline.html">Command Line</a></li> 
     55    <li><a href="macros.html">Macros</a></li> 
     56 
     57    <li><a href="command_line.html">Command Line</a></li> 
    5258 
    5359    <li><a href="switches.html">Switches</a></li> 
     
    7076    <ul><li><a href="switches.html#switch_link"><span class="subtoc">-link</span></a></li></ul> 
    7177    <ul><li><a href="switches.html#switch_M"><span class="subtoc">-M&lt;name&gt;</span></a></li></ul> 
     78    <ul><li><a href="switches.html#switch_MDF"><span class="subtoc">-MDF&lt;file&gt;</span></a></li></ul> 
    7279    <ul><li><a href="switches.html#switch_names"><span class="subtoc">-names</span></a></li></ul> 
    7380    <ul><li><a href="switches.html#switch_noautoimport"><span class="subtoc">-noautoimport</span></a></li></ul> 
     
    8390    <ul><li><a href="switches.html#switch_T"><span class="subtoc">-T&lt;name&gt;</span></a></li></ul> 
    8491    <ul><li><a href="switches.html#switch_test"><span class="subtoc">-test</span></a></li></ul> 
     92    <ul><li><a href="switches.html#switch_UMB"><span class="subtoc">-UMB</span></a></li></ul> 
    8593    <ul><li><a href="switches.html#switch_v"><span class="subtoc">-v (lowercase)</span></a></li></ul> 
    8694    <ul><li><a href="switches.html#switch_V"><span class="subtoc">-V (uppercase)</span></a></li></ul> 
     
    8997    <li><a href="response_file.html">Response File</a></li> 
    9098    <li><a href="configuration_file.html">Configuration File</a></li> 
     99    <li><a href="profile_file.html">Profile File</a></li> 
    91100    <li><a href="todo.html">Things Still To Do</a></li> 
    92101    <li><a href="dlls.html">DLL Libraries</a></li> 
     
    98107<b>Authors:</b><br>Derek Parnell, Melbourne<br><br> 
    99108<b>Initial Creation:</b><br>January 2005<br><br> 
    100 <b>Version:</b><br> 2.09<br><br> 
     109<b>Version:</b><br> 3.0<br><br> 
    101110<b>Date:</b><br> August 2005<br><br> 
    102111<a name="license"></a> 
     
    127136 
    128137 
    129 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    130 </span></body> 
     138<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     139 </span></body> 
    131140                 </html> 
  • trunk/Docs/autobuild.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from autobuild.d --> 
    711 
     
    6266 
    6367 
    64 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    65 </span></body> 
     68<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     69 </span></body> 
    6670                 </html> 
  • trunk/Docs/change_log.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from change_log.d --> 
    711 
     
    1216<p>A list of changes and fixes that have been made. 
    1317</p> 
     18<a name=""><h3 class="subsection">v3.00 -- 05/June/2006 </h3></a> 
     19<ul><span class="list">    <li><span class="item">** <b>FIX:</b> <i>Build</i> was using the wrong object file during 
     20    linkages if a target object file did not exist but one with the same name 
     21    existed in any of the Import paths. 
     22    </span></li> 
     23    <li><span class="item">** <b>FIX:</b> With the <i>-R=No</i> switch, when using the Digital 
     24     Mars linker, <i>Build</i> was not formatting the command line correctly. 
     25    </span></li> 
     26    <li><span class="item">** <b>FIX: Ticket #10 </b> The tool now recognises the 
     27     <a href="pragmas.html#pragma_link">pragma linked</a> object files when 
     28     building a library. 
     29    </span></li> 
     30    <li><span class="item">** <b>FIX: Ticket #9 </b> Now, if the output file created by the 
     31     rule ends with the library extention, it is presented to the linker 
     32     as a library rather than an object file. 
     33    </span></li> 
     34    <li><span class="item">** <b>FIX: </b> <i>thanks to gmiller:</i> Added booltype.d to 
     35     Makefile files. 
     36    </span></li> 
     37    <li><span class="item">** <b>FIX: Ticket #15 </b> GDC places object files in the 
     38    directory from which it is called so the tool no longer assumes the 
     39    same directory as the corresponding source file. 
     40    </span></li> 
     41    <li><span class="item">** <b>FIX: Ticket #17 </b> Hopefully its a more posix-friendly 
     42    tool now. Most of the hard-coded switches and options that are 
     43    environment related are now user-configurable via the <a href="configuration_file.html"> 
     44    Configuration File</a> functionality. 
     45    </span></li> 
     46    <li><span class="item">** <b>FIX: </b> <i>thanks to gmiller:</i> Corrected the imports 
     47    in <i>util.fileex.d</i> 
     48    </span></li> 
     49    <li><span class="item">** <b>FIX: </b> <i>thanks to gmiller:</i> Module and package exclusion 
     50    was not working if your current directory was in a directory tree that 
     51    contained the module/package you were excluding. For example if your 
     52    current directory was C:\dmd\src\phobos it would not exclude any of the 
     53    'std' modules.</span></li> 
     54 
     55    <li><span class="item">** <b>ENH: </b> Any file name on the command line with an extention 
     56     of <i>".brf" </i> will be used as a <a href="response_file.html">Build Response File</a> 
     57    </span></li> 
     58 
     59    <li><span class="item">** <b>ENH: </b> If there is nothing on the command line and the 
     60    file 'build.brf' exists in the current directory, then it will be 
     61    used as the <a href="response_file.html">Build Response File</a> for this run. 
     62    </span></li> 
     63 
     64    <li><span class="item">** <b>ENH: </b> Will now look for the compiler's configuration file 
     65    in the following areas... 
     66    <ul><span class="list">        <li><span class="item">If defined, the directory defined by the <i>ConfigPath</i> 
     67        configuration item in <i>Build's</i> configuration file. And in this 
     68        case it doesn't look anywhere in any of the areas listed below.</span></li> 
     69        <li><span class="item">The current directory.</span></li> 
     70        <li><span class="item">The directory named in the <i>HOME</i> environment symbol.</span></li> 
     71        <li><span class="item">For Windows environments only, the directory named in 
     72        the combination of the <i>HOMEDRIVE</i> and <i>HOMEPATH</i> environment symbols.</span></li> 
     73        <li><span class="item">The same directory in which the compiler resides.</span></li> 
     74        <li><span class="item">The directory defined by the <i>EtcPath</i> configuration item 
     75        in <i>Build's</i> configuration file.</span></li> 
     76    </span></ul> 
     77    </span></li> 
     78 
     79    <li><span class="item">** <b>ENH: </b> It is now possible to add environment specific items 
     80    to the build.cfg file. To do so, add the items to the appropriate item group... 
     81        <ul class="indent">        <pre class="cite">            [Windows] 
     82            # items that only apply when building in Windows. 
     83 
     84            [Posix] 
     85            # items that only apply when building in Posix (unix). 
     86 
     87            [DigitalMars] 
     88            # items that only apply when building with DigitalMars tools. 
     89 
     90            [GNU] 
     91            # items that only apply when building with GNU tools. 
     92 
     93            [Windows:DigitalMars] 
     94            # items that only apply when building with DigitalMars tools in Windows. 
     95 
     96            [Windows:GNU] 
     97            # items that only apply when building with GNU tools in Windows. 
     98 
     99            [Posix:DigitalMars] 
     100            # items that only apply when building with DigitalMars tools in Posix. 
     101 
     102            [Posix:GNU] 
     103            # items that only apply when building with GNU tools in Posix. 
     104        </pre> 
     105        </ul> 
     106    </span></li> 
     107 
     108    <li><span class="item">** <b>CHG: </b> When building the <i>Build</i> application itself, 
     109    you must now add <b>-version=BuildVerbose</b> to the command line if 
     110    you want an edition of <i>Build</i> that supports the <b>-V</b> (verbose) switch. As 
     111    shipped, the pre-built editions of <i>Build</i> do not support 
     112    the <b>-V</b> switch. 
     113    </span></li> 
     114</span></ul> 
     115 
    14116<a name=""><h3 class="subsection">v2.10 -- 06/Apr/2006 </h3></a> 
    15117<ul><span class="list">    <li><span class="item">** <b>FIX: </b> The default Build Response File invoked when just 
     
    450552</span></ul> 
    451553 
    452 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    453 </span></body> 
     554<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     555 </span></body> 
    454556                 </html> 
  • trunk/Docs/command_line.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from command_line.d --> 
    711 
     
    1721 
    1822You can however specify the files and switches in any order you like. 
    19  
     23<br/>&nbsp;<br/> 
    2024Normally you would only supply a single file name to <i>Build</i>, that being 
    2125 the source file of the top-level file in the application. Typically 
    2226 the one that has the 'main()' or 'WinMain()' function, though this is 
    2327 not strictly necessary. 
    24  
     28<br/>&nbsp;<br/> 
     29The files supplied on the command line can be a mixture of source files, 
     30macro files, object files, resource files, resource source files, libraries, 
     31and any other type of file needed to build an application or library. 
     32<br/>&nbsp;<br/> 
    2533If you run the utility without any files and without any switches, it 
    2634 display a <i>help</i> screen with some details about the switches. That looks 
     
    6674    <b>-si</b>        Search the Import Path(s) for files specified on 
    6775                   the command line. 
     76    <b>-MDF&lt;path&gt;</b>  Overrides the default Macro Definition File 
    6877    <b>-RDF&lt;path&gt;</b>  Overrides the default Rule Definition File 
    6978    <b>-gui[:x.y]</b> Forces a GUI application to be created. The optional 
     
    8291                the target name istaken from the first or only name 
    8392                of the command line. 
    84     <b>-R&lt;y|n&gt;</b> Indicates whether to use a response file or command line 
     93    <b>-R=&lt;Yes/No&gt;</b> Indicates whether to use a response file or command line 
    8594                   arguments with the compiler tools. 
    86                  <b>-Ry</b> will cause a response to be used. 
    87                  <b>-Rn</b> will cause command line arguments to be used. 
     95                 <b>-R=Yes</b> will cause a response to be used. 
     96                 <b>-R=No</b> will cause command line arguments to be used. 
    8897                 <b>-R</b> will reverse the current usage. 
    8998                  Note that the default for Windows <i>DigitalMars</i> is to use a response file 
     
    107116                This will override any pragma() 
    108117                 statements in the source code. 
     118    <b>-UMB=&lt;Yes/No&gt;</b> If <b>Yes</b> this forces the utility to expect 
     119                 the object file to be created or residing in the current 
     120                 directory. 
    109121    <b>[...]</b>      All other options, objectfiles and libraries are 
    110122                passed to the compiler 
     
    115127 
    116128 
    117 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    118 </span></body> 
     129<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     130 </span></body> 
    119131                 </html> 
  • trunk/Docs/configuration_file.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
    6                  <body><h1></h1><!-- Generated by Ddoc from configuration_file.d --> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title>User Manual for BUILD</title> 
     9                 </head> 
     10                 <body><h1>User Manual for BUILD</h1><!-- Generated by Ddoc from configuration_file.d --> 
    711 
    812 
     
    4650</pre> 
    4751 
     52<b>INIT:</b> <br> 
     53This specifies an internal string value. The format is actually 
     54<i>INIT:<b>stringname</b></i> where <i>stringname</i> identifies the specific 
     55internal string to set. 
     56<pre class="code">   INIT:MapSwitch = -M 
     57</pre> 
     58<ul class="indent"><p>The identifiers for the settable strings are detailed below.</p> 
     59<div class="tabrow1">ExeExtention</div><div class="tabrow2">The file extention for executable files. <span class="eg">Example: "exe"</span></div> 
     60<div class="tabrow1">LibExtention</div><div class="tabrow2">The file extention for library files.<span class="eg">Example: "lib"</span></div> 
     61<div class="tabrow1">ObjExtention</div><div class="tabrow2">The file extention for object files.<span class="eg">Example: "obj"</span></div> 
     62<div class="tabrow1">ShrLibExtention</div><div class="tabrow2">The file extention for shared libraries files.<span class="eg">Example: "dll"</span></div> 
     63<div class="tabrow1">SrcExtention   </div><div class="tabrow2">The file extention for D source files.<span class="eg">Example: "d"</span></div> 
     64<div class="tabrow1">MacroExtention </div><div class="tabrow2"> The file extention for macro files.<span class="eg">Example: "mac"</span></div> 
     65<div class="tabrow1">DdocExtention  </div><div class="tabrow2">The file extention for D Documentation files.<span class="eg">Example: "ddoc"</span></div> 
     66<div class="tabrow1">CompilerExe    </div><div class="tabrow2">The file name of the compiler.<span class="eg">Example: "dmd.exe"</span></div> 
     67<div class="tabrow1">CompileOnly    </div><div class="tabrow2">The switch that is passed to the compiler to tell 
     68                          it not to link, just compile the files instead.<span class="eg">Example: "-c"</span></div> 
     69<div class="tabrow1">LinkerExe      </div><div class="tabrow2">The file name of the linker.<span class="eg">Example: "link.exe"</span></div> 
     70<div class="tabrow1">ConfigFile     </div><div class="tabrow2">The name of the compiler's configuration file. <span class="eg">Example: "sc.ini"</span></div> 
     71<div class="tabrow1">CompilerPath   </div><div class="tabrow2">If the compiler is not in the standard search PATH, 
     72                          this specifies the location of the compiler. <span class="eg">Example: "F:\dmd\bin"</span></div> 
     73<div class="tabrow1">ConfigPath     </div><div class="tabrow2">This will specify where to look for the compiler's 
     74                          configuration file. It overrrides the default 
     75                          places to look for it. <span class="eg">Example: "D:\configarea"</span></div> 
     76<div class="tabrow1">LinkerPath     </div><div class="tabrow2">If not overriden by any LINKCMD= 
     77                          option found in the compiler's configuration file, 
     78                          this specifies the location of the linker. 
     79                          <span class="eg">Example: "F:\dm\bin"</span> 
     80                          <br>If this empty and there is no LINKCMD= found, 
     81                          the linker is assumed to be in the same place as the 
     82                          compiler. 
     83                          </div> 
     84<div class="tabrow1">LinkerDefs     </div><div class="tabrow2">The default set of switches for the linker. These are 
     85                          applied to every link run. <span class="eg">Example: "/noi /map"</span></div> 
     86<div class="tabrow1">LibPaths       </div><div class="tabrow2">The default set of paths used by the linker to 
     87                          scan for library files. <span class="eg">Example: "C:\mylibs;c:\dfl"</span></div> 
     88<div class="tabrow1">ConfigSep      </div><div class="tabrow2">The delimiter used to separate paths in the 
     89                          <i>LibPaths</i> list. <span class="eg">Example: ";"</span></div> 
     90<div class="tabrow1">Librarian      </div><div class="tabrow2">The name of the librarian tool. <span class="eg">Example: "lib.exe "</span></div> 
     91<div class="tabrow1">LibrarianOpts  </div><div class="tabrow2">The default switches that are always passed to 
     92                          the librarian tool. <span class="eg">Example: "-c -p256"</span></div> 
     93<div class="tabrow1">VersionSwitch  </div><div class="tabrow2">The switch that sets a <i>version</i> symbol for the 
     94                          compiler. <span class="eg">Example: "-version"</span></div> 
     95<div class="tabrow1">DebugSwitch    </div><div class="tabrow2">The switch that sets a <i>debug</i> symbol for the 
     96                          compiler. <span class="eg">Example: "-debug"</span></div> 
     97<div class="tabrow1">CompilerDefs   </div><div class="tabrow2">The default switches that are always passed to 
     98                          the compiler. <span class="eg">Example: "-op"</span> 
     99                          <br> Note that in the DigitalMars environment if 
     100                          you don't specify any CompilerDefs, "-op" is 
     101                          assumed.</div> 
     102<div class="tabrow1">OutFileSwitch  </div><div class="tabrow2">The switch tells <i>Build</i> 
     103                          where to create the executable file. <span class="eg">Example: "-of"</span></div> 
     104<div class="tabrow1">ImportPath     </div><div class="tabrow2">This is the switch for the compiler to tell it where 
     105                          to search for imported modules. <span class="eg">Example: "-I"</span></div> 
     106<div class="tabrow1">LinkLibSwitch  </div><div class="tabrow2">This is the switch for the linker to tell it 
     107                          a library to use. <span class="eg">Example: "-l"</span></div> 
     108<div class="tabrow1">LibPathSwitch  </div><div class="tabrow2">This is the switch for the linker to tell it 
     109                          where to search for the libraries. <span class="eg">Example: "-L"</span></div> 
     110<div class="tabrow1">MapSwitch      </div><div class="tabrow2">This is the switch for the linker to tell it 
     111                          to create a map file. Note that the DigitalMars 
     112                          linker does not have a switch for this function. 
     113                          <span class="eg">Example: "-M"</span></div> 
     114<div class="tabrow1">SymInfoSwitch  </div><div class="tabrow2">This is the switch for the linker to tell it 
     115                          to insert symbolic debugging information into 
     116                          the executable.<span class="eg">Example: "/co"</span></div> 
     117<div class="tabrow1">BuildImportPath</div><div class="tabrow2">This is the switch for <i>Build</i> to tell it 
     118                          a path to scan for imported modules. <span class="eg">Example: "-I"</span></div> 
     119<div class="tabrow1">ImportPathDelim</div><div class="tabrow2">This is the switch for <i>Build</i> to tell it 
     120                          which character is used to delimit paths on 
     121                          a BuildImportPath list. <span class="eg">Example: ";"</span></div> 
     122<div class="tabrow1">OutputPath     </div><div class="tabrow2">This is the switch for <i>Build</i> to tell it 
     123                          the path to use for all temporary output files. <span class="eg">Example: "-od"</span></div> 
     124<div class="tabrow1">RunSwitch      </div><div class="tabrow2">This is the switch for <i>Build</i> to tell it 
     125                          to run the application once it successfully 
     126                          compiles. <span class="eg">Example: "-exec"</span></div> 
     127<div class="tabrow1">LibrarianPath  </div><div class="tabrow2">This is the default path where build will run 
     128                          the librarian tool from. It will be overridden 
     129                          by a 'LIBCMD=' in the configuration file or 
     130                          on the commandline. <span class="eg">Example: "c:\tools\"</span></div> 
     131<div class="tabrow1">ResponseExt    </div><div class="tabrow2">This is the file extention that Build will use 
     132                          for its response files. <span class="eg">Example: "brf"</span></div> 
     133<div class="tabrow1">DefResponseFile</div><div class="tabrow2">This is the name of <i>Build's</i> default 
     134                          response file. <span class="eg">Example: "build.brf"</span></div> 
     135<div class="tabrow1">RDFName        </div><div class="tabrow2">This is the name of <i>Build's</i> default 
     136                          Rules Definition File. <span class="eg">Example: "default.rdf"</span></div> 
     137<div class="tabrow1">DefMacroDefFile</div><div class="tabrow2">This is the name of <i>Build's</i> default 
     138                          Macro Definition File. <span class="eg">Example: "build.mdf"</span></div> 
     139<div class="tabrow1">LinkerStdOut   </div><div class="tabrow2">This is the commandline option given to the linker 
     140                          when the <i>Build</i> commandline has the <i>"-silent"</i> 
     141                          switch. <span class="eg">Example: "&gt;nul"</span></div> 
     142<div class="tabrow1">IgnoredModules </div><div class="tabrow2">This is a comma delimited list of modules or packages 
     143                          to ignore. <i>Build</i> will not scan these modules and 
     144                          packages for dependancies. <span class="eg">Example: "std,dfl,dui"</span> 
     145                          If none is specified by this configuration item then 
     146                          'phobos' is assumed.</div> 
     147<div class="tabrow1">AssumedLibs    </div><div class="tabrow2">This is a comma delimited list of libraries that 
     148                          are passed to the linker. <span class="eg">Example: "dfl,mt"</span> <br/>&nbsp;<br/> 
     149                          If the application being compiled has a WinMain 
     150                          function or is otherwise identified as a Windows 
     151                          application then the following are automatically 
     152                          passed to the linker. <br> 
     153                          <ul><span class="list">                                <li><span class="item">gdi32.lib</span></li> 
     154                                <li><span class="item">advapi32.lib</span></li> 
     155                                <li><span class="item">COMCTL32.LIB</span></li> 
     156                                <li><span class="item">comdlg32.lib</span></li> 
     157                                <li><span class="item">CTL3D32.LIB</span></li> 
     158                                <li><span class="item">kernel32.lib</span></li> 
     159                                <li><span class="item">ODBC32.LIB</span></li> 
     160                                <li><span class="item">ole32.lib</span></li> 
     161                                <li><span class="item">OLEAUT32.LIB</span></li> 
     162                                <li><span class="item">shell32.lib</span></li> 
     163                                <li><span class="item">user32.lib</span></li> 
     164                                <li><span class="item">uuid.lib</span></li> 
     165                                <li><span class="item">winmm.lib</span></li> 
     166                                <li><span class="item">winspool.lib</span></li> 
     167                                <li><span class="item">wsock32.lib</span></li> 
     168                          </span></ul> 
     169                          <br/>&nbsp;<br/> 
     170                          If the application is being compiled in a Unix 
     171                          environment then the following are automatically 
     172                          passed to the linker. <br> 
     173                          <ul><span class="list">                                <li><span class="item">c</span></li> 
     174                                <li><span class="item">phobos</span></li> 
     175                                <li><span class="item">m</span></li> 
     176                          </span></ul> 
     177</div> 
     178<div class="tabrow1">PathId         </div><div class="tabrow2">The name of the environment symbol used by <i>Build</i> 
     179                          when scanning for executables. <span class="eg">Example: "PATH"</span></div> 
     180<div class="tabrow1">HomePathId     </div><div class="tabrow2">The name of the environment symbol used by <i>Build</i> 
     181                          when scanning for configuration file. <span class="eg">Example: "HOME"</span></div> 
     182<div class="tabrow1">EtcPath        </div><div class="tabrow2">The name of an alternative path used by <i>Build</i> 
     183                          when scanning for configuration file. <span class="eg">Example: "c:\etc\"</span></div> 
     184<div class="tabrow1">GenDebugInfo   </div><div class="tabrow2">The switch that tells <i>Build</i> and the compiler 
     185                          to insert debugging information into the object 
     186                          files. <span class="eg">Example: "-g"</span></div> 
     187<div class="tabrow1">ModOutPrefix   </div><div class="tabrow2">If the <i>Build</i> switch <i><span class="quote">&quot;-modules&quot;</span></i> was 
     188                          used, this defines the string which <i>Build</i> will 
     189                          begin the Modules List output file with. 
     190                          <span class="eg">Example: "MODULES = \n"</span></div> 
     191<div class="tabrow1">ModOutSuffix   </div><div class="tabrow2">If the <i>Build</i> switch <i><span class="quote">&quot;-modules&quot;</span></i> was 
     192                          used, this defines the string which <i>Build</i> will 
     193                          end the Modules List output file with. 
     194                          <span class="eg">Example: ""</span></div> 
     195<div class="tabrow1">ModOutBody     </div><div class="tabrow2">If the <i>Build</i> switch <i><span class="quote">&quot;-modules&quot;</span></i> was 
     196                          used, this defines the string which <i>Build</i> will 
     197                          use as a template for each module being listed. 
     198                          <span class="eg">Example: "   $(MODULE {mod})"</span> <br/>&nbsp;<br/> 
     199                          Note that {mod} will be replaced with the module's 
     200                          name and {src} will be replaced with the source 
     201                          file's name.</div> 
     202<div class="tabrow1">ModOutDelim    </div><div class="tabrow2">If the <i>Build</i> switch <i><span class="quote">&quot;-modules&quot;</span></i> was 
     203                          used, this defines the string which <i>Build</i> will 
     204                          insert in between each listed module. 
     205                          <span class="eg">Example: "\n"</span></div> 
     206<div class="tabrow1">ModOutFile     </div><div class="tabrow2">If the <i>Build</i> switch <i><span class="quote">&quot;-modules&quot;</span></i> was 
     207                          used, this defines the output file's suffix. This 
     208                          is only used if the <i><span class="quote">&quot;-modules&quot;</span></i> switch 
     209                          did not specify an exact file name to use. In which 
     210                          case the Target name is used as a prefix and this 
     211                          string as the suffix. 
     212                          <span class="eg">Example: "_modules.ddoc  "</span></div> 
     213 
     214</ul> 
     215 
     216<p><span class="example"><i>Example:</i> </span><pre class="code">INIT:MacroExtention = bmc 
     217INIT:LinkerPath = /u2/qwerty/ 
     218INIT:AssumedLibs = c,kde,mgui 
     219</pre></p> 
     220 
     221<b>Default Values for Configuration Items</b> 
     222<table class="conftab">  <thead class="confthead">    <td class="confthcell"><i>INIT:</i> item</td><td class="confthcell">DigitalMars-Windows</td><td class="confthcell">GDC-Windows</td><td class="confthcell">DigitalMars-Unix</td><td class="confthcell">GDC-Unix</td> 
     223  </thead> 
     224  <tr class="confrow"><td class="confcell"><strong>ExeExtention</strong>&nbsp;</td><td class="confcell">exe&nbsp;</td><td class="confcell">exe&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     225  <tr class="confrow"><td class="confcell"><strong>LibExtention</strong>&nbsp;</td><td class="confcell">lib&nbsp;</td><td class="confcell">lib&nbsp;</td><td class="confcell">a&nbsp;</td><td class="confcell">a&nbsp;</td></tr> 
     226  <tr class="confrow"><td class="confcell"><strong>ObjExtention</strong>&nbsp;</td><td class="confcell">obj&nbsp;</td><td class="confcell">obj&nbsp;</td><td class="confcell">o&nbsp;</td><td class="confcell">o&nbsp;</td></tr> 
     227  <tr class="confrow"><td class="confcell"><strong>ShrLibExtention</strong>&nbsp;</td><td class="confcell">dll&nbsp;</td><td class="confcell">dll&nbsp;</td><td class="confcell">s&nbsp;</td><td class="confcell">s&nbsp;</td></tr> 
     228  <tr class="confrow"><td class="confcell"><strong>SrcExtention</strong>&nbsp;</td><td class="confcell">d&nbsp;</td><td class="confcell">d&nbsp;</td><td class="confcell">d&nbsp;</td><td class="confcell">d&nbsp;</td></tr> 
     229  <tr class="confrow"><td class="confcell"><strong>MacroExtention</strong>&nbsp;</td><td class="confcell">mac&nbsp;</td><td class="confcell">mac&nbsp;</td><td class="confcell">mac&nbsp;</td><td class="confcell">mac&nbsp;</td></tr> 
     230  <tr class="confrow"><td class="confcell"><strong>DdocExtention</strong>&nbsp;</td><td class="confcell">ddoc&nbsp;</td><td class="confcell">ddoc&nbsp;</td><td class="confcell">ddoc&nbsp;</td><td class="confcell">ddoc&nbsp;</td></tr> 
     231  <tr class="confrow"><td class="confcell"><strong>CompilerExe</strong>&nbsp;</td><td class="confcell">dmd.exe&nbsp;</td><td class="confcell">gdc.exe&nbsp;</td><td class="confcell">dmd&nbsp;</td><td class="confcell">gdc&nbsp;</td></tr> 
     232  <tr class="confrow"><td class="confcell"><strong>CompileOnly</strong>&nbsp;</td><td class="confcell">-c&nbsp;</td><td class="confcell">-c&nbsp;</td><td class="confcell">-c&nbsp;</td><td class="confcell">-c&nbsp;</td></tr> 
     233  <tr class="confrow"><td class="confcell"><strong>LinkerExe</strong>&nbsp;</td><td class="confcell">link.exe&nbsp;</td><td class="confcell">gdc.exe&nbsp;</td><td class="confcell">gcc&nbsp;</td><td class="confcell">gdmd&nbsp;</td></tr> 
     234  <tr class="confrow"><td class="confcell"><strong>ConfigFile</strong>&nbsp;</td><td class="confcell">sc.ini&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">dmd.conf&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     235  <tr class="confrow"><td class="confcell"><strong>ConfigPath</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     236  <tr class="confrow"><td class="confcell"><strong>CompilerPath</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     237  <tr class="confrow"><td class="confcell"><strong>LinkerPath</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     238  <tr class="confrow"><td class="confcell"><strong>LinkerDefs</strong>&nbsp;</td><td class="confcell">/noi/map&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     239  <tr class="confrow"><td class="confcell"><strong>LibPaths</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     240  <tr class="confrow"><td class="confcell"><strong>ConfigSep</strong>&nbsp;</td><td class="confcell">;&nbsp;</td><td class="confcell">;&nbsp;</td><td class="confcell">:&nbsp;</td><td class="confcell">:&nbsp;</td></tr> 
     241  <tr class="confrow"><td class="confcell"><strong>Librarian</strong>&nbsp;</td><td class="confcell">lib.exe&nbsp;</td><td class="confcell">ar.exe&nbsp;</td><td class="confcell">ar&nbsp;</td><td class="confcell">ar&nbsp;</td></tr> 
     242  <tr class="confrow"><td class="confcell"><strong>LibrarianOpts</strong>&nbsp;</td><td class="confcell">-c -p256&nbsp;</td><td class="confcell">-c&nbsp;</td><td class="confcell">-r&nbsp;</td><td class="confcell">-r&nbsp;</td></tr> 
     243  <tr class="confrow"><td class="confcell"><strong>VersionSwitch</strong>&nbsp;</td><td class="confcell">-version&nbsp;</td><td class="confcell">-fversion&nbsp;</td><td class="confcell">-version&nbsp;</td><td class="confcell">-fversion&nbsp;</td></tr> 
     244  <tr class="confrow"><td class="confcell"><strong>DebugSwitch</strong>&nbsp;</td><td class="confcell">-debug&nbsp;</td><td class="confcell">-fdebug&nbsp;</td><td class="confcell">-debug&nbsp;</td><td class="confcell">-fdebug&nbsp;</td></tr> 
     245  <tr class="confrow"><td class="confcell"><strong>OutFileSwitch</strong>&nbsp;</td><td class="confcell">-of&nbsp;</td><td class="confcell"><span class="quote">&quot;-o &quot;</span>&nbsp;</td><td class="confcell">-of&nbsp;</td><td class="confcell"><span class="quote">&quot;-o &quot;</span>&nbsp;</td></tr> 
     246  <tr class="confrow"><td class="confcell"><strong>ImportPath</strong>&nbsp;</td><td class="confcell">-I&nbsp;</td><td class="confcell"><span class="quote">&quot;-I &quot;</span>&nbsp;</td><td class="confcell">-I&nbsp;</td><td class="confcell"><span class="quote">&quot;-I &quot;</span>&nbsp;</td></tr> 
     247  <tr class="confrow"><td class="confcell"><strong>LinkLibSwitch</strong>&nbsp;</td><td class="confcell">-l&nbsp;</td><td class="confcell">-l&nbsp;</td><td class="confcell">-l&nbsp;</td><td class="confcell">-l-L&nbsp;</td></tr> 
     248  <tr class="confrow"><td class="confcell"><strong>LibPathSwitch</strong>&nbsp;</td><td class="confcell">-L&nbsp;</td><td class="confcell">-L&nbsp;</td><td class="confcell">-L&nbsp;</td><td class="confcell">-L&nbsp;</td></tr> 
     249  <tr class="confrow"><td class="confcell"><strong>MapSwitch</strong>&nbsp;</td><td class="confcell">-M&nbsp;</td><td class="confcell">-M&nbsp;</td><td class="confcell">-M&nbsp;</td><td class="confcell">-M&nbsp;</td></tr> 
     250  <tr class="confrow"><td class="confcell"><strong>SymInfoSwitch</strong>&nbsp;</td><td class="confcell">/co&nbsp;</td><td class="confcell">/co&nbsp;</td><td class="confcell">/co&nbsp;</td><td class="confcell">/co&nbsp;</td></tr> 
     251  <tr class="confrow"><td class="confcell"><strong>BuildImportPath</strong>&nbsp;</td><td class="confcell">-I&nbsp;</td><td class="confcell">-I&nbsp;</td><td class="confcell">-I&nbsp;</td><td class="confcell">-I&nbsp;</td></tr> 
     252  <tr class="confrow"><td class="confcell"><strong>ImportPathDelim</strong>&nbsp;</td><td class="confcell">;&nbsp;</td><td class="confcell">;&nbsp;</td><td class="confcell">;&nbsp;</td><td class="confcell">;&nbsp;</td></tr> 
     253  <tr class="confrow"><td class="confcell"><strong>OutputPath</strong>&nbsp;</td><td class="confcell">-od&nbsp;</td><td class="confcell">-od&nbsp;</td><td class="confcell">-od&nbsp;</td><td class="confcell">-od&nbsp;</td></tr> 
     254  <tr class="confrow"><td class="confcell"><strong>RunSwitch</strong>&nbsp;</td><td class="confcell">-exec&nbsp;</td><td class="confcell">-exec&nbsp;</td><td class="confcell">-exec&nbsp;</td><td class="confcell">-exec&nbsp;</td></tr> 
     255  <tr class="confrow"><td class="confcell"><strong>LibrarianPath</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     256  <tr class="confrow"><td class="confcell"><strong>ResponseExt</strong>&nbsp;</td><td class="confcell">brf&nbsp;</td><td class="confcell">brf&nbsp;</td><td class="confcell">brf&nbsp;</td><td class="confcell">brf&nbsp;</td></tr> 
     257  <tr class="confrow"><td class="confcell"><strong>DefResponseFile</strong>&nbsp;</td><td class="confcell">build.brf&nbsp;</td><td class="confcell">build.brf&nbsp;</td><td class="confcell">build.brf&nbsp;</td><td class="confcell">build.brf&nbsp;</td></tr> 
     258  <tr class="confrow"><td class="confcell"><strong>RDFName</strong>&nbsp;</td><td class="confcell">default.rdf&nbsp;</td><td class="confcell">default.rdf&nbsp;</td><td class="confcell">default.rdf&nbsp;</td><td class="confcell">default.rdf&nbsp;</td></tr> 
     259  <tr class="confrow"><td class="confcell"><strong>DefMacroDefFile</strong>&nbsp;</td><td class="confcell">build.mdf&nbsp;</td><td class="confcell">build.mdf&nbsp;</td><td class="confcell">build.mdf&nbsp;</td><td class="confcell">build.mdf&nbsp;</td></tr> 
     260  <tr class="confrow"><td class="confcell"><strong>LinkerStdOut</strong>&nbsp;</td><td class="confcell">&gt;nul&nbsp;</td><td class="confcell">&gt;nul&nbsp;</td><td class="confcell">&gt;/dev/null&nbsp;</td><td class="confcell">&gt;/dev/null&nbsp;</td></tr> 
     261  <tr class="confrow"><td class="confcell"><strong>IgnoredModules</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     262  <tr class="confrow"><td class="confcell"><strong>AssumedLibs</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     263  <tr class="confrow"><td class="confcell"><strong>PathId</strong>&nbsp;</td><td class="confcell">PATH&nbsp;</td><td class="confcell">PATH&nbsp;</td><td class="confcell">PATH&nbsp;</td><td class="confcell">PATH&nbsp;</td></tr> 
     264  <tr class="confrow"><td class="confcell"><strong>ModOutPrefix</strong>&nbsp;</td><td class="confcell"><span class="quote">&quot;MODULES = \n&quot;</span>&nbsp;</td><td class="confcell"><span class="quote">&quot;MODULES = \n&quot;</span>&nbsp;</td><td class="confcell"><span class="quote">&quot;MODULES = \n&quot;</span>&nbsp;</td><td class="confcell"><span class="quote">&quot;MODULES = \n&quot;</span>&nbsp;</td></tr> 
     265  <tr class="confrow"><td class="confcell"><strong>ModOutSuffix</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     266  <tr class="confrow"><td class="confcell"><strong>ModOutBody</strong>&nbsp;</td><td class="confcell"><span class="quote">&quot;   $(MODULE {mod})\n&quot;</span>&nbsp;</td><td class="confcell"><span class="quote">&quot;   $(MODULE {mod})\n&quot;</span>&nbsp;</td><td class="confcell"><span class="quote">&quot;   $(MODULE {mod})\n&quot;</span>&nbsp;</td><td class="confcell"><span class="quote">&quot;   $(MODULE {mod})\n&quot;</span>&nbsp;</td></tr> 
     267  <tr class="confrow"><td class="confcell"><strong>ModOutDelim</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td></tr> 
     268  <tr class="confrow"><td class="confcell"><strong>ModOutFile</strong>&nbsp;</td><td class="confcell">_modules.ddoc&nbsp;</td><td class="confcell">_modules.ddoc&nbsp;</td><td class="confcell">_modules.ddoc&nbsp;</td><td class="confcell">_modules.ddoc&nbsp;</td></tr> 
     269  <tr class="confrow"><td class="confcell"><strong>GenDebugInfo</strong>&nbsp;</td><td class="confcell">-g&nbsp;</td><td class="confcell">-g&nbsp;</td><td class="confcell">-g&nbsp;</td><td class="confcell">-g&nbsp;</td></tr> 
     270  <tr class="confrow"><td class="confcell"><strong>CompilerDefs</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">-version=Posix&nbsp;</td><td class="confcell">-fversion=Posix&nbsp;</td></tr> 
     271  <tr class="confrow"><td class="confcell"><strong>HomePathId</strong>&nbsp;</td><td class="confcell">HOME&nbsp;</td><td class="confcell">HOME&nbsp;</td><td class="confcell">HOME&nbsp;</td><td class="confcell">HOME&nbsp;</td></tr> 
     272  <tr class="confrow"><td class="confcell"><strong>EtcPath</strong>&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">&nbsp;</td><td class="confcell">/etc/&nbsp;</td><td class="confcell">/etc/&nbsp;</td></tr> 
     273</table> 
     274 
    48275<b>Environment Symbol Substitution</b> <br> 
    49276Before each configuration file option line is processed, it is first checked 
     
    51278the value of that symbol. References take the form <b>%&lt;SYMNAME&gt;%</b> 
    52279<br> 
    53 There are two special symbols: <b>@D</b> is replaced by the compiler's 
    54 path, and <b>@P</b> is replaced by the compiler's configuration file's path. 
     280There are three special symbols: <b>@D</b> is replaced by the compiler's 
     281path, <b>@P</b> is replaced by the compiler's configuration file's path, 
     282and <b>%%</b> is replaced by a single <b>%</b> character and can be used 
     283to avoid an unwanted environment symbol substitution. 
    55284 
    56285<p><span class="example"><i>Example:</i> Assuming you had set BUILDOPTS=-w -g</span><pre class="code">CMDLINE=%BUILDOPTS%    # Allow switches to be passed via enviroment symbol. 
     
    82311the command line. To apply the 'debug' group in the above example, you 
    83312place on the command line <b>+dbg</b> 
     313<br/>&nbsp;<br/> 
     314There are few optional predefined group names that are used when building 
     315for specific environments. 
     316<ul class="indent">    <pre class="cite">        [Windows] 
     317        # items that only apply when building in Windows. 
     318 
     319        [Posix] 
     320        # items that only apply when building in Posix (unix). 
     321 
     322        [DigitalMars] 
     323        # items that only apply when building with DigitalMars tools. 
     324 
     325        [GNU] 
     326        # items that only apply when building with GNU tools. 
     327 
     328        [Windows:DigitalMars] 
     329        # items that only apply when building with DigitalMars tools in Windows. 
     330 
     331        [Windows:GNU] 
     332        # items that only apply when building with GNU tools in Windows. 
     333 
     334        [Posix:DigitalMars] 
     335        # items that only apply when building with DigitalMars tools in Posix. 
     336 
     337        [Posix:GNU] 
     338        # items that only apply when building with GNU tools in Posix. 
     339    </pre> 
     340</ul> 
     341These groups are automatically used when building in the appropriate 
     342enviroments and do not explicitly have to be mentioned on the command line. 
    84343<br/>&nbsp;<br/> 
    85344<b>Comments</b> <br> 
     
    112371 
    113372 
    114 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    115 </span></body> 
     373<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     374 </span></body> 
    116375                 </html> 
  • trunk/Docs/dlls.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from dlls.d --> 
    711 
     
    3236 
    3337 
    34 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    35 </span></body> 
     38<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     39 </span></body> 
    3640                 </html> 
  • trunk/Docs/introduction.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from introduction.d --> 
    711 
     
    1115                 <a name="introduction"><h1 class="topic">Topic: Introduction</h1></a> 
    1216<p>This is a utility to build an application using the D programming language. 
    13 It does this by examining the source file supplied on the command line 
    14 to work out its dependant files, and then determines which need to be 
    15  compiled and which need to be linked to create the executable. 
     17It does this by examining the files supplied on the command line 
     18to work out what are the dependant files, and then determines which 
     19source files need to be compiled, which macro files need to be transformed, 
     20which resource files need to be generated, and which object files and 
     21libraries need to be linked to create the executable. 
    1622 
    1723Alternatively, it can be used to create a Library file rather than an 
     
    2228</p> 
    2329 
    24 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    25 </span></body> 
     30<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     31 </span></body> 
    2632                 </html> 
  • trunk/Docs/pragmas.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from pragmas.d --> 
    711 
     
    199203</p> 
    200204 
    201 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    202 </span></body> 
     205<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     206 </span></body> 
    203207                 </html> 
  • trunk/Docs/response_file.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from response_file.d --> 
    711 
     
    4650 
    4751 
    48 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    49 </span></body> 
     52<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     53 </span></body> 
    5054                 </html> 
  • trunk/Docs/rules.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from rules.d --> 
    711 
     
    1620output file. 
    1721 
    18 The default Rule Definition File is called <span class="quote">"default.rdf"</span>. It is found by 
     22The default Rule Definition File is called <span class="quote">&quot;default.rdf&quot;</span>. It is found by 
    1923first looking in the directory where the utility is installed, and if 
    2024it is not found there, the directories in the PATH environment symbol 
     
    5862 
    5963 
    60 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    61 </span></body> 
     64<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     65 </span></body> 
    6266                 </html> 
  • trunk/Docs/style.css

    r41 r44  
    209209    font-size: smaller; 
    210210} 
     211 
     212div.tabrow1 
     213{ 
     214    font-size: larger; 
     215    font-weight: bold; 
     216    background: #FFFFF0; 
     217    color: blue; 
     218    padding: 3px; 
     219    margin-right: 5%; 
     220    border: 1px solid; 
     221} 
     222 
     223div.tabrow2 
     224{ 
     225    font-size: normal; 
     226    background: #AAFFFF; 
     227    color: black; 
     228    padding-left: 2px; 
     229    padding-bottom: 2px; 
     230    margin-left: 5%; 
     231    margin-right: 5%; 
     232    border-left: 1px solid; 
     233    border-right: 1px solid; 
     234    border-bottom: 1px solid; 
     235} 
     236 
     237span.eg 
     238{ 
     239    color: gray; 
     240    padding-left: 10px; 
     241    padding-bottom: 2px; 
     242    font-style: italic; 
     243    font-size: smaller; 
     244    font-family: serif; 
     245} 
     246 
     247thead.confthead 
     248{ 
     249    font-weight: bold; 
     250    text-align: center; 
     251    font-family: sans-serif; 
     252    background: #80FFFF; 
     253} 
     254 
     255td.confcell 
     256{ 
     257    font-family: monospace; 
     258    padding-left: 0.5em; 
     259} 
     260 
     261td.confthcell 
     262{ 
     263    color: navy; 
     264} 
     265 
     266thead.macrothead 
     267{ 
     268    font-weight: bold; 
     269    text-align: center; 
     270    font-family: sans-serif; 
     271    background: #80FFFF; 
     272} 
     273 
     274td.macrothcell 
     275{ 
     276    color: navy; 
     277} 
     278 
  • trunk/Docs/switches.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from switches.d --> 
    711 
     
    187191default is to use command line arguments. 
    188192<br/>&nbsp;<br/> 
    189 This switch has three formats: <br
     193This switch has three formats: <br/>&nbsp;<br/
    190194<ul><span class="list"> <li><span class="item">-Ry to use a response file </span></li> 
    191195 <li><span class="item">-Rn to use command line arguments </span></li> 
     
    246250 
    247251<a name="switch_RDF"><h2 class="section">switch: -RDF&lt;file&gt;<span class="secdef"> 
    248      Defines a file to override the default <a href="rules">Rule Definition File</a>.</span></h2></a> 
     252     Defines a file to override the default <a href="rules.html">Rule Definition File</a>.</span></h2></a> 
    249253<ul class="indent">The default file is called <b>default.rdf</b>. But if you need to provide 
    250254an alternate file, you can use this switch. 
    251255 
    252256<p><span class="example"><i>Example:</i> </span><pre class="code">-RDFmyrules.xyz 
     257</pre></p> 
     258</ul> 
     259 
     260<a name="switch_MDF"><h2 class="section">switch: -MDF&lt;file&gt;<span class="secdef"> 
     261     Defines a file to override the default <a href="macros.html">Macro Definition File</a>.</span></h2></a> 
     262<ul class="indent">The default file is called <b>build.mdf</b>. But if you need to provide 
     263an alternate file, you can use this switch. 
     264 
     265<p><span class="example"><i>Example:</i> </span><pre class="code">-MDFmymacros.xyz 
    253266</pre></p> 
    254267</ul> 
     
    358371 
    359372 
    360 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    361 </span></body> 
     373<a name="switch_UMB"><h2 class="section">switch: -UBM=&lt;Yes/No&gt;<span class="secdef"> 
     374    Determines where the linker expects the object files.</span></h2></a> 
     375<ul class="indent">For <b>DMD</b> environments, <i>Build</i> expects that object files will be created 
     376in the same directory as the source file, or in the directory 
     377specified in any <a href="#switch_od">-od</a> switch. However, this switch 
     378can tell <i>Build</i> to expect them in the current directory. 
     379<br/>&nbsp;<br/> 
     380For <b>GDC</b> environments, <i>Build</i> expects that object files will be created 
     381in the current directory. However  this switch can tell <i>Build</i> to expect 
     382then to be in same directory as the source file, or in the directory 
     383specified in any <a href="#switch_od">-od</a> switch. 
     384<br/>&nbsp;<br/> 
     385The forms <b>-UMB, -UMB=Yes, -UMB:Yes, -UMB=Y, -UMB:Y, -UMB=, -UMB:</b> all 
     386mean the same; that the object files are expected in the current directory. 
     387Any other form of the switch (eg. <b>-UMB=No</b> ) will make the utility 
     388expect the object files to be in the same directory as the source files. 
     389<br/>&nbsp;<br/> 
     390Unless you have some special need to do this, the -UMB switch is not 
     391really required. 
     392<br/>&nbsp;<br/> 
     393<p><span class="example"><i>Example:</i> </span><pre class="code">build editor -UMB=Yes 
     394</pre></p> 
     395In the example above, the utility will expect object files to be created 
     396in the current directory. 
     397 
     398</ul> 
     399 
     400<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     401 </span></body> 
    362402                 </html> 
  • trunk/Docs/todo.html

    r41 r44  
    1 <html> 
     1<?xml version="1.0" encoding="utf-8"?> 
     2                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
     3                 <html> 
    24                 <head> 
    35                 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    4                  <link rel="stylesheet" type="text/css" href="style.css"> 
    5                  <title></title></head> 
     6                 <link rel="stylesheet" type="text/css" href="style.css" title="standard"> 
     7                 <link rel="alternate stylesheet" type="text/css" href="none.css" title="none"> 
     8                 <title></title> 
     9                 </head> 
    610                 <body><h1></h1><!-- Generated by Ddoc from todo.d --> 
    711 
     
    3539 
    3640 
    37 <br /><hr/><span class="footnote">Generated by Ddoc, Thu Apr  6 13:09:34 2006 
    38 </span></body> 
     41<br /><hr/><span class="footnote">Generated by Ddoc, Tue Jun  6 10:31:40 2006 
     42 </span></body> 
    3943                 </html> 
  • trunk/Source/build.d

    r41 r44  
    66 Authors: Derek Parnell, Melbourne 
    77 Initial Creation: January 2005 
    8  Version: 2.1
     8 Version: 3.0
    99 Date: August 2005 
    1010 License: 
     
    3434version(linux)  version = Posix; 
    3535version(darwin) version = Posix; 
     36version(DigitalMars) version(Windows) version = UseResponseFile; 
    3637 
    3738version(build) 
     
    3940    version(Windows) { 
    4041        // OptLink Definition File 
    41         pragma (build_def, "VERSION 2.10"); 
     42        pragma (build_def, "VERSION 3.00"); 
    4243    } 
    4344} 
     
    5657 
    5758    import std.c.stdio; 
     59 
    5860    import std.file; 
    5961    import std.outbuffer; 
     
    6365    import std.string; 
    6466 
    65     version(Windows) { 
     67    version(Windows) 
     68    { 
    6669        import std.c.windows.windows; 
    6770    } 
    68     else version(linux) { 
     71 
     72    version(linux) 
     73    { 
    6974        import std.c.linux.linux; 
    7075    } 
    71     else version(darwin) { 
     76 
     77    version(darwin) 
     78    { 
    7279        import std.c.darwin.darwin; 
    7380    } 
     
    7683    extern (C) 
    7784    { 
    78         char*   getenv  (char *); 
    79         int     putenv  (char *); 
    8085        int     system  (char *); 
    8186    } 
    8287 
     88    class BuildException : Error 
     89    { 
     90        this(char[] pMsg) 
     91        { 
     92            super (vAppName ~ ":" ~ pMsg); 
     93        } 
     94    } 
    8395 
    8496    // --------- enums ---------------- 
    8597    enum LibOpt {Implicit, Build, DontBuild} 
    8698 
    87     // --------- constants ---------------- 
    88     const { 
    89         version(Windows) { 
    90             char[] kExeExtention=`exe`; 
    91             char[] kLibExtention=`lib`; 
    92             char[] kObjExtention=`obj`; 
    93             char[] kShrLibExtention=`dll`; 
    94         } 
    95  
    96         version(Posix) { 
    97             char[] kExeExtention=``; 
    98             char[] kLibExtention=`a`; 
    99             char[] kObjExtention=`o`; 
    100             char[] kShrLibExtention=`s`; 
    101         } 
    102         char[] kSrcExtention=`d`; 
    103         char[] kMacroExtention=`mac`; 
    104         char[] kDdocExtention=`ddoc`; 
    105  
    106     } 
     99    // --------- internal strings ---------------- 
     100    version(Windows) { 
     101        char[] vExeExtention=`exe`; 
     102        char[] vLibExtention=`lib`; 
     103        char[] vObjExtention=`obj`; 
     104        char[] vShrLibExtention=`dll`; 
     105        char[] vLinkerStdOut = ">nul"; 
     106    } 
     107 
     108    version(Posix) { 
     109        char[] vExeExtention=``; 
     110        char[] vLibExtention=`a`; 
     111        char[] vObjExtention=`o`; 
     112        char[] vShrLibExtention=`s`; 
     113        char[] vLinkerStdOut = ">/dev/null"; 
     114    } 
     115    char[] vSrcExtention=`d`; 
     116    char[] vMacroExtention=`mac`; 
     117    char[] vDdocExtention=`ddoc`; 
    107118 
    108119    // ---------- Module scoped globals ----------- 
     
    110121        version(Windows) { 
    111122            char[] vCompilerExe=`dmd.exe`; 
    112             char[] vCompileOnlySwitch = ` -c`; 
     123            char[] vCompileOnly = `-c`; 
    113124            char[] vLinkerExe=`link.exe`; 
    114125            char[] vConfigFile=`sc.ini`; 
    115126            char[] vCompilerPath=``; 
    116127            char[] vLinkerPath=``; 
    117             char[] vLinkerDefSwitches=`/noi/map`; 
     128            char[] vLinkerDefs=`/noi/map`; 
    118129            char[] vConfigPath=``; 
    119130            char[] vLibPaths = ``; 
    120131            char[] vConfigSep = ";"; 
    121             char[] vLibrarian = `lib`; 
     132            char[] vLibrarian = `lib.exe`; 
    122133            char[] vLibrarianOpts = `-c -p256`; 
     134            char[] vHomePathId = "HOME"; 
     135            char[] vEtcPath    = ""; 
    123136        } 
    124137 
    125138        version(Posix) { 
    126139            char[] vCompilerExe=`dmd`; 
    127             char[] vCompileOnlySwitch= ` -c`; 
    128             char[] vLinkerExe=`ld`; 
     140            char[] vCompileOnly= `-c`; 
     141            char[] vLinkerExe=`gcc`; 
    129142            char[] vConfigFile=`dmd.conf`; 
    130143            char[] vCompilerPath=``; 
    131144            char[] vLinkerPath=``; 
    132             char[] vLinkerDefSwitches=`/noi/map`; 
     145            char[] vLinkerDefs=``; 
    133146            char[] vConfigPath=`/etc/`; 
    134147            char[] vLibPaths = ``; 
     
    136149            char[] vLibrarian = `ar`; 
    137150            char[] vLibrarianOpts = `-r`; 
    138         } 
    139  
    140         char[]     vVersionSwitch = "-version="; 
     151            char[] vHomePathId = "HOME"; 
     152            char[] vEtcPath    = "/etc/"; 
     153        } 
     154 
     155        char[]     vVersionSwitch = "-version"; 
    141156        char[]     vDebugSwitch = "-debug"; 
    142         char[]     vKeepPathSwitch = "-op"
     157        char[][]   vCompilerDefs
    143158        char[]     vOutFileSwitch = "-of"; 
    144         char[]     vImportPathSwitch = "-I"; 
    145         char[]     vNoLinkSwitch    = "-c"; 
     159        char[]     vImportPath = "-I"; 
     160        bool       vUseModBaseName = false; 
     161        char[]     vLinkLibSwitch = "-l"; 
     162        char[]     vSymInfoSwitch = "/co"; 
    146163    } 
    147164 
     
    149166        version(Windows) { 
    150167            char[] vCompilerExe=`gdc.exe`; 
    151             char[] vCompileOnlySwitch= ` -c`; 
     168            char[] vCompileOnly= `-c`; 
    152169            char[] vLinkerExe=`gdc.exe`; 
    153170            char[] vConfigFile=null; 
    154171            char[] vCompilerPath=``; 
    155172            char[] vLinkerPath=``; 
    156             char[] vLinkerDefSwitches=``; 
     173            char[] vLinkerDefs=``; 
    157174            char[] vConfigPath=null; 
    158175            char[] vLibPaths = ``; 
    159176            char[] vConfigSep = ";"; 
    160             char[] vLibrarian = `lib`; 
     177            char[] vLibrarian = `ar.exe`; 
    161178            char[] vLibrarianOpts = `-c`; 
     179            char[] vLinkLibSwitch = "-l"; 
     180            char[] vHomePathId = "HOME"; 
     181            char[] vEtcPath    = ""; 
    162182        } 
    163183 
    164184        version(Posix) { 
    165185            char[] vCompilerExe=`gdc`; 
    166             char[] vCompileOnlySwitch= ` -c`; 
    167             char[] vLinkerExe=`ld`; 
     186            char[] vCompileOnly= `-c`; 
     187            char[] vLinkerExe=`gdmd`; 
    168188            char[] vConfigFile=null; 
    169             char[] vCompilerPath=`/opt/gdc/bin`; 
     189            char[] vCompilerPath=``; 
    170190            char[] vLinkerPath=``; 
    171             char[] vLinkerDefSwitches=``; 
     191            char[] vLinkerDefs=``; 
    172192            char[] vConfigPath=null; 
    173193            char[] vLibPaths = ``; 
     
    175195            char[] vLibrarian = `ar`; 
    176196            char[] vLibrarianOpts = `-r`; 
    177         } 
    178         char[]     vVersionSwitch = "-fversion="; 
     197            char[] vLinkLibSwitch = "-l-L"; 
     198            char[] vHomePathId = "HOME"; 
     199            char[] vEtcPath    = "/etc/"; 
     200        } 
     201        char[]     vVersionSwitch = "-fversion"; 
    179202        char[]     vDebugSwitch = "-fdebug"; 
    180203        char[]     vOutFileSwitch = "-o "; 
    181         char[]     vKeepPathSwitch = ""; 
    182         char[]     vImportPathSwitch = "-I "; 
    183         char[]     vNoLinkSwitch    = "-c"; 
    184     } 
    185  
    186     char[]       vBuildImportPathSwitch = "-I"; 
    187     char[]       vTemporaryPathSwitch = "-od"; 
     204        char[][]   vCompilerDefs; 
     205        char[]     vImportPath = "-I "; 
     206        char[]     vSymInfoSwitch = "/co"; 
     207        /* GDC places object files in the directory from which it is called */ 
     208        bool       vUseModBaseName = true; 
     209    } 
     210 
     211    char[]       vOverrideConfigPath = ""; 
     212    char[]       vBuildImportPath = "-I"; 
     213    char[]       vImportPathDelim = ";"; 
     214    char[]       vOutputPath = "-od"; 
    188215    char[]       vRunSwitch = "-exec"; 
    189216    char[]       vLibrarianPath = ""; 
    190217    char[]*      vDelayedValue = null; 
    191218    char[]       vTemporaryPath = ""; 
     219    char[]       vLibPathSwitch = "-L"; 
     220    char[]       vMapSwitch = "-M"; 
     221    char[]       vGenDebugInfo = "-g"; 
     222    char[]       vResponseExt = "brf"; 
     223    char[]       vDefResponseFile = "build.brf"; 
     224    char[]       vDefMacroDefFile = "build.mdf"; 
     225    char[]       vUtilsConfigFile = "build.cfg"; 
     226    char[]       vRDFName = "default.rdf"; 
     227    char[]       vPathId = "PATH";   // Used to locate the environment symbol 
     228 
     229    char[]       vModOutPrefix = "MODULES = \n"; 
     230    char[]       vModOutSuffix = ""; 
     231    char[]       vModOutBody   = "    $(MODULE {mod})\n"; 
     232    char[]       vModOutDelim  = ""; 
     233    char[]       vModOutFile   = "_modules.ddoc"; 
    192234 
    193235    Bool         vTestRun; 
     
    196238    Bool         vForceCompile; 
    197239    Bool         vSilent; 
     240    Bool         vSymbols; 
    198241    Bool         vCleanup; 
    199     Bool         vVerbose; 
     242    version(BuildVerbose) Bool         vVerbose; 
    200243    Bool         vMacroInput; 
    201244    Bool         vNames; 
     
    206249    Bool         vUseResponseFile; 
    207250    Bool         vConsoleApp; 
     251 
     252    char[]       vSymbolOutName; 
    208253    char[]       vRunParms; 
    209254    char[]       vTargetExe; 
     
    213258    char[][]     vBuildDef; 
    214259    char[][]     vDefaultLibs; 
    215     char[][]     vDefaultCompArgs; 
    216260    LibOpt       vLibraryAction = LibOpt.Implicit; 
    217261    char[]       vAppPath; 
    218262    char[]       vAppName; 
    219     char[]       vAppVersion = "2.10"; 
     263    char[]       vAppVersion = "3.00"; 
    220264    char[]       vTargetName;           // Output name from first file name. 
    221265    char[]       vPragmaTargetName;     // Output name from pragma. 
     
    227271    char[][]     vCompilerArgs;         // Arguments passed to compiler 
    228272    char[][]     vSourceScanList;       // The list of places to find source files. 
    229     char[]       vRDFName = "default.rdf"; 
    230     bool[char[]] vNestedDelim; 
    231273    struct ExternRef 
    232274    { 
     
    236278    ExternRef[]  vExternals; 
    237279 
    238     Substitute[] vSubstitutions; 
    239  
    240  
    241     const static char[] kPathId = "PATH";   // Used to locate the environment symbol 
    242280 
    243281    version(Windows) 
     
    254292//------------------------------------------------------- 
    255293{ 
    256     source.ActivateVersion("build"); //todo 
    257  
    258     vDefaultCompArgs ~= vKeepPathSwitch;     // Keep object files in same folder as source. 
    259     vModulesToIgnore ~= "phobos";  // Assume phobos will be ignored. 
     294    // Force the 'build' version to be active. 
     295    source.ActivateVersion("build"); 
     296 
    260297    vSourceScanList ~= "." ~ std.path.sep; 
    261298    vNoLink = False; 
     
    265302    vSilent = False; 
    266303    vCleanup = False; 
    267     vVerbose = False; 
     304    version(BuildVerbose) vVerbose = False; 
    268305    vMacroInput = True; 
    269306    vNames = False; 
     
    273310    vExecuteProgram = False; 
    274311    vUseResponseFile = False; 
     312    vSymbols = False; 
    275313    vConsoleApp = True; 
    276314 
    277     version(Posix){ 
    278         vDefaultCompArgs ~= vVersionSwitch ~ "Posix"; // Until such time as this is standard in dmd. 
     315    version(Posix) 
     316    { 
     317        vCompilerDefs ~= vVersionSwitch ~ "=Posix"; // Until such time as this is standard in dmd. 
    279318    } 
    280319 
     
    284323     } 
    285324 
    286     version(DigitalMars) { 
    287         version(Windows) { 
    288             vUseResponseFile = True; 
    289         } 
    290         else 
    291         { 
    292             vUseResponseFile = False; 
    293         } 
    294      } else 
    295      { 
    296         vUseResponseFile = False; 
    297      } 
    298  
    299     vNestedDelim["("] = true; 
    300     vNestedDelim["<"] = true; 
    301     vNestedDelim["{"] = true; 
    302     vNestedDelim["["] = true; 
    303 
    304  
    305 static ~this() 
    306 
    307     // Clean up any resources held by the source files. 
    308     Source.Finalize(); 
     325    vUseResponseFile = False; 
     326    version(UseResponseFile) vUseResponseFile = True; 
     327 
     328    util.str.SetEnv("@P", std.path.getDirName(vConfigPath)); 
     329    util.str.SetEnv("@D", std.path.getDirName(vCompilerPath)); 
     330 
     331    Source.UseModBaseName(vUseModBaseName); 
    309332} 
    310333 
     
    370393    writefln("  -LIBPATH=<pathlist> Used to add a semi-colon delimited list"); 
    371394    writefln("                of search paths for library files."); 
     395    writefln("  -MDF<path> Overrides the default Macro Definition File"); 
    372396    writefln("  -test      Does everything as normal except it displays the commands"); 
    373397    writefln("              instead of running them."); 
    374398    writefln("  -RDF<path> Overrides the default Rule Definition File"); 
    375     writefln("  -R<y|n>    Indicates whether to use a response file or command line"); 
     399    writefln("  -R=<Yes|No> Indicates whether to use a response file or command line"); 
    376400    writefln("              arguments with the compiler tools."); 
    377     writefln("               -Ry will cause a response to be used."); 
    378     writefln("               -Rn will cause command line arguments to be used."); 
     401    writefln("               -R=Yes will cause a response to be used."); 
     402    writefln("               -R=No will cause command line arguments to be used."); 
    379403    writefln("               -R will reverse the current usage."); 
    380404    writefln("  -PP<path>  Add a path to the Source Search List"); 
    381405 
    382   version(DigitalMars) { 
    383    version(Windows) { 
    384     writefln("               ** The default is to use a response file"); } 
    385    else { 
    386     writefln("               ** The default is to use command line arguments"); } 
    387   } 
    388   else { 
    389     writefln("               ** The default is to use command line arguments"); } 
     406  version(UseResponseFile) 
     407    writefln("               ** The default is to use a response file"); 
     408  else 
     409    writefln("               ** The default is to use command line arguments"); 
    390410 
    391411    writefln("  -exec<param> If the link is successful, this will cause the"); 
     
    410430    writefln("  -info      Displays the version and path of the Build application."); 
    411431    writefln("  -nodef    Prevents a Module Definition File from being created."); 
     432    writefln("  -UMB=<Yes/No> If 'Yes' this forces the utility to expect"); 
     433    writefln("            the object file to be created or residing in the current"); 
     434    writefln("            directory."); 
    412435    writefln("  [...]      All other options, objectfiles and libraries are"); 
    413436    writefln("              passed to the compiler"); 
     
    425448 
    426449//------------------------------------------------------- 
     450int RunCommand(char[] pExeName, char[] pCommand) 
     451//------------------------------------------------------- 
     452{ 
     453    if (util.fileex.FileExists(pExeName) == false) 
     454    { 
     455        throw new BuildException(std.string.format("Cannot find application '%s' to run", pExeName)); 
     456    } 
     457    return RunCommand(pExeName ~ " " ~ pCommand); 
     458} 
     459 
     460//------------------------------------------------------- 
    427461int RunCommand(char[] pCommand) 
    428462//------------------------------------------------------- 
     
    439473 
    440474 
    441         if(vVerbose == True) { 
    442             writefln("Running '%s'",pCommand); 
     475        version(BuildVerbose) 
     476        { 
     477            if(vVerbose == True) 
     478                writefln("Running '%s'",pCommand); 
    443479        } 
    444480 
     
    447483        version(Windows) lTrueRC = lRC; 
    448484 
    449         if(vVerbose == True) { 
    450             if (lTrueRC == 0){ 
    451                 writefln("Successful"); 
    452             } else { 
    453                 writefln("Failed. Return code: %04x",lRC); 
     485        version(BuildVerbose) 
     486        { 
     487            if(vVerbose == True) { 
     488                if (lTrueRC == 0){ 
     489                    writefln("Successful"); 
     490                } else { 
     491                    writefln("Failed. Return code: %04x",lRC); 
     492                } 
    454493            } 
    455494        } 
    456495        return lTrueRC; 
    457496    } 
    458 } 
    459  
    460 //------------------------------------------------------- 
    461 char[] GetEnv(char[] pSymbol) 
    462 //------------------------------------------------------- 
    463 { 
    464     return std.string.toString(getenv(pSymbol)); 
    465497} 
    466498 
     
    474506    FileDateTime lModsTime = new FileDateTime(); 
    475507 
    476     foreach(int i, char[] lFileName; Source.ScanOrder
     508    foreach(int i, Source lSource; Source
    477509    { 
    478510        // Get the next Source object to examine. 
    479         lSource = Source.SourceIndex[lFileName]; 
    480511        if (lSource.Ignore) 
    481512            continue; 
     
    484515        lSource.search(); 
    485516 
    486         if(vVerbose == True) { 
    487             writefln("source file[%d] %s", i, 
    488                     util.pathex.AbbreviateFileName(lFileName)); 
    489         } 
    490         else if(vNames == True) { 
    491             writefln(" [ %s ]", util.pathex.AbbreviateFileName(lFileName)); 
     517        version(BuildVerbose) 
     518        { 
     519            if(vVerbose == True) { 
     520                writefln("source file[%d] %s", i, 
     521                        util.pathex.AbbreviateFileName(lSource.FileName)); 
     522            } 
     523            else if(vNames == True) { 
     524                writefln(" [ %s ]", util.pathex.AbbreviateFileName(lSource.FileName)); 
     525            } 
     526        } else { 
     527            if(vNames == True) { 
     528                writefln(" [ %s ]", util.pathex.AbbreviateFileName(lSource.FileName)); 
     529            } 
    492530        } 
    493531 
    494532        if (lSource.DependantsTime > lModsTime) 
    495533        { 
    496             if(vVerbose == True) { 
    497                 writefln("Newer time: from %s to %s", 
    498                     lModsTime.toString(), 
    499                     lSource.DependantsTime.toString() 
    500                     ); 
     534            version(BuildVerbose) 
     535            { 
     536                if(vVerbose == True) 
     537                    writefln("Newer time: from %s to %s", 
     538                                lModsTime.toString(), 
     539                                lSource.DependantsTime.toString() 
     540                            ); 
    501541            } 
    502542 
     
    510550        FileDateTime lLinkTime = GetFileTime(lFileName); 
    511551 
    512         if(vVerbose == True) { 
    513             writefln("link file[%d] %s %s", i, 
    514                     util.pathex.AbbreviateFileName(lFileName), lLinkTime.toString()); 
    515         } 
    516         else if(vNames == True) { 
    517             writefln(" [ %s ]", util.pathex.AbbreviateFileName(lFileName)); 
    518         } 
    519  
     552        version(BuildVerbose) 
     553        { 
     554            if(vVerbose == True) { 
     555                writefln("link file[%d] %s %s", i, 
     556                        util.pathex.AbbreviateFileName(lFileName), lLinkTime.toString()); 
     557            } 
     558            else if(vNames == True) { 
     559                writefln(" [ %s ]", util.pathex.AbbreviateFileName(lFileName)); 
     560            } 
     561        } else { 
     562            if(vNames == True) { 
     563                writefln(" [ %s ]", util.pathex.AbbreviateFileName(lFileName)); 
     564            } 
     565        } 
    520566        if (lLinkTime > lModsTime) 
    521567        { 
    522             if(vVerbose == True) { 
    523                 writefln("Newer time: from %s to %s", 
    524                     lModsTime.toString(), 
    525                     lLinkTime.toString() 
    526                     ); 
     568            version(BuildVerbose) 
     569            { 
     570                if(vVerbose == True) 
     571                    writefln("Newer time: from %s to %s", 
     572                                lModsTime.toString(), 
     573                                lLinkTime.toString() 
     574                            ); 
    527575            } 
    528576 
     
    554602 
    555603    lRuleDefnFile = util.pathex.LocateFile(vRDFName, 
    556                         getDirName(vAppPath) ~ std.path.pathsep ~ GetEnv(kPathId)); 
    557     if (vVerbose == True) 
    558         writefln("Rule Definitions from %s", lRuleDefnFile); 
     604                        getDirName(vAppPath) ~ std.path.pathsep ~ util.str.GetEnv(vPathId)); 
     605    version(BuildVerbose) 
     606    { 
     607        if (vVerbose == True) 
     608            writefln("Rule Definitions from %s", lRuleDefnFile); 
     609    } 
     610 
    559611    GetTextLines( lRuleDefnFile, lRuleText ); 
    560612    foreach(char[] lLine; lRuleText) 
     
    577629    } 
    578630 
    579     if (vVerbose == True) 
     631    version(BuildVerbose) if (vVerbose == True) 
    580632    { 
    581633        foreach(Rule r; lRules) 
     
    626678        lInFile = util.pathex.LocateFile(lInFile, vImportRoots); 
    627679        if (! util.fileex.FileExists( lInFile ) ) 
    628             throw new Exception( 
     680            throw new BuildException( 
    629681                std.string.format("External file '%s' not found", lInFile)); 
    630682 
     
    685737    char[]      lDefName; 
    686738    char[]      lOutText; 
    687    char[]      lCompilerOpts; 
     739    char[]      lCompilerOpts; 
    688740    char[]      lSourcesToCompile; 
    689741    char[]      lCommand; 
     
    699751    foreach( char[] lFile; vCmdLineSourceFiles) 
    700752    { 
    701         new Source(GetFullPathname(lFile, vSourceScanList)); 
     753        lFile = GetFullPathname(lFile, vSourceScanList); 
     754        if (std.path.getExt(lFile) == vMacroExtention) 
     755        { 
     756            version(BuildVerbose) 
     757            { 
     758                if (vVerbose == True) 
     759                    writefln("Macro file '%s' being processed.", lFile); 
     760            } 
     761 
     762            char[] lAltFile = std.path.addExt( lFile, vSrcExtention); // Make it a D source file. 
     763            if (util.macro.ConvertFile(lFile, "build", lAltFile)) 
     764                lFile = lAltFile; 
     765            else 
     766            { 
     767                version(BuildVerbose) 
     768                { 
     769                    if ((vSilent != True) || (vVerbose == True)) 
     770                        writefln("Macro file '%s' failed to generate output", lFile); 
     771                } else { 
     772                    if (vSilent != True) 
     773                        writefln("Macro file '%s' failed to generate output", lFile); 
     774                } 
     775                lFile.length = 0; 
     776            } 
     777        } 
     778 
     779        if (lFile.length > 0) 
     780        { 
     781            new Source(lFile); 
     782        } 
    702783    } 
    703784 
     
    727808    // default target name. 
    728809    if (vPragmaTargetName.length != 0) 
     810    { 
    729811        vTargetName = vPragmaTargetName; 
     812        version(BuildVerbose) 
     813        { 
     814            if(vVerbose == True) 
     815                writefln("Pragma target override is '%s'", std.path.getName(vTargetName)); 
     816        } 
     817 
     818    } 
    730819 
    731820    // If a target name was supplied on the command line, use that 
     
    733822    if (vCommandTargetName.length != 0) 
    734823    { 
    735         char[] lBaseName; 
    736  
    737         lBaseName = vTargetName.dup; 
    738         for(int i = lBaseName.length-1; i >= 0; i--) 
    739         { 
    740             if (lBaseName[i] == '.') 
    741             { 
    742                 lBaseName.length = i; 
    743                 break; 
    744             } 
    745         } 
    746         vTargetName = Expand(vCommandTargetName, "Target=" ~  lBaseName); 
     824        vTargetName = util.str.Expand(vCommandTargetName, "Target=" ~ 
     825            util.pathex.GetBaseName(vTargetName)); 
     826        version(BuildVerbose) 
     827        { 
     828            if(vVerbose == True) 
     829                writefln("Cmdline target override is '%s'", vTargetName); 
     830        } 
    747831    } 
    748832 
     
    753837    if (vLibraryAction == LibOpt.Build) 
    754838        // Target is a library. 
    755         lTargetName = ReplaceExtention(vTargetName, kLibExtention); 
     839        lTargetName = ReplaceExtention(vTargetName, vLibExtention); 
    756840 
    757841    else if (vNoLink == False) 
    758    
     842   
    759843        if (Source.WasMainFound) 
    760844            if (Source.WasMainDLL) 
    761845                // Target is a shared library. 
    762                 lTargetName = ReplaceExtention(vTargetName, kShrLibExtention); 
     846                lTargetName = ReplaceExtention(vTargetName, vShrLibExtention); 
    763847            else 
    764848            { 
    765849                // Target is an executable 
    766                 lTargetName = ReplaceExtention(vTargetName, kExeExtention); 
     850                lTargetName = ReplaceExtention(vTargetName, vExeExtention); 
    767851                vTargetExe = lTargetName; 
    768852            } 
     
    772856            // so assume they know what they are doing and also assume an 
    773857            // executable is required. 
    774             lTargetName = ReplaceExtention(vTargetName, kExeExtention); 
     858            lTargetName = ReplaceExtention(vTargetName, vExeExtention); 
    775859            vTargetExe = lTargetName; 
    776860        } 
    777    
     861   
    778862    else 
    779863        // Not linking and not archiving, so no target is required. 
     
    787871 
    788872        // Show user if required to. 
    789         if((vVerbose == True) || (vNames == True) ) { 
    790             writefln("\nBuilding target '%s'", lTargetName); 
     873        version(BuildVerbose) 
     874        { 
     875            if((vVerbose == True) || (vNames == True) ) 
     876                writefln("\nBuilding target '%s'", lTargetName); 
    791877        } 
    792878 
     
    799885        // rebuild the target. 
    800886        lTargetTime = util.fdt.GetFileTime (lTargetName); 
    801         if(vVerbose == True) { 
    802             writefln("Time %s for %s (target)", lTargetTime.toString(), lTargetName); 
    803             writefln("Time %s (most recent)", lMostRecentTime.toString()); 
    804         } 
     887        version(BuildVerbose) 
     888        { 
     889            if(vVerbose == True) { 
     890                writefln("Time %s for %s (target)", lTargetTime.toString(), lTargetName); 
     891                writefln("Time %s (most recent)", lMostRecentTime.toString()); 
     892            } 
     893        } 
     894 
    805895        if(lTargetTime < lMostRecentTime) { 
    806896            lBuildRequired = True; 
    807897        } 
    808898    } 
    809     else if((vVerbose == True) || (vNames == True) ) { 
    810             writefln("\nCompiling only. No target will be built."); 
    811         } 
     899    else 
     900    { 
     901        version(BuildVerbose) 
     902        { 
     903            if((vVerbose == True) || (vNames == True) ) 
     904                writefln("\nCompiling only. No target will be built."); 
     905        } else { 
     906            if(vNames == True) 
     907                writefln("\nCompiling only. No target will be built."); 
     908        } 
     909    } 
    812910 
    813911    // Run any external tools referenced in the source files. 
     
    820918    } 
    821919 
    822     if (Source.SourceIndex.length == 0) 
     920    if (Source.FileCount == 0) 
    823921    { 
    824922        /* It is possible to only have object and library 
     
    832930        { 
    833931            // Only include OBJECT files. 
    834             if (util.str.ends(lFileName , kObjExtention) == True) 
     932            if (util.str.ends(lFileName , vObjExtention) == True) 
    835933                lFilesToLink ~= lFileName; 
    836934        } 
    837935    } 
    838     else foreach (int i, char[] lFileName; Source.ScanOrder
     936    else foreach(int i, Source lCurrentSource; Source
    839937    { 
    840938        // Check each source to see if we need to recompile it. 
    841         Source lCurrentSource; 
    842939        Bool lNeedsCompiling; 
    843940        char[] lShortFileName; 
     
    846943        lNeedsCompiling = vForceCompile; 
    847944 
    848         lCurrentSource = Source.SourceIndex[lFileName]; 
    849945        if (lCurrentSource.Ignore) 
    850946            continue; 
    851947 
    852         lShortFileName = util.pathex.AbbreviateFileName(lFileName); 
     948        lShortFileName = util.pathex.AbbreviateFileName(lCurrentSource.FileName); 
    853949        lFileType = std.path.getExt(lShortFileName); 
    854         if (lFileType != kSrcExtention && lFileType != kDdocExtention) 
     950        if (lFileType != vSrcExtention && lFileType != vDdocExtention) 
    855951            continue; 
    856952 
    857953        // Only source files are examined from here on. 
    858         if (lCurrentSource.NoLink || lFileType == kDdocExtention) 
     954        if (lCurrentSource.NoLink || lFileType == vDdocExtention) 
    859955        { 
    860956            lNonLinkingSources ~= lCurrentSource; 
     
    863959        if(lCurrentSource.FilesTime > lCurrentSource.ObjectsTime) 
    864960        { 
    865             if (vVerbose == True) 
    866                 writefln("%s newer than its object file", lShortFileName); 
     961            version(BuildVerbose) 
     962            { 
     963                if (vVerbose == True) 
     964                    writefln("%s newer than its object file", lShortFileName); 
     965            } 
     966 
    867967            lNeedsCompiling = True; 
    868968 
    869969        } else if(lCurrentSource.DependantsTime > lCurrentSource.ObjectsTime) { 
    870             if (vVerbose == True) 
    871                 writefln("%s has newer dependants than its object file.", 
     970            version(BuildVerbose) 
     971            { 
     972                if (vVerbose == True) 
     973                    writefln("%s has newer dependants than its object file.", 
    872974                                lShortFileName); 
     975            } 
    873976 
    874977            lNeedsCompiling = True; 
     
    885988                lFilesToLink ~= util.pathex.AbbreviateFileName(lCurrentSource.ObjectName); 
    886989 
    887             if (vTestRun == False) 
    888             { 
    889                 if (lCurrentSource.IncrementBuildNumber()) 
    890                 { 
    891                     if (vVerbose == True) 
    892                         writefln("New build number %d for %s", 
    893                                lCurrentSource.BuildNumber, 
    894                                lCurrentSource.ModuleName); 
    895  
     990            version(BuildVerbose) 
     991            { 
     992                if (vTestRun == False) 
     993                { 
     994                    if (lCurrentSource.IncrementBuildNumber()) 
     995                    { 
     996                        if (vVerbose == True) 
     997                            writefln("New build number %d for %s", 
     998                                       lCurrentSource.BuildNumber, 
     999                                        lCurrentSource.ModuleName); 
     1000                     } 
    8961001                } 
    8971002            } 
     
    9261031                AddBuildDef("SUBSYSTEM WINDOWS"); 
    9271032            vDefaultLibs ~= "gdi32.lib"; 
     1033            vDefaultLibs ~= "advapi32.lib"; 
     1034            vDefaultLibs ~= "COMCTL32.LIB"; 
     1035            vDefaultLibs ~= "comdlg32.lib"; 
     1036            vDefaultLibs ~= "CTL3D32.LIB"; 
     1037            vDefaultLibs ~= "kernel32.lib"; 
     1038            vDefaultLibs ~= "ODBC32.LIB"; 
     1039            vDefaultLibs ~= "ole32.lib"; 
     1040            vDefaultLibs ~= "OLEAUT32.LIB"; 
     1041            vDefaultLibs ~= "shell32.lib"; 
     1042            vDefaultLibs ~= "user32.lib"; 
     1043            vDefaultLibs ~= "uuid.lib"; 
     1044            vDefaultLibs ~= "winmm.lib"; 
     1045            vDefaultLibs ~= "winspool.lib"; 
     1046            vDefaultLibs ~= "wsock32.lib"; 
    9281047        } 
    9291048        else if (Source.WasMainDLL) { 
     
    9541073    } 
    9551074 
    956     version(Posix) 
    957     { 
    958             vDefaultLibs ~= "c"; 
    959     } 
    960     // Add any library or external obj files required. 
    961     if (lLinking == True) 
    962     { 
    963         lLibraryFiles.length = 0; 
    964  
    965         foreach (char[] lFileName; vLinkFiles.keys) 
    966         { 
    967             char[] lCmdItem; 
    968  
    969             if (lFileName.length > 0) 
    970             { 
    971                 lCmdItem = lFileName; 
    972                 if ( util.str.ends(lCmdItem, "." ~ kLibExtention) == True) 
    973                 { 
    974                     // Cut off extention. 
    975                     lCmdItem.length = lCmdItem.length - kLibExtention.length - 1; 
    976 //                        lPrefix = "-L-l"; // Needed for linker to find the library. 
    977                     lLibraryFiles ~= lCmdItem; 
    978                 } 
    979                 else 
    980                 { 
    981                     lFilesToLink ~= lCmdItem; 
    982                 } 
     1075    // Add any library and any external object files required. 
     1076    lLibraryFiles.length = 0; 
     1077    foreach (char[] lFileName; vLinkFiles.keys) 
     1078    { 
     1079        char[] lCmdItem; 
     1080 
     1081        if (lFileName.length > 0) 
     1082        { 
     1083            lCmdItem = lFileName; 
     1084            if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True) 
     1085            { 
     1086                // Cut off extention. 
     1087                lCmdItem.length = lCmdItem.length - vLibExtention.length - 1; 
     1088                lLibraryFiles ~= lCmdItem; 
     1089            } 
     1090            else 
     1091            { 
     1092                lFilesToLink ~= lCmdItem; 
    9831093            } 
    9841094        } 
     
    9901100        if (lSourcesToCompile.length > 0) 
    9911101        { 
    992            // Ok, I have some compiling to do! 
     1102            // Ok, I have some compiling to do! 
    9931103            char[] lCommandLine; 
    9941104 
     
    9961106 
    9971107            if (vUseResponseFile == True) 
    998            
     1108           
    9991109                lDResponseFileName = ReplaceExtention(lTargetName, "rsp"); 
    10001110                if (vTemporaryPath.length != 0) 
     
    10041114                lDResponseFileName = util.pathex.AbbreviateFileName(lDResponseFileName); 
    10051115                util.fileex.CreateTextFile(lDResponseFileName,lCommandLine); 
    1006                 lCommand = vCompilerPath ~ vCompilerExe ~ vCompileOnlySwitch ~ " @" ~ lDResponseFileName; 
     1116                lCommand = vCompileOnly ~ " @" ~ lDResponseFileName; 
    10071117            } 
    10081118            else 
    10091119            {   // using commandline; may run into limits 
    10101120                lCommandLine=std.string.replace(lCommandLine, "\n", " "); 
    1011                 lCommand = vCompilerPath ~ vCompilerExe  ~ vCompileOnlySwitch ~ " " ~ lCommandLine; 
    1012             } 
    1013  
    1014             if (vVerbose == True) { 
    1015                 writefln("Compiling with ..........\n%s\n", lCommandLine); 
     1121                lCommand = vCompileOnly ~ " " ~ lCommandLine; 
     1122            } 
     1123 
     1124            version(BuildVerbose) 
     1125            { 
     1126                if (vVerbose == True) 
     1127                    writefln("Compiling with ..........\n%s\n", lCommandLine); 
    10161128            } 
    10171129 
    10181130            // Run Compiler to compile the source files that need it. 
    1019             lRunResult = RunCommand(lCommand); 
     1131            lRunResult = RunCommand(vCompilerPath ~ vCompilerExe, lCommand); 
    10201132            if (lRunResult != 0) 
    10211133                vExecuteProgram = False; 
    10221134        } 
    10231135 
    1024        // LINK phase ... 
    1025        if ( (lRunResult == 0) && (lFilesToLink.length > 0) && (lLinking == True)) 
     1136        // LINK phase ... 
     1137        if ( (lRunResult == 0) && (lFilesToLink.length > 0) && (lLinking == True)) 
    10261138        { 
    10271139            char[] lCommandLine; 
     
    10311143            // Build the command line for the linker. 
    10321144            lCommandLine = ""; 
    1033             version(Windows) 
    1034             { 
    1035                 // Transfer linker switches from Compiler switches. 
    1036                 foreach (char[] lCompileArg; vCompilerArgs) 
    1037                 { 
    1038                     if (util.str.begins(lCompileArg, "-L") == True) 
    1039                     { 
    1040                         lLinkerSwitches ~= lCompileArg[2..$]; 
    1041                     } 
    1042                 } 
    1043                 foreach( char[] lSwitch; std.string.split(vLinkerDefSwitches ~ lLinkerSwitches, "/")) 
    1044                 { 
    1045                     if (lSwitch == "nomap") 
    1046                     { 
    1047                         IsMapping = False; 
    1048                     } 
    1049                     else if (lSwitch == "map") 
    1050                     { 
    1051                         IsMapping = True; 
    1052                     } 
    1053                 } 
    1054  
    1055                 // (1) Gather the object file names 
    1056                 foreach(char[] lFile; lFilesToLink) 
    1057                 { 
    1058                     lCommandLine ~= lFile ~ "+"; 
    1059                 } 
    1060                 if (lCommandLine.length > 0) 
    1061                     lCommandLine[$-1] = '\n'; 
    1062  
    1063                 // (2) Set the output file name 
    1064                 lCommandLine ~= util.str.enquote(util.pathex.AbbreviateFileName(lTargetName)) ~ "\n"; 
    1065  
    1066                 // (3) Set the map name 
    1067                 if (IsMapping == True) 
    1068                     lCommandLine ~= ReplaceExtention(lTargetName, "map"); 
    1069  
    1070                 lCommandLine ~= "\n"; 
    1071  
    1072                 // (4) Gather the libraries names. 
    1073                 // Include the default libraries first. 
    1074                 lLibraryFiles = vDefaultLibs ~ lLibraryFiles; 
    1075                 if (lLibraryFiles.length > 0) 
    1076                 { 
    1077                     foreach( char[] lLib; lLibraryFiles) 
    1078                     { 
    1079                         lCommandLine ~= util.str.enquote(lLib) ~"+"; 
    1080                     } 
    1081                     lCommandLine[$-1] = '\n'; 
    1082                 } 
    1083                 else 
    1084                     lCommandLine ~= "\n"; 
    1085  
    1086                 // Include the explictly named libraries. 
    1087                 if (vLibPaths.length > 1) 
    1088                 { 
    1089                     if (vLibPaths[0..1] == vConfigSep) 
    1090                         vLibPaths = vLibPaths[1..$]; 
    1091  
    1092                     // Include the paths to the libraries. 
    1093                     if (vVerbose == True) 
    1094                         writefln("Setting LIB=%s", vLibPaths); 
    1095                     putenv("LIB=" ~ vLibPaths[1..$]); 
    1096                 } 
    1097  
    1098                 // (5) Set the 'def' file name 
    1099                 if (lDefName.length > 0) 
    1100                     lCommandLine ~= util.str.enquote(lDefName) ~ "\n"; 
    1101                 else 
    1102                     lCommandLine ~= "\n"; 
    1103  
    1104                 // (6) Gather the resource file names 
    1105  
    1106                 // (7) Gather then switches 
    1107                 lCommandLine ~= vLinkerDefSwitches; 
    1108                 lCommandLine ~= lLinkerSwitches; 
    1109                 lCommandLine ~= "\n"; 
    1110             } 
    1111  
    1112             version(Posix) 
    1113             { 
    1114                 // Transfer linker switches from Compiler switches. 
    1115                 foreach (char[] lCompileArg; vCompilerArgs) 
    1116                 { 
    1117                     if (util.str.begins(lCompileArg, "-L") == True) 
    1118                     { 
    1119                         lLinkerSwitches ~= lCompileArg[2..$]; 
    1120                     } 
    1121                 } 
    1122                 foreach( char[] lSwitch; std.string.split(vLinkerDefSwitches ~ lLinkerSwitches, "/")) 
    1123                 { 
    1124                     if (lSwitch == "nomap") 
    1125                     { 
    1126                         IsMapping = False; 
    1127                     } 
    1128                     else if (lSwitch == "map") 
    1129                     { 
    1130                         IsMapping = True; 
    1131                     } 
    1132                 } 
    1133  
    1134                 // (1) Gather the object file names 
    1135                 foreach(char[] lFile; lFilesToLink) 
    1136                 { 
    1137                     lCommandLine ~= lFile ~ "\n"; 
    1138                 } 
    1139  
    1140                 // (2) Set the output file name 
    1141                 lCommandLine ~= "-o " ~ util.str.enquote(util.pathex.AbbreviateFileName(lTargetName)) ~ "\n"; 
    1142  
    1143                 // (3) Set the map name 
    1144                 if (IsMapping == True) 
    1145                     lCommandLine ~= "-M\n"; 
    1146  
    1147                 // (4) Gather the libraries names. 
    1148                 // Include the default libraries first. 
    1149                 foreach( char[] lLib; vDefaultLibs ~ lLibraryFiles) 
    1150                 { 
    1151                     lCommandLine ~= "-l" ~ util.str.enquote(lLib) ~ "\n"; 
    1152                 } 
    1153  
    1154                 if (vLibPaths.length > 1) 
    1155                 { 
    1156                     if (vLibPaths[0..1] == vConfigSep) 
    1157                         vLibPaths = vLibPaths[1..$]; 
    1158  
    1159                     // Include the paths to the libraries. 
    1160                     if (vVerbose == True) 
    1161                         writefln("Setting LIB=%s", vLibPaths); 
    1162                     char[][] lLibPaths; 
    1163                     lLibPaths = std.string.split(vLibPaths, vConfigSep); 
    1164                     foreach(char[] lLib; lLibPaths) 
    1165                     { 
    1166                         if (lLib.length > 0) 
    1167                             lCommandLine ~= "-L" ~ util.str.enquote(lLib) ~ "\n"; 
    1168                     } 
    1169                 } 
    1170  
    1171                 // (4) Gather then switches 
    1172                 lCommandLine ~= vLinkerDefSwitches; 
    1173                 lCommandLine ~= lLinkerSwitches; 
    1174                 lCommandLine ~= "\n"; 
    1175             } 
     1145            version(Windows) 
     1146            { 
     1147                // Transfer linker switches from Compiler switches. 
     1148                foreach (char[] lCompileArg; vCompilerArgs) 
     1149                { 
     1150                    if (util.str.begins(lCompileArg, "-L") == True) 
     1151                    { 
     1152                        lLinkerSwitches ~= lCompileArg[2..$]; 
     1153                    } 
     1154                } 
     1155                foreach( char[] lSwitch; std.string.split(vLinkerDefs ~ lLinkerSwitches, "/")) 
     1156                { 
     1157                    if (lSwitch == "nomap") 
     1158                    { 
     1159                        IsMapping = False; 
     1160                    } 
     1161                    else if (lSwitch == "map") 
     1162                    { 
     1163                        IsMapping = True; 
     1164                    } 
     1165                } 
     1166 
     1167                // (1) Gather the object file names 
     1168                foreach(char[] lFile; lFilesToLink) 
     1169                { 
     1170                    // Only include OBJECT files. 
     1171                    if (std.path.getExt(lFile) == vObjExtention) 
     1172                        lCommandLine ~= lFile ~ "+"; 
     1173                } 
     1174                if (lCommandLine.length > 0) 
     1175                    lCommandLine[$-1] = '\n'; 
     1176 
     1177                // (2) Set the output file name 
     1178                lCommandLine ~= util.str.enquote(util.pathex.AbbreviateFileName(lTargetName)) ~ "\n"; 
     1179 
     1180                // (3) Set the map name 
     1181                if (IsMapping == True) 
     1182                    lCommandLine ~= ReplaceExtention(lTargetName, "map"); 
     1183 
     1184                lCommandLine ~= "\n"; 
     1185 
     1186                // (4) Gather the libraries names. 
     1187                // Include the default libraries first. 
     1188                lLibraryFiles = vDefaultLibs ~ lLibraryFiles; 
     1189                if (lLibraryFiles.length > 0) 
     1190                { 
     1191                    foreach( char[] lLib; lLibraryFiles) 
     1192                    { 
     1193                        lCommandLine ~= util.str.enquote(lLib) ~"+"; 
     1194                    } 
     1195                    lCommandLine[$-1] = '\n'; 
     1196                } 
     1197                else 
     1198                    lCommandLine ~= "\n"; 
     1199 
     1200                // Include the explictly named libraries. 
     1201                if (vLibPaths.length > 1) 
     1202                { 
     1203                    if (vLibPaths[0..1] == vConfigSep) 
     1204                        vLibPaths = vLibPaths[1..$]; 
     1205 
     1206                    // Include the paths to the libraries. 
     1207                    version(BuildVerbose) 
     1208                    { 
     1209                        if (vVerbose == True) 
     1210                            writefln("Setting LIB=%s", vLibPaths); 
     1211                    } 
     1212                    util.str.SetEnv("LIB",vLibPaths[1..$]); 
     1213                } 
     1214 
     1215                // (5) Set the 'def' file name 
     1216                if (lDefName.length > 0) 
     1217                    lCommandLine ~= util.str.enquote(lDefName) ~ "\n"; 
     1218                else 
     1219                    lCommandLine ~= "\n"; 
     1220 
     1221                // (6) Gather the resource file names 
     1222                { 
     1223                    int lCnt; 
     1224                    foreach(char[] lFile; lFilesToLink) 
     1225                    { 
     1226                        char[] lExt; 
     1227 
     1228                        lExt = std.path.getExt(lFile); 
     1229                        lCnt = 0; 
     1230                        // Only include non OBJECT and non LIBRARY files. 
     1231                        if (lExt != vObjExtention && lExt != vLibExtention) 
     1232                        { 
     1233                            lCommandLine ~= lFile; 
     1234                            lCnt++; 
     1235                        } 
     1236                        if (lCnt > 0) 
     1237                            lCommandLine ~= "+"; 
     1238                    } 
     1239                    if (lCnt > 0) 
     1240                        lCommandLine[$-1] = '\n'; 
     1241                } 
     1242 
     1243                // (7) Gather then switches 
     1244                lCommandLine ~= vLinkerDefs; 
     1245                lCommandLine ~= lLinkerSwitches; 
     1246                lCommandLine ~= "\n"; 
     1247            } 
     1248 
     1249            version(Posix) 
     1250            { 
     1251                // Transfer linker switches from Compiler switches. 
     1252                foreach (char[] lCompileArg; vCompilerArgs) 
     1253                { 
     1254                    if (util.str.begins(lCompileArg, "-L") == True) 
     1255                    { 
     1256                        lLinkerSwitches ~= lCompileArg[2..$]; 
     1257                    } 
     1258                } 
     1259                foreach( char[] lSwitch; std.string.split(vLinkerDefs ~ lLinkerSwitches, "/")) 
     1260                { 
     1261                    if (lSwitch == "nomap") 
     1262                    { 
     1263                        IsMapping = False; 
     1264                    } 
     1265                    else if (lSwitch == "map") 
     1266                    { 
     1267                        IsMapping = True; 
     1268                    } 
     1269                } 
     1270 
     1271                // (1) Gather the object and resource file names 
     1272                foreach(char[] lFile; lFilesToLink) 
     1273                { 
     1274                    lCommandLine ~= lFile ~ "\n"; 
     1275                } 
     1276 
     1277                // (2) Set the output file name 
     1278                lCommandLine ~= vOutFileSwitch ~ util.str.enquote(util.pathex.AbbreviateFileName(lTargetName)) ~ "\n"; 
     1279 
     1280                // (3) Set the map name 
     1281                if (IsMapping == True) 
     1282                    lCommandLine ~= vMapSwitch ~ "\n"; 
     1283 
     1284                // (4) Gather the libraries names. 
     1285                // Include the default libraries first. 
     1286                foreach( char[] lLib; vDefaultLibs ~ lLibraryFiles) 
     1287                { 
     1288                    lCommandLine ~= vLinkLibSwitch ~ util.str.enquote(lLib) ~ "\n"; 
     1289                } 
     1290 
     1291                if (vLibPaths.length > 1) 
     1292                { 
     1293                    if (vLibPaths[0..1] == vConfigSep) 
     1294                        vLibPaths = vLibPaths[1..$]; 
     1295 
     1296                    // Include the paths to the libraries. 
     1297                    version(BuildVerbose) 
     1298                    { 
     1299                        if (vVerbose == True) 
     1300                            writefln("Setting LIB=%s", vLibPaths); 
     1301                    } 
     1302 
     1303                    char[][] lLibPaths; 
     1304                    lLibPaths = std.string.split(vLibPaths, vConfigSep); 
     1305                    foreach(char[] lLib; lLibPaths) 
     1306                    { 
     1307                        if (lLib.length > 0) 
     1308                            lCommandLine ~= vLibPathSwitch ~ util.str.enquote(lLib) ~ "\n"; 
     1309                    } 
     1310                } 
     1311 
     1312                // (5) Gather then switches 
     1313                lCommandLine ~= vLinkerDefs; 
     1314                lCommandLine ~= lLinkerSwitches; 
     1315                lCommandLine ~= "\n"; 
     1316            } 
    11761317 
    11771318            if (vUseResponseFile == True) 
    1178            
     1319           
    11791320                lLinkResponseFileName = ReplaceExtention(lTargetName, "ksp"); 
    11801321                if (vTemporaryPath.length != 0) 
     
    11841325                lLinkResponseFileName = util.pathex.AbbreviateFileName(lLinkResponseFileName); 
    11851326                util.fileex.CreateTextFile(lLinkResponseFileName,lCommandLine); 
    1186                 lCommand = vLinkerPath ~ vLinkerExe ~ " @" ~ lLinkResponseFileName; 
     1327                lCommand = "@" ~ lLinkResponseFileName; 
    11871328            } 
    11881329            else 
    11891330            {   // using commandline; may run into limits 
    1190                 lCommandLine=std.string.replace(lCommandLine, "\n", " "); 
    1191                 lCommand = vLinkerPath ~ vLinkerExe ~ " " ~ lCommandLine; 
    1192             } 
    1193  
    1194             if (vVerbose == True) { 
    1195                 writefln("Linking with ..........\n%s\n", lCommandLine); 
     1331                version(DigitalMars) 
     1332                { 
     1333                    lCommandLine=std.string.replace(lCommandLine, "\n", ","); 
     1334                    // Locate switches and change delim from a comma to a blank, 
     1335                    // then remove any trailing comma too. 
     1336                    int lPos = std.string.find(lCommandLine, "/"); 
     1337                    if (lPos != -1) 
     1338                        lCommandLine[lPos-1] = ' '; 
     1339                    if (lCommandLine[$-1] == ',') 
     1340                        lCommandLine[$-1] = ' '; 
     1341                } 
     1342                version(GNU) 
     1343                    lCommandLine=std.string.replace(lCommandLine, "\n", " "); 
     1344                lCommand = lCommandLine; 
     1345            } 
     1346 
     1347            version(BuildVerbose) 
     1348            { 
     1349                if (vVerbose == True) 
     1350                    writefln("Linking with ..........\n%s\n", lCommandLine); 
    11961351            } 
    11971352 
     
    11991354            if (vSilent == True) 
    12001355            { 
    1201                 version(Posix) lCommand ~= " >/dev/null"; 
    1202                 version(Windows) lCommand ~= " >nul"; 
    1203             } 
    1204  
    1205             lRunResult = RunCommand(lCommand); 
     1356                lCommand ~= " " ~ vLinkerStdOut; 
     1357            } 
     1358 
     1359            lRunResult = RunCommand(vLinkerPath ~ vLinkerExe, lCommand); 
    12061360            if (lRunResult != 0) 
    12071361                vExecuteProgram = False; 
     
    12211375        char[] lTargetFileName; 
    12221376        char[] lImpLibPath; 
     1377        char[] lImpLibArgs; 
    12231378        ulong[] lImpManf; 
    12241379 
    12251380        vExecuteProgram = False; 
    12261381 
    1227         lImpLibPath = util.pathex.LocateFile("implib.exe", GetEnv(kPathId)); 
     1382        lImpLibPath = util.pathex.LocateFile("implib.exe", util.str.GetEnv(vPathId)); 
    12281383        if (util.fileex.FileExists(lImpLibPath)) 
    12291384        { 
    12301385            lImpManf = util.fileex.FindInFile(lImpLibPath, "Borland"); 
    12311386            if (lImpManf.length != 0) 
    1232                 lImpLibPath ~= " -a "; 
     1387                lImpLibArgs ~= "-a"; 
    12331388            else 
    1234                 lImpLibPath ~= " /system "; 
     1389                lImpLibArgs ~= "/system"; 
    12351390 
    12361391            lTargetFileName = std.path.getBaseName(lTargetName); 
    1237             lRunResult = RunCommand(lImpLibPath ~ std.path.addExt(lTargetFileName, "lib") 
    1238                             ~ " " ~ std.path.addExt(lTargetFileName, "dll") ); 
     1392            lRunResult = RunCommand(lImpLibPath, lImpLibArgs ~ 
     1393                                       " " ~ std.path.addExt(lTargetFileName, "lib") ~ 
     1394                                       " " ~ std.path.addExt(lTargetFileName, "dll") ); 
    12391395        } 
    12401396    } 
     
    12551411            if ((vAllObjects == True) || lFileDir == "" || lFileDir == lTargetDir) 
    12561412            { 
    1257                 if (lFileName.length > 1 + kSrcExtention.length) 
    1258                 { 
    1259                     if (lFileName[$-kSrcExtention.length .. $] == kSrcExtention) 
    1260                     { 
    1261                         lFileName = lFileName[0..$-kSrcExtention.length] ~ kObjExtention; 
     1413                if (lFileName.length > 1 + vSrcExtention.length) 
     1414                { 
     1415                    if (lFileName[$-vSrcExtention.length .. $] == vSrcExtention) 
     1416                    { 
     1417                        lFileName = lFileName[0..$-vSrcExtention.length] ~ vObjExtention; 
    12621418                    } 
    12631419                } 
     
    12761432                } 
    12771433                util.fileex.CreateTextFile(lLResponseFileName,lOutText); 
    1278                 lCommand = vLibrarianPath ~ vLibrarian ~ " @" ~ lLResponseFileName; 
     1434                lCommand = "@" ~ lLResponseFileName; 
    12791435            } 
    12801436            else 
    12811437            {   // using commandline, may run into limits 
    1282                 lCommand  = vLibrarianPath ~ vLibrarian ~ " " ~ std.string.replace(lOutText,std.path.linesep," "); 
    1283             } 
    1284  
    1285             if (vVerbose == True) { 
    1286                 writefln("Librarian with ..........\n%s\n", lOutText); 
    1287             } 
    1288  
    1289             lRunResult = RunCommand(lCommand); 
     1438                lCommand  = std.string.replace(lOutText,std.path.linesep," "); 
     1439            } 
     1440 
     1441            version(BuildVerbose) 
     1442            { 
     1443                if (vVerbose == True) 
     1444                    writefln("Librarian with ..........\n%s\n", lOutText); 
     1445            } 
     1446 
     1447            lRunResult = RunCommand(vLibrarianPath ~ vLibrarian, lCommand); 
    12901448        } 
    12911449    } 
     
    12961454        char[][] lHitList; 
    12971455 
    1298         if (vVerbose == True) { 
    1299             writefln("Cleaning up ..."); 
    1300         } 
    1301         foreach(char[] lFileName; Source.ScanOrder) 
    1302         { 
    1303             Source lSource; 
    1304             lSource = Source.SourceIndex[lFileName]; 
     1456        version(BuildVerbose) 
     1457        { 
     1458            if (vVerbose == True) 
     1459                writefln("Cleaning up ..."); 
     1460        } 
     1461 
     1462        foreach(Source lSource; Source) 
     1463        { 
    13051464            if (lSource.Ignore) 
    13061465                continue; 
     
    13291488                if (util.fileex.FileExists( lFilename ) ) 
    13301489                { 
    1331                     if (vVerbose == True) { 
    1332                         writefln("  removing %s", lFilename); 
     1490                    version(BuildVerbose) 
     1491                    { 
     1492                        if (vVerbose == True) 
     1493                            writefln("  removing %s", lFilename); 
    13331494                    } 
    13341495                    std.file.remove(lFilename); 
     
    13521513    { 
    13531514        version(Posix) 
    1354             vDefaultCompArgs ~= vImportPathSwitch ~ "\"" ~ lRoot ~ "\""; 
    1355         else 
    1356             vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 
    1357     } 
    1358  
    1359     foreach(char[] lArg; vDefaultCompArgs) 
     1515            vCompilerDefs ~= vImportPath ~ "\"" ~ lRoot ~ "\""; 
     1516        version(Windows) 
     1517            vCompilerDefs ~= vImportPath ~ lRoot; 
     1518    } 
     1519 
     1520    foreach(char[] lArg; vCompilerDefs) 
    13601521    { 
    13611522        AddCompilerArg( lArg ); 
     
    13691530        { 
    13701531            // Enclose in quotes if no quotes are currently present. 
    1371             if (find(lCompileArg, "\"") == -1) 
     1532            if (std.string.find(lCompileArg, "\"") == -1) 
    13721533                // Arguments containing a blank need to be quoted. 
    1373                 if (find(lCompileArg, " ") != -1) 
     1534                if (std.string.find(lCompileArg, " ") != -1) 
    13741535                { 
    13751536                    // Strip off any trailing shell escape lead-in character. 
     
    13901551    if (pLinking == False) 
    13911552    { // No linking allowed. 
    1392         if (vNoLinkSwitch.length > 0) 
    1393         { 
    1394             if (find(vNoLinkSwitch, " ") != -1) 
    1395                 lOutText ~= std.string.format(`"%s"`,vNoLinkSwitch); 
     1553        if (vCompileOnly.length > 0) 
     1554        { 
     1555            if (std.string.find(vCompileOnly, " ") != -1) 
     1556                lOutText ~= std.string.format(`"%s"`,vCompileOnly); 
    13961557            else 
    1397                 lOutText ~= vNoLinkSwitch
     1558                lOutText ~= vCompileOnly
    13981559            // Terminate with a newline char. 
    13991560            lOutText ~= "\n"; 
    14001561 
    1401             AddCompilerArg( vNoLinkSwitch ); 
     1562            AddCompilerArg( vCompileOnly ); 
    14021563        } 
    14031564    } 
     
    14231584        vExternals[$-1].FilePath = pPath; 
    14241585        vExternals[$-1].ToolOpts = pOpts; 
    1425         if (vVerbose == True) { 
    1426             writef("Added external file to be built: %s", pPath); 
    1427             foreach( char[] lOpt; pOpts) 
    1428                 writef(" `%s`", lOpt); 
    1429             writefln(""); 
     1586        version(BuildVerbose) 
     1587        { 
     1588            if (vVerbose == True) 
     1589            { 
     1590                writef("Added external file to be built: %s", pPath); 
     1591                foreach( char[] lOpt; pOpts) 
     1592                    writef(" `%s`", lOpt); 
     1593                writefln(""); 
     1594            } 
    14301595        } 
    14311596    } 
     
    14511616    if (vPragmaTargetName.length == 0) 
    14521617        vPragmaTargetName = pPath; 
    1453     else if (vPragmaTargetName != pPath) { 
    1454         if (vVerbose == True) { 
    1455             writefln("Multiple pragma(target,...) detected. '%s' will be used and '%s' rejected.", 
    1456                     vPragmaTargetName, pPath ); 
     1618    else 
     1619    { 
     1620        version(BuildVerbose) 
     1621        { 
     1622            if (vPragmaTargetName != pPath) 
     1623            { 
     1624                if (vVerbose == True) 
     1625                    writefln("Multiple pragma(target,...) detected. '%s' will be used and '%s' rejected.", 
     1626                                    vPragmaTargetName, pPath ); 
     1627            } 
    14571628        } 
    14581629    } 
     
    15011672        { 
    15021673            if (pArg[0..3] == `+v+`) 
    1503                 pArg = vVersionSwitch ~ pArg[3..$]; 
     1674                pArg = vVersionSwitch ~ "=" ~ pArg[3..$]; 
    15041675        } 
    15051676 
     
    15521723{ 
    15531724    return vImportRoots; 
    1554 } 
    1555  
    1556 // function to replace tokens in the form %<SYM>%  with environment data. 
    1557 // ------------------------------------------- 
    1558 char[] ExpandEnvVar(char[] pLine) 
    1559 // ------------------------------------------- 
    1560 { 
    1561     char[] lLine; 
    1562     char[] lSymName; 
    1563     int lPos; 
    1564     int lEnd; 
    1565  
    1566     lLine.length = 0; 
    1567     for( lPos = 0; lPos < pLine.length; lPos++ ) 
    1568     { 
    1569         if (pLine[lPos] == '%') 
    1570         { 
    1571             lSymName.length = 0; 
    1572             for(lEnd = lPos+1; (lEnd < pLine.length) && (pLine[lEnd] != '%'); lEnd++ ) 
    1573             { 
    1574                 lSymName ~= pLine[lEnd]; 
    1575             } 
    1576             if (lSymName.length > 0) 
    1577             { 
    1578                 if (lSymName == "@P") 
    1579                 { 
    1580                     // Special symbol that refers to the DMD configuration file's directory. 
    1581                     lSymName = (vConfigPath ? vConfigPath[0..length-1] : ""); 
    1582                 } 
    1583                 else if (lSymName == "@D") 
    1584                 { 
    1585                     // Special symbol that refers to the compiler's file's directory. 
    1586                     lSymName = (vCompilerPath ? vCompilerPath[0..length-1] : ""); 
    1587                 } 
    1588                 else 
    1589                 { 
    1590                     lSymName = (GetEnv(std.utf.toUTF8(lSymName))); 
    1591                 } 
    1592                 lLine ~= lSymName; 
    1593             } 
    1594             lPos = lEnd; 
    1595         } 
    1596         else 
    1597         { 
    1598             lLine ~= pLine[lPos]; 
    1599         } 
    1600     } 
    1601     return lLine; 
    16021725} 
    16031726 
     
    16721795                { 
    16731796                    lRootName = AddRoot(lRoot); 
    1674                     /* 
    1675                     version(Posix) 
    1676                         vDefaultCompArgs ~= vImportPathSwitch ~ "\"" ~ lRoot ~ "\""; 
    1677                     else 
    1678                         vDefaultCompArgs ~= vImportPathSwitch ~ lRoot; 
    1679                         */ 
    1680                     if(vVerbose == True) { 
    1681                         if (lRootName.length > 0){ 
    1682                             writefln(" added root from config file %s", lRootName); 
    1683                         } 
     1797                    version(BuildVerbose) 
     1798                    { 
     1799                        if(vVerbose == True && lRootName.length > 0) 
     1800                                writefln(" added root from config file %s", lRootName); 
    16841801                    } 
    16851802                } 
     
    17091826                } 
    17101827 
    1711                 if (util.str.IsLike(lSwitch,  std.utf.toUTF32(vTemporaryPathSwitch ~ "*")) == True) 
     1828                if (util.str.IsLike(lSwitch,  std.utf.toUTF32(vOutputPath ~ "*")) == True) 
    17121829                { 
    17131830                    char[] lbRoot; 
    17141831 
    1715                     vTemporaryPath = lSwitch[vTemporaryPathSwitch.length .. $]; 
     1832                    vTemporaryPath = lSwitch[vOutputPath.length .. $]; 
    17161833                    if (vTemporaryPath.length > 0 && vTemporaryPath[$-1..$] != std.path.sep) 
    17171834                        vTemporaryPath ~= std.path.sep; 
     
    17211838                        lbRoot = AddRoot(vTemporaryPath); 
    17221839                        if (lbRoot.length > 0){ 
    1723                             if(vVerbose == True) { 
     1840                            version(BuildVerbose) 
     1841                            { 
     1842                                if(vVerbose == True) 
    17241843                                    writefln("Added root from config file Object Write Path = %s",lbRoot); 
    17251844                            } 
     
    17451864 
    17461865    // Check for a environment flag before config file. 
    1747     lSymValue = GetEnv("DFLAGS"); 
     1866    lSymValue = util.str.GetEnv("DFLAGS"); 
    17481867    if (lSymValue.length > 0 ) 
    17491868    { 
    1750         if (vVerbose == True) 
    1751             writefln("Analyzing environment symbol DFLAGS=%s", lSymValue); 
     1869        version(BuildVerbose) 
     1870        { 
     1871            if (vVerbose == True) 
     1872                writefln("Analyzing environment symbol DFLAGS=%s", lSymValue); 
     1873        } 
     1874 
    17521875        Process_DFLAGS( lSymValue ); 
    17531876    } 
     
    17681891    } 
    17691892 
    1770     lPath = vConfigPath ~ vConfigFile ; 
     1893    if (vOverrideConfigPath.length > 0) 
     1894        lPath = vOverrideConfigPath ~ vConfigFile ; 
     1895    else 
     1896        lPath = vConfigPath ~ vConfigFile ; 
     1897    version(BuildVerbose) 
     1898    { 
     1899        if (vVerbose == True) 
     1900            writefln("Reading from config: %s", lPath); 
     1901    } 
    17711902    util.fileex.GetTextLines(lPath, lTextLines, util.fileex.GetOpt.Exists); 
    17721903 
    1773     if (vVerbose == True) { 
    1774         writefln("Reading from config: %s", lPath); 
    1775     } 
    17761904 
    17771905    foreach(int i, char[] lLine; lTextLines) 
     
    17811909 
    17821910        // Replace any environment symbols with their value. 
    1783         if (vVerbose == True) { 
    1784             writefln(" Line %d: %s", i+1, lLine); 
    1785         } 
    1786         lLine = ExpandEnvVar(lLine); 
     1911        version(BuildVerbose) 
     1912        { 
     1913            if (vVerbose == True) 
     1914                writefln(" Line %d: %s", i+1, lLine); 
     1915        } 
     1916 
     1917        lLine = util.str.ExpandEnvVar(lLine); 
    17871918 
    17881919        // Examine DFLAGS 
    1789         lPos = find(lLine, "DFLAGS="); 
     1920        lPos = std.string.find(lLine, "DFLAGS="); 
    17901921        if(lPos == 0) 
    17911922        { 
     
    17941925 
    17951926        // Examine LIB 
    1796         lPos = find(lLine, "LIB="); 
     1927        lPos = std.string.find(lLine, "LIB="); 
    17971928        if(lPos == 0) 
    17981929        { 
     
    18261957                } 
    18271958            } 
    1828             if(vVerbose == True) 
    1829             { 
    1830                 writefln(" use %s",vLibPaths); 
     1959            version(BuildVerbose) 
     1960            { 
     1961                if(vVerbose == True) 
     1962                    writefln(" use %s",vLibPaths); 
    18311963            } 
    18321964            continue; 
     
    18341966 
    18351967        // Examine LINKCMD 
    1836         lPos = find(lLine, "LINKCMD="); 
     1968        lPos = std.string.find(lLine, "LINKCMD="); 
    18371969        if(lPos == 0) { 
    18381970            // Strip out any quotes 
    1839             while( (lPos = find(lLine, "\"")) != -1) 
     1971            while( (lPos = std.string.find(lLine, "\"")) != -1) 
    18401972            { 
    18411973                lLine = lLine[0..lPos] ~ lLine[lPos+1 .. $]; 
     
    18451977            vLinkerPath = util.pathex.CanonicalPath(vLinkerPath); 
    18461978            vLinkerExe = std.path.getBaseName(lLine[7..$]); 
    1847             if(vVerbose == True) { 
    1848                 writefln(" linker path %s",vLinkerPath); 
    1849                 writefln(" linker is %s",vLinkerExe); 
     1979            version(BuildVerbose) 
     1980            { 
     1981                if(vVerbose == True) 
     1982                { 
     1983                    writefln(" linker path %s",vLinkerPath); 
     1984                    writefln(" linker is %s",vLinkerExe); 
     1985                } 
    18501986            } 
    18511987            continue; 
    18521988        } 
    18531989 
    1854         lPos = find(lLine, "LIBCMD="); 
     1990        lPos = std.string.find(lLine, "LIBCMD="); 
    18551991        if(lPos == 0) { 
    18561992            // Strip out any quotes 
    1857             while( (lPos = find(lLine, "\"")) != -1) 
     1993            while( (lPos = std.string.find(lLine, "\"")) != -1) 
    18581994            { 
    18591995                lLine = lLine[0..lPos] ~ lLine[lPos+1 .. $]; 
     
    18631999 
    18642000            vLibrarian = std.path.getBaseName(lLine[7..$]); 
    1865             if(vVerbose == True) { 
    1866                 writefln(" librarian path %s",vLibrarianPath); 
    1867                 writefln(" librarian is %s",vLibrarian); 
     2001            version(BuildVerbose) 
     2002            { 
     2003                if(vVerbose == True) 
     2004                { 
     2005                    writefln(" librarian path %s",vLibrarianPath); 
     2006                    writefln(" librarian is %s",vLibrarian); 
     2007                } 
    18682008            } 
    18692009        } 
     
    19182058 
    19192059// ------------------------------------------------ 
    1920 Substitute[] GetMacros() 
    1921 { 
    1922     return vSubstitutions; 
    1923 } 
    1924  
    1925 // ------------------------------------------------ 
    19262060char[] GetFullPathnameScan(char[] pFileName, int pScanList) 
    19272061// ------------------------------------------- 
     
    19552089    // Look for file in current folder first. 
    19562090    lLocalPath = util.pathex.CanonicalPath(pFileName, false); 
    1957     if(util.fileex.FileExists(lLocalPath)) { 
     2091    if(util.fileex.FileExists(lLocalPath)) 
     2092    { 
    19582093        return util.pathex.AbbreviateFileName(lLocalPath); 
    19592094    } 
    19602095 
    19612096    // Examine each known import root to see if the file lives there. 
    1962     foreach(char[] lNextRoot; vImportRoots) { 
     2097    foreach(char[] lNextRoot; vImportRoots) 
     2098    { 
    19632099        lPossiblePath = ( lNextRoot ~ pFileName ); 
    1964         if(util.fileex.FileExists(lPossiblePath)) { 
     2100        if(util.fileex.FileExists(lPossiblePath)) 
     2101        { 
    19652102            return util.pathex.AbbreviateFileName(lPossiblePath); 
    19662103        } 
     
    19822119    // Assume that an environment symbol name was supplied, 
    19832120    // but if that fails, assume its a list of paths. 
    1984     lRawValue = GetEnv(pSymName); 
     2121    lRawValue = util.str.GetEnv(pSymName); 
    19852122    if (lRawValue.length == 0) 
    19862123        lRawValue = pSymName; 
     
    20092146    return lCompilerPath; 
    20102147} 
     2148 
     2149// ------------------------------- 
     2150void ExamineArgs(char[][] pArgGroup) 
     2151// ------------------------------- 
     2152{ 
     2153    foreach(char[] lArg; pArgGroup) 
     2154    { 
     2155        ProcessCmdLineArg( lArg ); 
     2156    } 
     2157} 
     2158 
    20112159 
    20122160// ------------------------------------------- 
     
    20332181    source.GetFullPathnameScan = &GetFullPathnameScan; 
    20342182    source.GetObjWritePath  = &GetTemporaryPath; 
    2035     source.GetMacros        = &GetMacros; 
    20362183    source.AddCompilerArg   = &AddCompilerArg; 
    20372184 
    20382185    // Scan the PATH env symbol to locate the D compiler. 
    2039     lCompPath = FindFileInPathList(kPathId, vCompilerExe); 
     2186    lCompPath = FindFileInPathList(vPathId, vCompilerExe); 
    20402187    if (lCompPath.length > 0){ 
    20412188        if (lCompPath[length-1] != std.path.sep[0]) 
    20422189            lCompPath ~= std.path.sep; 
    20432190        vCompilerPath = lCompPath.dup; 
    2044         // Set config path to same as compiler unless it is already set. 
    2045         if (!(vConfigPath is null) && (vConfigPath.length == 0)) 
    2046             vConfigPath = lCompPath.dup; 
     2191        util.str.SetEnv("@D", std.path.getDirName(vCompilerPath)); 
    20472192    } 
    20482193 
     
    20502195    { 
    20512196        vCompilerPath = util.pathex.GetInitCurDir; 
     2197        util.str.SetEnv("@D", std.path.getDirName(vCompilerPath)); 
    20522198        lSetPath = true; 
    20532199    } 
     
    20652211        } 
    20662212    } 
     2213    util.str.SetEnv("@S", std.path.getDirName(vAppPath)); 
    20672214 
    20682215    pArgs=pArgs[1..pArgs.length]; 
    20692216    if (pArgs.length == 0) { 
    2070         // No other arguments so show usage message. 
    2071         DisplayUsage (); 
    2072         return 0; 
     2217        if (util.fileex.FileExists(vDefResponseFile) == false) 
     2218        { 
     2219            // No other arguments so show usage message. 
     2220            DisplayUsage (); 
     2221            return 0; 
     2222        } 
     2223        else 
     2224        { 
     2225            pArgs ~= "@" ~ vDefResponseFile; 
     2226        } 
    20732227    } 
    20742228 
    20752229 
    20762230    GatherArgs( pArgs ); 
    2077     source.mVerboseMode = vVerbose; 
    2078     if (vVerbose == True){ 
    2079         writefln("*** build v%s (build %d)***", vAppVersion, build_bn.auto_build_number); 
    2080     } 
    2081  
    2082     foreach(char[] lArg; vCombinedArgs) { 
    2083         ProcessCmdLineArg( lArg ); 
    2084     } 
    2085  
     2231    version(BuildVerbose) 
     2232    { 
     2233        source.mVerboseMode = vVerbose; 
     2234        if (vVerbose == True) 
     2235            writefln("*** build v%s (build %d)***", vAppVersion, build_bn.auto_build_number); 
     2236    } 
     2237 
     2238    ExamineArgs( vCombinedArgs ); 
     2239 
     2240    // Grab the external macro definitions unless otherwise told not to. 
    20862241    source.mMacroInput = vMacroInput; 
    20872242    if (vMacroInput == True) 
    2088         ProcessMacroDefs(vVerbose); 
     2243        version(BuildVerbose) 
     2244        { 
     2245            ProcessMacroDefs(vVerbose); 
     2246        } else { 
     2247            ProcessMacroDefs(False); 
     2248        } 
    20892249 
    20902250    if( (vTargetName.length == 0) && (vCommandTargetName.length == 0) ){ 
    2091         throw new Exception("No target name supplied."); 
    2092     } 
    2093  
    2094     if ((vVerbose == True) || (vNames == True) ) 
    2095         writefln("Current Dir '%s'", util.pathex.GetInitCurDir()); 
     2251        throw new BuildException("No target name supplied."); 
     2252    } 
     2253 
     2254    version(BuildVerbose) 
     2255    { 
     2256        if ((vVerbose == True) || (vNames == True) ) 
     2257            writefln("Current Dir '%s'", util.pathex.GetInitCurDir()); 
     2258    } else { 
     2259        if (vNames == True) 
     2260            writefln("Current Dir '%s'", util.pathex.GetInitCurDir()); 
     2261    } 
    20962262 
    20972263    if (lSetPath) 
    20982264    { 
     2265        version(BuildVerbose) 
     2266        { 
     2267            if (vVerbose == True) 
     2268                writefln("%s not found in PATH symbol, so assuming current directory", 
     2269                        vCompilerExe); 
     2270        } 
     2271    } 
     2272 
     2273    if (vCompilerPath[length-1] != std.path.sep[0]) 
     2274    { 
     2275        vCompilerPath ~= std.path.sep; 
     2276        util.str.SetEnv("@D", std.path.getDirName(vCompilerPath)); 
     2277    } 
     2278 
     2279 
     2280    if (vConfigFile.length > 0) 
     2281    { 
     2282        char[][] lPotentialPaths; 
     2283 
     2284 
     2285        lPotentialPaths ~= "." ~ std.path.sep; 
     2286        lPotentialPaths ~= util.str.GetEnv(vHomePathId); 
     2287        version(Windows) 
     2288        { 
     2289            char[] lTemp; 
     2290            lTemp = util.str.GetEnv("HOMEDRIVE"); 
     2291            if (lTemp.length > 0) 
     2292            { 
     2293                lPotentialPaths ~= lTemp ~ util.str.GetEnv("HOMEPATH"); 
     2294            } 
     2295        } 
     2296        lPotentialPaths ~= vCompilerPath; 
     2297        if (vEtcPath.length > 0) 
     2298            lPotentialPaths ~= vEtcPath; 
     2299 
     2300        foreach( char[] p; lPotentialPaths) 
     2301        { 
     2302            if (util.str.ends(p, std.path.sep) is False) 
     2303                p ~= std.path.sep; 
     2304            if (util.fileex.FileExists(p ~ vConfigFile) == true) 
     2305            { 
     2306                vConfigPath = p.dup; 
     2307                util.str.SetEnv("@P", std.path.getDirName(vConfigPath)); 
     2308                break; 
     2309            } 
     2310        } 
     2311    } 
     2312 
     2313    if (util.fileex.FileExists(vCompilerPath ~ vCompilerExe) == false) 
     2314    { 
     2315        throw new BuildException(std.string.format("The compiler '%s' was not found.", 
     2316                vCompilerPath ~ vCompilerExe)); 
     2317    } 
     2318 
     2319    version(BuildVerbose) 
     2320    { 
    20992321        if (vVerbose == True) 
    2100         { 
    2101             writefln("%s not found in PATH symbol, so assuming current directory", 
    2102                         vCompilerExe); 
    2103         } 
    2104     } 
    2105  
    2106     if (vCompilerPath[length-1] != std.path.sep[0]) 
    2107         vCompilerPath ~= std.path.sep; 
    2108  
    2109  
    2110     if (vConfigPath.length == 0) 
    2111     { 
    2112         vConfigPath = vCompilerPath; 
    2113         if (vVerbose == True) 
    2114         { 
    2115             writefln("No configuration file path, so assuming current directory"); 
    2116         } 
    2117     } 
    2118     if (util.str.ends(vConfigPath, std.path.sep) is False) 
    2119         vConfigPath ~= std.path.sep; 
    2120  
    2121     version(DigitalMars) 
    2122     { 
    2123         if (util.fileex.FileExists(vConfigPath ~ vConfigFile) == false) 
    2124         { 
    2125             throw new Exception(std.string.format("The configuration file '%s' was not found.", 
    2126                     vConfigPath ~ vConfigFile)); 
    2127         } 
    2128     } 
    2129  
    2130     if (util.fileex.FileExists(vCompilerPath ~ vCompilerExe) == false) 
    2131     { 
    2132         throw new Exception(std.string.format("The compiler '%s' was not found.", 
    2133                 vCompilerPath ~ vCompilerExe)); 
    2134     } 
    2135  
    2136     if (vVerbose == True){ 
    2137         writefln("Compiler installed in %s",vCompilerPath); 
    2138         writefln("Configuration File installed in %s",vConfigPath); 
     2322            writefln("Compiler installed in %s",vCompilerPath); 
    21392323    } 
    21402324 
     
    21432327    ReadEnviron(); 
    21442328    version(DigitalMars) ReadConfigFile(); 
     2329 
     2330    version(Posix) 
     2331    { 
     2332        // Unless supplied by the config file, these are the default 
     2333        // libraries to use for linking. 
     2334        if (vDefaultLibs.length == 0) 
     2335        { 
     2336            vDefaultLibs ~= "c"; 
     2337            vDefaultLibs ~= "phobos"; 
     2338            vDefaultLibs ~= "m"; 
     2339        } 
     2340    } 
     2341 
     2342    // Assume phobos will be ignored unless user has specified another set. 
     2343    if (vModulesToIgnore.length == 0) 
     2344        vModulesToIgnore ~= "phobos"; 
    21452345 
    21462346    // Rationalize the ignored modules list. 
     
    21712371        } 
    21722372    } 
    2173  
    21742373    if ( lAllExist == false) 
    21752374    { 
    2176         throw new Exception ("Not all supplied files exist."); 
    2177     } 
    2178  
     2375        throw new BuildException ("Not all supplied files exist."); 
     2376    } 
     2377 
     2378    // Process the files 
    21792379    lBuildResult = Build(); 
    21802380 
    2181     if(vVerbose == True) { 
     2381    // After processing analysis. 
     2382    version(BuildVerbose) 
     2383    { 
     2384        if(vVerbose == True) 
     2385        { 
     2386            writefln(""); 
     2387            DisplayItems(vBuildArgs,      "build args: ..............."); 
     2388            DisplayItems(vCompilerArgs,   "compiler args: ................"); 
     2389            DisplayItems(vCmdLineSourceFiles,   "command line files: ..............."); 
     2390            DisplayItems(Source.AllFiles, 
     2391                                          "source files: ..............."); 
     2392            DisplayItems(vLinkFiles.keys, "link files: ..............."); 
     2393            DisplayItems(vExternals,      "externally built files: ..............."); 
     2394            DisplayItems(vImportRoots,    "import roots: ................."); 
     2395            DisplayItems(vModulesToIgnore,"ignored packages: ................."); 
     2396            DisplayItems(vModulesToNotice,"noticed package: ................."); 
     2397        } 
     2398    } 
     2399 
     2400    // Output list of modules if it was requested. 
     2401    if(vSymbols == True) 
     2402    { 
     2403        char[] lSymbolData; 
     2404        int lModuleCount; 
     2405        char[] lSymbolOutName; 
     2406 
     2407        foreach(Source lSource; Source) 
     2408        { 
     2409            if (lSource.Ignore) 
     2410                continue; 
     2411            if (lSource.NoLink) 
     2412                continue; 
     2413            if (lSource.ModuleName.length == 0) 
     2414                continue; 
     2415 
     2416            if (lModuleCount == 0) 
     2417            { 
     2418                lSymbolData ~= vModOutPrefix; 
     2419            } 
     2420            lModuleCount++; 
     2421 
     2422            if (lModuleCount > 1) 
     2423            { 
     2424                lSymbolData ~= vModOutDelim; 
     2425            } 
     2426 
     2427            lSymbolData ~= util.str.Expand(vModOutBody, "mod=" ~ lSource.ModuleName 
     2428                                                ~ "," ~ "src=" ~ lSource.FileName 
     2429                                           ); 
     2430        } 
     2431        if (lModuleCount != 0) 
     2432        { 
     2433            lSymbolData ~= vModOutSuffix; 
     2434        } 
     2435 
     2436        if (vSymbolOutName.length == 0) 
     2437            vSymbolOutName = util.pathex.GetBaseName(vTargetName) ~ vModOutFile; 
     2438 
     2439        // ensure requested path exists. 
     2440        util.pathex.MakePath(vSymbolOutName); 
     2441 
     2442        // write out the data buffer to disk. 
     2443        std.file.write(vSymbolOutName, lSymbolData); 
     2444    } 
     2445 
     2446    // Run the resulting program if it was requested. 
     2447    if ((vExecuteProgram == True) && (vTargetExe.length > 0)) 
     2448    { 
     2449        // Put at one blank line out first to separate it 
     2450        // from compiler console output. 
    21822451        writefln(""); 
    2183         DisplayItems(vBuildArgs,      "build args: ..............."); 
    2184         DisplayItems(vCompilerArgs,   "compiler args: ................"); 
    2185         DisplayItems(vCmdLineSourceFiles,   "command line files: ..............."); 
    2186         DisplayItems(Source.ScanOrder, 
    2187                                       "source files: ..............."); 
    2188         DisplayItems(vLinkFiles.keys, "link files: ..............."); 
    2189         DisplayItems(vExternals,      "externally built files: ..............."); 
    2190         DisplayItems(vImportRoots,    "import roots: ................."); 
    2191         DisplayItems(vModulesToIgnore,"ignored packages: ................."); 
    2192         DisplayItems(vModulesToNotice,"noticed package: ................."); 
    2193     } 
    2194  
    2195     if ((vExecuteProgram == True) && (vTargetExe.length > 0)) 
    2196     { 
    2197         RunCommand( vTargetExe ~ " " ~ std.string.strip(vRunParms)); 
     2452 
     2453        RunCommand( vTargetExe, std.string.strip(vRunParms)); 
    21982454    } 
    21992455 
     
    22092465    char[][] lRespLines; 
    22102466 
    2211     if (pArg.length == 1) 
    2212         lRespFileName = "build.brf"; 
     2467    if (pArg.length == 0) 
     2468        return; 
     2469    if (pArg == "@") 
     2470        lRespFileName = vDefResponseFile; 
     2471    else if (pArg[0] == '@') 
     2472        lRespFileName = pArg[1..length].dup; 
    22132473    else 
    2214         lRespFileName = pArg[1..length].dup
     2474        lRespFileName = pArg
    22152475 
    22162476    if (std.path.getExt(lRespFileName).length == 0) 
    22172477    { 
    2218         lRespFileName ~= ".brf"; 
    2219     } 
    2220  
    2221     if (pVerbose == True) 
    2222         writefln("Response file %s", lRespFileName); 
     2478        lRespFileName ~= "." ~ vResponseExt; 
     2479    } 
     2480 
     2481    version(BuildVerbose) 
     2482    { 
     2483        if (pVerbose == True) 
     2484            writefln("Response file %s", lRespFileName); 
     2485    } 
    22232486 
    22242487    lRespLines = util.fileex.GetTextLines(lRespFileName, util.fileex.GetOpt.Exists); 
     
    22342497 
    22352498        lArg = std.string.strip(lArg); 
    2236         if (lArg.length > 1){ 
    2237             if (pVerbose == True) 
    2238                 writefln("Response file arg: %s", lArg); 
    2239             GatherOneArg( lArg ); 
     2499        if (lArg.length > 1) 
     2500        { 
     2501            version(BuildVerbose) 
     2502            { 
     2503                if (pVerbose == True) 
     2504                    writefln("Response file arg: %s", lArg); 
     2505            } 
     2506            GatherOneArg( lArg, vCombinedArgs ); 
    22402507        } 
    22412508    } 
     
    22442511void ProcessCmdLineArg( char[] pArg ) 
    22452512{ 
    2246     char[] lNewPath; 
    22472513    static char[] lImportSwitch; 
    22482514 
    2249     if(util.str.begins(pArg, "-version=") == True) { 
     2515    // Handle a version switch on the command line by 
     2516    if(util.str.begins(pArg, vVersionSwitch) == True) 
     2517    { 
    22502518        char[] lVersionString; 
    22512519 
    2252         lVersionString=pArg [9 .. $]; 
    2253         source.ActivateVersion(lVersionString); 
    2254         pArg = vVersionSwitch ~ lVersionString; 
    2255     } 
    2256     else if(util.str.begins(pArg, "-fversion=") == True) { 
    2257         char[] lVersionString; 
    2258  
    2259         lVersionString=pArg [10 .. $]; 
    2260         source.ActivateVersion(lVersionString); 
    2261         pArg = vVersionSwitch ~ lVersionString; 
    2262     } 
    2263  
    2264     else if(pArg == "-fdebug") { 
     2520        lVersionString=pArg [vVersionSwitch.length .. $]; 
     2521        if (lVersionString.length > 0 && lVersionString[0] == '=') 
     2522            lVersionString = lVersionString[1..$]; 
     2523        if (lVersionString.length > 0) 
     2524        { 
     2525            source.ActivateVersion(lVersionString); 
     2526        } 
     2527    } 
     2528    else if(pArg == vDebugSwitch) 
     2529    { 
    22652530        source.ActivateDebug("1"); 
    2266         pArg = vDebugSwitch; 
    2267     } 
    2268     else if(pArg == "-debug") { 
    2269         source.ActivateDebug("1"); 
    2270         pArg = vDebugSwitch; 
    2271     } 
    2272     else if(util.str.begins(pArg, "-fdebug=") == True) { 
     2531    } 
     2532    else if(util.str.begins(pArg, vDebugSwitch) == True) 
     2533    { 
    22732534        char[] lDebugString; 
    22742535 
    2275         lDebugString=pArg [8 .. $]; 
    2276         source.ActivateDebug(lDebugString); 
    2277         pArg = vDebugSwitch ~ "=" ~ lDebugString; 
    2278     } 
    2279     else if(util.str.begins(pArg, "-debug=") == True) { 
    2280         char[] lDebugString; 
    2281  
    2282         lDebugString=pArg [7 .. $]; 
    2283         source.ActivateDebug(lDebugString); 
    2284         pArg = vDebugSwitch ~ "=" ~ lDebugString; 
     2536        lDebugString = pArg [vDebugSwitch.length .. $]; 
     2537        if (lDebugString.length > 0 && lDebugString[0] == '=') 
     2538            lDebugString = lDebugString[1..$]; 
     2539        if (lDebugString.length > 0) 
     2540        { 
     2541            source.ActivateDebug(lDebugString); 
     2542        } 
    22852543    } 
    22862544 
     
    24032661            { 
    24042662            if (pArg[0] == '-') { 
    2405                 if (pArg == "-g"
     2663                if (pArg == vGenDebugInfo
    24062664                { 
    24072665                    // Requires symbolic debug info. 
    2408                     vLinkerDefSwitches ~= "/co"
     2666                    vLinkerDefs ~= vSymInfoSwitch
    24092667                    AddCompilerArg(pArg); 
    24102668                    break; 
     
    24272685                } 
    24282686 
     2687                if (util.str.begins(pArg, "-CFG=") == True) 
     2688                { 
     2689                    char[] lFile; 
     2690                    char[] lSubSection; 
     2691                    char[][] lLocalArgs; 
     2692                    lFile = pArg[5..$]; 
     2693                    lSubSection = ""; 
     2694                    if (auto m = std.regexp.search(lFile, "(.*)\\[(.*)\\]") ) 
     2695                    { 
     2696                        lSubSection = m.match(2); 
     2697                        lFile = m.match(1); 
     2698                    } 
     2699                    version(BuildVerbose) 
     2700                    { 
     2701                        ProcessOneBuildConfig("+" ~ lSubSection, vVerbose, lFile, lLocalArgs); 
     2702                    } else { 
     2703                        ProcessOneBuildConfig("+" ~ lSubSection, False, lFile, lLocalArgs); 
     2704                    } 
     2705                    vBuildArgs ~= pArg; 
     2706                    ExamineArgs(lLocalArgs); 
     2707                    break; 
     2708                } 
     2709 
     2710                // Check if a list of modules has been requested. 
     2711                if (util.str.IsLike(pArg, "-modules*"d) == True) 
     2712                { 
     2713                    vSymbols = True; 
     2714                    if (pArg.length > 8) 
     2715                    { 
     2716                        if (pArg[8] == '=' || pArg[8] == ':') 
     2717                            // drop off leading delimiter. 
     2718                            vSymbolOutName = pArg[9..$]; 
     2719                        else 
     2720                            vSymbolOutName = pArg[8..$]; 
     2721                    } 
     2722                    else 
     2723                    { 
     2724                        vSymbolOutName = pArg[8..$]; 
     2725                    } 
     2726                    vBuildArgs ~= pArg; 
     2727                    // Not passed thru. 
     2728                    break; 
     2729                } 
     2730 
    24292731                // Test for alternate install locations. 
    24302732                if (util.str.IsLike(pArg, "-DCPATH?*"d) == True) 
    24312733                { 
    2432                     lNewPath = pArg[7..length].dup; 
    2433                     if (vCompilerPath == vConfigPath) 
     2734                    char[] lNewPath = pArg[7..length].dup; 
     2735                    if (util.str.ends(lNewPath, std.path.sep) == False) 
     2736                        lNewPath ~= std.path.sep; 
     2737                    version(BuildVerbose) 
     2738                    { 
     2739                        if (vVerbose == True) 
     2740                            writefln("DCPATH was %s now %s", vCompilerPath, lNewPath); 
     2741                    } 
     2742                    vCompilerPath = lNewPath; 
     2743                    util.str.SetEnv("@D", std.path.getDirName(vCompilerPath)); 
     2744                    vBuildArgs ~= pArg; 
     2745                    break; 
     2746 
     2747                } 
     2748 
     2749                if (util.str.IsLike(pArg,  "-CFPATH?*"d) == True) 
     2750                { 
     2751                    char[] lNewPath = pArg[7..length].dup; 
     2752                    if (util.str.ends(lNewPath, std.path.sep) == False) 
     2753                        lNewPath ~= std.path.sep; 
     2754                    version(BuildVerbose) 
    24342755                    { 
    24352756                        if (vVerbose == True) 
    24362757                            writefln("CFPATH was %s now %s", vConfigPath, lNewPath); 
    2437                         vConfigPath = lNewPath; 
    2438                     } 
    2439                     if (vVerbose == True) 
    2440                         writefln("DCPATH was %s now %s", vCompilerPath, lNewPath); 
    2441                     vCompilerPath = lNewPath; 
     2758                    } 
     2759                    vOverrideConfigPath = lNewPath; 
    24422760                    vBuildArgs ~= pArg; 
     2761                    util.str.SetEnv("@P", std.path.getDirName(vOverrideConfigPath)); 
    24432762                    break; 
    24442763 
    24452764                } 
    24462765 
    2447                 if (util.str.IsLike(pArg,  "-CFPATH?*"d) == True) 
    2448                 { 
    2449                     if (vVerbose == True) 
    2450                         writefln("CFPATH was %s now %s", vConfigPath, pArg[7..length]); 
    2451                     vConfigPath = pArg[7..length].dup; 
    2452                     vBuildArgs ~= pArg; 
    2453                     break; 
    2454  
    2455                 } 
    2456  
    24572766                if (util.str.IsLike(pArg,  "-PP?*"d) == True) 
    24582767                { 
    2459                     char[] lNewPath; 
    2460                     lNewPath = pArg[3..length].dup; 
    2461                     if (vVerbose == True) 
    2462                         writefln("Added %s to Source Scan List", lNewPath); 
     2768                    char[] lNewPath = pArg[3..length].dup; 
     2769                    version(BuildVerbose) 
     2770                    { 
     2771                        if (vVerbose == True) 
     2772                            writefln("Added %s to Source Scan List", lNewPath); 
     2773                    } 
     2774 
    24632775                    vBuildArgs ~= pArg; 
    24642776                    if ( util.str.ends(lNewPath, std.path.sep) == False) 
     
    24712783                if (util.str.IsLike(pArg,  "-RDF?*"d) == True) 
    24722784                { 
    2473                     if (vVerbose == True) 
    2474                         writefln("RDF was %s now %s", vRDFName, pArg[4..$]); 
     2785                    version(BuildVerbose) 
     2786                    { 
     2787                        if (vVerbose == True) 
     2788                            writefln("RDF was %s now %s", vRDFName, pArg[4..$]); 
     2789                    } 
     2790 
    24752791                    vRDFName = pArg[4..$].dup; 
    24762792                    vBuildArgs ~= pArg; 
     
    24792795                } 
    24802796 
    2481                 if (pArg == vBuildImportPathSwitch) 
     2797                if (util.str.IsLike(pArg,  "-MDF?*"d) == True) 
     2798                { 
     2799                    version(BuildVerbose) 
     2800                    { 
     2801                        if (vVerbose == True) 
     2802                            writefln("MDF was %s now %s", vDefMacroDefFile, pArg[4..$]); 
     2803                    } 
     2804 
     2805                    vDefMacroDefFile = pArg[4..$].dup; 
     2806                    vBuildArgs ~= pArg; 
     2807                    break; 
     2808 
     2809                } 
     2810 
     2811                if (pArg == vBuildImportPath) 
    24822812                { 
    24832813                    vDelayedValue = &lImportSwitch; 
     
    24852815                    break; 
    24862816                } 
    2487                 else if ( util.str.begins(pArg, vBuildImportPathSwitch) == True) 
     2817                else if ( util.str.begins(pArg, vBuildImportPath) == True) 
    24882818                { 
    24892819                    char [] lRoot; 
    2490                     foreach(char[] lCmdRoot; std.string.split(pArg[vBuildImportPathSwitch.length .. $], ";")) 
     2820                    foreach(char[] lCmdRoot; std.string.split(pArg[vBuildImportPath.length .. $], 
     2821                                                        vImportPathDelim)) 
    24912822                    { 
    24922823                        lRoot = AddRoot(lCmdRoot); 
    2493                         if (lRoot.length > 0){ 
    2494                             if(vVerbose == True) { 
     2824                        if (lRoot.length > 0) 
     2825                        { 
     2826                            version(BuildVerbose) 
     2827                            { 
     2828                                if(vVerbose == True) 
    24952829                                    writefln("Added root from command line = %s",lRoot); 
    24962830                            } 
     
    25092843 
    25102844 
     2845                if (util.str.IsLike(pArg, "-UMB*"d) == True) 
     2846                { 
     2847 
     2848                    vBuildArgs ~= pArg; 
     2849                    if (pArg.length == 4) 
     2850                        vUseModBaseName = true; 
     2851                    else 
     2852                    { 
     2853                        char lValue; 
     2854                        if (pArg[4] == '=' || pArg[4] == ':') 
     2855                            if (pArg.length > 5) 
     2856                                lValue = pArg[5]; 
     2857                            else 
     2858                                lValue = 'Y'; 
     2859 
     2860                        vUseModBaseName = 
     2861                             (lValue == 'y' || 
     2862                              lValue == 'Y'); 
     2863                    } 
     2864                    Source.UseModBaseName(vUseModBaseName); 
     2865                    break; 
     2866                } 
    25112867                // Special check for Object Write Path 
    25122868                version(DigitalMars) 
    25132869                { 
    2514                 if (util.str.IsLike(pArg,  std.utf.toUTF32(vTemporaryPathSwitch ~ "*")) == True) 
     2870                if (util.str.IsLike(pArg,  std.utf.toUTF32(vOutputPath ~ "*")) == True) 
    25152871                { 
    25162872                    char[] lRoot; 
    25172873 
    2518                     vTemporaryPath = pArg[vTemporaryPathSwitch.length .. $]; 
     2874                    vTemporaryPath = pArg[vOutputPath.length .. $]; 
    25192875                    if (vTemporaryPath.length > 0 && vTemporaryPath[$-1..$] != std.path.sep) 
    25202876                        vTemporaryPath ~= std.path.sep; 
     
    25222878                    lRoot = AddRoot(vTemporaryPath); 
    25232879                    if (lRoot.length > 0){ 
    2524                         if(vVerbose == True) { 
     2880                        version(BuildVerbose) 
     2881                        { 
     2882                            if(vVerbose == True) 
    25252883                                writefln("Added root from Object Write Path = %s",lRoot); 
    25262884                        } 
     
    25812939                if (util.str.IsLike(pArg,  "-R*"d) == True) 
    25822940                { 
    2583                     // Response file usage (eg. -Ry) 
     2941                    char lValue; 
     2942                    // Response file usage (eg. -R=Yes) 
    25842943                    if (pArg.length == 2) 
    25852944                        vUseResponseFile = ~vUseResponseFile; 
    25862945 
    2587                     else if (pArg[2] == 'y') 
    2588                         vUseResponseFile = True; 
    2589  
    25902946                    else 
    2591                         vUseResponseFile = False; 
    2592  
     2947                    { 
     2948                        if (pArg.length == 3) 
     2949                            lValue = pArg[2]; 
     2950                        else 
     2951                        { 
     2952                            if (pArg[2] == '=' || pArg[2] == ':') 
     2953                                lValue = pArg[3]; 
     2954                            else 
     2955                                lValue = pArg[2]; 
     2956                        } 
     2957 
     2958                        if (lValue == 'y' || lValue == 'Y') 
     2959                            vUseResponseFile = True; 
     2960                        else 
     2961                            vUseResponseFile = False; 
     2962                    } 
    25932963                    vBuildArgs ~= pArg; 
    25942964                    break; 
     
    26323002                            lRoot = AddRoot(lCmdRoot); 
    26333003                            if (lRoot.length > 0){ 
    2634                                 if(vVerbose == True) { 
     3004                                version(BuildVerbose) 
     3005                                { 
     3006                                    if(vVerbose == True) 
    26353007                                        writefln("Added root from command line = %s",lRoot); 
    26363008                                } 
     
    26533025                    pArg = std.string.replace(pArg, "/", std.path.sep); 
    26543026                } 
    2655                 switch(std.path.getExt(pArg)) { 
    2656                    case "": 
    2657                        pArg ~= "." ~ kSrcExtention; 
     3027 
     3028                auto lArgExt = std.path.getExt(pArg); 
     3029                if (lArgExt == "") 
     3030                { 
     3031                       pArg ~= "." ~ vSrcExtention; 
    26583032                       vCmdLineSourceFiles ~= pArg; 
    2659                        break; 
    2660  
    2661                    case kSrcExtention: 
    2662                    case kMacroExtention: 
    2663                    case kDdocExtention: 
     3033                } 
     3034                else if (lArgExt == vSrcExtention || 
     3035                           lArgExt == vMacroExtention || 
     3036                           lArgExt == vDdocExtention) 
     3037                { 
    26643038                       vCmdLineSourceFiles ~= pArg; 
    2665                        break; 
    2666  
    2667                    default: 
     3039                } 
     3040                else if (lArgExt == vResponseExt) 
     3041                { 
     3042                } 
     3043                else 
     3044                { 
    26683045                       AddLink(GetFullPathname(pArg)); 
    26693046                } 
    2670                 if(vTargetName is null) { 
     3047 
     3048                if(vTargetName is null && 
     3049                    ((std.path.getExt(pArg) == vSrcExtention) || 
     3050                     (std.path.getExt(pArg) == vMacroExtention) 
     3051                    ) 
     3052                  ) 
     3053                { 
    26713054                   vTargetName = pArg; 
     3055                    version(BuildVerbose) 
     3056                    { 
     3057                        if(vVerbose == True) 
     3058                            writefln("Default target is '%s'", std.path.getName(vTargetName)); 
     3059                    } 
    26723060                } 
    26733061            } 
     
    26773065} 
    26783066 
    2679 void GatherOneArg( char[] pArg
     3067bool GatherOneArg( char[] pArg, inout char[][] pArgGroup
    26803068{ 
    26813069    static bool[char[]] lKnownArgs; 
     3070    bool lMergeArg = false; 
    26823071<