Remove references to build directory when installing.

pull/15/head
Jussi Pakkanen 12 years ago
parent eae83aea61
commit aee4b52498
  1. 4
      environment.py
  2. 9
      shellgenerator.py
  3. 2
      test cases/6 linkshared/builder.txt

@ -201,6 +201,10 @@ class Environment():
def get_scratch_dir(self): def get_scratch_dir(self):
return self.scratch_dir 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): def detect_cxx_compiler(self):
exelist = self.get_cxx_compiler_exelist() exelist = self.get_cxx_compiler_exelist()
p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE) p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE)

@ -194,6 +194,15 @@ echo Run compile.sh before this or bad things will happen.
outfile.write('echo Installing "%s".\n' % name) outfile.write('echo Installing "%s".\n' % name)
self.copy_file(outfile, self.get_target_filename(t), outdir) self.copy_file(outfile, self.get_target_filename(t), outdir)
self.generate_shlib_aliases(t, outdir, outfile) 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): def generate_tests(self, outfile):
for t in self.build.get_tests(): for t in self.build.get_tests():

@ -2,4 +2,6 @@ project('shared library linking test', 'c')
lib = shared_library('mylib', 'libfile.c') lib = shared_library('mylib', 'libfile.c')
exe = executable('prog', 'main.c') exe = executable('prog', 'main.c')
exe.link(lib) exe.link(lib)
lib.install()
exe.install()
add_test('runtest', exe) add_test('runtest', exe)

Loading…
Cancel
Save