OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Notes: | 5 # Notes: |
6 # | 6 # |
7 # This is all roughly based on the Makefile system used by the Linux | 7 # This is all roughly based on the Makefile system used by the Linux |
8 # kernel, but is a non-recursive make -- we put the entire dependency | 8 # kernel, but is a non-recursive make -- we put the entire dependency |
9 # graph in front of make and let it figure it out. | 9 # graph in front of make and let it figure it out. |
10 # | 10 # |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 target_postbuilds[configname] = target_postbuild | 1418 target_postbuilds[configname] = target_postbuild |
1419 else: | 1419 else: |
1420 ldflags = config.get('ldflags', []) | 1420 ldflags = config.get('ldflags', []) |
1421 # Compute an rpath for this output if needed. | 1421 # Compute an rpath for this output if needed. |
1422 if any(dep.endswith('.so') or '.so.' in dep for dep in deps): | 1422 if any(dep.endswith('.so') or '.so.' in dep for dep in deps): |
1423 # We want to get the literal string "$ORIGIN" into the link command, | 1423 # We want to get the literal string "$ORIGIN" into the link command, |
1424 # so we need lots of escaping. | 1424 # so we need lots of escaping. |
1425 ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset) | 1425 ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset) |
1426 ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' % | 1426 ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' % |
1427 self.toolset) | 1427 self.toolset) |
| 1428 library_dirs = config.get('library_dirs', []) |
| 1429 ldflags += [('-L%s' % library_dir) for library_dir in library_dirs] |
1428 self.WriteList(ldflags, 'LDFLAGS_%s' % configname) | 1430 self.WriteList(ldflags, 'LDFLAGS_%s' % configname) |
1429 if self.flavor == 'mac': | 1431 if self.flavor == 'mac': |
1430 self.WriteList(self.xcode_settings.GetLibtoolflags(configname), | 1432 self.WriteList(self.xcode_settings.GetLibtoolflags(configname), |
1431 'LIBTOOLFLAGS_%s' % configname) | 1433 'LIBTOOLFLAGS_%s' % configname) |
1432 libraries = spec.get('libraries') | 1434 libraries = spec.get('libraries') |
1433 if libraries: | 1435 if libraries: |
1434 # Remove duplicate entries | 1436 # Remove duplicate entries |
1435 libraries = gyp.common.uniquer(libraries) | 1437 libraries = gyp.common.uniquer(libraries) |
1436 if self.flavor == 'mac': | 1438 if self.flavor == 'mac': |
1437 libraries = self.xcode_settings.AdjustLibraries(libraries) | 1439 libraries = self.xcode_settings.AdjustLibraries(libraries) |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 root_makefile.write("endif\n") | 2150 root_makefile.write("endif\n") |
2149 root_makefile.write('\n') | 2151 root_makefile.write('\n') |
2150 | 2152 |
2151 if (not generator_flags.get('standalone') | 2153 if (not generator_flags.get('standalone') |
2152 and generator_flags.get('auto_regeneration', True)): | 2154 and generator_flags.get('auto_regeneration', True)): |
2153 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) | 2155 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) |
2154 | 2156 |
2155 root_makefile.write(SHARED_FOOTER) | 2157 root_makefile.write(SHARED_FOOTER) |
2156 | 2158 |
2157 root_makefile.close() | 2159 root_makefile.close() |
OLD | NEW |