scons: Add Haiku build support
authorAlexander von Gluck IV <kallisti5@unixzen.com>
Mon, 16 Jan 2012 12:42:05 +0000 (12:42 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 17 Jan 2012 20:01:14 +0000 (20:01 +0000)
Enables building stock Mesa under the Haiku operating system.

common.py
scons/gallium.py
src/SConscript
src/gallium/SConscript
src/glu/sgi/SConscript

index 5578f72af1fa5675987a6496f085bf77c4da4238..2674f327bd8b3bee8f097b2810418c91850ec973 100644 (file)
--- a/common.py
+++ b/common.py
@@ -83,7 +83,7 @@ def AddOptions(opts):
        opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
                                                                                         allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
        opts.Add(EnumOption('platform', 'target platform', host_platform,
-                                                                                        allowed_values=('linux', 'windows', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
+                                                                                        allowed_values=('linux', 'windows', 'darwin', 'cygwin', 'sunos', 'freebsd8', 'haiku')))
        opts.Add(BoolOption('embedded', 'embedded build', 'no'))
        opts.Add('toolchain', 'compiler toolchain', default_toolchain)
        opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
index 221d1848f6dc646ff80438041c1f6065ee9ef42d..5a0c6fef13c175b0069afa3492ad93980e09a9cf 100755 (executable)
@@ -289,6 +289,8 @@ def generate(env):
             cppdefines += ['_DEBUG']
     if platform == 'windows':
         cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
+    if platform == 'haiku':
+        cppdefines += ['BEOS_THREADS']
     if env['embedded']:
         cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
     env.Append(CPPDEFINES = cppdefines)
index 0a30838def98d73c66340f5b3304395119e79121..ba6be0be1a0a1b916c53ec08669f9b6a8c07f221 100644 (file)
@@ -22,10 +22,11 @@ SConscript('mesa/SConscript')
 SConscript('mapi/vgapi/SConscript')
 
 if not env['embedded']:
-    if env['platform'] not in ['windows', 'darwin']:
+    if env['platform'] not in ['windows', 'darwin', 'haiku']:
         SConscript('glx/SConscript')
-    if env['platform'] not in ['darwin']:
+    if env['platform'] not in ['darwin', 'haiku']:
         SConscript('egl/main/SConscript')
+    if env['platform'] not in ['darwin']:
         SConscript('glu/sgi/SConscript')
 
     if env['gles']:
index 4f4650698bd95fc73cff136e49a378a020a3cc69..8efd04c84124dd3f1a9059668de1b1827215794c 100644 (file)
@@ -10,16 +10,22 @@ SConscript('auxiliary/SConscript')
 # Drivers
 #
 
+# These are common and work across all platforms
 SConscript([
     'drivers/galahad/SConscript',
     'drivers/identity/SConscript',
-    'drivers/llvmpipe/SConscript',
     'drivers/rbug/SConscript',
     'drivers/softpipe/SConscript',
-    'drivers/svga/SConscript',
     'drivers/trace/SConscript',
 ])
 
+# These drivers do not build on Haiku
+if env['platform'] not in ['haiku']:
+    SConscript([
+        'drivers/llvmpipe/SConscript',
+        'drivers/svga/SConscript',
+    ])
+
 if not env['msvc']:
     # These drivers do not build on MSVC compilers
     SConscript([
@@ -53,7 +59,7 @@ SConscript('winsys/sw/null/SConscript')
 
 if not env['embedded']:
     SConscript('state_trackers/vega/SConscript')
-    if env['platform'] not in ['darwin']:
+    if env['platform'] not in ['darwin', 'haiku']:
         SConscript('state_trackers/egl/SConscript')
 
     if env['x11']:
@@ -83,7 +89,7 @@ SConscript([
 ])
 
 if not env['embedded']:
-    if env['platform'] not in ['darwin']:
+    if env['platform'] not in ['darwin', 'haiku']:
         SConscript([
             'targets/egl-static/SConscript'
         ])
index 94c74267fd208e4c0db50fb88c79c3e60714642a..97405d86911de9c2e1a4755d8503c82a49670cab 100644 (file)
@@ -122,12 +122,18 @@ else:
     ])
     target = 'glu'
 
-glu = env.SharedLibrary(
-    target = target,
-    source = sources
-)
+if env['platform'] == 'haiku':
+    glu = env.StaticLibrary(
+        target = target,
+        source = sources
+    )
+else:
+    glu = env.SharedLibrary(
+        target = target,
+        source = sources
+    )
+    env.Alias('glu', env.InstallSharedLibrary(glu, version=(1, 3, 0)))
 
-env.Alias('glu', env.InstallSharedLibrary(glu, version=(1, 3, 0)))
 
 if env['platform'] == 'windows':
     glu = env.FindIxes(glu, 'LIBPREFIX', 'LIBSUFFIX')