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_dri==1 or 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 libdrm)',
548 'target_name': 'udev',
549 'type': 'static_library',
551 ['_toolset=="target"', {
555 'hard_dependency': 1,
559 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev0.h',
560 'output_cc': '<(INTERMEDIATE_DIR)/libudev0_loader.cc',
561 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
563 'action_name': 'generate_libudev0_loader',
573 '--name', 'LibUdev0Loader',
574 '--output-h', '<(output_h)',
575 '--output-cc', '<(output_cc)',
576 '--header', '"third_party/libudev/libudev0.h"',
578 '<@(libudev_functions)',
580 'message': 'Generating libudev0 library loader',
581 'process_outputs_as_sources': 1,
585 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev1.h',
586 'output_cc': '<(INTERMEDIATE_DIR)/libudev1_loader.cc',
587 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
589 'action_name': 'generate_libudev1_loader',
599 '--name', 'LibUdev1Loader',
600 '--output-h', '<(output_h)',
601 '--output-cc', '<(output_cc)',
602 '--header', '"third_party/libudev/libudev1.h"',
604 '<@(libudev_functions)',
606 'message': 'Generating libudev1 library loader',
607 'process_outputs_as_sources': 1,
618 'target_name': 'libpci',
619 'type': 'static_library',
621 '<!@(<(pkg-config) --cflags libpci)',
623 'direct_dependent_settings': {
625 '<(SHARED_INTERMEDIATE_DIR)',
628 ['linux_link_libpci==1', {
631 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
634 '<!@(<(pkg-config) --libs-only-l libpci)',
643 'hard_dependency': 1,
647 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
648 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
649 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
651 'action_name': 'generate_libpci_loader',
661 '--name', 'LibPciLoader',
662 '--output-h', '<(output_h)',
663 '--output-cc', '<(output_cc)',
664 '--header', '<pci/pci.h>',
665 # TODO(phajdan.jr): Report problem to pciutils project
666 # and get it fixed so that we don't need --use-extern-c.
668 '--link-directly=<(linux_link_libpci)',
669 '<@(libpci_functions)',
671 'message': 'Generating libpci library loader',
672 'process_outputs_as_sources': 1,
681 'target_name': 'dbus',
683 'direct_dependent_settings': {
685 '<!@(<(pkg-config) --cflags dbus-1)',
690 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
693 '<!@(<(pkg-config) --libs-only-l dbus-1)',
698 'target_name': 'fontconfig',
701 ['_toolset=="target"', {
703 ['use_system_fontconfig==1', {
704 'direct_dependent_settings': {
706 '<!@(<(pkg-config) --cflags fontconfig)',
711 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
714 '<!@(<(pkg-config) --libs-only-l fontconfig)',
717 }, { # use_system_fontconfig==0
719 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
721 'export_dependent_settings' : [
722 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
730 'target_name': 'freetype2',
733 ['_toolset=="target"', {
734 'direct_dependent_settings': {
736 '<!@(<(pkg-config) --cflags freetype2)',
741 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
744 '<!@(<(pkg-config) --libs-only-l freetype2)',
751 'target_name': 'gconf',
754 ['use_gconf==1 and _toolset=="target"', {
755 'direct_dependent_settings': {
757 '<!@(<(pkg-config) --cflags gconf-2.0)',
765 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
768 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
775 'target_name': 'gio',
776 'type': 'static_library',
778 ['use_gio==1 and _toolset=="target"', {
780 '<!@(<(pkg-config) --cflags gio-2.0)',
783 'gio_warning_define': [
784 # glib >=2.40 deprecate g_settings_list_schemas in favor of
785 # g_settings_schema_source_list_schemas. This function is not
786 # available on earlier versions that we still need to support
787 # (specifically, 2.32), so disable the warning.
788 # TODO(mgiuca): Remove this suppression (and variable) when we
789 # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
790 # code to use g_settings_schema_source_list_schemas instead.
791 'GLIB_DISABLE_DEPRECATION_WARNINGS',
795 '<(gio_warning_define)',
797 'direct_dependent_settings': {
799 '<!@(<(pkg-config) --cflags gio-2.0)',
803 '<(gio_warning_define)',
806 '<(SHARED_INTERMEDIATE_DIR)',
814 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
817 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
820 ['linux_link_gsettings==0 and OS=="linux"', {
827 'hard_dependency': 1,
831 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
832 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
833 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
835 'action_name': 'generate_libgio_loader',
845 '--name', 'LibGioLoader',
846 '--output-h', '<(output_h)',
847 '--output-cc', '<(output_cc)',
848 '--header', '<gio/gio.h>',
849 '--link-directly=<(linux_link_gsettings)',
850 '<@(libgio_functions)',
852 'message': 'Generating libgio library loader',
853 'process_outputs_as_sources': 1,
860 'target_name': 'glib',
862 'toolsets': ['host', 'target'],
864 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
867 ['_toolset=="target"', {
868 'direct_dependent_settings': {
870 '<!@(<(pkg-config) --cflags <(glib_packages))',
875 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
878 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
882 'direct_dependent_settings': {
884 '<!@(pkg-config --cflags <(glib_packages))',
889 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
892 '<!@(pkg-config --libs-only-l <(glib_packages))',
899 'target_name': 'gnome_keyring',
902 ['use_gnome_keyring==1', {
903 'direct_dependent_settings': {
905 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
911 ['linux_link_gnome_keyring==0', {
912 'defines': ['DLOPEN_GNOME_KEYRING'],
917 ['linux_link_gnome_keyring!=0', {
920 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
923 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
942 # The unit tests use a few convenience functions from the GNOME
943 # Keyring library directly. We ignore linux_link_gnome_keyring and
944 # link directly in this version of the target to allow this.
945 # *** Do not use this target in the main binary! ***
946 'target_name': 'gnome_keyring_direct',
949 ['use_gnome_keyring==1', {
950 'direct_dependent_settings': {
952 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
958 ['linux_link_gnome_keyring==0', {
959 'defines': ['DLOPEN_GNOME_KEYRING'],
965 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
968 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
975 'target_name': 'libbrlapi',
976 'type': 'static_library',
977 'all_dependent_settings': {
979 '<(SHARED_INTERMEDIATE_DIR)',
985 ['linux_link_libbrlapi==1', {
997 'hard_dependency': 1,
1001 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
1002 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
1003 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1005 'action_name': 'generate_brlapi_loader',
1013 'action': ['python',
1015 '--name', 'LibBrlapiLoader',
1016 '--output-h', '<(output_h)',
1017 '--output-cc', '<(output_cc)',
1018 '--header', '<brlapi.h>',
1019 '--link-directly=<(linux_link_libbrlapi)',
1020 '<@(libbrlapi_functions)',
1022 'message': 'Generating libbrlapi library loader',
1023 'process_outputs_as_sources': 1,
1028 'target_name': 'libcap',
1037 'target_name': 'libresolv',
1046 # GN version: //third_party/speech-dispatcher
1047 'target_name': 'libspeechd',
1048 'type': 'static_library',
1049 'direct_dependent_settings': {
1051 '<(SHARED_INTERMEDIATE_DIR)',
1054 ['linux_link_libspeechd==1', {
1066 'hard_dependency': 1,
1070 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
1071 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
1072 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1074 # speech-dispatcher >= 0.8 installs libspeechd.h into
1075 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
1076 # puts libspeechd.h in the top-level include directory.
1077 # Since we need to support both cases for now, we ship a copy of
1078 # libspeechd.h in third_party/speech-dispatcher. If the user
1079 # prefers to link against the speech-dispatcher directly, the
1080 # `libspeechd_h_prefix' variable can be passed to gyp with a value
1081 # such as "speech-dispatcher/" that will be prepended to
1082 # "libspeechd.h" in the #include directive.
1083 # TODO(phaldan.jr): Once we do not need to support
1084 # speech-dispatcher < 0.8 we can get rid of all this (including
1085 # third_party/speech-dispatcher) and just include
1086 # speech-dispatcher/libspeechd.h unconditionally.
1087 'libspeechd_h_prefix%': '',
1089 'action_name': 'generate_libspeechd_loader',
1097 'action': ['python',
1099 '--name', 'LibSpeechdLoader',
1100 '--output-h', '<(output_h)',
1101 '--output-cc', '<(output_cc)',
1102 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
1104 '"third_party/speech-dispatcher/libspeechd.h"',
1105 '--link-directly=<(linux_link_libspeechd)',
1112 'spd_set_notification_on',
1113 'spd_set_voice_rate',
1114 'spd_set_voice_pitch',
1115 'spd_list_synthesis_voices',
1116 'spd_set_synthesis_voice',
1118 'spd_set_output_module',
1121 'message': 'Generating libspeechd library loader',
1122 'process_outputs_as_sources': 1,
1127 'target_name': 'pangocairo',
1129 'toolsets': ['host', 'target'],
1131 ['use_pango==1 and use_cairo==1', {
1133 ['_toolset=="target"', {
1134 'direct_dependent_settings': {
1136 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
1141 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
1144 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
1148 'direct_dependent_settings': {
1150 '<!@(pkg-config --cflags pangocairo pangoft2)',
1155 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
1158 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
1167 'target_name': 'ssl',
1170 ['_toolset=="target"', {
1172 ['use_openssl==1', {
1174 '../../third_party/boringssl/boringssl.gyp:boringssl',
1178 '../../net/third_party/nss/ssl.gyp:libssl',
1180 'direct_dependent_settings': {
1182 # We need for our local copies of the libssl3 headers to come
1183 # before other includes, as we are shadowing system headers.
1184 '<(DEPTH)/net/third_party/nss/ssl',
1188 # Link in the system NSS if it is used for either the internal
1189 # crypto library (use_openssl==0) or platform certificate
1190 # library (use_nss_certs==1).
1191 ['use_openssl==0 or use_nss_certs==1', {
1192 'direct_dependent_settings': {
1194 '<!@(<(pkg-config) --cflags nss)',
1199 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1202 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1207 'direct_dependent_settings': {
1209 # There is a broken header guard in /usr/include/nss/secmod.h:
1210 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1211 '-Wno-header-guard',