1 From 7eff2bf8e27599c1c94217b2bb1b73d4b7d18e59 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3 Date: Wed, 6 May 2015 10:45:22 +0200
4 Subject: [PATCH 1/4] select platforms based on configuration results
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
10 Fetched from pull #81 on github for libepoxy:
11 https://github.com/anholt/libepoxy/pull/81/commits
12 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
14 configure.ac | 13 +++++--------
15 src/dispatch_common.c | 9 ++++++---
16 src/dispatch_common.h | 9 +++++----
17 3 files changed, 16 insertions(+), 15 deletions(-)
19 diff --git a/configure.ac b/configure.ac
20 index 2d67726..225ab73 100644
23 @@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
24 # uintptr_t to a void *") by default. Kill that.
25 XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
27 +PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
29 +AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
34 @@ -86,7 +90,7 @@ case $host_os in
41 # On platforms with dlopen, we load everything dynamically and
42 # don't link against a specific window system or GL implementation.
43 @@ -144,13 +148,6 @@ esac
45 AC_SUBST([VISIBILITY_CFLAGS])
47 -PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
48 -if test x$x11 = xno -a x$build_glx = xyes; then
49 - AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
52 -AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
54 PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
57 diff --git a/src/dispatch_common.c b/src/dispatch_common.c
58 index 013027f..163d348 100644
59 --- a/src/dispatch_common.c
60 +++ b/src/dispatch_common.c
61 @@ -656,10 +656,13 @@ epoxy_get_proc_address(const char *name)
62 #elif defined(__APPLE__)
63 return epoxy_gl_dlsym(name);
66 if (epoxy_current_context_is_glx()) {
67 return glXGetProcAddressARB((const GLubyte *)name);
70 +#endif /* PLATFORM_HAS_GLX */
73 GLenum egl_api = epoxy_egl_get_current_gl_context_api();
76 @@ -669,10 +672,10 @@ epoxy_get_proc_address(const char *name)
82 +#endif /* PLATFORM_HAS_EGL */
83 errx(1, "Couldn't find current GLX or EGL context.\n");
85 +#endif /* _WIN32 | __APPLE__*/
88 WRAPPER_VISIBILITY (void)
89 diff --git a/src/dispatch_common.h b/src/dispatch_common.h
90 index 676a4d5..2728b45 100644
91 --- a/src/dispatch_common.h
92 +++ b/src/dispatch_common.h
101 #define PLATFORM_HAS_EGL 0
102 #define PLATFORM_HAS_GLX 0
103 -#define PLATFORM_HAS_WGL 1
104 +#define PLATFORM_HAS_WGL BUILD_WGL
105 #define EPOXY_IMPORTEXPORT __declspec(dllexport)
106 #elif defined(__APPLE__)
107 #define PLATFORM_HAS_EGL 0
109 #define PLATFORM_HAS_WGL 0
110 #define EPOXY_IMPORTEXPORT
111 #elif defined(ANDROID)
112 -#define PLATFORM_HAS_EGL 1
113 +#define PLATFORM_HAS_EGL BUILD_EGL
114 #define PLATFORM_HAS_GLX 0
115 #define PLATFORM_HAS_WGL 0
116 #define EPOXY_IMPORTEXPORT
118 -#define PLATFORM_HAS_EGL 1
119 -#define PLATFORM_HAS_GLX 1
120 +#define PLATFORM_HAS_EGL BUILD_EGL
121 +#define PLATFORM_HAS_GLX BUILD_GLX
122 #define PLATFORM_HAS_WGL 0
123 #define EPOXY_IMPORTEXPORT