1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
9 'pkg-config': '<(chroot_cmd) ./pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
11 'pkg-config': 'pkg-config',
15 # If any of the linux_link_FOO below are set to 1, then the corresponding
16 # target will be linked against the FOO library (either dynamically or
17 # statically, depending on the pkg-config files), as opposed to loading the
18 # FOO library dynamically with dlopen.
19 'linux_link_libgps%': 0,
20 'linux_link_libpci%': 0,
21 'linux_link_libspeechd%': 0,
22 'linux_link_libbrlapi%': 0,
24 # Used below for the various libraries. In this scope for sharing with GN.
25 'libbrlapi_functions': [
26 'brlapi_getHandleSize',
27 'brlapi_error_location',
30 'brlapi__openConnection',
31 'brlapi__closeConnection',
32 'brlapi__getDisplaySize',
33 'brlapi__enterTtyModeWithPath',
34 'brlapi__leaveTtyMode',
40 'g_settings_get_child',
41 'g_settings_get_string',
42 'g_settings_get_boolean',
44 'g_settings_get_strv',
45 'g_settings_list_schemas',
55 'libudev_functions': [
56 'udev_device_get_action',
57 'udev_device_get_devnode',
58 'udev_device_get_parent',
59 'udev_device_get_parent_with_subsystem_devtype',
60 'udev_device_get_property_value',
61 'udev_device_get_subsystem',
62 'udev_device_get_sysattr_value',
63 'udev_device_get_sysname',
64 'udev_device_get_syspath',
65 'udev_device_new_from_devnum',
66 'udev_device_new_from_subsystem_sysname',
67 'udev_device_new_from_syspath',
69 'udev_enumerate_add_match_subsystem',
70 'udev_enumerate_get_list_entry',
72 'udev_enumerate_scan_devices',
73 'udev_enumerate_unref',
74 'udev_list_entry_get_next',
75 'udev_list_entry_get_name',
76 'udev_monitor_enable_receiving',
77 'udev_monitor_filter_add_match_subsystem_devtype',
78 'udev_monitor_get_fd',
79 'udev_monitor_new_from_netlink',
80 'udev_monitor_receive_device',
84 'udev_set_log_priority',
89 [ 'chromeos==0 and use_ozone==0', {
90 # Hide GTK and related dependencies for Chrome OS and Ozone, so they won't get
91 # added back to Chrome OS and Ozone. Don't try to use GTK on Chrome OS and Ozone.
97 ['_toolset=="target"', {
98 'direct_dependent_settings': {
100 '<!@(<(pkg-config) --cflags gdk-2.0)',
105 '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
108 '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
115 'target_name': 'gtk',
117 'toolsets': ['host', 'target'],
119 # gtk requires gmodule, but it does not list it as a dependency
120 # in some misconfigured systems.
121 'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
124 ['_toolset=="target"', {
125 'all_dependent_settings': {
127 '<!@(<(pkg-config) --cflags <(gtk_packages))',
132 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
135 '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
139 'all_dependent_settings': {
141 '<!@(pkg-config --cflags <(gtk_packages))',
146 '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
149 '<!@(pkg-config --libs-only-l <(gtk_packages))',
156 'target_name': 'gtkprint',
159 ['_toolset=="target"', {
160 'direct_dependent_settings': {
162 '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
167 '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
170 '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
178 [ 'use_x11==1 or ozone_platform_ozonex==1', {
179 # Hide X11 and related dependencies when use_x11=0
182 'target_name': 'x11',
184 'toolsets': ['host', 'target'],
186 ['_toolset=="target"', {
187 'direct_dependent_settings': {
189 '<!@(<(pkg-config) --cflags x11)',
194 '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
197 '<!@(<(pkg-config) --libs-only-l x11 xi)',
201 'direct_dependent_settings': {
203 '<!@(pkg-config --cflags x11)',
208 '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
211 '<!@(pkg-config --libs-only-l x11 xi)',
218 'target_name': 'xcursor',
220 'direct_dependent_settings': {
222 '<!@(<(pkg-config) --cflags xcursor)',
227 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
230 '<!@(<(pkg-config) --libs-only-l xcursor)',
235 'target_name': 'xcomposite',
237 'direct_dependent_settings': {
239 '<!@(<(pkg-config) --cflags xcomposite)',
244 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
247 '<!@(<(pkg-config) --libs-only-l xcomposite)',
252 'target_name': 'xdamage',
254 'direct_dependent_settings': {
256 '<!@(<(pkg-config) --cflags xdamage)',
261 '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
264 '<!@(<(pkg-config) --libs-only-l xdamage)',
269 'target_name': 'xext',
271 'direct_dependent_settings': {
273 '<!@(<(pkg-config) --cflags xext)',
278 '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
281 '<!@(<(pkg-config) --libs-only-l xext)',
286 'target_name': 'xfixes',
288 'direct_dependent_settings': {
290 '<!@(<(pkg-config) --cflags xfixes)',
295 '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
298 '<!@(<(pkg-config) --libs-only-l xfixes)',
305 'direct_dependent_settings': {
307 '<!@(<(pkg-config) --cflags xi)',
312 '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
315 '<!@(<(pkg-config) --libs-only-l xi)',
320 'target_name': 'xrandr',
322 'toolsets': ['host', 'target'],
324 ['_toolset=="target"', {
325 'direct_dependent_settings': {
327 '<!@(<(pkg-config) --cflags xrandr)',
332 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
335 '<!@(<(pkg-config) --libs-only-l xrandr)',
339 'direct_dependent_settings': {
341 '<!@(pkg-config --cflags xrandr)',
346 '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
349 '<!@(pkg-config --libs-only-l xrandr)',
356 'target_name': 'xrender',
358 'direct_dependent_settings': {
360 '<!@(<(pkg-config) --cflags xrender)',
365 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
368 '<!@(<(pkg-config) --libs-only-l xrender)',
373 'target_name': 'xtst',
375 'toolsets': ['host', 'target'],
377 ['_toolset=="target"', {
378 'direct_dependent_settings': {
380 '<!@(<(pkg-config) --cflags xtst)',
385 '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
388 '<!@(<(pkg-config) --libs-only-l xtst)',
392 'direct_dependent_settings': {
394 '<!@(pkg-config --cflags xtst)',
399 '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
402 '<!@(pkg-config --libs-only-l xtst)',
410 ['use_x11==1 and chromeos==0', {
413 'target_name': 'xscrnsaver',
415 'direct_dependent_settings': {
417 '<!@(<(pkg-config) --cflags xscrnsaver)',
422 '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
425 '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
431 ['use_evdev_gestures==1', {
434 'target_name': 'libevdev-cros',
436 'direct_dependent_settings': {
438 '<!@(<(pkg-config) --cflags libevdev-cros)'
443 '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
446 '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
451 'target_name': 'libgestures',
453 'direct_dependent_settings': {
455 '<!@(<(pkg-config) --cflags libgestures)'
460 '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
463 '<!@(<(pkg-config) --libs-only-l libgestures)',
469 ['use_xkbcommon==1', {
472 'target_name': 'xkbcommon',
474 'direct_dependent_settings': {
476 '<!@(<(pkg-config) --cflags xkbcommon)'
481 '<!@(<(pkg-config) --libs-only-L --libs-only-other xkbcommon)',
484 '<!@(<(pkg-config) --libs-only-l xkbcommon)',
490 ['ozone_platform_gbm==1', {
493 'target_name': 'gbm',
495 'direct_dependent_settings': {
497 '<!@(<(pkg-config) --cflags gbm)',
502 '<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)',
505 '<!@(<(pkg-config) --libs-only-l gbm)',
511 ['ozone_platform_dri==1 or ozone_platform_gbm==1', {
514 'target_name': 'libdrm',
516 'direct_dependent_settings': {
518 '<!@(<(pkg-config) --cflags libdrm)',
523 '<!@(<(pkg-config) --libs-only-l libdrm)',
532 'target_name': 'udev',
533 'type': 'static_library',
535 ['_toolset=="target"', {
539 'hard_dependency': 1,
543 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev0.h',
544 'output_cc': '<(INTERMEDIATE_DIR)/libudev0_loader.cc',
545 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
547 'action_name': 'generate_libudev0_loader',
557 '--name', 'LibUdev0Loader',
558 '--output-h', '<(output_h)',
559 '--output-cc', '<(output_cc)',
560 '--header', '"third_party/libudev/libudev0.h"',
562 '<@(libudev_functions)',
564 'message': 'Generating libudev0 library loader',
565 'process_outputs_as_sources': 1,
569 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev1.h',
570 'output_cc': '<(INTERMEDIATE_DIR)/libudev1_loader.cc',
571 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
573 'action_name': 'generate_libudev1_loader',
583 '--name', 'LibUdev1Loader',
584 '--output-h', '<(output_h)',
585 '--output-cc', '<(output_cc)',
586 '--header', '"third_party/libudev/libudev1.h"',
588 '<@(libudev_functions)',
590 'message': 'Generating libudev1 library loader',
591 'process_outputs_as_sources': 1,
602 'target_name': 'libpci',
603 'type': 'static_library',
605 '<!@(<(pkg-config) --cflags libpci)',
607 'direct_dependent_settings': {
609 '<(SHARED_INTERMEDIATE_DIR)',
612 ['linux_link_libpci==1', {
615 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
618 '<!@(<(pkg-config) --libs-only-l libpci)',
627 'hard_dependency': 1,
631 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
632 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
633 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
635 'action_name': 'generate_libpci_loader',
645 '--name', 'LibPciLoader',
646 '--output-h', '<(output_h)',
647 '--output-cc', '<(output_cc)',
648 '--header', '<pci/pci.h>',
649 # TODO(phajdan.jr): Report problem to pciutils project
650 # and get it fixed so that we don't need --use-extern-c.
652 '--link-directly=<(linux_link_libpci)',
653 '<@(libpci_functions)',
655 'message': 'Generating libpci library loader',
656 'process_outputs_as_sources': 1,
665 'target_name': 'dbus',
667 'direct_dependent_settings': {
669 '<!@(<(pkg-config) --cflags dbus-1)',
674 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
677 '<!@(<(pkg-config) --libs-only-l dbus-1)',
682 'target_name': 'fontconfig',
685 ['_toolset=="target"', {
687 ['use_system_fontconfig==1', {
688 'direct_dependent_settings': {
690 '<!@(<(pkg-config) --cflags fontconfig)',
695 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
698 '<!@(<(pkg-config) --libs-only-l fontconfig)',
701 }, { # use_system_fontconfig==0
703 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
705 'export_dependent_settings' : [
706 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
714 'target_name': 'freetype2',
717 ['_toolset=="target"', {
718 'direct_dependent_settings': {
720 '<!@(<(pkg-config) --cflags freetype2)',
725 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
728 '<!@(<(pkg-config) --libs-only-l freetype2)',
735 'target_name': 'gconf',
738 ['use_gconf==1 and _toolset=="target"', {
739 'direct_dependent_settings': {
741 '<!@(<(pkg-config) --cflags gconf-2.0)',
749 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
752 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
759 'target_name': 'gio',
760 'type': 'static_library',
762 ['use_gio==1 and _toolset=="target"', {
764 '<!@(<(pkg-config) --cflags gio-2.0)',
767 'gio_warning_define': [
768 # glib >=2.40 deprecate g_settings_list_schemas in favor of
769 # g_settings_schema_source_list_schemas. This function is not
770 # available on earlier versions that we still need to support
771 # (specifically, 2.32), so disable the warning.
772 # TODO(mgiuca): Remove this suppression (and variable) when we
773 # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
774 # code to use g_settings_schema_source_list_schemas instead.
775 'GLIB_DISABLE_DEPRECATION_WARNINGS',
779 '<(gio_warning_define)',
781 'direct_dependent_settings': {
783 '<!@(<(pkg-config) --cflags gio-2.0)',
787 '<(gio_warning_define)',
790 '<(SHARED_INTERMEDIATE_DIR)',
798 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
801 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
804 ['linux_link_gsettings==0 and OS=="linux"', {
811 'hard_dependency': 1,
815 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
816 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
817 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
819 'action_name': 'generate_libgio_loader',
829 '--name', 'LibGioLoader',
830 '--output-h', '<(output_h)',
831 '--output-cc', '<(output_cc)',
832 '--header', '<gio/gio.h>',
833 '--link-directly=<(linux_link_gsettings)',
834 '<@(libgio_functions)',
836 'message': 'Generating libgio library loader',
837 'process_outputs_as_sources': 1,
844 'target_name': 'glib',
846 'toolsets': ['host', 'target'],
848 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
851 ['_toolset=="target"', {
852 'direct_dependent_settings': {
854 '<!@(<(pkg-config) --cflags <(glib_packages))',
859 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
862 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
866 'direct_dependent_settings': {
868 '<!@(pkg-config --cflags <(glib_packages))',
873 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
876 '<!@(pkg-config --libs-only-l <(glib_packages))',
883 'target_name': 'gnome_keyring',
886 ['use_gnome_keyring==1', {
887 'direct_dependent_settings': {
889 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
895 ['linux_link_gnome_keyring==0', {
896 'defines': ['DLOPEN_GNOME_KEYRING'],
901 ['linux_link_gnome_keyring!=0', {
904 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
907 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
926 # The unit tests use a few convenience functions from the GNOME
927 # Keyring library directly. We ignore linux_link_gnome_keyring and
928 # link directly in this version of the target to allow this.
929 # *** Do not use this target in the main binary! ***
930 'target_name': 'gnome_keyring_direct',
933 ['use_gnome_keyring==1', {
934 'direct_dependent_settings': {
936 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
942 ['linux_link_gnome_keyring==0', {
943 'defines': ['DLOPEN_GNOME_KEYRING'],
949 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
952 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
959 'target_name': 'libbrlapi',
960 'type': 'static_library',
961 'all_dependent_settings': {
963 '<(SHARED_INTERMEDIATE_DIR)',
969 ['linux_link_libbrlapi==1', {
981 'hard_dependency': 1,
985 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
986 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
987 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
989 'action_name': 'generate_brlapi_loader',
999 '--name', 'LibBrlapiLoader',
1000 '--output-h', '<(output_h)',
1001 '--output-cc', '<(output_cc)',
1002 '--header', '<brlapi.h>',
1003 '--link-directly=<(linux_link_libbrlapi)',
1004 '<@(libbrlapi_functions)',
1006 'message': 'Generating libbrlapi library loader',
1007 'process_outputs_as_sources': 1,
1012 'target_name': 'libcap',
1021 'target_name': 'libresolv',
1030 # GN version: //third_party/speech-dispatcher
1031 'target_name': 'libspeechd',
1032 'type': 'static_library',
1033 'direct_dependent_settings': {
1035 '<(SHARED_INTERMEDIATE_DIR)',
1038 ['linux_link_libspeechd==1', {
1050 'hard_dependency': 1,
1054 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
1055 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
1056 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1058 # speech-dispatcher >= 0.8 installs libspeechd.h into
1059 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
1060 # puts libspeechd.h in the top-level include directory.
1061 # Since we need to support both cases for now, we ship a copy of
1062 # libspeechd.h in third_party/speech-dispatcher. If the user
1063 # prefers to link against the speech-dispatcher directly, the
1064 # `libspeechd_h_prefix' variable can be passed to gyp with a value
1065 # such as "speech-dispatcher/" that will be prepended to
1066 # "libspeechd.h" in the #include directive.
1067 # TODO(phaldan.jr): Once we do not need to support
1068 # speech-dispatcher < 0.8 we can get rid of all this (including
1069 # third_party/speech-dispatcher) and just include
1070 # speech-dispatcher/libspeechd.h unconditionally.
1071 'libspeechd_h_prefix%': '',
1073 'action_name': 'generate_libspeechd_loader',
1081 'action': ['python',
1083 '--name', 'LibSpeechdLoader',
1084 '--output-h', '<(output_h)',
1085 '--output-cc', '<(output_cc)',
1086 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
1088 '"third_party/speech-dispatcher/libspeechd.h"',
1089 '--link-directly=<(linux_link_libspeechd)',
1096 'spd_set_notification_on',
1097 'spd_set_voice_rate',
1098 'spd_set_voice_pitch',
1099 'spd_list_synthesis_voices',
1100 'spd_set_synthesis_voice',
1102 'spd_set_output_module',
1104 'message': 'Generating libspeechd library loader',
1105 'process_outputs_as_sources': 1,
1110 'target_name': 'pangocairo',
1112 'toolsets': ['host', 'target'],
1114 ['use_pango==1 and use_cairo==1', {
1116 ['_toolset=="target"', {
1117 'direct_dependent_settings': {
1119 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
1124 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
1127 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
1131 'direct_dependent_settings': {
1133 '<!@(pkg-config --cflags pangocairo pangoft2)',
1138 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
1141 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
1150 'target_name': 'ssl',
1153 ['_toolset=="target"', {
1155 ['use_openssl==1', {
1157 '../../third_party/boringssl/boringssl.gyp:boringssl',
1160 ['use_openssl==0', {
1162 '../../net/third_party/nss/ssl.gyp:libssl',
1164 'direct_dependent_settings': {
1166 # We need for our local copies of the libssl3 headers to come
1167 # before other includes, as we are shadowing system headers.
1168 '<(DEPTH)/net/third_party/nss/ssl',
1171 '<!@(<(pkg-config) --cflags nss)',
1176 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1179 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1183 ['use_openssl==0 and clang==1', {
1184 'direct_dependent_settings': {
1186 # There is a broken header guard in /usr/include/nss/secmod.h:
1187 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1188 '-Wno-header-guard',