2018-03-29 12:47:07 +00:00
|
|
|
diff --git a/src/dispatch_common.c b/src/dispatch_common.c
|
2018-09-25 09:50:51 +00:00
|
|
|
index b3e4f5f..303e8f5 100644
|
2018-03-29 12:47:07 +00:00
|
|
|
--- a/src/dispatch_common.c
|
|
|
|
+++ b/src/dispatch_common.c
|
2018-09-25 09:50:51 +00:00
|
|
|
@@ -310,6 +310,19 @@ get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_fail, bool l
|
|
|
|
flags |= RTLD_NOLOAD;
|
|
|
|
|
|
|
|
*handle = dlopen(lib_name, flags);
|
2018-03-29 12:47:07 +00:00
|
|
|
+#ifdef LIBGL_PATH
|
|
|
|
+ if (!*handle) {
|
|
|
|
+ char pathbuf[sizeof(LIBGL_PATH) + 1 + 1024 + 1];
|
|
|
|
+ int l = snprintf(pathbuf, sizeof(pathbuf), "%s/%s", LIBGL_PATH, lib_name);
|
|
|
|
+ if (l < 0 || l >= sizeof(pathbuf)) {
|
|
|
|
+ // This really shouldn't happen
|
|
|
|
+ fprintf(stderr, "Error prefixing library pathname\n");
|
|
|
|
+ exit(1);
|
|
|
|
+ }
|
2018-09-25 09:50:51 +00:00
|
|
|
+ *handle = dlopen(pathbuf, flags);
|
2018-03-29 12:47:07 +00:00
|
|
|
+ }
|
|
|
|
+#endif
|
2018-09-25 09:50:51 +00:00
|
|
|
+
|
2018-03-29 12:47:07 +00:00
|
|
|
if (!*handle) {
|
|
|
|
if (exit_on_fail) {
|
|
|
|
fprintf(stderr, "Couldn't open %s: %s\n", lib_name, dlerror());
|