From aee4b52498033fb3127c53924e2a7c103d8e696a Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 3 Feb 2013 17:51:05 +0200 Subject: [PATCH] Remove references to build directory when installing. --- environment.py | 4 ++++ shellgenerator.py | 9 +++++++++ test cases/6 linkshared/builder.txt | 2 ++ 3 files changed, 15 insertions(+) diff --git a/environment.py b/environment.py index 9938235d0..fdf0627bf 100755 --- a/environment.py +++ b/environment.py @@ -201,6 +201,10 @@ class Environment(): def get_scratch_dir(self): return self.scratch_dir + def get_depfixer(self): + path = os.path.split(__file__)[0] + return os.path.join(path, 'depfixer.py') + def detect_cxx_compiler(self): exelist = self.get_cxx_compiler_exelist() p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE) diff --git a/shellgenerator.py b/shellgenerator.py index 6ca1666eb..8c1d54799 100755 --- a/shellgenerator.py +++ b/shellgenerator.py @@ -194,6 +194,15 @@ echo Run compile.sh before this or bad things will happen. outfile.write('echo Installing "%s".\n' % name) self.copy_file(outfile, self.get_target_filename(t), outdir) self.generate_shlib_aliases(t, outdir, outfile) + self.fix_deps(outfile, t, outdir) + + def fix_deps(self, outfile, target, outdir): + if isinstance(target, interpreter.StaticLibrary): + return + depfixer = self.environment.get_depfixer() + fname = os.path.join(outdir, target.get_filename()) + cmds = [depfixer, fname, self.environment.get_build_dir()] + outfile.write(' '.join(shell_quote(cmds)) + ' || exit\n') def generate_tests(self, outfile): for t in self.build.get_tests(): diff --git a/test cases/6 linkshared/builder.txt b/test cases/6 linkshared/builder.txt index 5889e2e42..9127d8cba 100644 --- a/test cases/6 linkshared/builder.txt +++ b/test cases/6 linkshared/builder.txt @@ -2,4 +2,6 @@ project('shared library linking test', 'c') lib = shared_library('mylib', 'libfile.c') exe = executable('prog', 'main.c') exe.link(lib) +lib.install() +exe.install() add_test('runtest', exe)