# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-SUBDIRS = gtest mapi
+SUBDIRS = gtest loader mapi
if NEED_OPENGL_COMMON
SUBDIRS += glsl mesa
endif
-SUBDIRS += $(SRC_DIRS)
+if HAVE_DRI_GLX
+SUBDIRS += glx
+endif
+
+if HAVE_EGL_PLATFORM_WAYLAND
+SUBDIRS += egl/wayland
+endif
+
+if HAVE_GBM
+SUBDIRS += gbm
+endif
+
+if HAVE_EGL
+SUBDIRS += egl
+endif
+
+if HAVE_GALLIUM
+SUBDIRS += \
+ gallium/auxiliary \
+ gallium/drivers \
+ gallium/state_trackers \
+ gallium/winsys \
+ gallium/targets
+
+if HAVE_GALLIUM_TESTS
+SUBDIRS += \
+ gallium/tests/trivial \
+ gallium/tests/unit
+endif
+endif