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 gbm)',
423 ['ozone_platform_dri==1 or ozone_platform_gbm==1', {
426 'target_name': 'libdrm',
428 'direct_dependent_settings': {
430 '<!@(<(pkg-config) --cflags libdrm)',
435 '<!@(<(pkg-config) --libs-only-l libdrm)',
444 'target_name': 'dbus',
446 'direct_dependent_settings': {
448 '<!@(<(pkg-config) --cflags dbus-1)',
453 '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
456 '<!@(<(pkg-config) --libs-only-l dbus-1)',
461 'target_name': 'fontconfig',
464 ['_toolset=="target"', {
466 ['use_system_fontconfig==1', {
467 'direct_dependent_settings': {
469 '<!@(<(pkg-config) --cflags fontconfig)',
474 '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
477 '<!@(<(pkg-config) --libs-only-l fontconfig)',
480 }, { # use_system_fontconfig==0
482 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
484 'export_dependent_settings' : [
485 '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
493 'target_name': 'freetype2',
496 ['_toolset=="target"', {
497 'direct_dependent_settings': {
499 '<!@(<(pkg-config) --cflags freetype2)',
504 '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
507 '<!@(<(pkg-config) --libs-only-l freetype2)',
514 'target_name': 'gconf',
517 ['use_gconf==1 and _toolset=="target"', {
518 'direct_dependent_settings': {
520 '<!@(<(pkg-config) --cflags gconf-2.0)',
528 '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
531 '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
538 'target_name': 'gio',
539 'type': 'static_library',
541 ['use_gio==1 and _toolset=="target"', {
543 '<!@(<(pkg-config) --cflags gio-2.0)',
545 'direct_dependent_settings': {
547 '<!@(<(pkg-config) --cflags gio-2.0)',
553 '<(SHARED_INTERMEDIATE_DIR)',
561 '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
564 '<!@(<(pkg-config) --libs-only-l gio-2.0)',
567 ['linux_link_gsettings==0 and OS=="linux"', {
574 'hard_dependency': 1,
578 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
579 'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
580 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
582 'action_name': 'generate_libgio_loader',
592 '--name', 'LibGioLoader',
593 '--output-h', '<(output_h)',
594 '--output-cc', '<(output_cc)',
595 '--header', '<gio/gio.h>',
596 '--link-directly=<(linux_link_gsettings)',
598 'g_settings_get_child',
599 'g_settings_get_string',
600 'g_settings_get_boolean',
601 'g_settings_get_int',
602 'g_settings_get_strv',
603 'g_settings_list_schemas',
605 'message': 'Generating libgio library loader',
606 'process_outputs_as_sources': 1,
613 'target_name': 'glib',
615 'toolsets': ['host', 'target'],
617 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
620 ['_toolset=="target"', {
621 'direct_dependent_settings': {
623 '<!@(<(pkg-config) --cflags <(glib_packages))',
628 '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
631 '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
635 'direct_dependent_settings': {
637 '<!@(pkg-config --cflags <(glib_packages))',
642 '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
645 '<!@(pkg-config --libs-only-l <(glib_packages))',
652 'target_name': 'gnome_keyring',
655 ['use_gnome_keyring==1', {
656 'direct_dependent_settings': {
658 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
664 ['linux_link_gnome_keyring==0', {
665 'defines': ['DLOPEN_GNOME_KEYRING'],
670 ['linux_link_gnome_keyring!=0', {
673 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
676 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
695 # The unit tests use a few convenience functions from the GNOME
696 # Keyring library directly. We ignore linux_link_gnome_keyring and
697 # link directly in this version of the target to allow this.
698 # *** Do not use this target in the main binary! ***
699 'target_name': 'gnome_keyring_direct',
702 ['use_gnome_keyring==1', {
703 'direct_dependent_settings': {
705 '<!@(<(pkg-config) --cflags gnome-keyring-1)',
711 ['linux_link_gnome_keyring==0', {
712 'defines': ['DLOPEN_GNOME_KEYRING'],
718 '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
721 '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
728 'target_name': 'libbrlapi',
729 'type': 'static_library',
730 'all_dependent_settings': {
732 '<(SHARED_INTERMEDIATE_DIR)',
738 ['linux_link_libbrlapi==1', {
750 'hard_dependency': 1,
754 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
755 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
756 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
758 'action_name': 'generate_brlapi_loader',
768 '--name', 'LibBrlapiLoader',
769 '--output-h', '<(output_h)',
770 '--output-cc', '<(output_cc)',
771 '--header', '<brlapi.h>',
772 '--link-directly=<(linux_link_libbrlapi)',
773 'brlapi_getHandleSize',
774 'brlapi_error_location',
776 'brlapi__acceptKeys',
777 'brlapi__openConnection',
778 'brlapi__closeConnection',
779 'brlapi__getDisplaySize',
780 'brlapi__enterTtyModeWithPath',
781 'brlapi__leaveTtyMode',
785 'message': 'Generating libbrlapi library loader',
786 'process_outputs_as_sources': 1,
791 'target_name': 'libcap',
800 'target_name': 'libpci',
801 'type': 'static_library',
803 '<!@(<(pkg-config) --cflags libpci)',
805 'direct_dependent_settings': {
807 '<(SHARED_INTERMEDIATE_DIR)',
810 ['linux_link_libpci==1', {
813 '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
816 '<!@(<(pkg-config) --libs-only-l libpci)',
825 'hard_dependency': 1,
829 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
830 'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
831 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
833 'action_name': 'generate_libpci_loader',
843 '--name', 'LibPciLoader',
844 '--output-h', '<(output_h)',
845 '--output-cc', '<(output_cc)',
846 '--header', '<pci/pci.h>',
847 # TODO(phajdan.jr): Report problem to pciutils project
848 # and get it fixed so that we don't need --use-extern-c.
850 '--link-directly=<(linux_link_libpci)',
858 'message': 'Generating libpci library loader',
859 'process_outputs_as_sources': 1,
864 'target_name': 'libresolv',
873 # GN version: //third_party/speech-dispatcher
874 'target_name': 'libspeechd',
875 'type': 'static_library',
876 'direct_dependent_settings': {
878 '<(SHARED_INTERMEDIATE_DIR)',
881 ['linux_link_libspeechd==1', {
893 'hard_dependency': 1,
897 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
898 'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
899 'generator': '../../tools/generate_library_loader/generate_library_loader.py',
901 # speech-dispatcher >= 0.8 installs libspeechd.h into
902 # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
903 # puts libspeechd.h in the top-level include directory.
904 # Since we need to support both cases for now, we ship a copy of
905 # libspeechd.h in third_party/speech-dispatcher. If the user
906 # prefers to link against the speech-dispatcher directly, the
907 # `libspeechd_h_prefix' variable can be passed to gyp with a value
908 # such as "speech-dispatcher/" that will be prepended to
909 # "libspeechd.h" in the #include directive.
910 # TODO(phaldan.jr): Once we do not need to support
911 # speech-dispatcher < 0.8 we can get rid of all this (including
912 # third_party/speech-dispatcher) and just include
913 # speech-dispatcher/libspeechd.h unconditionally.
914 'libspeechd_h_prefix%': '',
916 'action_name': 'generate_libspeechd_loader',
926 '--name', 'LibSpeechdLoader',
927 '--output-h', '<(output_h)',
928 '--output-cc', '<(output_cc)',
929 '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
931 '"third_party/speech-dispatcher/libspeechd.h"',
932 '--link-directly=<(linux_link_libspeechd)',
939 'spd_set_notification_on',
940 'spd_set_voice_rate',
941 'spd_set_voice_pitch',
942 'spd_list_synthesis_voices',
943 'spd_set_synthesis_voice',
945 'spd_set_output_module',
947 'message': 'Generating libspeechd library loader',
948 'process_outputs_as_sources': 1,
953 'target_name': 'pangocairo',
955 'toolsets': ['host', 'target'],
957 ['_toolset=="target"', {
958 'direct_dependent_settings': {
960 '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
965 '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
968 '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
972 'direct_dependent_settings': {
974 '<!@(pkg-config --cflags pangocairo pangoft2)',
979 '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
982 '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
989 'target_name': 'ssl',
992 ['_toolset=="target"', {
996 '../../third_party/boringssl/boringssl.gyp:boringssl',
1001 '../../net/third_party/nss/ssl.gyp:libssl',
1003 'direct_dependent_settings': {
1005 # We need for our local copies of the libssl3 headers to come
1006 # before other includes, as we are shadowing system headers.
1007 '<(DEPTH)/net/third_party/nss/ssl',
1010 '<!@(<(pkg-config) --cflags nss)',
1015 '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1018 '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1022 ['use_openssl==0 and clang==1', {
1023 'direct_dependent_settings': {
1025 # There is a broken header guard in /usr/include/nss/secmod.h:
1026 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1027 '-Wno-header-guard',
1036 'target_name': 'udev',
1039 # libudev is not available on *BSD
1040 ['_toolset=="target" and os_bsd!=1', {
1041 'direct_dependent_settings': {
1043 '<!@(<(pkg-config) --cflags libudev)'
1048 '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)',
1051 '<!@(<(pkg-config) --libs-only-l libudev)',