diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 19:08:14 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 19:08:14 +0000 |
commit | dfbff862ecd56bf8ca179e676cd55aaca7346189 (patch) | |
tree | 0ddbc181048bc900abff065c629391d37a7e9527 /build/linux | |
parent | 9c6b19bd0fd8045914b1c0138333148a596c69a2 (diff) | |
download | chromium_src-dfbff862ecd56bf8ca179e676cd55aaca7346189.zip chromium_src-dfbff862ecd56bf8ca179e676cd55aaca7346189.tar.gz chromium_src-dfbff862ecd56bf8ca179e676cd55aaca7346189.tar.bz2 |
Linux: create a library loader code generator for dlopen and use it for libpci.
BUG=162733
Review URL: https://codereview.chromium.org/11415138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/linux')
-rw-r--r-- | build/linux/system.gyp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/build/linux/system.gyp b/build/linux/system.gyp index 2eacbdb..23f2689 100644 --- a/build/linux/system.gyp +++ b/build/linux/system.gyp @@ -11,6 +11,8 @@ 'pkg-config': 'pkg-config' }] ], + + 'linux_link_libpci%': 0, }, 'conditions': [ [ 'os_posix==1 and OS!="mac"', { @@ -275,6 +277,70 @@ ], }, { + 'target_name': 'libpci', + 'type': 'static_library', + 'cflags': [ + '<!@(<(pkg-config) --cflags libpci)', + ], + 'include_dirs': [ + '../..', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + ], + 'conditions': [ + ['linux_link_libpci==1', { + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l libpci)', + ], + } + }], + ], + }, + 'hard_dependency': 1, + 'actions': [ + { + 'variables': { + 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h', + 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc', + 'generator': '../../tools/generate_library_loader/generate_library_loader.py', + }, + 'action_name': 'generate_libpci_loader', + 'inputs': [ + '<(generator)', + ], + 'outputs': [ + '<(output_h)', + '<(output_cc)', + ], + 'action': ['python', + '<(generator)', + '--name', 'LibPciLoader', + '--output-h', '<(output_h)', + '--output-cc', '<(output_cc)', + '--header', '<pci/pci.h>', + # TODO(phajdan.jr): Report problem to pciutils project + # and get it fixed so that we don't need --use-extern-c. + '--use-extern-c', + '--link-directly=<(linux_link_libpci)', + 'pci_alloc', + 'pci_init', + 'pci_cleanup', + 'pci_scan_bus', + 'pci_fill_info', + 'pci_lookup_name', + ], + 'message': 'Generating libpci library loader.', + 'process_outputs_as_sources': 1, + }, + ], + }, + { 'target_name': 'x11', 'type': 'none', 'toolsets': ['host', 'target'], |