OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 target_postbuilds[configname] = target_postbuild | 1411 target_postbuilds[configname] = target_postbuild |
1412 else: | 1412 else: |
1413 ldflags = config.get('ldflags', []) | 1413 ldflags = config.get('ldflags', []) |
1414 # Compute an rpath for this output if needed. | 1414 # Compute an rpath for this output if needed. |
1415 if any(dep.endswith('.so') for dep in deps): | 1415 if any(dep.endswith('.so') for dep in deps): |
1416 # We want to get the literal string "$ORIGIN" into the link command, | 1416 # We want to get the literal string "$ORIGIN" into the link command, |
1417 # so we need lots of escaping. | 1417 # so we need lots of escaping. |
1418 ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset) | 1418 ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset) |
1419 ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' % | 1419 ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' % |
1420 self.toolset) | 1420 self.toolset) |
| 1421 library_dirs = spec.get('library_dirs', []) |
| 1422 library_dirs += config.get('library_dirs', []) |
| 1423 ldflags += [('-L%s' % library_dir) for library_dir in library_dirs] |
1421 self.WriteList(ldflags, 'LDFLAGS_%s' % configname) | 1424 self.WriteList(ldflags, 'LDFLAGS_%s' % configname) |
1422 libraries = spec.get('libraries') | 1425 libraries = spec.get('libraries') |
1423 if libraries: | 1426 if libraries: |
1424 # Remove duplicate entries | 1427 # Remove duplicate entries |
1425 libraries = gyp.common.uniquer(libraries) | 1428 libraries = gyp.common.uniquer(libraries) |
1426 if self.flavor == 'mac': | 1429 if self.flavor == 'mac': |
1427 libraries = self.xcode_settings.AdjustLibraries(libraries) | 1430 libraries = self.xcode_settings.AdjustLibraries(libraries) |
1428 self.WriteList(libraries, 'LIBS') | 1431 self.WriteList(libraries, 'LIBS') |
1429 self.WriteLn('%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))' % | 1432 self.WriteLn('%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))' % |
1430 QuoteSpaces(self.output_binary)) | 1433 QuoteSpaces(self.output_binary)) |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 root_makefile.write(" include " + include_file + "\n") | 2126 root_makefile.write(" include " + include_file + "\n") |
2124 root_makefile.write("endif\n") | 2127 root_makefile.write("endif\n") |
2125 root_makefile.write('\n') | 2128 root_makefile.write('\n') |
2126 | 2129 |
2127 if generator_flags.get('auto_regeneration', True): | 2130 if generator_flags.get('auto_regeneration', True): |
2128 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) | 2131 WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) |
2129 | 2132 |
2130 root_makefile.write(SHARED_FOOTER) | 2133 root_makefile.write(SHARED_FOOTER) |
2131 | 2134 |
2132 root_makefile.close() | 2135 root_makefile.close() |
OLD | NEW |