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,
25 [ 'chromeos==0 and use_ozone==0', {
26 # Hide GTK and related dependencies for Chrome OS and Ozone, so they won't get
27 # added back to Chrome OS and Ozone. Don't try to use GTK on Chrome OS and Ozone.
33 ['_toolset=="target"', {
34 'direct_dependent_settings': {
36 '<!@(<(pkg-config) --cflags gdk-2.0)',
41 '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
44 '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
53 'toolsets': ['host', 'target'],
55 # gtk requires gmodule, but it does not list it as a dependency
56 # in some misconfigured systems.
57 'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
60 ['_toolset=="target"', {
61 'all_dependent_settings': {
63 '<!@(<(pkg-config) --cflags <(gtk_packages))',
68 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
71 '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
75 'all_dependent_settings': {
77 '<!@(pkg-config --cflags <(gtk_packages))',
82 '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
85 '<!@(pkg-config --libs-only-l <(gtk_packages))',
92 'target_name': 'gtkprint',
95 ['_toolset=="target"', {
96 'direct_dependent_settings': {
98 '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
103 '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
106 '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
114 [ 'use_x11==1 or ozone_platform_ozonex==1', {
115 # Hide X11 and related dependencies when use_x11=0
118 'target_name': 'x11',
120 'toolsets': ['host', 'target'],
122 ['_toolset=="target"', {
123 'direct_dependent_settings': {
125 '<!@(<(pkg-config) --cflags x11)',
130 '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
133 '<!@(<(pkg-config) --libs-only-l x11 xi)',
137 'direct_dependent_settings': {
139 '<!@(pkg-config --cflags x11)',
144 '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
147 '<!@(pkg-config --libs-only-l x11 xi)',
154 'target_name': 'xcursor',
156 'direct_dependent_settings': {
158 '<!@(<(pkg-config) --cflags xcursor)',
163 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
166 '<!@(<(pkg-config) --libs-only-l xcursor)',
171 'target_name': 'xcomposite',
173 'direct_dependent_settings': {
175 '<!@(<(pkg-config) --cflags xcomposite)',
180 '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
183 '<!@(<(pkg-config) --libs-only-l xcomposite)',
188 'target_name': 'xdamage',
190 'direct_dependent_settings': {
192 '<!@(<(pkg-config) --cflags xdamage)',
197 '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
200 '<!@(<(pkg-config) --libs-only-l xdamage)',
205 'target_name': 'xext',
207 'direct_dependent_settings': {
209 '<!@(<(pkg-config) --cflags xext)',
214 '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
217 '<!@(<(pkg-config) --libs-only-l xext)',
222 'target_name': 'xfixes',
224 'direct_dependent_settings': {
226 '<!@(<(pkg-config) --cflags xfixes)',
231 '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
234 '<!@(<(pkg-config) --libs-only-l xfixes)',
241 'direct_dependent_settings': {
243 '<!@(<(pkg-config) --cflags xi)',
248 '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
251 '<!@(<(pkg-config) --libs-only-l xi)',
256 'target_name': 'xrandr',
258 'toolsets': ['host', 'target'],
260 ['_toolset=="target"', {
261 'direct_dependent_settings': {
263 '<!@(<(pkg-config) --cflags xrandr)',
268 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
271 '<!@(<(pkg-config) --libs-only-l xrandr)',
275 'direct_dependent_settings': {
277 '<!@(pkg-config --cflags xrandr)',
282 '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
285 '<!@(pkg-config --libs-only-l xrandr)',
292 'target_name': 'xrender',
294 'direct_dependent_settings': {
296 '<!@(<(pkg-config) --cflags xrender)',
301 '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
304 '<!@(<(pkg-config) --libs-only-l xrender)',
309 'target_name': 'xtst',
311 'toolsets': ['host', 'target'],
313 ['_toolset=="target"', {
314 'direct_dependent_settings': {
316 '<!@(<(pkg-config) --cflags xtst)',
321 '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
324 '<!@(<(pkg-config) --libs-only-l xtst)',
328 'direct_dependent_settings': {
330 '<!@(pkg-config --cflags xtst)',
335 '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
338 '<!@(pkg-config --libs-only-l xtst)',
346 ['use_x11==1 and chromeos==0', {
349 'target_name': 'xscrnsaver',
351 'direct_dependent_settings': {
353 '<!@(<(pkg-config) --cflags xscrnsaver)',
358 '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
361 '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
367 ['use_evdev_gestures==1', {
370 'target_name': 'libevdev-cros',
372 'direct_dependent_settings': {
374 '<!@(<(pkg-config) --cflags libevdev-cros)'
379 '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
382 '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
387 'target_name': 'libgestures',
389 'direct_dependent_settings': {
391 '<!@(<(pkg-config) --cflags libgestures)'
396 '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
399 '<!@(<(pkg-config) --libs-only-l libgestures)',
405 ['ozone_platform_gbm==1', {
408 'target_name': 'gbm',
410 'direct_dependent_settings': {
412 '<!@(<(pkg-config) --cflags gbm)',
417 '<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)',
420 '<!@(<(pkg-config) --libs-only-l gbm)',
426 ['ozone_platform_dri==1 or ozone_platform_gbm==1', {
429 'target_name': 'libdrm',
431 'direct_dependent_settings': {
433 '<!@(<(pkg-config) --cflags libdrm)',
438 '<!@(<(pkg-config) --libs-only-l libdrm)',
447 'target_name': 'udev',
450 ['_toolset=="target"', {
451 'direct_dependent_settings': {
453 '<!@(<(pkg-config) --cflags libudev)'
458 '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)',
461 '<!@(<(pkg-config) --libs-only-l libudev)',
472 'target_name': 'dbus',
474 'direct_dependent_settings': {
476 '<!@(<(pkg-config) --cflags dbus-1)',
481 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
484 '<!@(<(pkg-config) --libs-only-l dbus-1)',
489 'target_name': 'fontconfig',
492 ['_toolset=="target"', {
494 ['use_system_fontconfig==1', {
495 'direct_dependent_settings': {
497 '<!@(<(pkg-config) --cflags fontconfig)',
502 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
505 '<!@(<(pkg-config) --libs-only-l fontconfig)',
508 }, { # use_system_fontconfig==0
510 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
512 'export_dependent_settings' : [
513 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
521 'target_name': 'freetype2',
524 ['_toolset=="target"', {
525 'direct_dependent_settings': {
527 '<!@(<(pkg-config) --cflags freetype2)',
532 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
535 '<!@(<(pkg-config) --libs-only-l freetype2)',
542 'target_name': 'gconf',
545 ['use_gconf==1 and _toolset=="target"', {
546 'direct_dependent_settings': {
548 '<!@(<(pkg-config) --cflags gconf-2.0)',
556 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
559 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
566 'target_name': 'gio',
567 'type': 'static_library',
569 ['use_gio==1 and _toolset=="target"', {
571 '<!@(<(pkg-config) --cflags gio-2.0)',
574 'gio_warning_define': [
575 # glib >=2.40 deprecate g_settings_list_schemas in favor of
576 # g_settings_schema_source_list_schemas. This function is not
577 # available on earlier versions that we still need to support
578 # (specifically, 2.32), so disable the warning.
579 # TODO(mgiuca): Remove this suppression (and variable) when we
580 # drop support for Ubuntu 13.10 (saucy) and earlier. Update the
581 # code to use g_settings_schema_source_list_schemas instead.
582 'GLIB_DISABLE_DEPRECATION_WARNINGS',
586 '<(gio_warning_define)',
588 'direct_dependent_settings': {
590 '<!@(<(pkg-config) --cflags gio-2.0)',
594 '<(gio_warning_define)',
597 '<(SHARED_INTERMEDIATE_DIR)',
605 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
608 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
611 ['linux_link_gsettings==0 and OS=="linux"', {
618 'hard_dependency': 1,
622 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
623 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
624 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
626 'action_name': 'generate_libgio_loader',
636 '--name', 'LibGioLoader',
637 '--output-h', '<(output_h)',
638 '--output-cc', '<(output_cc)',
639 '--header', '<gio/gio.h>',
640 '--link-directly=<(linux_link_gsettings)',
642 'g_settings_get_child',
643 'g_settings_get_string',
644 'g_settings_get_boolean',
645 'g_settings_get_int',
646 'g_settings_get_strv',
647 'g_settings_list_schemas',
649 'message': 'Generating libgio library loader',
650 'process_outputs_as_sources': 1,
657 'target_name': 'glib',
659 'toolsets': ['host', 'target'],
661 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
664 ['_toolset=="target"', {
665 'direct_dependent_settings': {
667 '<!@(<(pkg-config) --cflags <(glib_packages))',
672 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
675 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
679 'direct_dependent_settings': {
681 '<!@(pkg-config --cflags <(glib_packages))',
686 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
689 '<!@(pkg-config --libs-only-l <(glib_packages))',
696 'target_name': 'gnome_keyring',
699 ['use_gnome_keyring==1', {
700 'direct_dependent_settings': {
702 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
708 ['linux_link_gnome_keyring==0', {
709 'defines': ['DLOPEN_GNOME_KEYRING'],
714 ['linux_link_gnome_keyring!=0', {
717 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
720 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
739 # The unit tests use a few convenience functions from the GNOME
740 # Keyring library directly. We ignore linux_link_gnome_keyring and
741 # link directly in this version of the target to allow this.
742 # *** Do not use this target in the main binary! ***
743 'target_name': 'gnome_keyring_direct',
746 ['use_gnome_keyring==1', {
747 'direct_dependent_settings': {
749 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
755 ['linux_link_gnome_keyring==0', {
756 'defines': ['DLOPEN_GNOME_KEYRING'],
762 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
765 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
772 'target_name': 'libbrlapi',
773 'type': 'static_library',
774 'all_dependent_settings': {
776 '<(SHARED_INTERMEDIATE_DIR)',
782 ['linux_link_libbrlapi==1', {
794 'hard_dependency': 1,
798 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
799 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
800 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
802 'action_name': 'generate_brlapi_loader',
812 '--name', 'LibBrlapiLoader',
813 '--output-h', '<(output_h)',
814 '--output-cc', '<(output_cc)',
815 '--header', '<brlapi.h>',
816 '--link-directly=<(linux_link_libbrlapi)',
817 'brlapi_getHandleSize',
818 'brlapi_error_location',
820 'brlapi__acceptKeys',
821 'brlapi__openConnection',
822 'brlapi__closeConnection',
823 'brlapi__getDisplaySize',
824 'brlapi__enterTtyModeWithPath',
825 'brlapi__leaveTtyMode',
829 'message': 'Generating libbrlapi library loader',
830 'process_outputs_as_sources': 1,
835 'target_name': 'libcap',
844 'target_name': 'libpci',
845 'type': 'static_library',
847 '<!@(<(pkg-config) --cflags libpci)',
849 'direct_dependent_settings': {
851 '<(SHARED_INTERMEDIATE_DIR)',
854 ['linux_link_libpci==1', {
857 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
860 '<!@(<(pkg-config) --libs-only-l libpci)',
869 'hard_dependency': 1,
873 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
874 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
875 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
877 'action_name': 'generate_libpci_loader',
887 '--name', 'LibPciLoader',
888 '--output-h', '<(output_h)',
889 '--output-cc', '<(output_cc)',
890 '--header', '<pci/pci.h>',
891 # TODO(phajdan.jr): Report problem to pciutils project
892 # and get it fixed so that we don't need --use-extern-c.
894 '--link-directly=<(linux_link_libpci)',
902 'message': 'Generating libpci library loader',
903 'process_outputs_as_sources': 1,
908 'target_name': 'libresolv',
917 # GN version: //third_party/speech-dispatcher
918 'target_name': 'libspeechd',
919 'type': 'static_library',
920 'direct_dependent_settings': {
922 '<(SHARED_INTERMEDIATE_DIR)',
925 ['linux_link_libspeechd==1', {
937 'hard_dependency': 1,
941 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
942 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
943 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
945 # speech-dispatcher >= 0.8 installs libspeechd.h into
946 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
947 # puts libspeechd.h in the top-level include directory.
948 # Since we need to support both cases for now, we ship a copy of
949 # libspeechd.h in third_party/speech-dispatcher. If the user
950 # prefers to link against the speech-dispatcher directly, the
951 # `libspeechd_h_prefix' variable can be passed to gyp with a value
952 # such as "speech-dispatcher/" that will be prepended to
953 # "libspeechd.h" in the #include directive.
954 # TODO(phaldan.jr): Once we do not need to support
955 # speech-dispatcher < 0.8 we can get rid of all this (including
956 # third_party/speech-dispatcher) and just include
957 # speech-dispatcher/libspeechd.h unconditionally.
958 'libspeechd_h_prefix%': '',
960 'action_name': 'generate_libspeechd_loader',
970 '--name', 'LibSpeechdLoader',
971 '--output-h', '<(output_h)',
972 '--output-cc', '<(output_cc)',
973 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
975 '"third_party/speech-dispatcher/libspeechd.h"',
976 '--link-directly=<(linux_link_libspeechd)',
983 'spd_set_notification_on',
984 'spd_set_voice_rate',
985 'spd_set_voice_pitch',
986 'spd_list_synthesis_voices',
987 'spd_set_synthesis_voice',
989 'spd_set_output_module',
991 'message': 'Generating libspeechd library loader',
992 'process_outputs_as_sources': 1,
997 'target_name': 'pangocairo',
999 'toolsets': ['host', 'target'],
1001 ['_toolset=="target"', {
1002 'direct_dependent_settings': {
1004 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
1009 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
1012 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
1016 'direct_dependent_settings': {
1018 '<!@(pkg-config --cflags pangocairo pangoft2)',
1023 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
1026 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
1033 'target_name': 'ssl',
1036 ['_toolset=="target"', {
1038 ['use_openssl==1', {
1040 '../../third_party/boringssl/boringssl.gyp:boringssl',
1043 ['use_openssl==0', {
1045 '../../net/third_party/nss/ssl.gyp:libssl',
1047 'direct_dependent_settings': {
1049 # We need for our local copies of the libssl3 headers to come
1050 # before other includes, as we are shadowing system headers.
1051 '<(DEPTH)/net/third_party/nss/ssl',
1054 '<!@(<(pkg-config) --cflags nss)',
1059 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1062 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1066 ['use_openssl==0 and clang==1', {
1067 'direct_dependent_settings': {
1069 # There is a broken header guard in /usr/include/nss/secmod.h:
1070 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1071 '-Wno-header-guard',