From: Nick Bowler Date: Fri, 28 Aug 2009 04:35:07 +0000 (-0400) Subject: upkg: Support UOBJECT_MODULE_PATH to add library search paths. X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/commitdiff_plain/8a80b1ded9fffcfa2eb84013b9f412e82943a07f upkg: Support UOBJECT_MODULE_PATH to add library search paths. --- diff --git a/src/package.c b/src/package.c index 1de6096..a095756 100644 --- a/src/package.c +++ b/src/package.c @@ -101,11 +101,19 @@ static void u_pkg_init(UPkg *pkg) static void u_pkg_class_init(UPkgClass *class) { + GTypeModuleClass *modclass = G_TYPE_MODULE_CLASS(class); + const char *modpath = getenv("UOBJECT_MODULE_PATH"); + g_type_class_add_private(class, sizeof (struct upkg_priv)); - GTypeModuleClass *modclass = G_TYPE_MODULE_CLASS(class); + if (lt_dlinit() != 0) { + dl_print_errors(__func__); + } - if (lt_dlinit() != 0 || lt_dlsetsearchpath(PKGLIBDIR) != 0) { + if (modpath && lt_dlsetsearchpath(modpath) != 0) { + dl_print_errors(__func__); + } + if (lt_dladdsearchdir(PKGLIBDIR) != 0) { dl_print_errors(__func__); }