[Mesa-dev] [PATCH] mapi: Only install khrplatform.h with EGL or GLES

Eric Engestrom eric.engestrom at imgtec.com
Thu Jul 13 13:35:49 UTC 2017


On Thursday, 2017-07-13 09:51:20 +0300, Jussi Kukkonen wrote:
> When mesa is built with "--disable-egl --disable-gles1
> --disable-gles2" the KHR platform headers are not needed.
> 
> Not installing the header when not needed allows using mesa for GL
> and another implementation for GLES+EGL (as is done in practice with
> userland on raspberrypi).

I was actually thinking of adding an am_conditional instead, like so:

----8<----
diff --git a/configure.ac b/configure.ac
index 61d98e28e0..46fcd8f3fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1291,6 +1291,9 @@ AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
 AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
                                         "x$enable_gles1" = xyes -o \
                                         "x$enable_gles2" = xyes)
+AM_CONDITIONAL(NEED_KHRPLATFORM, test "x$enable_egl" = xyes -o \
+                                      "x$enable_gles1" = xyes -o \
+                                      "x$enable_gles2" = xyes)
 
 # Validate GLX options
 if test "x$enable_glx" = xyes; then
diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index 9ff70a14fd..83e32d2185 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -242,5 +242,7 @@ es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
 
 include $(top_srcdir)/install-lib-links.mk
 
+if NEED_KHRPLATFORM
 khrdir = $(includedir)/KHR
 khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
+endif
---->8----

> ---
>  src/mapi/Makefile.am | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
> index 9ff70a14fd..94c77fb82c 100644
> --- a/src/mapi/Makefile.am
> +++ b/src/mapi/Makefile.am
> @@ -188,6 +188,8 @@ es1api_libGLESv1_CM_la_LDFLAGS = \
>  	$(LD_NO_UNDEFINED)
>  
>  es1api_libGLESv1_CM_la_LIBADD += shared-glapi/libglapi.la
> +
> +khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
>  endif
>  
>  es1api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
> @@ -233,6 +235,12 @@ es2api_libGLESv2_la_LDFLAGS = \
>  	$(LD_NO_UNDEFINED)
>  
>  es2api_libGLESv2_la_LIBADD += shared-glapi/libglapi.la
> +
> +khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
> +endif
> +
> +if HAVE_EGL
> +khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
>  endif
>  
>  es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
> @@ -243,4 +251,3 @@ es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
>  include $(top_srcdir)/install-lib-links.mk
>  
>  khrdir = $(includedir)/KHR
> -khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
> -- 
> 2.13.2
> 


More information about the mesa-dev mailing list