diff options
Diffstat (limited to 'EGL/yagl_egl_state.c')
-rw-r--r-- | EGL/yagl_egl_state.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/EGL/yagl_egl_state.c b/EGL/yagl_egl_state.c index 3e56841..03062c5 100644 --- a/EGL/yagl_egl_state.c +++ b/EGL/yagl_egl_state.c @@ -41,6 +41,12 @@ #include <pthread.h> #include <dlfcn.h> +#ifdef __x86_64__ +#define LIBPATH "/usr/lib64/driver/" +#else +#define LIBPATH "/usr/lib/driver/" +#endif + struct yagl_egl_state { EGLint error; @@ -74,11 +80,11 @@ void *yagl_get_gles1_sym(const char *name) } if (!state->gles1_handle) { - state->gles1_handle = dlopen("/usr/lib/driver/libGLESv1_CM.so.1", + state->gles1_handle = dlopen(LIBPATH"libGLESv1_CM.so.1", RTLD_NOW | RTLD_GLOBAL); if (!state->gles1_handle) { - state->gles1_handle = dlopen("/usr/lib/driver/libGLESv1_CM.so", + state->gles1_handle = dlopen(LIBPATH"libGLESv1_CM.so", RTLD_NOW | RTLD_GLOBAL); } } @@ -98,11 +104,11 @@ void *yagl_get_gles2_sym(const char *name) void *sym = NULL; if (!state->gles2_handle) { - state->gles2_handle = dlopen("/usr/lib/driver/libGLESv2.so.1", + state->gles2_handle = dlopen(LIBPATH"libGLESv2.so.1", RTLD_NOW | RTLD_GLOBAL); if (!state->gles2_handle) { - state->gles2_handle = dlopen("/usr/lib/driver/libGLESv2.so", + state->gles2_handle = dlopen(LIBPATH"libGLESv2.so", RTLD_NOW | RTLD_GLOBAL); } } @@ -198,7 +204,7 @@ static void yagl_egl_state_init() * Perhaps common EGL/GLES code needs to be moved to a separate * library in the future. */ - state->egl_handle = dlopen("/usr/lib/driver/libEGL.so", + state->egl_handle = dlopen(LIBPATH"libEGL.so", RTLD_NOW | RTLD_GLOBAL); pthread_setspecific(g_state_key, state); |