]> git.draconx.ca Git - upkg.git/blobdiff - src/package.c
build: Add uobject/package.h to Makefile.am
[upkg.git] / src / package.c
index 7b3b723dd61373d03867cdee99916ede13812c6f..a0957563bb4246985456542556794420325cb0cd 100644 (file)
@@ -101,14 +101,22 @@ static void u_pkg_init(UPkg *pkg)
 
 static void u_pkg_class_init(UPkgClass *class)
 {
-       g_type_class_add_private(class, sizeof (struct upkg_priv));
-
        GTypeModuleClass *modclass = G_TYPE_MODULE_CLASS(class);
+       const char *modpath = getenv("UOBJECT_MODULE_PATH");
+
+       g_type_class_add_private(class, sizeof (struct upkg_priv));
 
        if (lt_dlinit() != 0) {
                dl_print_errors(__func__);
        }
 
+       if (modpath && lt_dlsetsearchpath(modpath) != 0) {
+               dl_print_errors(__func__);
+       }
+       if (lt_dladdsearchdir(PKGLIBDIR) != 0) {
+               dl_print_errors(__func__);
+       }
+
        modclass->load   = u_pkg_load;
        modclass->unload = u_pkg_unload;
 }