[Mesa-dev] [PATCH 06/12] egl_dri2: a ton of blob

Alexander von Gluck IV kallisti5 at unixzen.com
Mon Dec 22 06:36:05 PST 2014


From: Emil Velikov <emil.l.velikov at gmail.com>

Attempt to get a egl_dri2 SConscript
 - Drop going into the gallium egl-static
 - Promote the main library to a shared one.
 - Convert libEGL_Haiku into a conv. library - shove a demo platform_x11.
 - s/HAVE_EGL_PLATFORM_HAIKU/HAVE_HAIKU_PLATFORM/
 - A ton of extra crap all over.

Not even build tested, and I don't expect it to build properly yet.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/SConscript                  |    2 +-
 src/egl/drivers/dri2/SConscript |   33 ++++++++++++++++++++++++---------
 src/egl/drivers/dri2/egl_dri2.c |    6 ++++++
 src/egl/drivers/dri2/egl_dri2.h |    2 +-
 src/egl/main/SConscript         |   12 ++++++++++--
 src/gallium/SConscript          |    6 ------
 6 files changed, 42 insertions(+), 19 deletions(-)

diff --git a/src/SConscript b/src/SConscript
index 6cac490..9c69b42 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -24,7 +24,6 @@ SConscript('mapi/glapi/SConscript')
 # Haiku C++ libGL dispatch (renderers depend on libgl)
 if env['platform'] in ['haiku']:
     SConscript('hgl/SConscript')
-    SConscript('egl/drivers/dri2/SConscript')
 
 SConscript('mesa/SConscript')
 
@@ -34,6 +33,7 @@ if not env['embedded']:
     if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'):
         SConscript('glx/SConscript')
     if env['platform'] not in ['darwin', 'sunos']:
+        SConscript('egl/drivers/dri2/SConscript')
         SConscript('egl/main/SConscript')
 
     if env['gles']:
diff --git a/src/egl/drivers/dri2/SConscript b/src/egl/drivers/dri2/SConscript
index b122182..2c081d2 100644
--- a/src/egl/drivers/dri2/SConscript
+++ b/src/egl/drivers/dri2/SConscript
@@ -3,22 +3,37 @@ Import('*')
 env = env.Clone()
 
 env.Append(CPPDEFINES = [
-	'HAVE_EGL_PLATFORM_HAIKU',
-	'DEFAULT_DRIVER_DIR=\\"\\"'
+    'DEFAULT_DRIVER_DIR=\\"\\"'
 ])
 
 env.Append(CPPPATH = [
-	'#/src/egl/main',
+    '#/include',
+    '#/src/egl/main',
+    '#/src/loader',
 ])
 
 sources = [
-	'egl_dri2.c',
-	'platform_haiku.cpp',
+    'egl_dri2.c',
 ]
 
-libEGL_Haiku = env.SharedLibrary(
-	target = 'egl_haiku.so',
-	source = sources,
+if env['platform'] == 'haiku':
+    sources.append('platform_haiku.cpp')
+    env.Append(CPPDEFINES = [
+        'HAVE_HAIKU_PLATFORM',
+    ])
+
+if env['x11']:
+    sources.append('platform_x11.cpp')
+    env.Append(CPPDEFINES = [
+        'HAVE_X11_PLATFORM',
+    ])
+    env.Append([CPPPATH = [
+#        'XCB_DRI2_CFLAGS',
+    ])
+
+egl_dri2 = env.ConvenienceLibrary(
+    target = 'egl_dri2',
+    source = sources,
 )
 
-Export('libEGL_Haiku')
+Export('egl_dri2')
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 2a6811c..062fb54 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -657,6 +657,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
          return EGL_TRUE;
       return dri2_initialize_android(drv, disp);
 #endif
+#ifdef HAVE_HAIKU_PLATFORM
+   case _EGL_PLATFORM_HAIKU:
+      if (disp->Options.TestOnly)
+         return EGL_TRUE;
+      return dri2_initialize_haiku(drv, disp);
+#endif
 
    default:
       _eglLog(_EGL_WARNING, "No EGL platform enabled.");
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 8cdf810..0486b4f 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -198,7 +198,7 @@ struct dri2_egl_display
    uint32_t                  capabilities;
 #endif
 
-#ifdef HAVE_EGL_PLATFORM_HAIKU
+#ifdef HAVE_HAIKU_PLATFORM
    void                     *bwindow;
    void                     *glview;
 #endif
diff --git a/src/egl/main/SConscript b/src/egl/main/SConscript
index 87c5b81..08cc42e 100644
--- a/src/egl/main/SConscript
+++ b/src/egl/main/SConscript
@@ -28,11 +28,19 @@ env.Append(CPPPATH = [
     '#/include',
 ])
 
+env.Prepend(LIBS = [
+    'egl_dri2',
+])
+
 # parse Makefile.sources
 egl_sources = env.ParseSourceList('Makefile.sources', 'LIBEGL_C_FILES')
 
-egl = env.ConvenienceLibrary(
-    target = 'egl',
+# libEGL.dll
+env['LIBPREFIX'] = 'lib'
+env['SHLIBPREFIX'] = 'lib'
+
+egl = env.SharedLibrary(
+    target = 'EGL',
     source = egl_sources,
 )
 
diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index 977e3fb..aef972c 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -63,12 +63,6 @@ SConscript([
 
 if not env['embedded']:
     SConscript('state_trackers/vega/SConscript')
-    if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'sunos'):
-        SConscript([
-            'state_trackers/egl/SConscript',
-            'targets/egl-static/SConscript',
-        ])
-
     if env['x11']:
         SConscript([
             'state_trackers/glx/xlib/SConscript',
-- 
1.7.1



More information about the mesa-dev mailing list