scons: builtin_glsl_function on windows needs bundled getopt.
[mesa.git] / SConstruct
index 368ad83edf3f552bf837c9368784370c8e885d92..19d8b13ccc939195d0252e81156d633a598784cd 100644 (file)
@@ -56,6 +56,12 @@ else:
 
 Help(opts.GenerateHelpText(env))
 
+# fail early for a common error on windows
+if env['gles']:
+    try:
+        import libxml2
+    except ImportError:
+        raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
 
 #######################################################################
 # Environment setup
@@ -115,8 +121,6 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
 # for debugging
 #print env.Dump()
 
-Export('env')
-
 
 #######################################################################
 # Invoke host SConscripts 
@@ -126,7 +130,7 @@ Export('env')
 #
 
 # Create host environent
-if env['platform'] != common.host_platform:
+if env['crosscompile'] and env['platform'] != 'embedded':
     host_env = Environment(
         options = opts,
         # no tool used
@@ -143,13 +147,18 @@ if env['platform'] != common.host_platform:
 
     host_env.Tool('gallium')
 
+    host_env['hostonly'] = True
+    assert host_env['crosscompile'] == False
+
+    Export(env = host_env)
+
     SConscript(
-        'src/glsl/SConscript',
+        'src/SConscript',
         variant_dir = host_env['build_dir'],
         duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
-        exports={'env':host_env},
     )
 
+Export('env')
 
 #######################################################################
 # Invoke SConscripts