+if HAVE_OPENGL
+gldir = $(includedir)/GL
+gl_HEADERS = \
+ $(top_srcdir)/include/GL/gl.h \
+ $(top_srcdir)/include/GL/glext.h \
+ $(top_srcdir)/include/GL/glcorearb.h \
+ $(top_srcdir)/include/GL/gl_mangle.h
+endif
+
+# TODO: When building with glvnd, glvnd itself should be providing gl.pc and the headers
+if HAVE_GLX
+glxdir = $(includedir)/GL
+glx_HEADERS = \
+ $(top_srcdir)/include/GL/glx.h \
+ $(top_srcdir)/include/GL/glxext.h \
+ $(top_srcdir)/include/GL/glx_mangle.h
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = mesa/gl.pc
+endif
+
+if HAVE_COMMON_OSMESA
+osmesadir = $(includedir)/GL
+osmesa_HEADERS = $(top_srcdir)/include/GL/osmesa.h
+endif
+
+# include only conditionally ?
+SUBDIRS += compiler
+
+## Optionally required by EGL
+if HAVE_PLATFORM_WAYLAND
+SUBDIRS += egl/wayland/wayland-drm
+endif
+
+if HAVE_VULKAN_COMMON
+SUBDIRS += vulkan
+endif
+
+EXTRA_DIST += vulkan/registry/vk.xml
+
+if HAVE_AMD_DRIVERS
+SUBDIRS += amd
+endif
+
+if HAVE_INTEL_DRIVERS
+SUBDIRS += intel
+endif
+
+if HAVE_BROADCOM_DRIVERS
+SUBDIRS += broadcom
+endif
+
+if HAVE_FREEDRENO_DRIVERS
+SUBDIRS += freedreno
+endif
+