[svn:parrot] r44102 - in trunk: . src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Feb 17 18:09:24 UTC 2010


Author: NotFound
Date: Wed Feb 17 18:09:23 2010
New Revision: 44102
URL: https://trac.parrot.org/parrot/changeset/44102

Log:
experimental env vars PARROT_LIBRARY and PARROT_INCLUDE, TT #1429

Modified:
   trunk/DEPRECATED.pod
   trunk/src/main.c

Modified: trunk/DEPRECATED.pod
==============================================================================
--- trunk/DEPRECATED.pod	Wed Feb 17 18:02:59 2010	(r44101)
+++ trunk/DEPRECATED.pod	Wed Feb 17 18:09:23 2010	(r44102)
@@ -337,6 +337,13 @@
 
 =over 4
 
+=item PARROT_LIBRARY and PARROT_INCLUDE environment variables [experimental]
+
+L<https://trac.parrot.org/parrot/ticket/1429>
+
+A way to provide an equivalent of -L and -I parrot command line options
+to language that doesn't support it.
+
 =item MT19937 [eligible in 2.1]
 
 L<https://trac.parrot.org/parrot/ticket/1278> - latest version now hosted

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	Wed Feb 17 18:02:59 2010	(r44101)
+++ trunk/src/main.c	Wed Feb 17 18:09:23 2010	(r44102)
@@ -128,6 +128,18 @@
     initialize_interpreter(interp, (void*)&stacktop);
     imcc_initialize(interp);
 
+    { /* EXPERIMENTAL: add library and include paths from environment */
+        PMC *env = pmc_new(interp, enum_class_Env);
+        STRING *path = VTABLE_get_string_keyed_str(interp, env,
+                Parrot_str_new_constant(interp, "PARROT_LIBRARY"));
+        if (!STRING_IS_NULL(path) && Parrot_str_length(interp, path) > 0)
+            Parrot_lib_add_path(interp, path, PARROT_LIB_PATH_LIBRARY);
+        path = VTABLE_get_string_keyed_str(interp, env,
+                Parrot_str_new_constant(interp, "PARROT_INCLUDE"));
+        if (!STRING_IS_NULL(path) && Parrot_str_length(interp, path) > 0)
+            Parrot_lib_add_path(interp, path, PARROT_LIB_PATH_INCLUDE);
+    }
+
     /* Parse flags */
     sourcefile = parseflags(interp, &argc, &argv, &core, &trace);
 


More information about the parrot-commits mailing list