summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-01-01 22:35:28 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-01-02 00:01:43 +0000
commit8a318edd0838ee3343be0425019d93541b621567 (patch)
tree85ffd91339e8412c5c62f449d8c0a7a5762beaa4
parentee39dc20e6f055f131f21ca2d63ea0eada5a80a6 (diff)
downloadexternal_mesa3d-8a318edd0838ee3343be0425019d93541b621567.zip
external_mesa3d-8a318edd0838ee3343be0425019d93541b621567.tar.gz
external_mesa3d-8a318edd0838ee3343be0425019d93541b621567.tar.bz2
scons: Put glut and glew shared libraries into build/xxx/bin or lib.
Use bin subdir for windows dlls, lib for unices.
-rw-r--r--scons/gallium.py38
-rw-r--r--src/glew/SConscript2
2 files changed, 23 insertions, 17 deletions
diff --git a/scons/gallium.py b/scons/gallium.py
index 0133f9f..69a3569 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -46,27 +46,31 @@ def symlink(target, source, env):
os.remove(target)
os.symlink(os.path.basename(source), target)
+def install(env, source, subdir):
+ target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], subdir)
+ env.Install(target_dir, source)
+
def install_program(env, source):
- source = str(source[0])
- target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], 'bin')
- target_name = str(source)
- env.InstallAs(os.path.join(target_dir, target_name), source)
+ install(env, source, 'bin')
-def install_shared_library(env, source, version = ()):
- source = str(source[0])
+def install_shared_library(env, sources, version = ()):
+ install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'])
version = tuple(map(str, version))
- target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], 'lib')
- if env['SHLIBSUFFIX'] == '.so':
- 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")
- last = env.Command(os.path.join(target_dir, target_name), last, action)
+ if env['SHLIBSUFFIX'] == '.dll':
+ dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+ install(env, dlls, 'bin')
+ libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX')
+ install(env, libs, 'lib')
else:
- target_name = str(source)
- env.InstallAs(os.path.join(target_dir, target_name), source)
+ for source in sources:
+ target_dir = os.path.join(install_dir, '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")
+ last = env.Command(os.path.join(target_dir, target_name), last, action)
def createInstallMethods(env):
env.AddMethod(install_program, 'InstallProgram')
diff --git a/src/glew/SConscript b/src/glew/SConscript
index 330231d..0c50abf 100644
--- a/src/glew/SConscript
+++ b/src/glew/SConscript
@@ -45,6 +45,8 @@ glew = lib_env.SharedLibrary(
],
)
+env.InstallSharedLibrary(glew, version=(1, 5))
+
if lib_env['platform'] == 'windows':
glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')