Changeset 23

Show
Ignore:
Timestamp:
03/28/05 06:17:54 (4 years ago)
Author:
Derek Parnell
Message:

Upload of v1.16 (build #566)

see Docs/CHANGE_LOG.htm for details.
modified trunk/Docs/AUTO_BUILD_NUMBER.htm
modified trunk/Docs/CHANGE_LOG.htm
modified trunk/Docs/COMMAND_LINE.htm
modified trunk/Docs/index.htm
modified trunk/Docs/PRAGMA.htm
modified trunk/Docs/RESPONSE_FILE.htm
modified trunk/Docs/RULE_DEFINITION_FILE.htm
modified trunk/Docs/SWITCHES.htm
modified trunk/Docs/TO_DO.htm
modified trunk/Source/build.d
modified trunk/Source/build_bn.d
modified trunk/Source/Makefile.dos
modified trunk/Source/source.d
modified trunk/Source/source_bn.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/pathex_bn.d
modified trunk/Source/util/str_bn.d
added downloads/build_1.16.zip
added downloads/build_win_1.16.exe

Files:

Legend:

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

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
  • trunk/Docs/CHANGE_LOG.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1313</h3><br> 
    1414<p> 
     15 <strong> -- v1.16 -- 28/Mar/2005 </strong> 
     16<ul> 
     17 <li> ** <strong>FIX</strong>: The utility now handles quotes around pragma(link) references. 
     18 <li> ** <strong>FIX</strong>: The utility now handles multiple references to the same module 
     19even though they are using different 'path' specifications. 
     20 <li> ** <strong>ENH</strong>: The utility now has support for making Windows DLL files. 
     21 </ul>  
     22<p> 
    1523 <strong> -- v1.15 -- 24/Mar/2005 </strong> 
    1624<ul> 
     
    2028was present. 
    2129 <li> ** <strong>FIX</strong>: The order of the librarian parameters was incorrect. 
    22  <li> ** <strong>FIX</strong>: Utility was not using the correct path name if importing 
     30 <li> ** <strong>FIX</strong>: The utility was not using the correct path name if importing 
    2331modules from some Import paths. 
    2432 <li> ** <strong>ENH</strong>: Verbose mode now shows the ignored and noticed packages. 
  • trunk/Docs/COMMAND_LINE.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    6868                (Only needed if WinMain is not found in the source files 
    6969                or if you wish to override the default Windows version) 
     70     <strong>-dll</strong>       Forces a DLL library to be created. 
     71                      (Only needed if DllMain is not found in the source files. 
    7072     <strong>-X&lt;module&gt;</strong> Packages and Modules to ignore (eg. -Xmylib) 
    7173     <strong>-M&lt;module&gt;</strong> Packages and Modules to notice (eg. -Mphobos) 
  • trunk/Docs/PRAGMA.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    110110Category: <a href="#PRAGMA">Pragma</a><br> 
    111111<p><p> You can have <em>build</em> create a customised OptLink definition file 
    112  by coding as many <em>build_def</em> pragmas as required. 
     112 by coding as many <em>build_def</em> pragmas as required. However, <em>build</em> will 
     113only allow the first of each type of Definition File command to be used. THis 
     114 means that if you code ... <br> 
     115<pre> 
     116      pragma (build_def, "EXETYPE DOS"); 
     117      pragma (build_def, "EXETYPE NT"); 
     118</pre> 
     119Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 
     120explicit build_def pragmas to override the default ones generated by 
     121 <em>build</em> for Windows programs or DLL libraries. 
    113122<p> 
    114123 The syntax for these pragma is <br> 
  • trunk/Docs/RESPONSE_FILE.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
  • trunk/Docs/RULE_DEFINITION_FILE.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    4141<pre> 
    4242 ----- Windows Resource Compiler ----- 
    43  This uses ` pragma(build, &lt;sourcefile>.rc); ` 
     43  This uses ` pragma(/b'build', &lt;sourcefile>.rc); `  
    4444 ------------------------------------- 
    4545 rule=Resources 
  • trunk/Docs/SWITCHES.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    1818<li><a href="#_CLEANUP"><i>switch</i> -cleanup</a> &nbsp;&nbsp;Ensures that all working files created during the run are removed. 
    1919<li><a href="#_DCPATH"><i>switch</i> -DCPATH</a> &nbsp;&nbsp; Identifies where the compiler has been installed. 
     20<li><a href="#_DLL"><i>switch</i> -dll</a> &nbsp;&nbsp;Forces a DLL library to be created. 
    2021<li><a href="#_FULL"><i>switch</i> -full</a> &nbsp;&nbsp;Causes all source files, except ignored modules, to be compiled. 
    2122<li><a href="#_GUI"><i>switch</i> -gui</a> &nbsp;&nbsp;Forces a GUI application to be created. 
     
    4849<a href="#_CLEANUP">-cleanup</a>, 
    4950<a href="#_DCPATH">-DCPATH</a>, 
     51<a href="#_DLL">-dll</a>, 
    5052<a href="#_FULL">-full</a>, 
    5153<a href="#_GUI">-gui</a>, 
     
    8385<a href="#_CLEANUP">-cleanup</a>, 
    8486<a href="#_DCPATH">-DCPATH</a>, 
     87<a href="#_DLL">-dll</a>, 
    8588<a href="#_FULL">-full</a>, 
    8689<a href="#_GUI">-gui</a>, 
     
    113116<a href="#_CFPATH">-CFPATH</a>, 
    114117<a href="#_DCPATH">-DCPATH</a>, 
     118<a href="#_DLL">-dll</a>, 
    115119<a href="#_FULL">-full</a>, 
    116120<a href="#_GUI">-gui</a>, 
     
    154158<a href="#_CFPATH">-CFPATH</a>, 
    155159<a href="#_CLEANUP">-cleanup</a>, 
     160<a href="#_DLL">-dll</a>, 
     161<a href="#_FULL">-full</a>, 
     162<a href="#_GUI">-gui</a>, 
     163<a href="#_INFO">-info</a>, 
     164<a href="#_LIB">-lib</a>, 
     165<a href="#_LINK">-link</a>, 
     166<a href="#_M">-M</a>, 
     167<a href="#_NAMES">-names</a>, 
     168<a href="#_NOLIB">-nolib</a>, 
     169<a href="#_NOLINK">-nolink</a>, 
     170<a href="#_R">-R</a>, 
     171<a href="#_RDF">-RDF</a>, 
     172<a href="#_T">-T</a>, 
     173<a href="#_TEST">-test</a>, 
     174<a href="#_V">-v</a>, 
     175<a href="#_V">-V</a>, 
     176<a href="#_X">-X</a> 
     177<hr> 
     178<h4><br> 
     179<a href="index.htm#makedocTOC">Table of Contents</a></h4> 
     180<h2><a name="_DLL">[<i>switch</i>]<br>-dll</a> </h2> 
     181<h3>Forces a DLL library to be created.</h3> 
     182Category: <a href="#SWITCHES">Switches</a><br> 
     183<p><p> <strong>Note:</strong> This only applies to Windows environment. 
     184<p> 
     185 Normally, if <em>build</em> finds a DllMain() function it automatically 
     186creates a DLL library. However, if you need to force a DLL 
     187library, you would use this switch. 
     188<p>See Also:  
     189<a href="#_ALLOBJ">-allobj</a>, 
     190<a href="#_CFPATH">-CFPATH</a>, 
     191<a href="#_CLEANUP">-cleanup</a>, 
     192<a href="#_DCPATH">-DCPATH</a>, 
    156193<a href="#_FULL">-full</a>, 
    157194<a href="#_GUI">-gui</a>, 
     
    186223<a href="#_CLEANUP">-cleanup</a>, 
    187224<a href="#_DCPATH">-DCPATH</a>, 
     225<a href="#_DLL">-dll</a>, 
    188226<a href="#_GUI">-gui</a>, 
    189227<a href="#_INFO">-info</a>, 
     
    224262<a href="#_CLEANUP">-cleanup</a>, 
    225263<a href="#_DCPATH">-DCPATH</a>, 
     264<a href="#_DLL">-dll</a>, 
    226265<a href="#_FULL">-full</a>, 
    227266<a href="#_INFO">-info</a>, 
     
    250289<a href="#_CLEANUP">-cleanup</a>, 
    251290<a href="#_DCPATH">-DCPATH</a>, 
     291<a href="#_DLL">-dll</a>, 
    252292<a href="#_FULL">-full</a>, 
    253293<a href="#_GUI">-gui</a>, 
     
    283323<a href="#_CLEANUP">-cleanup</a>, 
    284324<a href="#_DCPATH">-DCPATH</a>, 
     325<a href="#_DLL">-dll</a>, 
    285326<a href="#_FULL">-full</a>, 
    286327<a href="#_GUI">-gui</a>, 
     
    316357<a href="#_CLEANUP">-cleanup</a>, 
    317358<a href="#_DCPATH">-DCPATH</a>, 
     359<a href="#_DLL">-dll</a>, 
    318360<a href="#_FULL">-full</a>, 
    319361<a href="#_GUI">-gui</a>, 
     
    351393<a href="#_CLEANUP">-cleanup</a>, 
    352394<a href="#_DCPATH">-DCPATH</a>, 
     395<a href="#_DLL">-dll</a>, 
    353396<a href="#_FULL">-full</a>, 
    354397<a href="#_GUI">-gui</a>, 
     
    377420<a href="#_CLEANUP">-cleanup</a>, 
    378421<a href="#_DCPATH">-DCPATH</a>, 
     422<a href="#_DLL">-dll</a>, 
    379423<a href="#_FULL">-full</a>, 
    380424<a href="#_GUI">-gui</a>, 
     
    409453<a href="#_CLEANUP">-cleanup</a>, 
    410454<a href="#_DCPATH">-DCPATH</a>, 
     455<a href="#_DLL">-dll</a>, 
    411456<a href="#_FULL">-full</a>, 
    412457<a href="#_GUI">-gui</a>, 
     
    443488<a href="#_CLEANUP">-cleanup</a>, 
    444489<a href="#_DCPATH">-DCPATH</a>, 
     490<a href="#_DLL">-dll</a>, 
    445491<a href="#_FULL">-full</a>, 
    446492<a href="#_GUI">-gui</a>, 
     
    506552<a href="#_CLEANUP">-cleanup</a>, 
    507553<a href="#_DCPATH">-DCPATH</a>, 
     554<a href="#_DLL">-dll</a>, 
    508555<a href="#_FULL">-full</a>, 
    509556<a href="#_GUI">-gui</a>, 
     
    539586<a href="#_CLEANUP">-cleanup</a>, 
    540587<a href="#_DCPATH">-DCPATH</a>, 
     588<a href="#_DLL">-dll</a>, 
    541589<a href="#_FULL">-full</a>, 
    542590<a href="#_GUI">-gui</a>, 
     
    580628<a href="#_CLEANUP">-cleanup</a>, 
    581629<a href="#_DCPATH">-DCPATH</a>, 
     630<a href="#_DLL">-dll</a>, 
    582631<a href="#_FULL">-full</a>, 
    583632<a href="#_GUI">-gui</a>, 
     
    608657<a href="#_CLEANUP">-cleanup</a>, 
    609658<a href="#_DCPATH">-DCPATH</a>, 
     659<a href="#_DLL">-dll</a>, 
    610660<a href="#_FULL">-full</a>, 
    611661<a href="#_GUI">-gui</a>, 
     
    634684<a href="#_CLEANUP">-cleanup</a>, 
    635685<a href="#_DCPATH">-DCPATH</a>, 
     686<a href="#_DLL">-dll</a>, 
    636687<a href="#_FULL">-full</a>, 
    637688<a href="#_GUI">-gui</a>, 
     
    660711<a href="#_CLEANUP">-cleanup</a>, 
    661712<a href="#_DCPATH">-DCPATH</a>, 
     713<a href="#_DLL">-dll</a>, 
    662714<a href="#_FULL">-full</a>, 
    663715<a href="#_GUI">-gui</a>, 
     
    697749<a href="#_CLEANUP">-cleanup</a>, 
    698750<a href="#_DCPATH">-DCPATH</a>, 
     751<a href="#_DLL">-dll</a>, 
    699752<a href="#_FULL">-full</a>, 
    700753<a href="#_GUI">-gui</a>, 
  • trunk/Docs/TO_DO.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
  • trunk/Docs/index.htm

    r21 r23  
    22<head> 
    33<!-- Generated by MAKEDOC v1.1, (c) 2000,2003 by David Cuny, Derek Parnell, Matt Lewis --> 
    4 <!-- on 2005/03/24 at 14h51m27 --> 
     4<!-- on 2005/03/28 at 21h02m14 --> 
    55<style>h4 {text-align: right}</style> 
    66<title></title> 
     
    3232<tr><td><a href="COMMAND_LINE.htm#COMMAND_LINE">Command Line</a></td><td> The <em>build</em> utility supplies the source file and optional switches via the command line. 
    3333</td></tr> 
     34<tr><td><a href="DLL_LIBRARIES.htm#DLL_LIBRARIES">DLL Libraries</a></td><td>How to create a DLL library using Build. 
     35</td></tr> 
    3436<tr><td><a href="PRAGMA.htm#PRAGMA">Pragma</a></td><td> The <strong>build</strong> utility supports the use of various pragma statements. 
    3537</td></tr> 
     
    4850<a href="SWITCHES.htm#_CLEANUP">-cleanup</a>  [<i><code>switch</code></i>] Ensures that all working files created during the run are removed.<br> 
    4951<a href="SWITCHES.htm#_DCPATH">-DCPATH</a>  [<i><code>switch</code></i>]  Identifies where the compiler has been installed.<br> 
     52<a href="SWITCHES.htm#_DLL">-dll</a>  [<i><code>switch</code></i>] Forces a DLL library to be created.<br> 
    5053<a href="SWITCHES.htm#_FULL">-full</a>  [<i><code>switch</code></i>] Causes all source files, except ignored modules, to be compiled.<br> 
    5154<a href="SWITCHES.htm#_GUI">-gui</a>  [<i><code>switch</code></i>] Forces a GUI application to be created.<br> 
     
    6972<a href="CHANGE_LOG.htm#CHANGE_LOG">Change Log</a> <br> 
    7073<a href="COMMAND_LINE.htm#COMMAND_LINE">Command Line</a> <br> 
     74<a href="DLL_LIBRARIES.htm#DLL_LIBRARIES">DLL Libraries</a> <br> 
    7175<a href="PRAGMA.htm#INCLUDE">include</a>  [<i><code>pragma</code></i>] This identifies a required file which is not otherwise imported.<br> 
    7276<a href="PRAGMA.htm#LINK">link</a>  [<i><code>pragma</code></i>] This nominates one or more libraries that are required to be linked in.<br> 
  • trunk/Source/Makefile.dos

    r15 r23  
    1111SOURCES=$(SOURCES) source.d 
    1212SOURCES=$(SOURCES) util/fdt.d  
     13SOURCES=$(SOURCES) util/fileex.d  
     14SOURCES=$(SOURCES) util/fileex_bn.d  
     15SOURCES=$(SOURCES) util/linetoken.d  
     16SOURCES=$(SOURCES) util/linetoken_bn.d  
    1317 
    1418all: build  
  • trunk/Source/build.d

    r21 r23  
    3636 
    3737**************************************************************************/ 
    38 module build; 
    39 version(build) pragma(macro, "calc majv 1", "calc minv 15"); 
    40  
    4138/* 
    4239   A utility for building executables from source code written 
     
    5552///info 
    5653//A list of changes and fixes that have been made. 
     54// 
     55// /b"-- v1.16 -- 28/Mar/2005" 
     56//<ul> 
     57///li ** /b FIX: The utility now handles quotes around pragma(link) references. 
     58///li ** /b FIX: The utility now handles multiple references to the same module 
     59//even though they are using different 'path' specifications. 
     60///li ** /b ENH: The utility now has support for making Windows DLL files. 
     61//</ul> 
    5762// 
    5863// /b"-- v1.15 -- 24/Mar/2005" 
     
    6368//was present. 
    6469///li ** /b FIX: The order of the librarian parameters was incorrect. 
    65 ///li ** /b FIX: Utility was not using the correct path name if importing 
     70///li ** /b FIX: The utility was not using the correct path name if importing 
    6671//modules from some Import paths. 
    6772///li ** /b ENH: Verbose mode now shows the ignored and noticed packages. 
     
    213218 
    214219 
     220module build; 
    215221private import build_bn;    // This module's build number 
    216222 
     
    224230    version(Windows) { 
    225231        // OptLink Definition File 
    226         pragma (build_def, "VERSION 1.15"); 
     232        pragma (build_def, "VERSION 1.16"); 
    227233        pragma (build_def, "EXETYPE DOS"); 
    228234    } 
     
    275281            char[] kLibExtention=`lib`; 
    276282            char[] kObjExtention=`obj`; 
     283            char[] kShrLibExtention=`dll`; 
    277284        } 
    278285 
     
    281288            char[] kLibExtention=`a`; 
    282289            char[] kObjExtention=`o`; 
     290            char[] kShrLibExtention=`s`; 
    283291        } 
    284292 
     
    361369    char[]       vAppPath; 
    362370    char[]       vAppName; 
    363     char[]       vAppVersion = "1.15"; 
     371    char[]       vAppVersion = "1.16"; 
    364372    char[]       vTargetName;           // Output name from first file name. 
    365373    char[]       vPragmaTargetName;     // Output name from pragma. 
     
    469477    writefln("              (Only needed if WinMain is not found in the source files"); 
    470478    writefln("               or if you wish to override the default Windows version)"); 
     479    writefln("  -dll       Forces a DLL library to be created."); 
     480    writefln("              (Only needed if DllMain is not found in the source files.)"); 
    471481   } 
    472482 
     
    585595    foreach(int i, char[] lFileName; vLinkFiles.keys) 
    586596    { 
    587         FileDateTime lLinkTime = new FileDateTime(lFileName); 
     597        FileDateTime lLinkTime = GetFileTime(lFileName); 
    588598 
    589599        if(vVerbose) { 
    590             writefln("link file[%d] %s", i, 
    591                     util.pathex.AbbreviateFileName(lFileName)); 
     600            writefln("link file[%d] %s %s", i, 
     601                    util.pathex.AbbreviateFileName(lFileName), lLinkTime.toString()); 
    592602        } 
    593603        else if(vNames) { 
     
    784794    else if (vNoLink == false) 
    785795        if (Source.WasMainFound) 
    786             lTargetName = ReplaceExtention(vTargetName, kExeExtention); 
     796            if (Source.WasMainDLL) 
     797                lTargetName = ReplaceExtention(vTargetName, kShrLibExtention); 
     798            else 
     799                lTargetName = ReplaceExtention(vTargetName, kExeExtention); 
    787800        else 
    788801            lTargetName = "not defined"; 
     
    938951            vDefaultLibs ~= "gdi32.lib"; 
    939952        } 
     953        else if (Source.WasMainDLL) { 
     954            AddBuildDef(`LIBRARY "` ~ std.path.getBaseName(lTargetName) ~ `"`); 
     955            AddBuildDef("EXETYPE NT"); 
     956            if (vWinVer.length != 0) 
     957                AddBuildDef("SUBSYSTEM WINDOWS," ~ vWinVer); 
     958            else 
     959                AddBuildDef("SUBSYSTEM WINDOWS"); 
     960            AddBuildDef("CODE PRELOAD DISCARDABLE SHARED EXECUTE"); 
     961            AddBuildDef("DATA PRELOAD SINGLE WRITE"); 
     962        } 
    940963    } 
    941964 
     
    10101033 
    10111034    // Now build a library if requested to. 
    1012     if ( (vLibraryAction == LibOpt.Build) && (lRunResult == 0) ) 
     1035    if ( (Source.WasMainDLL)  && (lRunResult == 0) ) 
     1036    { 
     1037        char[] lTargetFileName; 
     1038        char[] lImpLibPath; 
     1039        ulong[] lImpManf; 
     1040         
     1041        lImpLibPath = util.pathex.LocateFile("implib.exe", GetEnv("PATH")); 
     1042        if (std.file.exists(lImpLibPath)) 
     1043        { 
     1044            lImpManf = util.fileex.FindInFile(lImpLibPath, "Borland"); 
     1045            if (lImpManf.length != 0) 
     1046                lImpLibPath ~= " -a "; 
     1047            else 
     1048                lImpLibPath ~= " /system "; 
     1049             
     1050            lTargetFileName = std.path.getBaseName(lTargetName); 
     1051            lRunResult = RunCommand(lImpLibPath ~ std.path.addExt(lTargetFileName, "lib") 
     1052                            ~ " " ~ std.path.addExt(lTargetFileName, "dll") ); 
     1053        } 
     1054    } 
     1055    else if ( (vLibraryAction == LibOpt.Build) && (lRunResult == 0) ) 
    10131056    { 
    10141057        lOutText.length = 0; 
     
    11681211// ------------------------------------------- 
    11691212{ 
     1213    int lPos; 
     1214    lPos = std.string.find(pText, ' '); 
     1215    if (lPos == -1) 
     1216        lPos = pText.length; 
     1217    foreach(char[] lDef; vBuildDef) 
     1218    { 
     1219        if (lDef.length >= lPos) 
     1220            if (lDef[0..lPos] == pText[0..lPos]) 
     1221                return; 
     1222    }     
    11701223    vBuildDef ~= pText; 
    11711224} 
     
    14121465            writefln("%s",pTitle); 
    14131466 
    1414         foreach(int lIndex, ExternRef lListEntry; pList) { 
     1467        foreach(int lIndex, ExternRef lListEntry; pList)  
     1468        { 
    14151469            writef(" [%2d]: %s",lIndex,lListEntry.FilePath); 
    14161470            if (lListEntry.ToolOpts.length > 0) 
     
    14271481{ 
    14281482    char[] lPossiblePath; 
     1483    char[] lLocalPath; 
    14291484 
    14301485    // Look for file in current folder first. 
    1431     lPossiblePath = util.pathex.CanonicalPath(pFileName, false); 
    1432     if(std.file.exists(lPossiblePath)) { 
    1433         return lPossiblePath; 
     1486    lLocalPath = util.pathex.CanonicalPath(pFileName, false); 
     1487    lLocalPath = util.pathex.AbbreviateFileName(lLocalPath); 
     1488    if(std.file.exists(lLocalPath)) { 
     1489        return lLocalPath; 
    14341490    } 
    14351491 
     
    14381494        lPossiblePath = ( lNextRoot ~ pFileName ); 
    14391495        if(std.file.exists(lPossiblePath)) { 
    1440             return lPossiblePath
    1441         } 
    1442     } 
    1443  
    1444     return pFileName
     1496            return util.pathex.AbbreviateFileName(lPossiblePath)
     1497        } 
     1498    } 
     1499 
     1500    return lLocalPath
    14451501} 
    14461502 
     
    19111967 
    19121968                    version(Windows) { 
    1913                     if (util.str.IsLike(pArg,  cast(dchar[])"-gui*")) 
    1914                     { 
    1915                             Source.WasMainGUI = true; 
    1916                             vBuildArgs ~= pArg; 
    1917                             if (pArg.length == 4) 
     1969                        if (util.str.IsLike(pArg,  cast(dchar[])"-gui*")) 
     1970                        { 
     1971                                Source.WasMainGUI = true; 
     1972                                vBuildArgs ~= pArg; 
     1973                                if (pArg.length == 4) 
     1974                                    break; 
     1975                                if (pArg[4] == ':') 
     1976                                    vWinVer = pArg[5..length]; 
     1977                                else 
     1978                                    vWinVer = pArg[4..length]; 
    19181979                                break; 
    1919                             if (pArg[4] == ':') 
    1920                                 vWinVer = pArg[5..length]; 
    1921                             else 
    1922                                 vWinVer = pArg[4..length]; 
    1923                             break; 
    1924                     } 
     1980                        } 
     1981                        if (pArg == "-dll") 
     1982                        { 
     1983                                Source.WasMainDLL = true; 
     1984                                vBuildArgs ~= pArg; 
     1985                                break; 
     1986                        } 
    19251987                    } 
    19261988 
     
    21392201///code 
    21402202// ----- Windows Resource Compiler ----- 
    2141 // This uses ` pragma(build, ~<sourcefile>.rc); ` 
     2203// This uses ` pragma(/b'build', ~<sourcefile>.rc); ` 
    21422204// ------------------------------------- 
    21432205// rule=Resources 
     
    21612223///desc This supplies an option to be placed in an OptLink definition file. 
    21622224//You can have /i build create a customised OptLink definition file 
    2163 //by coding as many /i build_def pragmas as required. 
     2225//by coding as many /i build_def pragmas as required. However, /i build will 
     2226//only allow the first of each type of Definition File command to be used. THis 
     2227//means that if you code ... /n 
     2228///code 
     2229//      pragma (build_def, "EXETYPE DOS"); 
     2230//      pragma (build_def, "EXETYPE NT"); 
     2231///endcode 
     2232//Then the EXETYPE DOS will be used and the 'NT' line ignored. You can use 
     2233//explicit build_def pragmas to override the default ones generated by  
     2234// /i build for Windows programs or DLL libraries. 
    21642235// 
    21652236//The syntax for these pragma is /n 
     
    23022373//                (Only needed if WinMain is not found in the source files 
    23032374//                or if you wish to override the default Windows version) 
     2375//    /b"-dll"       Forces a DLL library to be created. 
     2376//                      (Only needed if DllMain is not found in the source files. 
    23042377//    /b"-X~<module~>" Packages and Modules to ignore (eg. -Xmylib) 
    23052378//    /b"-M~<module~>" Packages and Modules to notice (eg. -Mphobos) 
     
    24982571 
    24992572///topic switches 
     2573///switch -dll 
     2574///desc Forces a DLL library to be created. 
     2575///b"Note:" This only applies to Windows environment. 
     2576// 
     2577//Normally, if /i build finds a DllMain() function it automatically 
     2578// creates a DLL library. However, if you need to force a DLL 
     2579// library, you would use this switch. 
     2580 
     2581///topic switches 
    25002582///switch -gui 
    25012583///desc Forces a GUI application to be created. 
     
    26322714//source text of the form @{tokenname}@ with the value of the token. 
    26332715 
     2716///topic DLL Libraries 
     2717///info 
     2718//How to create a DLL library using Build. 
     2719//When Build finds a DllMain() function, or the -dll switch is used, it 
     2720//creates a special type of Module Definition file, and sets the target to 
     2721//to be a DLL file. The Module Definition file generated takes the form ... 
     2722///code 
     2723//    LIBRARY "~<targetname>.dll"; 
     2724//    EXETYPE NT 
     2725//    SUBSYSTEM WINDOWS,~<version> 
     2726//    CODE PRELOAD DISCARDABLE SHARED EXECUTE 
     2727//    DATA PRELOAD SINGLE WRITE 
     2728///endcode 
     2729// 
     2730//You can replace any of these by explicitly coding a pragma(build_def) 
     2731//with different options than these defaults shown here. 
     2732// 
     2733//Also, if you have the program /b implib in your path, it will be run 
     2734//after the DLL file is created, in order to also create a /b".lib"  
     2735//library to interface with the DLL. Build currently supports both the 
     2736//DigitalMars version and the Borland (Inprise) version of /b implib. 
  • trunk/Source/build_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 520
     4long auto_build_number = 566
  • trunk/Source/source.d

    r21 r23  
    7575    bool mainFound; 
    7676    bool mainGUI; 
     77    bool mainDLL; 
    7778 
    7879} 
     
    271272                if (lCanUse){ 
    272273                    // Not known yet, so add it and grab its mod time 
     274                    lNextFile = GetFullPathname(lNextFile); 
    273275                    lCurFileTime = (new Source(lNextFile)).DependantsTime; 
    274276                } 
     
    306308    static void WasMainGUI(bool pValue) { mainGUI = pValue; } 
    307309 
     310    static bool WasMainDLL() { return mainDLL; } 
     311    static void WasMainDLL(bool pValue) { mainDLL = pValue; } 
     312 
    308313    bool IncrementBuildNumber() 
    309314    { 
     
    315320        else { 
    316321        lFileName = ModuleToFilename(mModuleName ~ "_bn"); 
     322        lFileName = GetFullPathname(lFileName); 
     323         
    317324        if (std.file.exists(lFileName)) 
    318325        { 
     
    405412                    break; 
    406413 
    407                 case "main", "WinMain": 
     414                case "main": 
     415                case "WinMain": 
     416                case "DllMain": 
    408417                    if ( (lPrevToken != "class") && 
    409418                         (lPrevToken != "template") 
     
    453462                if (pCurrentToken == "WinMain") { 
    454463                    mainGUI = true; 
     464                } 
     465                else if (pCurrentToken == "DllMain") { 
     466                    mainDLL = true; 
    455467                } 
    456468            } 
     
    623635                    while ( (lCurrentToken = GetNextToken(pFileText,pPos)) !== null) 
    624636                    { 
     637                        if (lCurrentToken == "\"") 
     638                            lCurrentToken = GetStringLit(pFileText, pPos); 
     639 
    625640                        if ((lCurrentToken != ",") && (lCurrentToken != ")")) 
    626641                        { 
  • trunk/Source/source_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 309
     4long auto_build_number = 355
  • trunk/Source/util/fdt_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 182
     4long auto_build_number = 196
  • trunk/Source/util/fileex.d

    r20 r23  
    4444    import std.string; 
    4545    import std.path; 
    46  
     46    import std.ctype; 
     47     
    4748    debug(1) 
    4849    { 
     
    150151    CreateTextFile(pFileName, lLines, pOpt); 
    151152} 
     153 
     154ulong[] FindInFile(char[] pFileName, char[] pText, char[] pOptions = "", uint pMax=1) 
     155{ 
     156    bool lCaseSensitive; 
     157    bool lRegExp; 
     158    bool lWordOnly; 
     159    bool lCounting; 
     160    auto char[] lBuffer; 
     161    int lPos; 
     162    ulong[] lResult; 
     163     
     164    // TODO // 
     165    // Implement options. ---------------------------------- //         
     166     
     167    lCaseSensitive = true; 
     168    if (std.string.find(pOptions, 'i') != -1) 
     169        lCaseSensitive = true; 
     170    if (std.string.find(pOptions, 'I') != -1) 
     171        lCaseSensitive = true; 
     172         
     173    lRegExp = false; 
     174    if (std.string.find(pOptions, 'r') != -1) 
     175        lRegExp = true; 
     176    if (std.string.find(pOptions, 'R') != -1) 
     177        lRegExp = true; 
     178 
     179    lWordOnly = false; 
     180    if (std.string.find(pOptions, 'w') != -1) 
     181        lWordOnly = true; 
     182    if (std.string.find(pOptions, 'W') != -1) 
     183        lWordOnly = true; 
     184 
     185    lCounting = true; 
     186    if (std.string.find(pOptions, 'a') != -1) 
     187        lCounting = false; 
     188    if (std.string.find(pOptions, 'A') != -1) 
     189        lCounting = false; 
     190         
     191    lBuffer = cast(char[])std.file.read(pFileName); 
     192    lResult.length = 0; 
     193    lPos = 0; 
     194     
     195    while ( (lPos = std.string.find(lBuffer[lPos..$], pText)) != -1) 
     196    { 
     197        if (lWordOnly) 
     198        { 
     199            if (lPos > 0) 
     200            { 
     201                if (std.ctype.isalnum(lBuffer[lPos-1]) ) 
     202                { 
     203                    lPos++; 
     204                    continue; 
     205                } 
     206            } 
     207            if (lPos + pText.length < lBuffer.length) 
     208            { 
     209                if (std.ctype.isalnum(lBuffer[lPos + pText.length - 1]) ) 
     210                { 
     211                    lPos++; 
     212                    continue; 
     213                } 
     214            } 
     215        } 
     216         
     217        lResult.length = lResult.length + 1; 
     218        lResult[$-1] = lPos; 
     219        if (lCounting) 
     220        { 
     221            pMax--; 
     222            if (pMax == 0) 
     223                break; 
     224        } 
     225         
     226        lPos += pText.length; 
     227        if ((lBuffer.length - lPos) < pText.length) 
     228            break; 
     229    } 
     230    return lResult; 
     231} 
     232         
  • trunk/Source/util/fileex_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 118
     4long auto_build_number = 144
  • trunk/Source/util/linetoken_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 50
     4long auto_build_number = 64
  • trunk/Source/util/pathex_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 201
     4long auto_build_number = 215
  • trunk/Source/util/str_bn.d

    r21 r23  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 177
     4long auto_build_number = 191