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.
7 # If any of the linux_link_FOO below are set to 1, then the corresponding
8 # target will be linked against the FOO library (either dynamically or
9 # statically, depending on the pkg-config files), as opposed to loading the
10 # FOO library dynamically with dlopen.
11 'linux_link_libgps%': 0,
12 'linux_link_libpci%': 0,
13 'linux_link_libspeechd%': 0,
14 'linux_link_libbrlapi%': 0,
16 # Used below for the various libraries. In this scope for sharing with GN.
17 'libbrlapi_functions': [
18 'brlapi_getHandleSize',
19 'brlapi_error_location',
22 'brlapi__openConnection',
23 'brlapi__closeConnection',
24 'brlapi__getDisplaySize',
25 'brlapi__enterTtyModeWithPath',
26 'brlapi__leaveTtyMode',
32 'g_settings_get_child',
33 'g_settings_get_string',
34 'g_settings_get_boolean',
36 'g_settings_get_strv',
37 'g_settings_list_schemas',
47 'libudev_functions': [
48 'udev_device_get_action',
49 'udev_device_get_devnode',
50 'udev_device_get_parent',
51 'udev_device_get_parent_with_subsystem_devtype',
52 'udev_device_get_property_value',
53 'udev_device_get_subsystem',
54 'udev_device_get_sysattr_value',
55 'udev_device_get_sysname',
56 'udev_device_get_syspath',
57 'udev_device_new_from_devnum',
58 'udev_device_new_from_subsystem_sysname',
59 'udev_device_new_from_syspath',
61 'udev_enumerate_add_match_subsystem',
62 'udev_enumerate_get_list_entry',
64 'udev_enumerate_scan_devices',
65 'udev_enumerate_unref',
66 'udev_list_entry_get_next',
67 'udev_list_entry_get_name',
68 'udev_monitor_enable_receiving',
69 'udev_monitor_filter_add_match_subsystem_devtype',
70 'udev_monitor_get_fd',
71 'udev_monitor_new_from_netlink',
72 'udev_monitor_receive_device',
76 'udev_set_log_priority',
81 [ 'chromeos==0 and use_ozone==0', {
82 # Hide GTK and related dependencies for Chrome OS and Ozone, so they won't get
83 # added back to Chrome OS and Ozone. Don't try to use GTK on Chrome OS and Ozone.
89 ['_toolset=="target"', {
90 'direct_dependent_settings': {
92 '<!@(<(pkg-config) --cflags atk)',
95 'ATK_LIB_DIR="<!@(<(pkg-config) --variable=libdir atk)"',
100 '<!@(<(pkg-config) --libs-only-L --libs-only-other atk)',
103 '<!@(<(pkg-config) --libs-only-l atk)',
110 'target_name': 'gdk',
113 ['_toolset=="target"', {
114 'direct_dependent_settings': {
116 '<!@(<(pkg-config) --cflags gdk-2.0)',
121 '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
124 '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
131 'target_name': 'gtk',
133 'toolsets': ['host', 'target'],
135 # gtk requires gmodule, but it does not list it as a dependency
136 # in some misconfigured systems.
137 'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
140 ['_toolset=="target"', {
141 'all_dependent_settings': {
143 '<!@(<(pkg-config) --cflags <(gtk_packages))',
148 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
151 '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
155 'all_dependent_settings': {
157 '<!@(pkg-config --cflags <(gtk_packages))',
162 '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
165 '<!@(pkg-config --libs-only-l <(gtk_packages))',
172 'target_name': 'gtkprint',
175 ['_toolset=="target"', {
176 'direct_dependent_settings': {
178 '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
183 '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
186 '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
194 [ 'use_x11==1 or ozone_platform_ozonex==1', {
195 # Hide X11 and related dependencies when use_x11=0
198 'target_name': 'x11',
200 'toolsets': ['host', 'target'],
202 ['_toolset=="target"', {
203 'direct_dependent_settings': {
205 '<!@(<(pkg-config) --cflags x11)',
210 '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
213 '<!@(<(pkg-config) --libs-only-l x11 xi)',
217 'direct_dependent_settings': {
219 '<!@(pkg-config --cflags x11)',
224 '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
227 '<!@(pkg-config --libs-only-l x11 xi)',
234 'target_name': 'xcursor',
236 'direct_dependent_settings': {
238 '<!@(<(pkg-config) --cflags xcursor)',
243 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
246 '<!@(<(pkg-config) --libs-only-l xcursor)',
251 'target_name': 'xcomposite',
253 'direct_dependent_settings': {
255 '<!@(<(pkg-config) --cflags xcomposite)',
260 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
263 '<!@(<(pkg-config) --libs-only-l xcomposite)',
268 'target_name': 'xdamage',
270 'direct_dependent_settings': {
272 '<!@(<(pkg-config) --cflags xdamage)',
277 '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
280 '<!@(<(pkg-config) --libs-only-l xdamage)',
285 'target_name': 'xext',
287 'direct_dependent_settings': {
289 '<!@(<(pkg-config) --cflags xext)',
294 '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
297 '<!@(<(pkg-config) --libs-only-l xext)',
302 'target_name': 'xfixes',
304 'direct_dependent_settings': {
306 '<!@(<(pkg-config) --cflags xfixes)',
311 '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
314 '<!@(<(pkg-config) --libs-only-l xfixes)',
321 'direct_dependent_settings': {
323 '<!@(<(pkg-config) --cflags xi)',
328 '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
331 '<!@(<(pkg-config) --libs-only-l xi)',
336 'target_name': 'xrandr',
338 'toolsets': ['host', 'target'],
340 ['_toolset=="target"', {
341 'direct_dependent_settings': {
343 '<!@(<(pkg-config) --cflags xrandr)',
348 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
351 '<!@(<(pkg-config) --libs-only-l xrandr)',
355 'direct_dependent_settings': {
357 '<!@(pkg-config --cflags xrandr)',
362 '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
365 '<!@(pkg-config --libs-only-l xrandr)',
372 'target_name': 'xrender',
374 'direct_dependent_settings': {
376 '<!@(<(pkg-config) --cflags xrender)',
381 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
384 '<!@(<(pkg-config) --libs-only-l xrender)',
389 'target_name': 'xtst',
391 'toolsets': ['host', 'target'],
393 ['_toolset=="target"', {
394 'direct_dependent_settings': {
396 '<!@(<(pkg-config) --cflags xtst)',
401 '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
404 '<!@(<(pkg-config) --libs-only-l xtst)',
408 'direct_dependent_settings': {
410 '<!@(pkg-config --cflags xtst)',
415 '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
418 '<!@(pkg-config --libs-only-l xtst)',
426 ['use_x11==1 and chromeos==0', {
429 'target_name': 'xscrnsaver',
431 'direct_dependent_settings': {
433 '<!@(<(pkg-config) --cflags xscrnsaver)',
438 '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
441 '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
447 ['use_evdev_gestures==1', {
450 'target_name': 'libevdev-cros',
452 'direct_dependent_settings': {
454 '<!@(<(pkg-config) --cflags libevdev-cros)'
459 '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
462 '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
467 'target_name': 'libgestures',
469 'direct_dependent_settings': {
471 '<!@(<(pkg-config) --cflags libgestures)'
476 '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
479 '<!@(<(pkg-config) --libs-only-l libgestures)',
485 ['use_xkbcommon==1', {
488 'target_name': 'xkbcommon',
490 'direct_dependent_settings': {
492 '<!@(<(pkg-config) --cflags xkbcommon)'
497 '<!@(<(pkg-config) --libs-only-L --libs-only-other xkbcommon)',
500 '<!@(<(pkg-config) --libs-only-l xkbcommon)',
506 ['ozone_platform_gbm==1', {
509 'target_name': 'gbm',
511 'direct_dependent_settings': {
513 '<!@(<(pkg-config) --cflags gbm)',
518 '<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)',
521 '<!@(<(pkg-config) --libs-only-l gbm)',
527 ['ozone_platform_drm==1 or ozone_platform_gbm==1', {
530 'target_name': 'libdrm',
532 'direct_dependent_settings': {
534 '<!@(<(pkg-config) --cflags libdrm)',
539 '<!@(<(pkg-config) --libs-only-L --libs-only-other libdrm)',
542 '<!@(<(pkg-config) --libs-only-l libdrm)',
551 'target_name': 'udev',
552 'type': 'static_library',
554 ['_toolset=="target"', {
558 'hard_dependency': 1,
562 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev0.h',
563 'output_cc': '<(INTERMEDIATE_DIR)/libudev0_loader.cc',
564 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
566 'action_name': 'generate_libudev0_loader',
576 '--name', 'LibUdev0Loader',
577 '--output-h', '<(output_h)',
578 '--output-cc', '<(output_cc)',
579 '--header', '"third_party/libudev/libudev0.h"',
581 '<@(libudev_functions)',
583 'message': 'Generating libudev0 library loader',
584 'process_outputs_as_sources': 1,
588 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev1.h',
589 'output_cc': '<(INTERMEDIATE_DIR)/libudev1_loader.cc',
590 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
592 'action_name': 'generate_libudev1_loader',
602 '--name', 'LibUdev1Loader',
603 '--output-h', '<(output_h)',
604 '--output-cc', '<(output_cc)',
605 '--header', '"third_party/libudev/libudev1.h"',
607 '<@(libudev_functions)',
609 'message': 'Generating libudev1 library loader',
610 'process_outputs_as_sources': 1,
621 'target_name': 'libpci',
622 'type': 'static_library',
624 '<!@(<(pkg-config) --cflags libpci)',
626 'direct_dependent_settings': {
628 '<(SHARED_INTERMEDIATE_DIR)',
631 ['linux_link_libpci==1', {
634 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
637 '<!@(<(pkg-config) --libs-only-l libpci)',
646 'hard_dependency': 1,
650 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
651 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
652 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
654 'action_name': 'generate_libpci_loader',
664 '--name', 'LibPciLoader',
665 '--output-h', '<(output_h)',
666 '--output-cc', '<(output_cc)',
667 '--header', '<pci/pci.h>',
668 # TODO(phajdan.jr): Report problem to pciutils project
669 # and get it fixed so that we don't need --use-extern-c.
671 '--link-directly=<(linux_link_libpci)',
672 '<@(libpci_functions)',
674 'message': 'Generating libpci library loader',
675 'process_outputs_as_sources': 1,
684 'target_name': 'dbus',
686 'direct_dependent_settings': {
688 '<!@(<(pkg-config) --cflags dbus-1)',
693 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
696 '<!@(<(pkg-config) --libs-only-l dbus-1)',
701 'target_name': 'fontconfig',
704 ['_toolset=="target"', {
706 ['use_system_fontconfig==1', {
707 'direct_dependent_settings': {
709 '<!@(<(pkg-config) --cflags fontconfig)',
714 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
717 '<!@(<(pkg-config) --libs-only-l fontconfig)',
720 }, { # use_system_fontconfig==0
722 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
724 'export_dependent_settings' : [
725 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
733 'target_name': 'freetype2',
736 ['_toolset=="target"', {
737 'direct_dependent_settings': {
739 '<!@(<(pkg-config) --cflags freetype2)',
744 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
747 '<!@(<(pkg-config) --libs-only-l freetype2)',
754 'target_name': 'gconf',
757 ['use_gconf==1 and _toolset=="target"', {
758 'direct_dependent_settings': {
760 '<!@(<(pkg-config) --cflags gconf-2.0)',
768 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
771 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
778 'target_name': 'gio',
779 'type': 'static_library',
781 ['use_gio==1 and _toolset=="target"', {
783 '<!@(<(pkg-config) --cflags gio-2.0)',
786 'gio_warning_define': [
787 # glib >=2.40 deprecate g_settings_list_schemas in favor of
788 # g_settings_schema_source_list_schemas. This function is not
789 # available on earlier versions that we still need to support
790 # (specifically, 2.32), so disable the warning.
791 # TODO(mgiuca): Remove this suppression (and variable) when we
792 # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
793 # code to use g_settings_schema_source_list_schemas instead.
794 'GLIB_DISABLE_DEPRECATION_WARNINGS',
798 '<(gio_warning_define)',
800 'direct_dependent_settings': {
802 '<!@(<(pkg-config) --cflags gio-2.0)',
806 '<(gio_warning_define)',
809 '<(SHARED_INTERMEDIATE_DIR)',
817 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
820 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
823 ['linux_link_gsettings==0 and OS=="linux"', {
830 'hard_dependency': 1,
834 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
835 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
836 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
838 'action_name': 'generate_libgio_loader',
848 '--name', 'LibGioLoader',
849 '--output-h', '<(output_h)',
850 '--output-cc', '<(output_cc)',
851 '--header', '<gio/gio.h>',
852 '--link-directly=<(linux_link_gsettings)',
853 '<@(libgio_functions)',
855 'message': 'Generating libgio library loader',
856 'process_outputs_as_sources': 1,
863 'target_name': 'glib',
865 'toolsets': ['host', 'target'],
867 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
870 ['_toolset=="target"', {
871 'direct_dependent_settings': {
873 '<!@(<(pkg-config) --cflags <(glib_packages))',
878 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
881 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
885 'direct_dependent_settings': {
887 '<!@(pkg-config --cflags <(glib_packages))',
892 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
895 '<!@(pkg-config --libs-only-l <(glib_packages))',
902 'target_name': 'gnome_keyring',
905 ['use_gnome_keyring==1', {
906 'direct_dependent_settings': {
908 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
914 ['linux_link_gnome_keyring==0', {
915 'defines': ['DLOPEN_GNOME_KEYRING'],
920 ['linux_link_gnome_keyring!=0', {
923 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
926 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
945 # The unit tests use a few convenience functions from the GNOME
946 # Keyring library directly. We ignore linux_link_gnome_keyring and
947 # link directly in this version of the target to allow this.
948 # *** Do not use this target in the main binary! ***
949 'target_name': 'gnome_keyring_direct',
952 ['use_gnome_keyring==1', {
953 'direct_dependent_settings': {
955 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
961 ['linux_link_gnome_keyring==0', {
962 'defines': ['DLOPEN_GNOME_KEYRING'],
968 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
971 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
978 'target_name': 'libbrlapi',
979 'type': 'static_library',
980 'all_dependent_settings': {
982 '<(SHARED_INTERMEDIATE_DIR)',
988 ['linux_link_libbrlapi==1', {
1000 'hard_dependency': 1,
1004 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
1005 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
1006 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1008 'action_name': 'generate_brlapi_loader',
1016 'action': ['python',
1018 '--name', 'LibBrlapiLoader',
1019 '--output-h', '<(output_h)',
1020 '--output-cc', '<(output_cc)',
1021 '--header', '<brlapi.h>',
1022 '--link-directly=<(linux_link_libbrlapi)',
1023 '<@(libbrlapi_functions)',
1025 'message': 'Generating libbrlapi library loader',
1026 'process_outputs_as_sources': 1,
1031 'target_name': 'libcap',
1040 'target_name': 'libresolv',
1049 # GN version: //third_party/speech-dispatcher
1050 'target_name': 'libspeechd',
1051 'type': 'static_library',
1052 'direct_dependent_settings': {
1054 '<(SHARED_INTERMEDIATE_DIR)',
1057 ['linux_link_libspeechd==1', {
1069 'hard_dependency': 1,
1073 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
1074 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
1075 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1077 # speech-dispatcher >= 0.8 installs libspeechd.h into
1078 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
1079 # puts libspeechd.h in the top-level include directory.
1080 # Since we need to support both cases for now, we ship a copy of
1081 # libspeechd.h in third_party/speech-dispatcher. If the user
1082 # prefers to link against the speech-dispatcher directly, the
1083 # `libspeechd_h_prefix' variable can be passed to gyp with a value
1084 # such as "speech-dispatcher/" that will be prepended to
1085 # "libspeechd.h" in the #include directive.
1086 # TODO(phaldan.jr): Once we do not need to support
1087 # speech-dispatcher < 0.8 we can get rid of all this (including
1088 # third_party/speech-dispatcher) and just include
1089 # speech-dispatcher/libspeechd.h unconditionally.
1090 'libspeechd_h_prefix%': '',
1092 'action_name': 'generate_libspeechd_loader',
1100 'action': ['python',
1102 '--name', 'LibSpeechdLoader',
1103 '--output-h', '<(output_h)',
1104 '--output-cc', '<(output_cc)',
1105 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
1107 '"third_party/speech-dispatcher/libspeechd.h"',
1108 '--link-directly=<(linux_link_libspeechd)',
1115 'spd_set_notification_on',
1116 'spd_set_voice_rate',
1117 'spd_set_voice_pitch',
1118 'spd_list_synthesis_voices',
1119 'spd_set_synthesis_voice',
1121 'spd_set_output_module',
1124 'message': 'Generating libspeechd library loader',
1125 'process_outputs_as_sources': 1,
1130 'target_name': 'pangocairo',
1132 'toolsets': ['host', 'target'],
1134 ['use_pango==1 and use_cairo==1', {
1136 ['_toolset=="target"', {
1137 'direct_dependent_settings': {
1139 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
1144 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
1147 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
1151 'direct_dependent_settings': {
1153 '<!@(pkg-config --cflags pangocairo pangoft2)',
1158 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
1161 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
1170 'target_name': 'ssl',
1173 ['_toolset=="target"', {
1175 ['use_openssl==1', {
1177 '../../third_party/boringssl/boringssl.gyp:boringssl',
1181 '../../net/third_party/nss/ssl.gyp:libssl',
1183 'direct_dependent_settings': {
1185 # We need for our local copies of the libssl3 headers to come
1186 # before other includes, as we are shadowing system headers.
1187 '<(DEPTH)/net/third_party/nss/ssl',
1191 # Link in the system NSS if it is used for either the internal
1192 # crypto library (use_openssl==0) or platform certificate
1193 # library (use_nss_certs==1).
1194 ['use_openssl==0 or use_nss_certs==1', {
1195 'direct_dependent_settings': {
1197 '<!@(<(pkg-config) --cflags nss)',
1202 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1205 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1210 'direct_dependent_settings': {
1212 # There is a broken header guard in /usr/include/nss/secmod.h:
1213 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1214 '-Wno-header-guard',