From a6c725839482f3d0f2af0eb15e5b6ab80184fb6c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Sep 2008 09:47:40 +0900 Subject: scons: Optimize for speed, not size, with MSVC. --- scons/gallium.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scons/gallium.py') diff --git a/scons/gallium.py b/scons/gallium.py index 43603e5104..342a0879c3 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -290,7 +290,7 @@ def generate(env): ] if msvc: # See also: - # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx + # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx # - cl /? if debug: cflags += [ @@ -302,7 +302,8 @@ def generate(env): cflags += [ '/Ox', # maximum optimizations '/Oi', # enable intrinsic functions - '/Os', # favor code space + '/Ot', # favor code speed + #'/fp:fast', # fast floating point ] if env['profile']: cflags += [ @@ -313,6 +314,11 @@ def generate(env): '/W3', # warning level #'/Wp64', # enable 64 bit porting warnings ] + if env['machine'] == 'x86': + cflags += [ + #'/QIfist', # Suppress _ftol + #'/arch:SSE2', # use the SSE2 instructions + ] if platform == 'windows': cflags += [ # TODO -- cgit v1.2.3 From 52c2dd1f73e17c8352fe976e2ee4cdf049f81957 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 8 Sep 2008 07:54:15 +0900 Subject: scons: Install libGL.so and respective symlinks. --- scons/gallium.py | 25 +++++++++++++++++++++++++ src/gallium/winsys/xlib/SConscript | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'scons/gallium.py') diff --git a/scons/gallium.py b/scons/gallium.py index 342a0879c3..abe962493d 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -140,6 +140,30 @@ def createCodeGenerateMethod(env): env.AddMethod(code_generate, 'CodeGenerate') +def symlink(target, source, env): + target = str(target[0]) + source = str(source[0]) + if os.path.islink(target) or os.path.exists(target): + os.remove(target) + os.symlink(os.path.basename(source), target) + +def install_shared_library(env, source, version = ()): + source = str(source[0]) + version = tuple(map(str, version)) + target_dir = os.path.join(env['build'], 'lib') + target_name = '.'.join((str(source),) + version) + last = env.InstallAs(os.path.join(target_dir, target_name), source) + while len(version): + version = version[:-1] + target_name = '.'.join((str(source),) + version) + action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE") + print os.path.join(target_dir, target_name), last + last = env.Command(os.path.join(target_dir, target_name), last, action) + +def createInstallMethods(env): + env.AddMethod(install_shared_library, 'InstallSharedLibrary') + + def generate(env): """Common environment generation code""" @@ -426,6 +450,7 @@ def generate(env): # Custom builders and methods createConvenienceLibBuilder(env) createCodeGenerateMethod(env) + createInstallMethods(env) # for debugging #print env.Dump() diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index 8650f595a7..324fbef306 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -36,8 +36,10 @@ if env['platform'] == 'linux' \ drivers += [trace] # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions - env.SharedLibrary( + libgl = env.SharedLibrary( target ='GL', source = sources, LIBS = glapi + mesa + drivers + auxiliaries + env['LIBS'], ) + + env.InstallSharedLibrary(libgl, version=(1, 5)) -- cgit v1.2.3 From 7cfc294c70e96269055341d327622774c9173b37 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 8 Sep 2008 21:50:50 +0900 Subject: scons: Install shared libs in the right subdir. --- scons/gallium.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scons/gallium.py') diff --git a/scons/gallium.py b/scons/gallium.py index abe962493d..3631607e66 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -150,14 +150,13 @@ def symlink(target, source, env): def install_shared_library(env, source, version = ()): source = str(source[0]) version = tuple(map(str, version)) - target_dir = os.path.join(env['build'], 'lib') + target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], 'lib') target_name = '.'.join((str(source),) + version) last = env.InstallAs(os.path.join(target_dir, target_name), source) while len(version): version = version[:-1] target_name = '.'.join((str(source),) + version) action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE") - print os.path.join(target_dir, target_name), last last = env.Command(os.path.join(target_dir, target_name), last, action) def createInstallMethods(env): -- cgit v1.2.3