[Mesa-dev] [PATCH 20/23] scons: build and use a single dri_common library
Emil Velikov
emil.l.velikov at gmail.com
Tue Jun 17 11:38:36 PDT 2014
Rather than building two identical ones for dri-vmwgfx and dri-swrast
build a single library, and drop some duplication in the build.
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
src/gallium/targets/dri-swrast/SConscript | 4 +--
src/gallium/targets/dri/SConscript | 2 +-
src/mesa/drivers/dri/common/SConscript | 52 +++++--------------------------
3 files changed, 10 insertions(+), 48 deletions(-)
diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript
index 8ddd14e..2b0894c 100644
--- a/src/gallium/targets/dri-swrast/SConscript
+++ b/src/gallium/targets/dri-swrast/SConscript
@@ -1,6 +1,6 @@
Import('*')
-env = driswenv.Clone()
+env = drienv.Clone()
env.Append(CPPPATH = [
'#/src/gallium/winsys/sw/dri',
@@ -14,7 +14,7 @@ env.Prepend(LIBS = [
mesa,
glsl,
gallium,
- COMMON_DRI_SW_OBJECTS
+ dri_common,
])
if True:
diff --git a/src/gallium/targets/dri/SConscript b/src/gallium/targets/dri/SConscript
index a78a1b1..6f01234 100644
--- a/src/gallium/targets/dri/SConscript
+++ b/src/gallium/targets/dri/SConscript
@@ -35,7 +35,7 @@ env.Prepend(LIBS = [
glsl,
gallium,
megadrivers_stub,
- COMMON_DRI_DRM_OBJECTS
+ dri_common,
])
module = env.LoadableModule(
diff --git a/src/mesa/drivers/dri/common/SConscript b/src/mesa/drivers/dri/common/SConscript
index 8821952..ae83217 100644
--- a/src/mesa/drivers/dri/common/SConscript
+++ b/src/mesa/drivers/dri/common/SConscript
@@ -27,55 +27,19 @@ drienv.Replace(CPPPATH = [
'#src/egl/drivers/dri',
])
-driswenv = drienv.Clone()
-driswenv.Append(CPPDEFINES = [
- '__NOT_HAVE_DRM_H',
- 'HAVE_DLADDR',
+drienv.AppendUnique(LIBS = [
+ 'expat',
])
drienv.PkgUseModules('DRM')
-dri_common_utils = drienv.SharedObject(
- target = 'utils.o',
- source = '#src/mesa/drivers/dri/common/utils.c'
-)
-
-dri_common_xmlconfig = drienv.SharedObject(
- target = 'xmlconfig.o',
- source = '#src/mesa/drivers/dri/common/xmlconfig.c'
-)
+sources = drienv.ParseSourceList('Makefile.sources', 'DRI_COMMON_FILES')
-dri_common_dri_util = drienv.SharedObject(
- target = 'dri_util.o',
- source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
-
-dri_common_drisw_util = driswenv.SharedObject(
- target = 'drisw_util.o',
- source = '#src/mesa/drivers/dri/common/dri_util.c'
+dri_common = drienv.ConvenienceLibrary(
+ target = 'dri_common',
+ source = sources,
)
-
-COMMON_DRI_SW_OBJECTS = [
- dri_common_utils,
- dri_common_xmlconfig,
- dri_common_drisw_util,
-]
-
-COMMON_DRI_DRM_OBJECTS = [
- dri_common_utils,
- dri_common_xmlconfig,
- dri_common_dri_util,
-]
-
-drienv.AppendUnique(LIBS = [
- 'expat',
-])
-
-driswenv.AppendUnique(LIBS = [
- 'expat',
-])
-
#
# megadrivers_stub
#
@@ -103,8 +67,6 @@ env.Alias('megadrivers_stub', megadrivers_stub)
Export([
'drienv',
- 'driswenv',
- 'COMMON_DRI_SW_OBJECTS',
- 'COMMON_DRI_DRM_OBJECTS',
+ 'dri_common',
'megadrivers_stub',
])
--
2.0.0
More information about the mesa-dev
mailing list