Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3506)

Unified Diff: build/linux/system.gyp

Issue 11415138: Linux: create a library loader code generator for dlopen and use it for libpci. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/linux/system.gyp
diff --git a/build/linux/system.gyp b/build/linux/system.gyp
index 2eacbdbaaba56db8f5633e7a63ef3d78dc8cae5c..23562e9a22c275fdeb47292b3e55dae105860050 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,65 @@
],
},
{
+ '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': [
+ {
+ 'action_name': 'generate_libpci_loader',
+ 'inputs': [
+ '../../tools/generate_library_loader/generate_library_loader.py',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/libpci_loader.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
+ ],
+ 'action': ['python',
+ '../../tools/generate_library_loader/generate_library_loader.py',
+ '--name', 'LibPciLoader',
+ '--output-h', '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
Mark Mentovai 2012/11/27 23:09:11 I’d declare the h name and cc name as variables, a
Paweł Hajdan Jr. 2012/11/28 01:05:52 Done.
+ '--output-cc', '<(INTERMEDIATE_DIR)/libpci_loader.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'],

Powered by Google App Engine
This is Rietveld 408576698