Open barracuda156 opened 2 years ago
After EGL enabled and dylib location set, build fails with:
../anholt-libepoxy-70a20c6/test/egl_without_glx.c: In function 'dlopen':
../anholt-libepoxy-70a20c6/test/egl_without_glx.c:69:30: error: 'RTLD_NEXT' undeclared (first use in this function); did you mean 'RTLD_NOW'?
69 | dlopen_unwrapped = dlsym(RTLD_NEXT, "dlopen");
| ^~~~~~~~~
| RTLD_NOW
../anholt-libepoxy-70a20c6/test/egl_has_extension_nocontext.c: In function 'main':
../anholt-libepoxy-70a20c6/test/egl_has_extension_nocontext.c:61:24: error: implicit declaration of function 'strndup' [-Werror=implicit-function-declaration]
61 | an_extension = strndup(extensions, first_space - extensions);
| ^~~~~~~
../anholt-libepoxy-70a20c6/test/egl_has_extension_nocontext.c:61:24: warning: incompatible implicit declaration of built-in function 'strndup' [-Wbuiltin-declaration-mismatch]
cc1: some warnings being treated as errors
../anholt-libepoxy-70a20c6/test/egl_epoxy_api.c: In function 'main':
../anholt-libepoxy-70a20c6/test/egl_epoxy_api.c:134:24: error: implicit declaration of function 'strndup' [-Werror=implicit-function-declaration]
134 | an_extension = strndup(extensions, first_space - extensions);
| ^~~~~~~
../anholt-libepoxy-70a20c6/test/egl_epoxy_api.c:134:24: warning: incompatible implicit declaration of built-in function 'strndup' [-Wbuiltin-declaration-mismatch]
cc1: some warnings being treated as errors
_DARWIN_C_SOURCE
definition should be added, that fixes error: 'RTLD_NEXT' undeclared
.
So, EGLDisplay
error is fixed like this:
--- src/dispatch_common.h.orig 2022-02-17 19:56:12.000000000 +0700
+++ src/dispatch_common.h 2022-09-01 21:11:53.000000000 +0700
@@ -28,7 +28,7 @@
#define PLATFORM_HAS_GLX ENABLE_GLX
#define PLATFORM_HAS_WGL 1
#elif defined(__APPLE__)
-#define PLATFORM_HAS_EGL 0
+#define PLATFORM_HAS_EGL ENABLE_EGL
#define PLATFORM_HAS_GLX ENABLE_GLX
#define PLATFORM_HAS_WGL 0
#elif defined(ANDROID)
--- src/dispatch_common.c.orig 2022-02-17 19:56:12.000000000 +0700
+++ src/dispatch_common.c 2022-09-01 21:11:35.000000000 +0700
@@ -174,7 +174,8 @@
#include "dispatch_common.h"
#if defined(__APPLE__)
-#define GLX_LIB "/opt/X11/lib/libGL.1.dylib"
+#define GLX_LIB "@PREFIX@/lib/libGL.1.dylib"
+#define EGL_LIB "@PREFIX@/lib/libEGL.1.dylib"
#define OPENGL_LIB "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
#define GLES1_LIB "libGLESv1_CM.so"
#define GLES2_LIB "libGLESv2.so"
Obviously however, libEGL.1.dylib
should be installed first, it is not there by default.
Compilation fails with
Egl
option enabled on 10.6.8:P. S.
mesa
@19.0.8_1+osmesa+python27 (with Egl support enabled),gcc12
@12.2.0.