summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-08-01 20:59:07 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-08-02 19:00:52 -0700
commit43c77ac3cb819ebfc8a35aa7df6012c8fcd3ec4a (patch)
tree8afd7d4a60deabed9103f2c87a7256321c325c32 /var
parent1ec06e61114ef8eb69b96491d9f7f09707dafc20 (diff)
downloadspack-43c77ac3cb819ebfc8a35aa7df6012c8fcd3ec4a.tar.gz
spack-43c77ac3cb819ebfc8a35aa7df6012c8fcd3ec4a.tar.bz2
spack-43c77ac3cb819ebfc8a35aa7df6012c8fcd3ec4a.tar.xz
spack-43c77ac3cb819ebfc8a35aa7df6012c8fcd3ec4a.zip
libdwarf: remove use of hide_files()
- This was a nasty workaround due to the way our compiler wrappers used to work. We don't want to have to modify our elfutils installation to install libdwarf. - Since cd9691de5, we no longer need this because the package will always come before dependencies in our include order.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/libdwarf/package.py134
1 files changed, 63 insertions, 71 deletions
diff --git a/var/spack/repos/builtin/packages/libdwarf/package.py b/var/spack/repos/builtin/packages/libdwarf/package.py
index 75288d66b1..7fa23300cf 100644
--- a/var/spack/repos/builtin/packages/libdwarf/package.py
+++ b/var/spack/repos/builtin/packages/libdwarf/package.py
@@ -61,77 +61,69 @@ class Libdwarf(Package):
filter_file(r'^typedef struct Elf Elf;$', '', 'libdwarf/libdwarf.h.in')
def install(self, spec, prefix):
-
- # elfutils contains a dwarf.h that conflicts with libdwarf's
- # TODO: we should remove this when we can modify the include order
- hide_list = []
- if spec.satisfies('^elfutils'):
- dwarf_h = join_path(spec['elfutils'].prefix, 'include/dwarf.h')
- hide_list.append(dwarf_h)
- with hide_files(*hide_list):
- # dwarf build does not set arguments for ar properly
- make.add_default_arg('ARFLAGS=rcs')
-
- # Dwarf doesn't provide an install, so we have to do it.
- mkdirp(prefix.bin, prefix.include, prefix.lib, prefix.man.man1)
-
- with working_dir('libdwarf'):
- extra_config_args = []
-
- # this is to prevent picking up system /usr/include/libelf.h
- if spec.satisfies('^libelf'):
- libelf_inc_dir = join_path(spec['libelf'].prefix,
- 'include/libelf')
- extra_config_args.append(
- 'CFLAGS=-I{0} -Wl,-L{1} -Wl,-lelf'.format(
- libelf_inc_dir, spec['libelf'].prefix.lib))
- configure("--prefix=" + prefix, "--enable-shared",
- *extra_config_args)
- filter_file(r'^dwfzlib\s*=\s*-lz',
- 'dwfzlib=-L{0} -lz'.format(
- self.spec['zlib'].prefix.lib),
- 'Makefile')
- make()
-
- libdwarf_name = 'libdwarf.{0}'.format(dso_suffix)
- libdwarf1_name = 'libdwarf.{0}'.format(dso_suffix) + ".1"
- install('libdwarf.a', prefix.lib)
- install('libdwarf.so', join_path(prefix.lib, libdwarf1_name))
- if spec.satisfies('@20160507:'):
- with working_dir(prefix.lib):
- os.symlink(libdwarf1_name, libdwarf_name)
- install('libdwarf.h', prefix.include)
- install('dwarf.h', prefix.include)
-
- # It seems like fix_darwin_install_name can't be used
- # here directly; the install name of the library in
- # the stage directory must be fixed in order for dyld
- # to locate it on Darwin when spack builds dwarfdump
- if sys.platform == 'darwin':
- install_name_tool = which('install_name_tool')
- install_name_tool('-id',
- join_path('..', 'libdwarf',
- 'libdwarf.so'),
- 'libdwarf.so')
-
- if spec.satisfies('@20130126:20130729'):
- dwarfdump_dir = 'dwarfdump2'
- else:
- dwarfdump_dir = 'dwarfdump'
- with working_dir(dwarfdump_dir):
- configure("--prefix=" + prefix)
- filter_file(r'^dwfzlib\s*=\s*-lz',
- 'dwfzlib=-L{0} -lz'.format(
- self.spec['zlib'].prefix.lib),
- 'Makefile')
-
- # This makefile has strings of copy commands that
- # cause a race in parallel
- make(parallel=False)
-
- install('dwarfdump', prefix.bin)
- install('dwarfdump.conf', prefix.lib)
- install('dwarfdump.1', prefix.man.man1)
+ # dwarf build does not set arguments for ar properly
+ make.add_default_arg('ARFLAGS=rcs')
+
+ # Dwarf doesn't provide an install, so we have to do it.
+ mkdirp(prefix.bin, prefix.include, prefix.lib, prefix.man.man1)
+
+ with working_dir('libdwarf'):
+ extra_config_args = []
+
+ # this is to prevent picking up system /usr/include/libelf.h
+ if spec.satisfies('^libelf'):
+ libelf_inc_dir = join_path(spec['libelf'].prefix,
+ 'include/libelf')
+ extra_config_args.append(
+ 'CFLAGS=-I{0} -Wl,-L{1} -Wl,-lelf'.format(
+ libelf_inc_dir, spec['libelf'].prefix.lib))
+ configure("--prefix=" + prefix, "--enable-shared",
+ *extra_config_args)
+ filter_file(r'^dwfzlib\s*=\s*-lz',
+ 'dwfzlib=-L{0} -lz'.format(
+ self.spec['zlib'].prefix.lib),
+ 'Makefile')
+ make()
+
+ libdwarf_name = 'libdwarf.{0}'.format(dso_suffix)
+ libdwarf1_name = 'libdwarf.{0}'.format(dso_suffix) + ".1"
+ install('libdwarf.a', prefix.lib)
+ install('libdwarf.so', join_path(prefix.lib, libdwarf1_name))
+ if spec.satisfies('@20160507:'):
+ with working_dir(prefix.lib):
+ os.symlink(libdwarf1_name, libdwarf_name)
+ install('libdwarf.h', prefix.include)
+ install('dwarf.h', prefix.include)
+
+ # It seems like fix_darwin_install_name can't be used
+ # here directly; the install name of the library in
+ # the stage directory must be fixed in order for dyld
+ # to locate it on Darwin when spack builds dwarfdump
+ if sys.platform == 'darwin':
+ install_name_tool = which('install_name_tool')
+ install_name_tool('-id',
+ join_path('..', 'libdwarf',
+ 'libdwarf.so'),
+ 'libdwarf.so')
+
+ if spec.satisfies('@20130126:20130729'):
+ dwarfdump_dir = 'dwarfdump2'
+ else:
+ dwarfdump_dir = 'dwarfdump'
+ with working_dir(dwarfdump_dir):
+ configure("--prefix=" + prefix)
+ filter_file(r'^dwfzlib\s*=\s*-lz',
+ 'dwfzlib=-L{0} -lz'.format(
+ self.spec['zlib'].prefix.lib),
+ 'Makefile')
+
+ # This makefile has strings of copy commands that
+ # cause a race in parallel
+ make(parallel=False)
+
+ install('dwarfdump', prefix.bin)
+ install('dwarfdump.conf', prefix.lib)
+ install('dwarfdump.1', prefix.man.man1)
@run_after('install')
def darwin_fix(self):