Author: leo
Date: Sun Aug 14 05:53:12 2005
New Revision: 8957

Added:
   branches/leo-ctx5/docs/running.pod   (props changed)
      - copied unchanged from r8956, trunk/docs/running.pod
Removed:
   branches/leo-ctx5/imcc/docs/running.pod
Modified:
   branches/leo-ctx5/MANIFEST
   branches/leo-ctx5/imcc/main.c
   branches/leo-ctx5/src/library.c
Log:
merge -r8952:8956 from trunk

Modified: branches/leo-ctx5/MANIFEST
==============================================================================
--- branches/leo-ctx5/MANIFEST  (original)
+++ branches/leo-ctx5/MANIFEST  Sun Aug 14 05:53:12 2005
@@ -655,7 +655,6 @@ imcc/docs/imcfaq.pod                    
 imcc/docs/macros.pod                              [main]doc
 imcc/docs/operation.pod                           [main]doc
 imcc/docs/parsing.pod                             [main]doc
-imcc/docs/running.pod                             [main]doc
 imcc/docs/syntax.pod                              [main]doc
 imcc/examples/README                              [main]doc
 imcc/examples/sample.imc                          [main]doc

Modified: branches/leo-ctx5/imcc/main.c
==============================================================================
--- branches/leo-ctx5/imcc/main.c       (original)
+++ branches/leo-ctx5/imcc/main.c       Sun Aug 14 05:53:12 2005
@@ -52,7 +52,7 @@ help_debug(void)
     "--parrot-debug -D [Flags] ...\n"
     "    0001    memory statistics\n"
     "    0002    print backtrace on exception\n"
-    "    0004    JIT debuggin\n"
+    "    0004    JIT debugging\n"
     "    0008    interpreter startup\n"
     "    0010    thread debugging\n"
     "    0020    eval/compile\n"
@@ -90,6 +90,7 @@ help(void)
     "       --gc-debug\n"
     "       --leak-test|--destroy-at-end\n"
     "    -. --wait    Read a keystroke before starting\n"
+    "       --runtime-prefix\n"
     "   <Compiler options>\n"
     "    -d --imcc_debug[=HEXFLAGS]\n"
     "    -v --verbose\n"
@@ -145,10 +146,12 @@ the GNU General Public License or the Ar
 #define OPT_DESTROY_FLAG 129
 #define OPT_HELP_DEBUG   130
 #define OPT_PBC_OUTPUT   131
+#define OPT_RUNTIME_PREFIX  132
+
 static struct longopt_opt_decl options[] = {
     { '.', '.', 0, { "--wait" } },
     { 'C', 'C', 0, { "--CGP-core" } },
-    { 'D', 'D', OPTION_optional_FLAG, { "---parrot-debug" } },
+    { 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } },
     { 'E', 'E', 0, { "--pre-process-only" } },
     { 'G', 'G', 0, { "--no-gc" } },
     { 'O', 'O', OPTION_optional_FLAG, { "--optimize" } },
@@ -169,6 +172,7 @@ static struct longopt_opt_decl options[]
     { '\0', OPT_PBC_OUTPUT, 0, { "--output-pbc" } },
     { 'p', 'p', 0, { "--profile" } },
     { 'r', 'r', 0, { "--run-pbc" } },
+    { '\0', OPT_RUNTIME_PREFIX, 0, { "--runtime-prefix" } },
     { 't', 't', OPTION_optional_FLAG, { "--trace" } },
     { 'v', 'v', 0, { "--verbose" } },
     { 'w', 'w', 0, { "--warnings" } },
@@ -264,6 +268,10 @@ parseflags(Parrot_Interp interp, int *ar
                 help_debug();
                 exit(EX_USAGE);
                 break;
+            case OPT_RUNTIME_PREFIX:
+                printf("%s\n", Parrot_get_runtime_prefix(interp, NULL));
+                exit(0);
+                break;
             case 'V':
                 imcc_version();
                 break;

Modified: branches/leo-ctx5/src/library.c
==============================================================================
--- branches/leo-ctx5/src/library.c     (original)
+++ branches/leo-ctx5/src/library.c     Sun Aug 14 05:53:12 2005
@@ -367,6 +367,17 @@ Parrot_get_runtime_prefix(Interp *interp
 {
     STRING *s, *key;
     PMC *config_hash;
+    int free_it;
+    char *env;
+
+    env = Parrot_getenv("PARROT_RUNTIME", &free_it);
+    if (env) {
+        if (!free_it)
+            env = strdup(env);
+        if (prefix_str)
+            *prefix_str = string_from_cstring(interpreter, env, 0);
+        return env;
+    }
 
     config_hash = VTABLE_get_pmc_keyed_int(interpreter, interpreter->iglobals,
             (INTVAL) IGLOBALS_CONFIG_HASH);

Reply via email to