Update scons build for new code layout.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 18 Feb 2008 10:52:44 +0000 (10:52 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 18 Feb 2008 10:52:44 +0000 (10:52 +0000)
15 files changed:
SConstruct
src/SConscript [new file with mode: 0644]
src/gallium/SConscript
src/gallium/auxiliary/cso_cache/SConscript [new file with mode: 0644]
src/gallium/auxiliary/draw/SConscript [new file with mode: 0644]
src/gallium/auxiliary/pipebuffer/SConscript [new file with mode: 0644]
src/gallium/auxiliary/tgsi/SConscript [new file with mode: 0644]
src/gallium/auxiliary/util/SConscript [new file with mode: 0644]
src/gallium/drivers/failover/SConscript [new file with mode: 0644]
src/gallium/winsys/SConscript [new file with mode: 0644]
src/gallium/winsys/dri/SConscript [new file with mode: 0644]
src/gallium/winsys/dri/intel/SConscript
src/gallium/winsys/xlib/SConscript [new file with mode: 0644]
src/mesa/SConscript
src/mesa/drivers/dri/SConscript [deleted file]

index 22a4072c9334c27df4a1fc67217a7236a04c3349..1126aff21b5776703a4141139f102972c6f58a11 100644 (file)
@@ -108,7 +108,10 @@ env.Append(CPPPATH = [
        '#/include',
        '#/src/mesa',
        '#/src/mesa/main',
-       '#/src/mesa/pipe',
+       '#/src/gallium/include/pipe',
+       '#/src/gallium/include',
+       '#/src/gallium/auxiliary',
+       '#/src/gallium/drivers',
 ])
 
 
@@ -222,7 +225,7 @@ build_dir = os.path.join(build_topdir, build_subdir)
 # http://www.scons.org/wiki/SimultaneousVariantBuilds
 
 SConscript(
-       'src/mesa/SConscript',
+       'src/SConscript',
        build_dir = build_dir,
        duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
 )
diff --git a/src/SConscript b/src/SConscript
new file mode 100644 (file)
index 0000000..5b09943
--- /dev/null
@@ -0,0 +1,7 @@
+Import('*')
+
+SConscript([
+       'gallium/SConscript',
+       'mesa/SConscript',
+       'gallium/winsys/SConscript',
+])
index d9c20e010075de13b9ba644d2ad20489799539fd..a835f6d661454773ab08aee075a8a28b79f9af68 100644 (file)
@@ -1,9 +1,24 @@
 Import('*')
 
-#env = env.Clone()
+env = env.Clone()
+
+auxiliaries = []
+
+Export('auxiliaries')
+
 
 SConscript([
-       'softpipe/SConscript',
-       'i915simple/SConscript',
-       'i965simple/SConscript',
+       # NOTE: order matters!
+       'auxiliary/util/SConscript',
+       'auxiliary/tgsi/SConscript',
+       'auxiliary/cso_cache/SConscript',
+       'auxiliary/draw/SConscript',
+       #'auxiliary/llvm/SConscript',
+       'auxiliary/pipebuffer/SConscript',
+
+       'drivers/softpipe/SConscript',
+       'drivers/i915simple/SConscript',
+       'drivers/i965simple/SConscript',
+       'drivers/failover/SConscript',
+       #'drivers/cell/SConscript',
 ])
diff --git a/src/gallium/auxiliary/cso_cache/SConscript b/src/gallium/auxiliary/cso_cache/SConscript
new file mode 100644 (file)
index 0000000..9751881
--- /dev/null
@@ -0,0 +1,10 @@
+Import('*')
+
+cso_cache = env.ConvenienceLibrary(
+       target = 'cso_cache',
+       source = [
+               'cso_cache.c',
+               'cso_hash.c',
+       ])
+
+auxiliaries.insert(0, cso_cache)
diff --git a/src/gallium/auxiliary/draw/SConscript b/src/gallium/auxiliary/draw/SConscript
new file mode 100644 (file)
index 0000000..8e3a8ca
--- /dev/null
@@ -0,0 +1,31 @@
+Import('*')
+
+draw = env.ConvenienceLibrary(
+       target = 'draw',
+       source = [
+               'draw_clip.c',
+               'draw_vs_exec.c',
+               'draw_vs_sse.c',
+               'draw_vs_llvm.c',
+               'draw_context.c',
+               'draw_cull.c',
+               'draw_debug.c',
+               'draw_flatshade.c',
+               'draw_offset.c',
+               'draw_prim.c',
+               'draw_stipple.c',
+               'draw_twoside.c',
+               'draw_unfilled.c',
+               'draw_validate.c',
+               'draw_vbuf.c',
+               'draw_vertex.c',
+               'draw_vertex_cache.c',
+               'draw_vertex_fetch.c',
+               'draw_vertex_shader.c',
+               'draw_vf.c',
+               'draw_vf_generic.c',
+               'draw_vf_sse.c',
+               'draw_wide_prims.c',
+       ])
+
+auxiliaries.insert(0, draw)
diff --git a/src/gallium/auxiliary/pipebuffer/SConscript b/src/gallium/auxiliary/pipebuffer/SConscript
new file mode 100644 (file)
index 0000000..3d41fd8
--- /dev/null
@@ -0,0 +1,14 @@
+Import('*')
+
+pipebuffer = env.ConvenienceLibrary(
+       target = 'pipebuffer',
+       source = [
+               'pb_buffer_fenced.c',
+               'pb_buffer_malloc.c',
+               'pb_bufmgr_fenced.c',
+               'pb_bufmgr_mm.c',
+               'pb_bufmgr_pool.c',
+               'pb_winsys.c',
+       ])
+
+auxiliaries.insert(0, pipebuffer)
diff --git a/src/gallium/auxiliary/tgsi/SConscript b/src/gallium/auxiliary/tgsi/SConscript
new file mode 100644 (file)
index 0000000..8464bfe
--- /dev/null
@@ -0,0 +1,14 @@
+Import('*')
+
+tgsi = env.ConvenienceLibrary(
+       target = 'tgsi',
+       source = [
+               'exec/tgsi_exec.c',
+               'exec/tgsi_sse2.c',
+               'util/tgsi_build.c',
+               'util/tgsi_dump.c',
+               'util/tgsi_parse.c',
+               'util/tgsi_util.c',
+       ])
+
+auxiliaries.insert(0, tgsi)
diff --git a/src/gallium/auxiliary/util/SConscript b/src/gallium/auxiliary/util/SConscript
new file mode 100644 (file)
index 0000000..b126cf4
--- /dev/null
@@ -0,0 +1,11 @@
+Import('*')
+
+util = env.ConvenienceLibrary(
+       target = 'util',
+       source = [
+               'p_debug.c',
+               'p_tile.c',
+               'p_util.c',
+       ])
+
+auxiliaries.insert(0, util)
diff --git a/src/gallium/drivers/failover/SConscript b/src/gallium/drivers/failover/SConscript
new file mode 100644 (file)
index 0000000..f8e9b1b
--- /dev/null
@@ -0,0 +1,13 @@
+Import('*')
+
+env = env.Clone()
+
+failover = env.ConvenienceLibrary(
+       target = 'failover',
+       source = [
+               'fo_state.c',
+               'fo_state_emit.c',
+               'fo_context.c',
+       ])
+
+Export('failover')
diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript
new file mode 100644 (file)
index 0000000..32215d8
--- /dev/null
@@ -0,0 +1,10 @@
+Import('*')
+
+if dri:
+       SConscript([
+               'dri/SConscript',
+       ])
+else:
+       SConscript([
+               'xlib/SConscript',
+       ])
diff --git a/src/gallium/winsys/dri/SConscript b/src/gallium/winsys/dri/SConscript
new file mode 100644 (file)
index 0000000..8c56ce9
--- /dev/null
@@ -0,0 +1,51 @@
+Import('*')
+
+drienv = env.Clone()
+
+drienv.Replace(CPPPATH = [
+       '#src/mesa/drivers/dri/common',
+       '#include',
+       '#include/GL/internal',
+       '#src/gallium/include',
+       '#src/gallium/auxiliary',
+       '#src/gallium/drivers',
+       '#src/mesa',
+       '#src/mesa/main',
+       '#src/mesa/glapi',
+       '#src/mesa/math',
+       '#src/mesa/transform',
+       '#src/mesa/shader',
+       '#src/mesa/swrast',
+       '#src/mesa/swrast_setup',
+       '#src/egl/main',
+       '#src/egl/drivers/dri',
+])
+
+drienv.ParseConfig('pkg-config --cflags --libs libdrm')
+
+COMMON_GALLIUM_SOURCES = [
+       '#src/mesa/drivers/dri/common/utils.c',
+       '#src/mesa/drivers/dri/common/vblank.c',
+       '#src/mesa/drivers/dri/common/dri_util.c',
+       '#src/mesa/drivers/dri/common/xmlconfig.c',
+]
+
+COMMON_BM_SOURCES = [
+       '#src/mesa/drivers/dri/common/dri_bufmgr.c',
+       '#src/mesa/drivers/dri/common/dri_drmpool.c',
+]
+
+Export([
+       'drienv',
+       'COMMON_GALLIUM_SOURCES',
+       'COMMON_BM_SOURCES',
+])
+
+# TODO: Installation
+#install: $(LIBNAME)
+#      $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
+#      $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
+
+SConscript([
+       'intel/SConscript',
+])
index a7cc10450e3351ee3cb3d7805c6efbf2e2d45dfb..525ba580e8e24286b84eee82eed92a6c1fc1ccac 100644 (file)
@@ -9,11 +9,6 @@ env.Append(CPPPATH = [
 
 #MINIGLX_SOURCES = server/intel_dri.c
 
-pipe_drivers = [
-       softpipe,
-       i915simple
-]
-
 DRIVER_SOURCES = [
        'intel_winsys_pipe.c',
        'intel_winsys_softpipe.c',
@@ -31,11 +26,14 @@ sources = \
        COMMON_BM_SOURCES + \
        DRIVER_SOURCES
 
-# DRIVER_DEFINES = -I../intel $(shell pkg-config libdrm --atleast-version=2.3.1 \
-#                              && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
+drivers = [
+       softpipe,
+       i915simple
+]
 
+# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
 env.SharedLibrary(
        target ='i915tex_dri.so',
        source = sources,
-       LIBS = pipe_drivers + env['LIBS'],
+       LIBS = mesa + drivers + auxiliaries + env['LIBS'],
 )
\ No newline at end of file
diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript
new file mode 100644 (file)
index 0000000..f8aa5ef
--- /dev/null
@@ -0,0 +1,28 @@
+#######################################################################
+# SConscript for xlib winsys
+
+Import('*')
+
+
+sources = [
+       'glxapi.c',
+       'fakeglx.c',
+       'xfonts.c',
+       'xm_api.c',
+       'xm_winsys.c',
+       'xm_winsys_aub.c',
+       'brw_aub.c',
+]
+       
+drivers = [
+       softpipe,
+       i915simple,
+       i965simple,
+]
+
+# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
+env.SharedLibrary(
+       target ='GL',
+       source = sources,
+       LIBS = glapi + mesa + drivers + auxiliaries + env['LIBS'],
+)
index faf8c84872cb54a4710a866d0c7ff0e12881af78..a828133580a4c79e6f8922d8872c4952ed0ed1cf 100644 (file)
@@ -1,7 +1,5 @@
 #######################################################################
-# SConscript for mesa
-#
-# TODO: Split this into per-module SConscripts 
+# SConscript for Mesa
 
 
 Import('*')
@@ -116,53 +114,6 @@ VF_SOURCES = [
        'vf/vf_sse.c',
 ]
 
-DRAW_SOURCES = [
-       'pipe/draw/draw_clip.c',
-       'pipe/draw/draw_context.c',
-       'pipe/draw/draw_cull.c',
-       'pipe/draw/draw_debug.c',
-       'pipe/draw/draw_flatshade.c',
-       'pipe/draw/draw_offset.c',
-       'pipe/draw/draw_prim.c',
-       'pipe/draw/draw_stipple.c',
-       'pipe/draw/draw_twoside.c',
-       'pipe/draw/draw_unfilled.c',
-       'pipe/draw/draw_validate.c',
-       'pipe/draw/draw_vbuf.c',
-       'pipe/draw/draw_vertex.c',
-       'pipe/draw/draw_vertex_cache.c',
-       'pipe/draw/draw_vertex_fetch.c',
-       'pipe/draw/draw_vertex_shader.c',
-       'pipe/draw/draw_vertex_shader_llvm.c',
-       'pipe/draw/draw_vf.c',
-       'pipe/draw/draw_vf_generic.c',
-       'pipe/draw/draw_vf_sse.c',
-       'pipe/draw/draw_wide_prims.c',
-]
-
-TGSIEXEC_SOURCES = [
-       'pipe/tgsi/exec/tgsi_exec.c',
-       'pipe/tgsi/exec/tgsi_sse2.c',
-]
-
-TGSIUTIL_SOURCES = [
-       'pipe/tgsi/util/tgsi_build.c',
-       'pipe/tgsi/util/tgsi_dump.c',
-       'pipe/tgsi/util/tgsi_parse.c',
-       'pipe/tgsi/util/tgsi_util.c',
-]
-
-STATECACHE_SOURCES = [
-       'pipe/cso_cache/cso_hash.c',
-       'pipe/cso_cache/cso_cache.c',
-]
-
-PIPEUTIL_SOURCES = [
-       'pipe/util/p_debug.c',
-       'pipe/util/p_tile.c',
-       'pipe/util/p_util.c',
-]
-
 STATETRACKER_SOURCES = [
        'state_tracker/st_atom.c',
        'state_tracker/st_atom_blend.c',
@@ -311,126 +262,25 @@ else:
        ASM_SOURCES = []
        API_SOURCES = []
 
-
-#######################################################################
-# Driver sources
-
-
-X11_DRIVER_SOURCES = [
-       'pipe/xlib/glxapi.c',
-       'pipe/xlib/fakeglx.c',
-       'pipe/xlib/xfonts.c',
-       'pipe/xlib/xm_api.c',
-       'pipe/xlib/xm_winsys.c',
-       'pipe/xlib/xm_winsys_aub.c',
-       'pipe/xlib/brw_aub.c',
-]
-
-OSMESA_DRIVER_SOURCES = [
-       'drivers/osmesa/osmesa.c',
-]
-
-GLIDE_DRIVER_SOURCES = [
-       'drivers/glide/fxapi.c',
-       'drivers/glide/fxdd.c',
-       'drivers/glide/fxddspan.c',
-       'drivers/glide/fxddtex.c',
-       'drivers/glide/fxsetup.c',
-       'drivers/glide/fxtexman.c',
-       'drivers/glide/fxtris.c',
-       'drivers/glide/fxvb.c',
-       'drivers/glide/fxglidew.c',
-       'drivers/glide/fxg.c',
-]
-
-SVGA_DRIVER_SOURCES = [
-       'drivers/svga/svgamesa.c',
-       'drivers/svga/svgamesa8.c',
-       'drivers/svga/svgamesa15.c',
-       'drivers/svga/svgamesa16.c',
-       'drivers/svga/svgamesa24.c',
-       'drivers/svga/svgamesa32.c',
-]
-
-FBDEV_DRIVER_SOURCES = [
-       'drivers/fbdev/glfbdev.c',
-]
-
-
-### All the core C sources
-
 SOLO_SOURCES = \
        MAIN_SOURCES + \
        MATH_SOURCES + \
        VBO_SOURCES + \
        VF_SOURCES + \
-       DRAW_SOURCES + \
-       TGSIEXEC_SOURCES + \
-       TGSIUTIL_SOURCES + \
-       PIPEUTIL_SOURCES + \
-       STATECACHE_SOURCES + \
        STATETRACKER_SOURCES + \
        SHADER_SOURCES + \
        ASM_SOURCES + \
        SLANG_SOURCES
 
-CORE_SOURCES = \
-       GLAPI_SOURCES + API_SOURCES + \
-       SOLO_SOURCES
-
-ALL_SOURCES = \
-       GLAPI_SOURCES + API_SOURCES + \
-       SOLO_SOURCES + \
-       ASM_SOURCES + \
-       X11_DRIVER_SOURCES + \
-       FBDEV_DRIVER_SOURCES + \
-       OSMESA_DRIVER_SOURCES
-
-
-######################################################################
-# Gallium sources
-
-SConscript([
-       'pipe/SConscript',
-])
-
-
-######################################################################
-# libGL
+mesa = env.ConvenienceLibrary(
+       target = 'mesa',
+       source = SOLO_SOURCES,
+)
+Export('mesa')
 
 if not dri:
-       STAND_ALONE_DRIVER_SOURCES = \
-               CORE_SOURCES + \
-               X11_DRIVER_SOURCES
-       
-       Import(
-               'softpipe', 
-               'i915simple',
-               'i965simple'
+       glapi = env.ConvenienceLibrary(
+               target = 'glapi',
+               source = GLAPI_SOURCES + API_SOURCES,
        )
-       
-       pipe_drivers = [
-               softpipe,
-               i965simple
-       ]
-       
-       env.SharedLibrary(
-               target ='GL',
-               source = STAND_ALONE_DRIVER_SOURCES,
-               LIBS = [softpipe, i965simple] + env['LIBS'],
-       )
-
-
-######################################################################
-# Driver sources
-
-if dri:
-       mesa = env.ConvenienceLibrary(
-               target = 'mesa',
-               source = SOLO_SOURCES,
-       )
-       env.Prepend(LIBS = [mesa])
-
-       SConscript([
-               'drivers/dri/SConscript',
-       ])
+       Export('glapi')
diff --git a/src/mesa/drivers/dri/SConscript b/src/mesa/drivers/dri/SConscript
deleted file mode 100644 (file)
index d32bd08..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-Import('*')
-
-drienv = env.Clone()
-
-drienv.Replace(CPPPATH = [
-       '#src/mesa/drivers/dri/common',
-       '#include',
-       '#include/GL/internal',
-       '#src/mesa',
-       '#src/mesa/main',
-       '#src/mesa/glapi',
-       '#src/mesa/math',
-       '#src/mesa/transform',
-       '#src/mesa/shader',
-       '#src/mesa/swrast',
-       '#src/mesa/swrast_setup',
-       '#src/egl/main',
-       '#src/egl/drivers/dri',
-])
-
-drienv.ParseConfig('pkg-config --cflags --libs libdrm')
-
-COMMON_GALLIUM_SOURCES = [
-       '../common/utils.c',
-       '../common/vblank.c',
-       '../common/dri_util.c',
-       '../common/xmlconfig.c',
-]
-
-COMMON_BM_SOURCES = [
-       '../common/dri_bufmgr.c',
-       '../common/dri_drmpool.c',
-]
-
-Export([
-       'drienv',
-       'COMMON_GALLIUM_SOURCES',
-       'COMMON_BM_SOURCES',
-])
-
-# TODO: Installation
-#install: $(LIBNAME)
-#      $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
-#      $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
-
-SConscript([
-       'intel_winsys/SConscript',
-])