Changeset 220

Show
Ignore:
Timestamp:
01/29/07 16:03:07 (1 year ago)
Author:
aldacron
Message:

Fixed two bugs in buiildme.d:
* libraries generated by DMD were corrupt using the single file method -- perhaps I just got the command line args for lib wrong. Now all object file paths are passed to lib/ar at once.
* when multiple packages were passed on the command line, no spaces were being inserted into the concatanated package list string, causing the build to fail

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/buildme.d

    r218 r220  
    5858    private static const char[] objExt = ".obj"; 
    5959    private static const char[] libExt = ".lib"; 
    60     private static const char[] libCmd = "@lib -n -p32"; 
    61     private static const char[] libCreateCmd = "@lib -c -n "; 
     60    private static const char[] libCmd = "@lib -c -n "; 
    6261    private static const char[] libPre = "";     
    6362} 
     
    6665    private static const char[] objExt = ".o"; 
    6766    private static const char[] libExt = ".a"; 
    68     private static const char[] libCmd = "ar -q "; 
    69     private static const char[] libCreateCmd = "ar -cr "; 
     67    private static const char[] libCmd = "ar -cr "; 
    7068    private static const char[] libPre = "lib";  
    7169} 
     
    128126                if(lower.find("derelict") == 0) 
    129127                { 
    130                     packageList ~= c
     128                    packageList ~= (" " ~ c)
    131129                } 
    132130        } 
     
    268266    } 
    269267     
     268    // replace each .d extension with the proper object file extension for the linker 
     269    fileList = fileList.replace(".d", objExt); 
     270    writefln(fileList); 
     271     
    270272    // create the library 
    271273    auto libName = libPre ~ packageName ~ libExt; 
    272     writefln("Creating library %s...", libName);     
    273     foreach(i, c; files) 
    274     { 
    275         auto obj = c.replace(".d", objExt); 
    276         auto cmd = i == 0 ? libCreateCmd : libCmd; 
    277          
    278         writefln("Adding object file %s", obj); 
    279         if(system(toStringz(cmd ~ "lib" ~ sep ~ libName ~ " " ~ obj)) != 0) 
    280         { 
    281             throw new Exception("Failed to create library " ~ libName); 
    282         } 
    283         writefln("Deleting object file %s", obj); 
    284         system(toStringz(delCmd ~ obj)); 
    285     } 
    286      
     274    writefln("Creating library %s...", libName); 
     275    if(system(toStringz(libCmd ~ "lib" ~ sep ~ libName ~ " " ~ fileList)) != 0) 
     276    { 
     277        throw new Exception("Failed to create library " ~ libName); 
     278    }        
     279     
     280    // delete the object files 
     281    writefln("Deleting object files..."); 
     282    system(toStringz(delCmd ~ " " ~ fileList)); 
     283     
     284    // strip the library on unices 
    287285    version(NixExt) 
    288286    {