Host: dlopen libX11.so.6 instead of libX11.so

Symlink libX11.so does not need to be present in system. However,
libX11.so.6 is very common (currently only?) SONAME.
This commit is contained in:
Martin Pulec
2017-06-05 10:34:26 +02:00
parent f8745c504a
commit 4a051e98dc

View File

@@ -28,6 +28,9 @@
#ifdef HAVE_X
#include <dlfcn.h>
#include <X11/Xlib.h>
/// @todo
/// The actual SONAME should be actually figured in configure.
#define X11_LIB_NAME "libX11.so.6"
#endif
#ifdef USE_MTRACE
@@ -124,7 +127,7 @@ bool common_preinit(int argc, char *argv[])
uv_argv = argv;
#ifdef HAVE_X
void *handle = dlopen("libX11.so", RTLD_NOW);
void *handle = dlopen(X11_LIB_NAME, RTLD_NOW);
if (handle) {
Status (*XInitThreadsProc)();
@@ -149,7 +152,7 @@ bool common_preinit(int argc, char *argv[])
dlclose(handle);
} else {
log_msg(LOG_LEVEL_WARNING, "Unable open X11 library: %s\n", dlerror());
log_msg(LOG_LEVEL_WARNING, "Unable open " X11_LIB_NAME " library: %s\n", dlerror());
}
#endif