comparison configure.d @ 132:bc5baa585b32

Updated to dmd 2.060
author David Bryant <bagnose@gmail.com>
date Thu, 02 Aug 2012 15:32:43 +0930
parents 1da160a2c373
children 9e1a313d8003
comparison
equal deleted inserted replaced
130:1bc3475624d3 132:bc5baa585b32
44 string targetPath = args[1]; 44 string targetPath = args[1];
45 45
46 // check that source_path looks like a source tree by making sure 46 // check that source_path looks like a source tree by making sure
47 // that a README and options file are present 47 // that a README and options file are present
48 writefln("Examining source"); 48 writefln("Examining source");
49 if (!std.path.join(sourcePath, "README").exists || !std.path.join(sourcePath, "options").exists) { 49 if (!buildPath(sourcePath, "README").exists || !buildPath(sourcePath, "options").exists) {
50 writefln("Error - current directory must contain README and options"); 50 writefln("Error - current directory must contain README and options");
51 return -1; 51 return -1;
52 } 52 }
53 53
54 // ensure that target_path exists 54 // ensure that target_path exists
56 if (targetPath.exists) { 56 if (targetPath.exists) {
57 writefln("Error - %s exists - abandoning configure", targetPath); 57 writefln("Error - %s exists - abandoning configure", targetPath);
58 return -1; 58 return -1;
59 } 59 }
60 targetPath.mkdirRecurse; 60 targetPath.mkdirRecurse;
61 string binPath = std.path.join(targetPath, "bin"); 61 string binPath = buildPath(targetPath, "bin");
62 binPath.mkdir; 62 binPath.mkdir;
63 63
64 // compile builder into bin_path 64 // compile builder into bin_path
65 writefln("Building the builder"); 65 writefln("Building the builder");
66 int ret = system(format("dmd -m32 -w -wi %s -O -of%s", 66 int ret = system(format("dmd -m64 -w -wi %s -O -of%s",
67 std.path.join(sourcePath, "builder.d"), std.path.join(binPath, "builder"))); 67 buildPath(sourcePath, "builder.d"), buildPath(binPath, "builder")));
68 if (ret) { 68 if (ret) {
69 writefln("Error - builder failed to compile"); 69 writefln("Error - builder failed to compile");
70 return -1; 70 return -1;
71 } 71 }
72 std.path.join(binPath, "builder.o").remove; 72 buildPath(binPath, "builder.o").remove;
73 73
74 // set up scripts 74 // set up scripts
75 { 75 {
76 auto file = File(std.path.join(targetPath, "build"), "w"); 76 auto file = File(buildPath(targetPath, "build"), "w");
77 file.writefln("#!/bin/bash"); 77 file.writefln("#!/bin/bash");
78 file.writefln("%s %s %s", std.path.join(binPath, "builder"), sourcePath, targetPath); 78 file.writefln("%s %s %s", buildPath(binPath, "builder"), sourcePath, targetPath);
79 } 79 }
80 system("chmod +x " ~ std.path.join(targetPath, "build")); 80 system("chmod +x " ~ buildPath(targetPath, "build"));
81 writefln("All done"); 81 writefln("All done");
82 82
83 return 0; 83 return 0;
84 } 84 }