1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
Index: src/dispatch_common.c
--- src/dispatch_common.c.orig
+++ src/dispatch_common.c
@@ -188,6 +188,11 @@
#define GLES1_LIB "libGLES_CM.dll"
#define GLES2_LIB "libGLESv2.dll"
#define OPENGL_LIB "OPENGL32"
+#elif defined(__OpenBSD__)
+#define GLX_LIB "libGL.so"
+#define EGL_LIB "libEGL.so"
+#define GLES1_LIB "libGLESv1_CM.so"
+#define GLES2_LIB "libGLESv2.so"
#else
#define GLVND_GLX_LIB "libGLX.so.1"
#define GLX_LIB "libGL.so.1"
@@ -306,8 +311,10 @@ get_dlopen_handle(void **handle, const char *lib_name,
pthread_mutex_lock(&api.mutex);
if (!*handle) {
int flags = RTLD_LAZY | RTLD_LOCAL;
+#ifndef __OpenBSD__
if (!load)
flags |= RTLD_NOLOAD;
+#endif
*handle = dlopen(lib_name, flags);
if (!*handle) {
@@ -680,12 +687,16 @@ epoxy_load_gl(void)
#if defined(OPENGL_LIB)
if (!api.gl_handle)
get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true);
-#endif
-
if (!api.gl_handle) {
fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB);
abort();
}
+#else
+ if (!api.gl_handle) {
+ fprintf(stderr, "Couldn't open %s\n", GLX_LIB);
+ abort();
+ }
+#endif
#endif
}
|