diff --git a/configure.ac b/configure.ac index 5b61ace..c2815b7 100644 --- a/configure.ac +++ b/configure.ac @@ -64,6 +64,12 @@ case $host_os in # (like checking for EGL and GLX libs in non-windows.). AC_SUBST([LOG_COMPILER], [wine]) ;; + darwin*) + build_egl=no + build_glx=yes + build_wgl=no + EPOXY_LINK_LIBS="" + ;; *) build_egl=yes build_glx=yes diff --git a/src/dispatch_common.c b/src/dispatch_common.c index d5051cd..ac92712 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -310,7 +310,11 @@ epoxy_conservative_has_gl_extension(const char *ext) void * epoxy_egl_dlsym(const char *name) { +#if PLATFORM_HAS_EGL return do_dlsym(&api.egl_handle, "libEGL.so.1", name, true); +#else + return NULL; +#endif } void * @@ -365,7 +369,11 @@ epoxy_get_proc_address(const char *name) return wglGetProcAddress(name); #else if (api.egl_handle) { +#if PLATFORM_HAS_EGL return eglGetProcAddress(name); +#else + return NULL; +#endif } else if (api.glx_handle) { return glXGetProcAddressARB((const GLubyte *)name); } else { @@ -377,16 +385,19 @@ epoxy_get_proc_address(const char *name) * application's namespace, then use that. */ PFNGLXGETPROCADDRESSARBPROC glx_gpa; - PFNEGLGETPROCADDRESSPROC egl_gpa; +#if PLATFORM_HAS_EGL + PFNEGLGETPROCADDRESSPROC egl_gpa; egl_gpa = dlsym(NULL, "eglGetProcAddress"); if (egl_gpa) return egl_gpa(name); +#endif glx_gpa = dlsym(NULL, "glXGetProcAddressARB"); if (glx_gpa) return glx_gpa((const GLubyte *)name); +#if PLATFORM_HAS_EGL /* OK, couldn't find anything in the app's address space. * Presumably they dlopened with RTLD_LOCAL, which hides it * from us. Just go dlopen()ing likely libraries and try them. @@ -395,6 +406,7 @@ epoxy_get_proc_address(const char *name) false); if (egl_gpa) return egl_gpa(name); +#endif /* PLATFORM_HAS_EGL */ return do_dlsym(&api.glx_handle, "libGL.so.1", "glXGetProcAddressARB", false); diff --git a/src/dispatch_common.h b/src/dispatch_common.h index f18fd7b..45b6c45 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -27,6 +27,10 @@ #define PLATFORM_HAS_EGL 0 #define PLATFORM_HAS_GLX 0 #define PLATFORM_HAS_WGL 1 +#elif defined(__APPLE__) +#define PLATFORM_HAS_EGL 0 +#define PLATFORM_HAS_GLX 1 +#define PLATFORM_HAS_WGL 0 #else #define PLATFORM_HAS_EGL 1 #define PLATFORM_HAS_GLX 1