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 atk)',
103 'ATK_LIB_DIR="<!@(<(pkg-config) --variable=libdir atk)"',
108 '<!@(<(pkg-config) --libs-only-L --libs-only-other atk)',
111 '<!@(<(pkg-config) --libs-only-l atk)',
118 'target_name': 'gdk',
121 ['_toolset=="target"', {
122 'direct_dependent_settings': {
124 '<!@(<(pkg-config) --cflags gdk-2.0)',
129 '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
132 '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
139 'target_name': 'gtk',
141 'toolsets': ['host', 'target'],
143 # gtk requires gmodule, but it does not list it as a dependency
144 # in some misconfigured systems.
145 'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
148 ['_toolset=="target"', {
149 'all_dependent_settings': {
151 '<!@(<(pkg-config) --cflags <(gtk_packages))',
156 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
159 '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
163 'all_dependent_settings': {
165 '<!@(pkg-config --cflags <(gtk_packages))',
170 '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
173 '<!@(pkg-config --libs-only-l <(gtk_packages))',
180 'target_name': 'gtkprint',
183 ['_toolset=="target"', {
184 'direct_dependent_settings': {
186 '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
191 '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
194 '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
202 [ 'use_x11==1 or ozone_platform_ozonex==1', {
203 # Hide X11 and related dependencies when use_x11=0
206 'target_name': 'x11',
208 'toolsets': ['host', 'target'],
210 ['_toolset=="target"', {
211 'direct_dependent_settings': {
213 '<!@(<(pkg-config) --cflags x11)',
218 '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
221 '<!@(<(pkg-config) --libs-only-l x11 xi)',
225 'direct_dependent_settings': {
227 '<!@(pkg-config --cflags x11)',
232 '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
235 '<!@(pkg-config --libs-only-l x11 xi)',
242 'target_name': 'xcursor',
244 'direct_dependent_settings': {
246 '<!@(<(pkg-config) --cflags xcursor)',
251 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
254 '<!@(<(pkg-config) --libs-only-l xcursor)',
259 'target_name': 'xcomposite',
261 'direct_dependent_settings': {
263 '<!@(<(pkg-config) --cflags xcomposite)',
268 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
271 '<!@(<(pkg-config) --libs-only-l xcomposite)',
276 'target_name': 'xdamage',
278 'direct_dependent_settings': {
280 '<!@(<(pkg-config) --cflags xdamage)',
285 '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
288 '<!@(<(pkg-config) --libs-only-l xdamage)',
293 'target_name': 'xext',
295 'direct_dependent_settings': {
297 '<!@(<(pkg-config) --cflags xext)',
302 '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
305 '<!@(<(pkg-config) --libs-only-l xext)',
310 'target_name': 'xfixes',
312 'direct_dependent_settings': {
314 '<!@(<(pkg-config) --cflags xfixes)',
319 '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
322 '<!@(<(pkg-config) --libs-only-l xfixes)',
329 'direct_dependent_settings': {
331 '<!@(<(pkg-config) --cflags xi)',
336 '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
339 '<!@(<(pkg-config) --libs-only-l xi)',
344 'target_name': 'xrandr',
346 'toolsets': ['host', 'target'],
348 ['_toolset=="target"', {
349 'direct_dependent_settings': {
351 '<!@(<(pkg-config) --cflags xrandr)',
356 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
359 '<!@(<(pkg-config) --libs-only-l xrandr)',
363 'direct_dependent_settings': {
365 '<!@(pkg-config --cflags xrandr)',
370 '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
373 '<!@(pkg-config --libs-only-l xrandr)',
380 'target_name': 'xrender',
382 'direct_dependent_settings': {
384 '<!@(<(pkg-config) --cflags xrender)',
389 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
392 '<!@(<(pkg-config) --libs-only-l xrender)',
397 'target_name': 'xtst',
399 'toolsets': ['host', 'target'],
401 ['_toolset=="target"', {
402 'direct_dependent_settings': {
404 '<!@(<(pkg-config) --cflags xtst)',
409 '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
412 '<!@(<(pkg-config) --libs-only-l xtst)',
416 'direct_dependent_settings': {
418 '<!@(pkg-config --cflags xtst)',
423 '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
426 '<!@(pkg-config --libs-only-l xtst)',
434 ['use_x11==1 and chromeos==0', {
437 'target_name': 'xscrnsaver',
439 'direct_dependent_settings': {
441 '<!@(<(pkg-config) --cflags xscrnsaver)',
446 '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
449 '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
455 ['use_evdev_gestures==1', {
458 'target_name': 'libevdev-cros',
460 'direct_dependent_settings': {
462 '<!@(<(pkg-config) --cflags libevdev-cros)'
467 '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
470 '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
475 'target_name': 'libgestures',
477 'direct_dependent_settings': {
479 '<!@(<(pkg-config) --cflags libgestures)'
484 '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
487 '<!@(<(pkg-config) --libs-only-l libgestures)',
493 ['use_xkbcommon==1', {
496 'target_name': 'xkbcommon',
498 'direct_dependent_settings': {
500 '<!@(<(pkg-config) --cflags xkbcommon)'
505 '<!@(<(pkg-config) --libs-only-L --libs-only-other xkbcommon)',
508 '<!@(<(pkg-config) --libs-only-l xkbcommon)',
514 ['ozone_platform_gbm==1', {
517 'target_name': 'gbm',
519 'direct_dependent_settings': {
521 '<!@(<(pkg-config) --cflags gbm)',
526 '<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)',
529 '<!@(<(pkg-config) --libs-only-l gbm)',
535 ['ozone_platform_dri==1 or ozone_platform_drm==1 or ozone_platform_gbm==1', {
538 'target_name': 'libdrm',
540 'direct_dependent_settings': {
542 '<!@(<(pkg-config) --cflags libdrm)',
547 '<!@(<(pkg-config) --libs-only-l libdrm)',
556 'target_name': 'udev',
557 'type': 'static_library',
559 ['_toolset=="target"', {
563 'hard_dependency': 1,
567 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev0.h',
568 'output_cc': '<(INTERMEDIATE_DIR)/libudev0_loader.cc',
569 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
571 'action_name': 'generate_libudev0_loader',
581 '--name', 'LibUdev0Loader',
582 '--output-h', '<(output_h)',
583 '--output-cc', '<(output_cc)',
584 '--header', '"third_party/libudev/libudev0.h"',
586 '<@(libudev_functions)',
588 'message': 'Generating libudev0 library loader',
589 'process_outputs_as_sources': 1,
593 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libudev1.h',
594 'output_cc': '<(INTERMEDIATE_DIR)/libudev1_loader.cc',
595 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
597 'action_name': 'generate_libudev1_loader',
607 '--name', 'LibUdev1Loader',
608 '--output-h', '<(output_h)',
609 '--output-cc', '<(output_cc)',
610 '--header', '"third_party/libudev/libudev1.h"',
612 '<@(libudev_functions)',
614 'message': 'Generating libudev1 library loader',
615 'process_outputs_as_sources': 1,
626 'target_name': 'libpci',
627 'type': 'static_library',
629 '<!@(<(pkg-config) --cflags libpci)',
631 'direct_dependent_settings': {
633 '<(SHARED_INTERMEDIATE_DIR)',
636 ['linux_link_libpci==1', {
639 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
642 '<!@(<(pkg-config) --libs-only-l libpci)',
651 'hard_dependency': 1,
655 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
656 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
657 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
659 'action_name': 'generate_libpci_loader',
669 '--name', 'LibPciLoader',
670 '--output-h', '<(output_h)',
671 '--output-cc', '<(output_cc)',
672 '--header', '<pci/pci.h>',
673 # TODO(phajdan.jr): Report problem to pciutils project
674 # and get it fixed so that we don't need --use-extern-c.
676 '--link-directly=<(linux_link_libpci)',
677 '<@(libpci_functions)',
679 'message': 'Generating libpci library loader',
680 'process_outputs_as_sources': 1,
689 'target_name': 'dbus',
691 'direct_dependent_settings': {
693 '<!@(<(pkg-config) --cflags dbus-1)',
698 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
701 '<!@(<(pkg-config) --libs-only-l dbus-1)',
706 'target_name': 'fontconfig',
709 ['_toolset=="target"', {
711 ['use_system_fontconfig==1', {
712 'direct_dependent_settings': {
714 '<!@(<(pkg-config) --cflags fontconfig)',
719 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
722 '<!@(<(pkg-config) --libs-only-l fontconfig)',
725 }, { # use_system_fontconfig==0
727 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
729 'export_dependent_settings' : [
730 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
738 'target_name': 'freetype2',
741 ['_toolset=="target"', {
742 'direct_dependent_settings': {
744 '<!@(<(pkg-config) --cflags freetype2)',
749 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
752 '<!@(<(pkg-config) --libs-only-l freetype2)',
759 'target_name': 'gconf',
762 ['use_gconf==1 and _toolset=="target"', {
763 'direct_dependent_settings': {
765 '<!@(<(pkg-config) --cflags gconf-2.0)',
773 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
776 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
783 'target_name': 'gio',
784 'type': 'static_library',
786 ['use_gio==1 and _toolset=="target"', {
788 '<!@(<(pkg-config) --cflags gio-2.0)',
791 'gio_warning_define': [
792 # glib >=2.40 deprecate g_settings_list_schemas in favor of
793 # g_settings_schema_source_list_schemas. This function is not
794 # available on earlier versions that we still need to support
795 # (specifically, 2.32), so disable the warning.
796 # TODO(mgiuca): Remove this suppression (and variable) when we
797 # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
798 # code to use g_settings_schema_source_list_schemas instead.
799 'GLIB_DISABLE_DEPRECATION_WARNINGS',
803 '<(gio_warning_define)',
805 'direct_dependent_settings': {
807 '<!@(<(pkg-config) --cflags gio-2.0)',
811 '<(gio_warning_define)',
814 '<(SHARED_INTERMEDIATE_DIR)',
822 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
825 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
828 ['linux_link_gsettings==0 and OS=="linux"', {
835 'hard_dependency': 1,
839 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
840 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
841 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
843 'action_name': 'generate_libgio_loader',
853 '--name', 'LibGioLoader',
854 '--output-h', '<(output_h)',
855 '--output-cc', '<(output_cc)',
856 '--header', '<gio/gio.h>',
857 '--link-directly=<(linux_link_gsettings)',
858 '<@(libgio_functions)',
860 'message': 'Generating libgio library loader',
861 'process_outputs_as_sources': 1,
868 'target_name': 'glib',
870 'toolsets': ['host', 'target'],
872 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
875 ['_toolset=="target"', {
876 'direct_dependent_settings': {
878 '<!@(<(pkg-config) --cflags <(glib_packages))',
883 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
886 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
890 'direct_dependent_settings': {
892 '<!@(pkg-config --cflags <(glib_packages))',
897 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
900 '<!@(pkg-config --libs-only-l <(glib_packages))',
907 'target_name': 'gnome_keyring',
910 ['use_gnome_keyring==1', {
911 'direct_dependent_settings': {
913 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
919 ['linux_link_gnome_keyring==0', {
920 'defines': ['DLOPEN_GNOME_KEYRING'],
925 ['linux_link_gnome_keyring!=0', {
928 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
931 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
950 # The unit tests use a few convenience functions from the GNOME
951 # Keyring library directly. We ignore linux_link_gnome_keyring and
952 # link directly in this version of the target to allow this.
953 # *** Do not use this target in the main binary! ***
954 'target_name': 'gnome_keyring_direct',
957 ['use_gnome_keyring==1', {
958 'direct_dependent_settings': {
960 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
966 ['linux_link_gnome_keyring==0', {
967 'defines': ['DLOPEN_GNOME_KEYRING'],
973 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
976 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
983 'target_name': 'libbrlapi',
984 'type': 'static_library',
985 'all_dependent_settings': {
987 '<(SHARED_INTERMEDIATE_DIR)',
993 ['linux_link_libbrlapi==1', {
1005 'hard_dependency': 1,
1009 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
1010 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
1011 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1013 'action_name': 'generate_brlapi_loader',
1021 'action': ['python',
1023 '--name', 'LibBrlapiLoader',
1024 '--output-h', '<(output_h)',
1025 '--output-cc', '<(output_cc)',
1026 '--header', '<brlapi.h>',
1027 '--link-directly=<(linux_link_libbrlapi)',
1028 '<@(libbrlapi_functions)',
1030 'message': 'Generating libbrlapi library loader',
1031 'process_outputs_as_sources': 1,
1036 'target_name': 'libcap',
1045 'target_name': 'libresolv',
1054 # GN version: //third_party/speech-dispatcher
1055 'target_name': 'libspeechd',
1056 'type': 'static_library',
1057 'direct_dependent_settings': {
1059 '<(SHARED_INTERMEDIATE_DIR)',
1062 ['linux_link_libspeechd==1', {
1074 'hard_dependency': 1,
1078 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
1079 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
1080 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
1082 # speech-dispatcher >= 0.8 installs libspeechd.h into
1083 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
1084 # puts libspeechd.h in the top-level include directory.
1085 # Since we need to support both cases for now, we ship a copy of
1086 # libspeechd.h in third_party/speech-dispatcher. If the user
1087 # prefers to link against the speech-dispatcher directly, the
1088 # `libspeechd_h_prefix' variable can be passed to gyp with a value
1089 # such as "speech-dispatcher/" that will be prepended to
1090 # "libspeechd.h" in the #include directive.
1091 # TODO(phaldan.jr): Once we do not need to support
1092 # speech-dispatcher < 0.8 we can get rid of all this (including
1093 # third_party/speech-dispatcher) and just include
1094 # speech-dispatcher/libspeechd.h unconditionally.
1095 'libspeechd_h_prefix%': '',
1097 'action_name': 'generate_libspeechd_loader',
1105 'action': ['python',
1107 '--name', 'LibSpeechdLoader',
1108 '--output-h', '<(output_h)',
1109 '--output-cc', '<(output_cc)',
1110 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
1112 '"third_party/speech-dispatcher/libspeechd.h"',
1113 '--link-directly=<(linux_link_libspeechd)',
1120 'spd_set_notification_on',
1121 'spd_set_voice_rate',
1122 'spd_set_voice_pitch',
1123 'spd_list_synthesis_voices',
1124 'spd_set_synthesis_voice',
1126 'spd_set_output_module',
1128 'message': 'Generating libspeechd library loader',
1129 'process_outputs_as_sources': 1,
1134 'target_name': 'pangocairo',
1136 'toolsets': ['host', 'target'],
1138 ['use_pango==1 and use_cairo==1', {
1140 ['_toolset=="target"', {
1141 'direct_dependent_settings': {
1143 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
1148 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
1151 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
1155 'direct_dependent_settings': {
1157 '<!@(pkg-config --cflags pangocairo pangoft2)',
1162 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
1165 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
1174 'target_name': 'ssl',
1177 ['_toolset=="target"', {
1179 ['use_openssl==1', {
1181 '../../third_party/boringssl/boringssl.gyp:boringssl',
1184 ['use_openssl==0', {
1186 '../../net/third_party/nss/ssl.gyp:libssl',
1188 'direct_dependent_settings': {
1190 # We need for our local copies of the libssl3 headers to come
1191 # before other includes, as we are shadowing system headers.
1192 '<(DEPTH)/net/third_party/nss/ssl',
1195 '<!@(<(pkg-config) --cflags nss)',
1200 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1203 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1207 ['use_openssl==0 and clang==1', {
1208 'direct_dependent_settings': {
1210 # There is a broken header guard in /usr/include/nss/secmod.h:
1211 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1212 '-Wno-header-guard',