rpaths for dependencies. elf, dwarf, cmake build on Linux

This commit is contained in:
Todd Gamblin 2013-02-19 01:20:50 -08:00
parent 5d81cfdac6
commit 7d9d4f3484
6 changed files with 28 additions and 13 deletions

8
lib/spack/env/cc vendored
View file

@ -10,6 +10,7 @@ def get_path(name):
# Import spack parameters through the build environment.
spack_lib = os.environ.get("SPACK_LIB")
spack_prefix = os.environ.get("SPACK_PREFIX")
spack_deps = get_path("SPACK_DEPENDENCIES")
spack_env_path = get_path("SPACK_ENV_PATH")
if not spack_lib or spack_deps == None:
@ -62,8 +63,15 @@ arguments += other_args
arguments += ['-L%s' % path for path in options.lib_path]
arguments += ['-l%s' % path for path in options.libs]
spack_rpaths = [spack_prefix] + spack_deps
arguments += ['-Wl,-rpath,%s/lib64' % path for path in spack_rpaths]
arguments += ['-Wl,-rpath,%s/lib' % path for path in spack_rpaths]
# Unset some pesky environment variables
pop_keys(os.environ, "LD_LIBRARY_PATH", "LD_RUN_PATH", "DYLD_LIBRARY_PATH")
sys.stderr.write(" ".join(arguments))
rcode = cmd(*arguments, fail_on_error=False)
sys.exit(rcode)

View file

@ -111,6 +111,7 @@ def add_commands_to_module(self):
self.module.install = install
self.module.rmtree = shutil.rmtree
self.module.move = shutil.move
self.module.remove = os.remove
# Useful directories within the prefix
self.module.prefix = self.prefix
@ -119,6 +120,7 @@ def add_commands_to_module(self):
self.module.etc = new_path(self.prefix, 'etc')
self.module.include = new_path(self.prefix, 'include')
self.module.lib = new_path(self.prefix, 'lib')
self.module.lib64 = new_path(self.prefix, 'lib64')
self.module.libexec = new_path(self.prefix, 'libexec')
self.module.share = new_path(self.prefix, 'share')
self.module.doc = new_path(self.module.share, 'doc')
@ -288,6 +290,9 @@ def setup_install_environment(self):
for dep in self.dependencies:
path_prepend("SPACK_DEPENDENCIES", dep.package.prefix)
# Install location
path_prepend("SPACK_PREFIX", self.prefix)
def do_install_dependencies(self):
# Pass along paths of dependencies here

View file

@ -46,7 +46,7 @@ def get_next(arg, args):
if os.path.isdir(target):
rpaths.append(target)
else:
other_args.extend([arg, target])
other_args.extend(['-Wl,' + arg, '-Wl,' + target])
else:
other_args.append(arg)
other_args.append('-Wl,' + arg)
return rpaths, other_args

View file

@ -21,21 +21,22 @@ def clean(self):
def install(self, prefix):
make.add_default_arg('ARFLAGS=rcs')
for dir in dwarf_dirs:
with working_dir(dir):
#configure("--prefix=%s" % prefix, '--enable-shared')
configure("--prefix=%s" % prefix)
# Dwarf doesn't provide an install, so we have to do it.
mkdirp(bin, include, lib, man1)
with working_dir('libdwarf'):
configure("--prefix=%s" % prefix, '--enable-shared')
make()
# Dwarf doesn't provide an install. Annoying.
mkdirp(bin, include, lib, man1)
with working_dir('libdwarf'):
install('libdwarf.a', lib)
#install('libdwarf.so', lib)
install('libdwarf.so', lib)
install('libdwarf.h', include)
install('dwarf.h', include)
with working_dir('dwarfdump2'):
configure("--prefix=%s" % prefix)
make()
install('dwarfdump', bin)
install('dwarfdump.conf', lib)
install('dwarfdump.1', man1)

View file

@ -7,6 +7,7 @@ class Libelf(Package):
def install(self, prefix):
configure("--prefix=%s" % prefix,
"--enable-shared",
"--disable-dependency-tracking",
"--disable-debug")
make()

View file

@ -60,9 +60,9 @@ def pkg(msg):
import platform
from version import Version
mac_version = platform.mac_ver()[0]
if Version(mac_version) >= Version("10.7"):
mac_ver = platform.mac_ver()[0]
if mac_ver and Version(mac_ver) >= Version('10.7'):
print u"\U0001F4E6" + indent,
else:
print '[%] ',
print '{}[+]{} '.format(green, reset),
print msg