+with_libunwind = get_option('libunwind')
+with_asm = get_option('asm')
+with_llvm = get_option('llvm')
+if get_option('texture-float')
+ pre_args += '-DTEXTURE_FLOAT_ENABLED'
+ message('WARNING: Floating-point texture enabled. Please consult docs/patents.txt and your lawyer before building mesa.')
+endif
+
+# XXX: yeah, do these
+with_appledri = false
+with_windowsdri = false
+
+dri_drivers_path = get_option('dri-drivers-path')
+if dri_drivers_path == ''
+ dri_drivers_path = join_paths(get_option('libdir'), 'dri')
+endif
+
+with_gles1 = get_option('gles1')
+with_gles2 = get_option('gles2')
+with_opengl = get_option('opengl')
+with_any_opengl = with_opengl or with_gles1 or with_gles2
+# Only build shared_glapi if at least one OpenGL API is enabled
+with_shared_glapi = get_option('shared-glapi') and with_any_opengl
+
+# TODO: these will need options, but at the moment they just control header
+# installs
+with_osmesa = false
+
+# shared-glapi is required if at least two OpenGL APIs are being built
+if not with_shared_glapi
+ if ((with_gles1 and with_gles2) or (with_gles1 and with_opengl)
+ or (with_gles2 and with_opengl))
+ error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
+ endif
+endif
+
+# We require OpenGL for OpenGL ES
+if (with_gles1 or with_gles2) and not with_opengl
+ error('building OpenGL ES without OpenGL is not supported.')
+endif
+
+with_dri = false
+with_dri_i915 = false
+with_dri_i965 = false
+with_dri_r100 = false
+with_dri_r200 = false
+with_dri_nouveau = false
+with_dri_swrast = false
+_drivers = get_option('dri-drivers')
+if _drivers != ''
+ _split = _drivers.split(',')
+ with_dri_i915 = _split.contains('i915')
+ with_dri_i965 = _split.contains('i965')
+ with_dri_r100 = _split.contains('r100')
+ with_dri_r200 = _split.contains('r200')
+ with_dri_nouveau = _split.contains('nouveau')
+ with_dri_swrast = _split.contains('swrast')
+ with_dri = true
+endif