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_syspath',
68 'udev_enumerate_add_match_subsystem',
69 'udev_enumerate_get_list_entry',
71 'udev_enumerate_scan_devices',
72 'udev_enumerate_unref',
73 'udev_list_entry_get_next',
74 'udev_list_entry_get_name',
75 'udev_monitor_enable_receiving',
76 'udev_monitor_filter_add_match_subsystem_devtype',
77 'udev_monitor_get_fd',
78 'udev_monitor_new_from_netlink',
79 'udev_monitor_receive_device',
83 'udev_set_log_priority',
88 [ 'chromeos==0 and use_ozone==0', {
89 # Hide GTK and related dependencies for Chrome OS and Ozone, so they won't get
90 # added back to Chrome OS and Ozone. Don't try to use GTK on Chrome OS and Ozone.
96 ['_toolset=="target"', {
97 'direct_dependent_settings': {
99 '<!@(<(pkg-config) --cflags gdk-2.0)',
104 '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
107 '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
114 'target_name': 'gtk',
116 'toolsets': ['host', 'target'],
118 # gtk requires gmodule, but it does not list it as a dependency
119 # in some misconfigured systems.
120 'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
123 ['_toolset=="target"', {
124 'all_dependent_settings': {
126 '<!@(<(pkg-config) --cflags <(gtk_packages))',
131 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
134 '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
138 'all_dependent_settings': {
140 '<!@(pkg-config --cflags <(gtk_packages))',
145 '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
148 '<!@(pkg-config --libs-only-l <(gtk_packages))',
155 'target_name': 'gtkprint',
158 ['_toolset=="target"', {
159 'direct_dependent_settings': {
161 '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
166 '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
169 '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
177 [ 'use_x11==1 or ozone_platform_ozonex==1', {
178 # Hide X11 and related dependencies when use_x11=0
181 'target_name': 'x11',
183 'toolsets': ['host', 'target'],
185 ['_toolset=="target"', {
186 'direct_dependent_settings': {
188 '<!@(<(pkg-config) --cflags x11)',
193 '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
196 '<!@(<(pkg-config) --libs-only-l x11 xi)',
200 'direct_dependent_settings': {
202 '<!@(pkg-config --cflags x11)',
207 '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
210 '<!@(pkg-config --libs-only-l x11 xi)',
217 'target_name': 'xcursor',
219 'direct_dependent_settings': {
221 '<!@(<(pkg-config) --cflags xcursor)',
226 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
229 '<!@(<(pkg-config) --libs-only-l xcursor)',
234 'target_name': 'xcomposite',
236 'direct_dependent_settings': {
238 '<!@(<(pkg-config) --cflags xcomposite)',
243 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
246 '<!@(<(pkg-config) --libs-only-l xcomposite)',
251 'target_name': 'xdamage',
253 'direct_dependent_settings': {
255 '<!@(<(pkg-config) --cflags xdamage)',
260 '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
263 '<!@(<(pkg-config) --libs-only-l xdamage)',
268 'target_name': 'xext',
270 'direct_dependent_settings': {
272 '<!@(<(pkg-config) --cflags xext)',
277 '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
280 '<!@(<(pkg-config) --libs-only-l xext)',
285 'target_name': 'xfixes',
287 'direct_dependent_settings': {
289 '<!@(<(pkg-config) --cflags xfixes)',
294 '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
297 '<!@(<(pkg-config) --libs-only-l xfixes)',
304 'direct_dependent_settings': {
306 '<!@(<(pkg-config) --cflags xi)',
311 '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
314 '<!@(<(pkg-config) --libs-only-l xi)',
319 'target_name': 'xrandr',
321 'toolsets': ['host', 'target'],
323 ['_toolset=="target"', {
324 'direct_dependent_settings': {
326 '<!@(<(pkg-config) --cflags xrandr)',
331 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
334 '<!@(<(pkg-config) --libs-only-l xrandr)',
338 'direct_dependent_settings': {
340 '<!@(pkg-config --cflags xrandr)',
345 '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
348 '<!@(pkg-config --libs-only-l xrandr)',
355 'target_name': 'xrender',
357 'direct_dependent_settings': {
359 '<!@(<(pkg-config) --cflags xrender)',
364 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
367 '<!@(<(pkg-config) --libs-only-l xrender)',
372 'target_name': 'xtst',
374 'toolsets': ['host', 'target'],
376 ['_toolset=="target"', {
377 'direct_dependent_settings': {
379 '<!@(<(pkg-config) --cflags xtst)',
384 '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
387 '<!@(<(pkg-config) --libs-only-l xtst)',
391 'direct_dependent_settings': {
393 '<!@(pkg-config --cflags xtst)',
398 '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
401 '<!@(pkg-config --libs-only-l xtst)',
409 ['use_x11==1 and chromeos==0', {
412 'target_name': 'xscrnsaver',
414 'direct_dependent_settings': {
416 '<!@(<(pkg-config) --cflags xscrnsaver)',
421 '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
424 '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
430 ['use_evdev_gestures==1', {
433 'target_name': 'libevdev-cros',
435 'direct_dependent_settings': {
437 '<!@(<(pkg-config) --cflags libevdev-cros)'
442 '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
445 '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
450 'target_name': 'libgestures',
452 'direct_dependent_settings': {
454 '<!@(<(pkg-config) --cflags libgestures)'
459 '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
462 '<!@(<(pkg-config) --libs-only-l libgestures)',
468 ['use_xkbcommon==1', {
471 'target_name': 'xkbcommon',
473 'direct_dependent_settings': {
475 '<!@(<(pkg-config) --cflags xkbcommon)'
480 '<!@(<(pkg-config) --libs-only-L --libs-only-other xkbcommon)',
483 '<!@(<(pkg-config) --libs-only-l xkbcommon)',
489 ['ozone_platform_gbm==1', {
492 'target_name': 'gbm',
494 'direct_dependent_settings': {
496 '<!@(<(pkg-config) --cflags gbm)',
501 '<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)',
504 '<!@(<(pkg-config) --libs-only-l gbm)',
510 ['ozone_platform_dri==1 or ozone_platform_gbm==1', {
513 'target_name': 'libdrm',
515 'direct_dependent_settings': {
517 '<!@(<(pkg-config) --cflags libdrm)',
522 '<!@(<(pkg-config) --libs-only-l libdrm)',
531 'target_name': 'udev',
532 'type': 'static_library',
534 ['_toolset=="target"', {
538 'hard_dependency': 1,
542 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev0.h',
543 'output_cc': '<(INTERMEDIATE_DIR)/libudev0_loader.cc',
544 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
546 'action_name': 'generate_libudev0_loader',
556 '--name', 'LibUdev0Loader',
557 '--output-h', '<(output_h)',
558 '--output-cc', '<(output_cc)',
559 '--header', '"third_party/libudev/libudev0.h"',
561 '<@(libudev_functions)',
563 'message': 'Generating libudev0 library loader',
564 'process_outputs_as_sources': 1,
568 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev1.h',
569 'output_cc': '<(INTERMEDIATE_DIR)/libudev1_loader.cc',
570 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
572 'action_name': 'generate_libudev1_loader',
582 '--name', 'LibUdev1Loader',
583 '--output-h', '<(output_h)',
584 '--output-cc', '<(output_cc)',
585 '--header', '"third_party/libudev/libudev1.h"',
587 '<@(libudev_functions)',
589 'message': 'Generating libudev1 library loader',
590 'process_outputs_as_sources': 1,
601 'target_name': 'libpci',
602 'type': 'static_library',
604 '<!@(<(pkg-config) --cflags libpci)',
606 'direct_dependent_settings': {
608 '<(SHARED_INTERMEDIATE_DIR)',
611 ['linux_link_libpci==1', {
614 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
617 '<!@(<(pkg-config) --libs-only-l libpci)',
626 'hard_dependency': 1,
630 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
631 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
632 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
634 'action_name': 'generate_libpci_loader',
644 '--name', 'LibPciLoader',
645 '--output-h', '<(output_h)',
646 '--output-cc', '<(output_cc)',
647 '--header', '<pci/pci.h>',
648 # TODO(phajdan.jr): Report problem to pciutils project
649 # and get it fixed so that we don't need --use-extern-c.
651 '--link-directly=<(linux_link_libpci)',
652 '<@(libpci_functions)',
654 'message': 'Generating libpci library loader',
655 'process_outputs_as_sources': 1,
664 'target_name': 'dbus',
666 'direct_dependent_settings': {
668 '<!@(<(pkg-config) --cflags dbus-1)',
673 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
676 '<!@(<(pkg-config) --libs-only-l dbus-1)',
681 'target_name': 'fontconfig',
684 ['_toolset=="target"', {
686 ['use_system_fontconfig==1', {
687 'direct_dependent_settings': {
689 '<!@(<(pkg-config) --cflags fontconfig)',
694 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
697 '<!@(<(pkg-config) --libs-only-l fontconfig)',
700 }, { # use_system_fontconfig==0
702 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
704 'export_dependent_settings' : [
705 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
713 'target_name': 'freetype2',
716 ['_toolset=="target"', {
717 'direct_dependent_settings': {
719 '<!@(<(pkg-config) --cflags freetype2)',
724 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
727 '<!@(<(pkg-config) --libs-only-l freetype2)',
734 'target_name': 'gconf',
737 ['use_gconf==1 and _toolset=="target"', {
738 'direct_dependent_settings': {
740 '<!@(<(pkg-config) --cflags gconf-2.0)',
748 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
751 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
758 'target_name': 'gio',
759 'type': 'static_library',
761 ['use_gio==1 and _toolset=="target"', {
763 '<!@(<(pkg-config) --cflags gio-2.0)',
766 'gio_warning_define': [
767 # glib >=2.40 deprecate g_settings_list_schemas in favor of
768 # g_settings_schema_source_list_schemas. This function is not
769 # available on earlier versions that we still need to support
770 # (specifically, 2.32), so disable the warning.
771 # TODO(mgiuca): Remove this suppression (and variable) when we
772 # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
773 # code to use g_settings_schema_source_list_schemas instead.
774 'GLIB_DISABLE_DEPRECATION_WARNINGS',
778 '<(gio_warning_define)',
780 'direct_dependent_settings': {
782 '<!@(<(pkg-config) --cflags gio-2.0)',
786 '<(gio_warning_define)',
789 '<(SHARED_INTERMEDIATE_DIR)',
797 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
800 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
803 ['linux_link_gsettings==0 and OS=="linux"', {
810 'hard_dependency': 1,
814 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
815 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
816 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
818 'action_name': 'generate_libgio_loader',
828 '--name', 'LibGioLoader',
829 '--output-h', '<(output_h)',
830 '--output-cc', '<(output_cc)',
831 '--header', '<gio/gio.h>',
832 '--link-directly=<(linux_link_gsettings)',
833 '<@(libgio_functions)',
835 'message': 'Generating libgio library loader',
836 'process_outputs_as_sources': 1,
843 'target_name': 'glib',
845 'toolsets': ['host', 'target'],
847 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
850 ['_toolset=="target"', {
851 'direct_dependent_settings': {
853 '<!@(<(pkg-config) --cflags <(glib_packages))',
858 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
861 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
865 'direct_dependent_settings': {
867 '<!@(pkg-config --cflags <(glib_packages))',
872 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
875 '<!@(pkg-config --libs-only-l <(glib_packages))',
882 'target_name': 'gnome_keyring',
885 ['use_gnome_keyring==1', {
886 'direct_dependent_settings': {
888 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
894 ['linux_link_gnome_keyring==0', {
895 'defines': ['DLOPEN_GNOME_KEYRING'],
900 ['linux_link_gnome_keyring!=0', {
903 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
906 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
925 # The unit tests use a few convenience functions from the GNOME
926 # Keyring library directly. We ignore linux_link_gnome_keyring and
927 # link directly in this version of the target to allow this.
928 # *** Do not use this target in the main binary! ***
929 'target_name': 'gnome_keyring_direct',
932 ['use_gnome_keyring==1', {
933 'direct_dependent_settings': {
935 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
941 ['linux_link_gnome_keyring==0', {
942 'defines': ['DLOPEN_GNOME_KEYRING'],
948 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
951 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
958 'target_name': 'libbrlapi',
959 'type': 'static_library',
960 'all_dependent_settings': {
962 '<(SHARED_INTERMEDIATE_DIR)',
968 ['linux_link_libbrlapi==1', {
980 'hard_dependency': 1,
984 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
985 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
986 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
988 'action_name': 'generate_brlapi_loader',
998 '--name', 'LibBrlapiLoader',
999 '--output-h', '<(output_h)',
1000 '--output-cc', '<(output_cc)',
1001 '--header', '<brlapi.h>',
1002 '--link-directly=<(linux_link_libbrlapi)',
1003 '<@(libbrlapi_functions)',
1005 'message': 'Generating libbrlapi library loader',
1006 'process_outputs_as_sources': 1,
1011 'target_name': 'libcap',
1020 'target_name': 'libresolv',
1029 # GN version: //third_party/speech-dispatcher
1030 'target_name': 'libspeechd',
1031 'type': 'static_library',
1032 'direct_dependent_settings': {
1034 '<(SHARED_INTERMEDIATE_DIR)',
1037 ['linux_link_libspeechd==1', {
1049 'hard_dependency': 1,
1053 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
1054 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
1055 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1057 # speech-dispatcher >= 0.8 installs libspeechd.h into
1058 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
1059 # puts libspeechd.h in the top-level include directory.
1060 # Since we need to support both cases for now, we ship a copy of
1061 # libspeechd.h in third_party/speech-dispatcher. If the user
1062 # prefers to link against the speech-dispatcher directly, the
1063 # `libspeechd_h_prefix' variable can be passed to gyp with a value
1064 # such as "speech-dispatcher/" that will be prepended to
1065 # "libspeechd.h" in the #include directive.
1066 # TODO(phaldan.jr): Once we do not need to support
1067 # speech-dispatcher < 0.8 we can get rid of all this (including
1068 # third_party/speech-dispatcher) and just include
1069 # speech-dispatcher/libspeechd.h unconditionally.
1070 'libspeechd_h_prefix%': '',
1072 'action_name': 'generate_libspeechd_loader',
1080 'action': ['python',
1082 '--name', 'LibSpeechdLoader',
1083 '--output-h', '<(output_h)',
1084 '--output-cc', '<(output_cc)',
1085 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
1087 '"third_party/speech-dispatcher/libspeechd.h"',
1088 '--link-directly=<(linux_link_libspeechd)',
1095 'spd_set_notification_on',
1096 'spd_set_voice_rate',
1097 'spd_set_voice_pitch',
1098 'spd_list_synthesis_voices',
1099 'spd_set_synthesis_voice',
1101 'spd_set_output_module',
1103 'message': 'Generating libspeechd library loader',
1104 'process_outputs_as_sources': 1,
1109 'target_name': 'pangocairo',
1111 'toolsets': ['host', 'target'],
1113 ['use_pango==1 and use_cairo==1', {
1115 ['_toolset=="target"', {
1116 'direct_dependent_settings': {
1118 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
1123 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
1126 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
1130 'direct_dependent_settings': {
1132 '<!@(pkg-config --cflags pangocairo pangoft2)',
1137 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
1140 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
1149 'target_name': 'ssl',
1152 ['_toolset=="target"', {
1154 ['use_openssl==1', {
1156 '../../third_party/boringssl/boringssl.gyp:boringssl',
1159 ['use_openssl==0', {
1161 '../../net/third_party/nss/ssl.gyp:libssl',
1163 'direct_dependent_settings': {
1165 # We need for our local copies of the libssl3 headers to come
1166 # before other includes, as we are shadowing system headers.
1167 '<(DEPTH)/net/third_party/nss/ssl',
1170 '<!@(<(pkg-config) --cflags nss)',
1175 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1178 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1182 ['use_openssl==0 and clang==1', {
1183 'direct_dependent_settings': {
1185 # There is a broken header guard in /usr/include/nss/secmod.h:
1186 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1187 '-Wno-header-guard',