[Gd-chatter] r11438 - trunk/gwydion/tools/refman

agent at gwydiondylan.org agent at gwydiondylan.org
Tue Sep 4 06:43:14 CEST 2007


Author: agent
Date: Tue Sep  4 06:43:13 2007
New Revision: 11438

Modified:
   trunk/gwydion/tools/refman/main.dylan
   trunk/gwydion/tools/refman/refman-library.dylan
Log:
Job: gd
Fixed problem where <platform> variable is #f.



Modified: trunk/gwydion/tools/refman/main.dylan
==============================================================================
--- trunk/gwydion/tools/refman/main.dylan	(original)
+++ trunk/gwydion/tools/refman/main.dylan	Tue Sep  4 06:43:13 2007
@@ -11,12 +11,13 @@
   option help?, "", "Help", long: "help", short: "h";
   option libpaths, "", "Library paths", long: "libdir", short: "L",
     kind: <repeated-parameter-option-parser>;
+  option debug?, "", "Debug output", long: "debug";
   synopsis print-help,
     usage: "refman [options] libnames...",
     description:
 "Export a library or libraries to a refman-style XML document, sent to STDOUT."
 "\n"
-"libnames are library names (as in libname.lib.du).";
+"libnames are library names, as in (libname).lib.du.";
 end argument-parser;
 
 
@@ -33,6 +34,14 @@
     exit-application(0);
   end;
 
+  // Set up platform constants.
+  let default-targets-dot-descr
+      = concatenate($default-dylan-dir, "/share/dylan/platforms.descr");
+  parse-platforms-file(as(<file-locator>, default-targets-dot-descr));
+  *current-target* := get-platform-named(as(<symbol>, $default-target-name));
+  define-platform-constants(*current-target*);
+  define-bootstrap-module();
+
   // Set up library search path if not specified.
   let lib-paths =
       if (args.libpaths.empty?)
@@ -46,8 +55,17 @@
       end;
   *data-unit-search-path* := map(curry(as, <directory-locator>), lib-paths);
 
+  if (args.debug?)
+    format-out("Searching paths\n");
+    for (loc in lib-paths)
+      format-out("  %s\n", as(<string>, loc));
+    end for;
+  end if;
+
   // Prevent d2c from using stdout.
-  *debug-output* := make(<string-stream>, direction: #"output");
+  unless (args.debug?)
+    *debug-output* := make(<string-stream>, direction: #"output");
+  end unless;
 
   // Load libraries of interest.
   let target-libraries = map(curry(as, <symbol>), args.libnames);
@@ -68,6 +86,9 @@
   end;
 
   // Print out the XML.
+  if (args.debug?)
+    format-out("Generating XML\n");
+  end if;
   format-out("%s\n", refman($Libraries, target-libraries));
   exit-application(0);
 end function main;

Modified: trunk/gwydion/tools/refman/refman-library.dylan
==============================================================================
--- trunk/gwydion/tools/refman/refman-library.dylan	(original)
+++ trunk/gwydion/tools/refman/refman-library.dylan	Tue Sep  4 06:43:13 2007
@@ -55,4 +55,6 @@
   use macros;
   use compile-time-values;
   use main-constants;
+  use platform;
+  use platform-constants;
 end module;



More information about the chatter mailing list