Skip to content

Commit

Permalink
update setup.winxed to build include files with libraries. Factor out…
Browse files Browse the repository at this point in the history
… the STAT constants into a separate file, since they are inexplicably different from the constants in the stat.pasm file in the parrot repo
  • Loading branch information
Whiteknight committed May 26, 2011
1 parent 872003c commit a3c9e13
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
32 changes: 25 additions & 7 deletions setup.winxed
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function main[main](argv)
"pir_pir" : {},
"inst_lib" : [],
"installable_pbc" : {},
"pasm_winxed" : {},
"include_winxed" : {},
"manifest_includes" : ["CREDITS", "README.md", "setup.winxed"]
};

Expand Down Expand Up @@ -237,7 +237,8 @@ function setup_experimental_libraries(var rosella)
"file/File",
"file/Visitor",
"file/visitor/FileList",
"file/Walker"
"file/Walker",
["file/Constants"]:[named("constants")]
);
}

Expand All @@ -257,21 +258,24 @@ function setup_utilities(var rosella)
}
}

function setup_winxed_lib(var rosella, string name, var includes, var files [slurpy])
function setup_winxed_lib(var rosella, string name, var includes, var files [slurpy],
var named [slurpy,named])
{
setup_lib_internal(rosella, name, "src/", includes, files);
setup_lib_internal(rosella, name, "src/", includes, files, named);
}

function setup_unstable_lib(var rosella, string name, var includes, var files [slurpy])
function setup_unstable_lib(var rosella, string name, var includes, var files [slurpy],
var named [slurpy,named])
{
setup_lib_internal(rosella, name, "src/unstable/", includes, files);
setup_lib_internal(rosella, name, "src/unstable/", includes, files, named);
}

function setup_lib_internal(var rosella, string name, string prefix,
var includes, var files_raw)
var includes, var files_raw, var named)
{
var pbc_files = [];
var pir_files = [];
setup_lib_constants(rosella, name, prefix, named);

// Get a list of all files
var files = [];
Expand All @@ -297,6 +301,20 @@ function setup_lib_internal(var rosella, string name, string prefix,
rosella["manifest_includes"].push(pir_lib_name);
}

function setup_lib_constants(var rosella, string name, string prefix, var args)
{
var constants_files = args["constants"];
if (constants_files == null || elements(constants_files) == 0)
return;
for (string constant_file in constants_files) {
string pasm_file = sprintf("%s%s.pasm", [prefix, constant_file]);
string winxed_file = sprintf("%s%s.winxed", [prefix, constant_file]);
rosella["include_winxed"][pasm_file] = winxed_file;
}
}



// Load in the distutils library, which we are also responsible for
// building. If we don't have a version handy, load in the bootstrapping
// version. If we do have one built, use that instead
Expand Down
6 changes: 2 additions & 4 deletions src/unstable/file/Walker.winxed
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$include_const "src/unstable/file/Constants.pasm";

namespace Rosella { namespace File
{
class Walker
Expand All @@ -24,8 +26,6 @@ namespace Rosella { namespace File
// subdirectories, if requested.
function visit_dir(string path, string name, var visitor)
{
int STAT_ISREG = 0x8000;
int STAT_ISDIR = 0x4000;
visitor.begin_folder(path, name);
var contents_raw = self.os.readdir(path);

Expand All @@ -50,8 +50,6 @@ namespace Rosella { namespace File

function get_file_details(string entry)
{
int STAT_ISREG = 0x8000;
int STAT_ISDIR = 0x4000;
var stat = self.os.stat(entry);
int mode = stat[2];
int isdir = 0;
Expand Down

0 comments on commit a3c9e13

Please sign in to comment.