[svn:parrot] r36783 - trunk/src
allison at svn.parrot.org
allison at svn.parrot.org
Mon Feb 16 05:12:05 UTC 2009
Author: allison
Date: Mon Feb 16 05:12:04 2009
New Revision: 36783
URL: https://trac.parrot.org/parrot/changeset/36783
Log:
[install] Fix versioned library search paths, generating the paths from the
config data.
Modified:
trunk/src/library.c
Modified: trunk/src/library.c
==============================================================================
--- trunk/src/library.c Mon Feb 16 04:53:01 2009 (r36782)
+++ trunk/src/library.c Mon Feb 16 05:12:04 2009 (r36783)
@@ -159,7 +159,8 @@
{
ASSERT_ARGS(parrot_init_library_paths)
PMC *paths;
- STRING *entry, *version, *versionlib;
+ STRING *entry;
+ STRING *versionlib = NULL;
PMC * const iglobals = interp->iglobals;
PMC * const config_hash =
@@ -183,19 +184,16 @@
entry = CONST_STRING(interp, "./");
VTABLE_push_string(interp, paths, entry);
if (VTABLE_elements(interp, config_hash)) {
- STRING * const key = CONST_STRING(interp, "includedir");
- entry = VTABLE_get_string_keyed_str(interp, config_hash, key);
+ STRING * const libkey = CONST_STRING(interp, "libdir");
+ STRING * const verkey = CONST_STRING(interp, "versiondir");
+ versionlib = VTABLE_get_string_keyed_str(interp, config_hash, libkey);
+ entry = VTABLE_get_string_keyed_str(interp, config_hash, verkey);
+ versionlib = Parrot_str_append(interp, versionlib, entry);
+ entry = Parrot_str_concat(interp, versionlib, CONST_STRING(interp, "/include/"), 0);
VTABLE_push_string(interp, paths, entry);
}
entry = CONST_STRING(interp, "lib/parrot/include/");
VTABLE_push_string(interp, paths, entry);
- entry = CONST_STRING(interp, "lib/parrot/");
- VTABLE_push_string(interp, paths, entry);
-
- version = CONST_STRING(interp, PARROT_VERSION);
- versionlib = Parrot_str_append(interp, entry, version);
- entry = Parrot_str_append(interp, versionlib, CONST_STRING(interp, "/include/"));
- VTABLE_push_string(interp, paths, entry);
/* define library paths */
@@ -208,17 +206,12 @@
VTABLE_push_string(interp, paths, entry);
entry = CONST_STRING(interp, "./");
VTABLE_push_string(interp, paths, entry);
- if (VTABLE_elements(interp, config_hash)) {
- STRING * const key = CONST_STRING(interp, "libdir");
- entry = VTABLE_get_string_keyed_str(interp, config_hash, key);
+ if (!STRING_IS_NULL(versionlib)) {
+ entry = Parrot_str_concat(interp, versionlib, CONST_STRING(interp, "/library/"), 0);
VTABLE_push_string(interp, paths, entry);
}
entry = CONST_STRING(interp, "lib/parrot/library/");
VTABLE_push_string(interp, paths, entry);
- entry = CONST_STRING(interp, "lib/parrot/");
- VTABLE_push_string(interp, paths, entry);
- entry = Parrot_str_append(interp, versionlib, CONST_STRING(interp, "/library/"));
- VTABLE_push_string(interp, paths, entry);
/* define dynext paths */
paths = pmc_new(interp, enum_class_ResizableStringArray);
@@ -226,12 +219,14 @@
PARROT_LIB_PATH_DYNEXT, paths);
entry = CONST_STRING(interp, "runtime/parrot/dynext/");
VTABLE_push_string(interp, paths, entry);
+ if (!STRING_IS_NULL(versionlib)) {
+ entry = Parrot_str_concat(interp, versionlib, CONST_STRING(interp, "/dynext/"), 0);
+ VTABLE_push_string(interp, paths, entry);
+ }
entry = CONST_STRING(interp, "");
VTABLE_push_string(interp, paths, entry);
entry = CONST_STRING(interp, "lib/parrot/dynext/");
VTABLE_push_string(interp, paths, entry);
- entry = Parrot_str_append(interp, versionlib, CONST_STRING(interp, "/dynext/"));
- VTABLE_push_string(interp, paths, entry);
/* shared exts */
paths = pmc_new(interp, enum_class_ResizableStringArray);
More information about the parrot-commits
mailing list