• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4
5{
6  'variables': {
7    'conditions': [
8      ['sysroot!=""', {
9        'pkg-config': '<(chroot_cmd) ./pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
10      }, {
11        'pkg-config': 'pkg-config',
12      }],
13    ],
14
15    'linux_link_libgps%': 0,
16    'linux_link_libpci%': 0,
17    'linux_link_libspeechd%': 0,
18    'linux_link_libbrlapi%': 0,
19  },
20  'conditions': [
21    [ 'chromeos==0 and use_ozone==0', {
22      # Hide GTK and related dependencies for Chrome OS and Ozone, so they won't get
23      # added back to Chrome OS and Ozone. Don't try to use GTK on Chrome OS and Ozone.
24      'targets': [
25        {
26          'target_name': 'gdk',
27          'type': 'none',
28          'conditions': [
29            ['_toolset=="target"', {
30              'direct_dependent_settings': {
31                'cflags': [
32                  '<!@(<(pkg-config) --cflags gdk-2.0)',
33                ],
34              },
35              'link_settings': {
36                'ldflags': [
37                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
38                ],
39                'libraries': [
40                  '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
41                ],
42              },
43            }],
44          ],
45        },
46        {
47          'target_name': 'gtk',
48          'type': 'none',
49          'toolsets': ['host', 'target'],
50          'variables': {
51            # gtk requires gmodule, but it does not list it as a dependency
52            # in some misconfigured systems.
53            'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
54          },
55          'conditions': [
56            ['_toolset=="target"', {
57              'all_dependent_settings': {
58                'cflags': [
59                  '<!@(<(pkg-config) --cflags <(gtk_packages))',
60                ],
61              },
62              'link_settings': {
63                'ldflags': [
64                  '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
65                ],
66                'libraries': [
67                  '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
68                ],
69              },
70            }, {
71              'all_dependent_settings': {
72                'cflags': [
73                  '<!@(pkg-config --cflags <(gtk_packages))',
74                ],
75              },
76              'link_settings': {
77                'ldflags': [
78                  '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
79                ],
80                'libraries': [
81                  '<!@(pkg-config --libs-only-l <(gtk_packages))',
82                ],
83              },
84            }],
85          ],
86        },
87        {
88          'target_name': 'gtkprint',
89          'type': 'none',
90          'conditions': [
91            ['_toolset=="target"', {
92              'direct_dependent_settings': {
93                'cflags': [
94                  '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
95                ],
96              },
97              'link_settings': {
98                'ldflags': [
99                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
100                ],
101                'libraries': [
102                  '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
103                ],
104              },
105            }],
106          ],
107        },
108      ],  # targets
109    }],
110    [ 'use_x11==1 or ozone_platform_ozonex==1', {
111      # Hide X11 and related dependencies when use_x11=0
112      'targets': [
113        {
114          'target_name': 'x11',
115          'type': 'none',
116          'toolsets': ['host', 'target'],
117          'conditions': [
118            ['_toolset=="target"', {
119              'direct_dependent_settings': {
120                'cflags': [
121                  '<!@(<(pkg-config) --cflags x11)',
122                ],
123              },
124              'link_settings': {
125                'ldflags': [
126                  '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
127                ],
128                'libraries': [
129                  '<!@(<(pkg-config) --libs-only-l x11 xi)',
130                ],
131              },
132            }, {
133              'direct_dependent_settings': {
134                'cflags': [
135                  '<!@(pkg-config --cflags x11)',
136                ],
137              },
138              'link_settings': {
139                'ldflags': [
140                  '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
141                ],
142                'libraries': [
143                  '<!@(pkg-config --libs-only-l x11 xi)',
144                ],
145              },
146            }],
147          ],
148        },
149        {
150          'target_name': 'xcursor',
151          'type': 'none',
152          'direct_dependent_settings': {
153            'cflags': [
154              '<!@(<(pkg-config) --cflags xcursor)',
155            ],
156          },
157          'link_settings': {
158            'ldflags': [
159              '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)',
160            ],
161            'libraries': [
162              '<!@(<(pkg-config) --libs-only-l xcursor)',
163            ],
164          },
165        },
166        {
167          'target_name': 'xcomposite',
168          'type': 'none',
169          'direct_dependent_settings': {
170            'cflags': [
171              '<!@(<(pkg-config) --cflags xcomposite)',
172            ],
173          },
174          'link_settings': {
175            'ldflags': [
176              '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)',
177            ],
178            'libraries': [
179              '<!@(<(pkg-config) --libs-only-l xcomposite)',
180            ],
181          },
182        },
183        {
184          'target_name': 'xdamage',
185          'type': 'none',
186          'direct_dependent_settings': {
187            'cflags': [
188              '<!@(<(pkg-config) --cflags xdamage)',
189            ],
190          },
191          'link_settings': {
192            'ldflags': [
193              '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)',
194            ],
195            'libraries': [
196              '<!@(<(pkg-config) --libs-only-l xdamage)',
197            ],
198          },
199        },
200        {
201          'target_name': 'xext',
202          'type': 'none',
203          'direct_dependent_settings': {
204            'cflags': [
205              '<!@(<(pkg-config) --cflags xext)',
206            ],
207          },
208          'link_settings': {
209            'ldflags': [
210              '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
211            ],
212            'libraries': [
213              '<!@(<(pkg-config) --libs-only-l xext)',
214            ],
215          },
216        },
217        {
218          'target_name': 'xfixes',
219          'type': 'none',
220          'direct_dependent_settings': {
221            'cflags': [
222              '<!@(<(pkg-config) --cflags xfixes)',
223            ],
224          },
225          'link_settings': {
226            'ldflags': [
227              '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
228            ],
229            'libraries': [
230              '<!@(<(pkg-config) --libs-only-l xfixes)',
231            ],
232          },
233        },
234        {
235          'target_name': 'xi',
236          'type': 'none',
237          'direct_dependent_settings': {
238            'cflags': [
239              '<!@(<(pkg-config) --cflags xi)',
240            ],
241          },
242          'link_settings': {
243            'ldflags': [
244              '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)',
245            ],
246            'libraries': [
247              '<!@(<(pkg-config) --libs-only-l xi)',
248            ],
249          },
250        },
251        {
252          'target_name': 'xrandr',
253          'type': 'none',
254          'toolsets': ['host', 'target'],
255          'conditions': [
256            ['_toolset=="target"', {
257              'direct_dependent_settings': {
258                'cflags': [
259                  '<!@(<(pkg-config) --cflags xrandr)',
260                ],
261              },
262              'link_settings': {
263                'ldflags': [
264                  '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)',
265                ],
266                'libraries': [
267                  '<!@(<(pkg-config) --libs-only-l xrandr)',
268                ],
269              },
270            }, {
271              'direct_dependent_settings': {
272                'cflags': [
273                  '<!@(pkg-config --cflags xrandr)',
274                ],
275              },
276              'link_settings': {
277                'ldflags': [
278                  '<!@(pkg-config --libs-only-L --libs-only-other xrandr)',
279                ],
280                'libraries': [
281                  '<!@(pkg-config --libs-only-l xrandr)',
282                ],
283              },
284            }],
285          ],
286        },
287        {
288          'target_name': 'xrender',
289          'type': 'none',
290          'direct_dependent_settings': {
291            'cflags': [
292              '<!@(<(pkg-config) --cflags xrender)',
293            ],
294          },
295          'link_settings': {
296            'ldflags': [
297              '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)',
298            ],
299            'libraries': [
300              '<!@(<(pkg-config) --libs-only-l xrender)',
301            ],
302          },
303        },
304        {
305          'target_name': 'xtst',
306          'type': 'none',
307          'toolsets': ['host', 'target'],
308          'conditions': [
309            ['_toolset=="target"', {
310              'direct_dependent_settings': {
311                'cflags': [
312                  '<!@(<(pkg-config) --cflags xtst)',
313                ],
314              },
315              'link_settings': {
316                'ldflags': [
317                  '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)',
318                ],
319                'libraries': [
320                  '<!@(<(pkg-config) --libs-only-l xtst)',
321                ],
322              },
323            }, {
324              'direct_dependent_settings': {
325                'cflags': [
326                  '<!@(pkg-config --cflags xtst)',
327                ],
328              },
329              'link_settings': {
330                'ldflags': [
331                  '<!@(pkg-config --libs-only-L --libs-only-other xtst)',
332                ],
333                'libraries': [
334                  '<!@(pkg-config --libs-only-l xtst)',
335                ],
336              },
337            }]
338          ]
339        }
340      ],  # targets
341    }],
342    ['use_x11==1 and chromeos==0', {
343      'targets': [
344        {
345          'target_name': 'xscrnsaver',
346          'type': 'none',
347          'direct_dependent_settings': {
348            'cflags': [
349              '<!@(<(pkg-config) --cflags xscrnsaver)',
350            ],
351          },
352          'link_settings': {
353            'ldflags': [
354              '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)',
355            ],
356            'libraries': [
357              '<!@(<(pkg-config) --libs-only-l xscrnsaver)',
358            ],
359          },
360        },
361      ],  # targets
362    }],
363    ['use_evdev_gestures==1', {
364      'targets': [
365        {
366          'target_name': 'libevdev-cros',
367          'type': 'none',
368          'direct_dependent_settings': {
369            'cflags': [
370              '<!@(<(pkg-config) --cflags libevdev-cros)'
371            ],
372          },
373          'link_settings': {
374            'ldflags': [
375              '<!@(<(pkg-config) --libs-only-L --libs-only-other libevdev-cros)',
376            ],
377            'libraries': [
378              '<!@(<(pkg-config) --libs-only-l libevdev-cros)',
379            ],
380          },
381        },
382        {
383          'target_name': 'libgestures',
384          'type': 'none',
385          'direct_dependent_settings': {
386            'cflags': [
387              '<!@(<(pkg-config) --cflags libgestures)'
388            ],
389          },
390          'link_settings': {
391            'ldflags': [
392              '<!@(<(pkg-config) --libs-only-L --libs-only-other libgestures)',
393            ],
394            'libraries': [
395              '<!@(<(pkg-config) --libs-only-l libgestures)',
396            ],
397          },
398        },
399      ],
400    }],
401    ['ozone_platform_gbm==1', {
402      'targets': [
403        {
404          'target_name': 'gbm',
405          'type': 'none',
406          'direct_dependent_settings': {
407            'cflags': [
408              '<!@(<(pkg-config) --cflags gbm)',
409            ],
410          },
411          'link_settings': {
412            'libraries': [
413              '<!@(<(pkg-config) --libs-only-l gbm)',
414            ],
415          },
416        },
417      ],
418    }],
419  ],  # conditions
420  'targets': [
421    {
422      'target_name': 'dbus',
423      'type': 'none',
424      'direct_dependent_settings': {
425        'cflags': [
426          '<!@(<(pkg-config) --cflags dbus-1)',
427        ],
428      },
429      'link_settings': {
430        'ldflags': [
431          '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
432        ],
433        'libraries': [
434          '<!@(<(pkg-config) --libs-only-l dbus-1)',
435        ],
436      },
437    },
438    {
439      'target_name': 'dridrm',
440      'type': 'none',
441      'direct_dependent_settings': {
442        'cflags': [
443          '<!@(<(pkg-config) --cflags libdrm)',
444        ],
445      },
446      'link_settings': {
447        'libraries': [
448          '<!@(<(pkg-config) --libs-only-l libdrm)',
449        ],
450      },
451    },
452    {
453      'target_name': 'fontconfig',
454      'type': 'none',
455      'conditions': [
456        ['_toolset=="target"', {
457          'conditions': [
458            ['use_system_fontconfig==1', {
459              'direct_dependent_settings': {
460                'cflags': [
461                  '<!@(<(pkg-config) --cflags fontconfig)',
462                ],
463              },
464              'link_settings': {
465                'ldflags': [
466                  '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
467                ],
468                'libraries': [
469                  '<!@(<(pkg-config) --libs-only-l fontconfig)',
470                ],
471              },
472            }, {  # use_system_fontconfig==0
473              'dependencies': [
474                '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
475              ],
476              'export_dependent_settings' : [
477                '../../third_party/fontconfig/fontconfig.gyp:fontconfig',
478              ],
479            }],
480          ],
481        }],
482      ],
483    },
484    {
485      'target_name': 'freetype2',
486      'type': 'none',
487      'conditions': [
488        ['_toolset=="target"', {
489          'direct_dependent_settings': {
490            'cflags': [
491              '<!@(<(pkg-config) --cflags freetype2)',
492            ],
493          },
494          'link_settings': {
495            'ldflags': [
496              '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
497            ],
498            'libraries': [
499              '<!@(<(pkg-config) --libs-only-l freetype2)',
500            ],
501          },
502        }],
503      ],
504    },
505    {
506      'target_name': 'gconf',
507      'type': 'none',
508      'conditions': [
509        ['use_gconf==1 and _toolset=="target"', {
510          'direct_dependent_settings': {
511            'cflags': [
512              '<!@(<(pkg-config) --cflags gconf-2.0)',
513            ],
514            'defines': [
515              'USE_GCONF',
516            ],
517          },
518          'link_settings': {
519            'ldflags': [
520              '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
521            ],
522            'libraries': [
523              '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
524            ],
525          },
526        }],
527      ],
528    },
529    {
530      'target_name': 'gio',
531      'type': 'static_library',
532      'conditions': [
533        ['use_gio==1 and _toolset=="target"', {
534          'cflags': [
535            '<!@(<(pkg-config) --cflags gio-2.0)',
536          ],
537          'direct_dependent_settings': {
538            'cflags': [
539              '<!@(<(pkg-config) --cflags gio-2.0)',
540            ],
541            'defines': [
542              'USE_GIO',
543            ],
544            'include_dirs': [
545              '<(SHARED_INTERMEDIATE_DIR)',
546            ],
547          },
548          'include_dirs': [
549            '../..',
550          ],
551          'link_settings': {
552            'ldflags': [
553              '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
554            ],
555            'libraries': [
556              '<!@(<(pkg-config) --libs-only-l gio-2.0)',
557            ],
558            'conditions': [
559              ['linux_link_gsettings==0 and OS=="linux"', {
560                'libraries': [
561                  '-ldl',
562                ],
563              }],
564            ],
565          },
566          'hard_dependency': 1,
567          'actions': [
568            {
569              'variables': {
570                'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
571                'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
572                'generator': '../../tools/generate_library_loader/generate_library_loader.py',
573              },
574              'action_name': 'generate_libgio_loader',
575              'inputs': [
576                '<(generator)',
577              ],
578              'outputs': [
579                '<(output_h)',
580                '<(output_cc)',
581              ],
582              'action': ['python',
583                         '<(generator)',
584                         '--name', 'LibGioLoader',
585                         '--output-h', '<(output_h)',
586                         '--output-cc', '<(output_cc)',
587                         '--header', '<gio/gio.h>',
588                         '--link-directly=<(linux_link_gsettings)',
589                         'g_settings_new',
590                         'g_settings_get_child',
591                         'g_settings_get_string',
592                         'g_settings_get_boolean',
593                         'g_settings_get_int',
594                         'g_settings_get_strv',
595                         'g_settings_list_schemas',
596              ],
597              'message': 'Generating libgio library loader',
598              'process_outputs_as_sources': 1,
599            },
600          ],
601        }],
602      ],
603    },
604    {
605      'target_name': 'glib',
606      'type': 'none',
607      'toolsets': ['host', 'target'],
608      'variables': {
609        'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
610      },
611      'conditions': [
612        ['_toolset=="target"', {
613          'direct_dependent_settings': {
614            'cflags': [
615              '<!@(<(pkg-config) --cflags <(glib_packages))',
616            ],
617          },
618          'link_settings': {
619            'ldflags': [
620              '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
621            ],
622            'libraries': [
623              '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
624            ],
625          },
626        }, {
627          'direct_dependent_settings': {
628            'cflags': [
629              '<!@(pkg-config --cflags <(glib_packages))',
630            ],
631          },
632          'link_settings': {
633            'ldflags': [
634              '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
635            ],
636            'libraries': [
637              '<!@(pkg-config --libs-only-l <(glib_packages))',
638            ],
639          },
640        }],
641      ],
642    },
643    {
644      'target_name': 'gnome_keyring',
645      'type': 'none',
646      'conditions': [
647        ['use_gnome_keyring==1', {
648          'direct_dependent_settings': {
649            'cflags': [
650              '<!@(<(pkg-config) --cflags gnome-keyring-1)',
651            ],
652            'defines': [
653              'USE_GNOME_KEYRING',
654            ],
655            'conditions': [
656              ['linux_link_gnome_keyring==0', {
657                'defines': ['DLOPEN_GNOME_KEYRING'],
658              }],
659            ],
660          },
661          'conditions': [
662            ['linux_link_gnome_keyring!=0', {
663              'link_settings': {
664                'ldflags': [
665                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
666                ],
667                'libraries': [
668                  '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
669                ],
670              },
671            }, {
672              'conditions': [
673                ['OS=="linux"', {
674                 'link_settings': {
675                   'libraries': [
676                     '-ldl',
677                   ],
678                 },
679                }],
680              ],
681            }],
682          ],
683        }],
684      ],
685    },
686    {
687      # The unit tests use a few convenience functions from the GNOME
688      # Keyring library directly. We ignore linux_link_gnome_keyring and
689      # link directly in this version of the target to allow this.
690      # *** Do not use this target in the main binary! ***
691      'target_name': 'gnome_keyring_direct',
692      'type': 'none',
693      'conditions': [
694        ['use_gnome_keyring==1', {
695          'direct_dependent_settings': {
696            'cflags': [
697              '<!@(<(pkg-config) --cflags gnome-keyring-1)',
698            ],
699            'defines': [
700              'USE_GNOME_KEYRING',
701            ],
702            'conditions': [
703              ['linux_link_gnome_keyring==0', {
704                'defines': ['DLOPEN_GNOME_KEYRING'],
705              }],
706            ],
707          },
708          'link_settings': {
709            'ldflags': [
710              '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
711            ],
712            'libraries': [
713              '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
714            ],
715          },
716        }],
717      ],
718    },
719    {
720      'target_name': 'libbrlapi',
721      'type': 'static_library',
722      'all_dependent_settings': {
723        'include_dirs': [
724          '<(SHARED_INTERMEDIATE_DIR)',
725        ],
726        'defines': [
727          'USE_BRLAPI',
728        ],
729        'conditions': [
730          ['linux_link_libbrlapi==1', {
731            'link_settings': {
732              'libraries': [
733                '-lbrlapi',
734              ],
735            }
736          }],
737        ],
738      },
739      'include_dirs': [
740        '../..',
741      ],
742      'hard_dependency': 1,
743      'actions': [
744        {
745          'variables': {
746            'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h',
747            'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc',
748            'generator': '../../tools/generate_library_loader/generate_library_loader.py',
749          },
750          'action_name': 'generate_brlapi_loader',
751          'inputs': [
752            '<(generator)',
753          ],
754          'outputs': [
755            '<(output_h)',
756            '<(output_cc)',
757          ],
758          'action': ['python',
759                     '<(generator)',
760                     '--name', 'LibBrlapiLoader',
761                     '--output-h', '<(output_h)',
762                     '--output-cc', '<(output_cc)',
763                     '--header', '<brlapi.h>',
764                     '--link-directly=<(linux_link_libbrlapi)',
765                     'brlapi_getHandleSize',
766                     'brlapi_error_location',
767                     'brlapi_strerror',
768                     'brlapi__acceptKeys',
769                     'brlapi__openConnection',
770                     'brlapi__closeConnection',
771                     'brlapi__getDisplaySize',
772                     'brlapi__enterTtyModeWithPath',
773                     'brlapi__leaveTtyMode',
774                     'brlapi__writeDots',
775                     'brlapi__readKey',
776          ],
777          'message': 'Generating libbrlapi library loader',
778          'process_outputs_as_sources': 1,
779        },
780      ],
781    },
782    {
783      'target_name': 'libcap',
784      'type': 'none',
785      'link_settings': {
786        'libraries': [
787          '-lcap',
788        ],
789      },
790    },
791    {
792      'target_name': 'libpci',
793      'type': 'static_library',
794      'cflags': [
795        '<!@(<(pkg-config) --cflags libpci)',
796      ],
797      'direct_dependent_settings': {
798        'include_dirs': [
799          '<(SHARED_INTERMEDIATE_DIR)',
800        ],
801        'conditions': [
802          ['linux_link_libpci==1', {
803            'link_settings': {
804              'ldflags': [
805                '<!@(<(pkg-config) --libs-only-L --libs-only-other libpci)',
806              ],
807              'libraries': [
808                '<!@(<(pkg-config) --libs-only-l libpci)',
809              ],
810            }
811          }],
812        ],
813      },
814      'include_dirs': [
815        '../..',
816      ],
817      'hard_dependency': 1,
818      'actions': [
819        {
820          'variables': {
821            'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libpci.h',
822            'output_cc': '<(INTERMEDIATE_DIR)/libpci_loader.cc',
823            'generator': '../../tools/generate_library_loader/generate_library_loader.py',
824          },
825          'action_name': 'generate_libpci_loader',
826          'inputs': [
827            '<(generator)',
828          ],
829          'outputs': [
830            '<(output_h)',
831            '<(output_cc)',
832          ],
833          'action': ['python',
834                     '<(generator)',
835                     '--name', 'LibPciLoader',
836                     '--output-h', '<(output_h)',
837                     '--output-cc', '<(output_cc)',
838                     '--header', '<pci/pci.h>',
839                     # TODO(phajdan.jr): Report problem to pciutils project
840                     # and get it fixed so that we don't need --use-extern-c.
841                     '--use-extern-c',
842                     '--link-directly=<(linux_link_libpci)',
843                     'pci_alloc',
844                     'pci_init',
845                     'pci_cleanup',
846                     'pci_scan_bus',
847                     'pci_fill_info',
848                     'pci_lookup_name',
849          ],
850          'message': 'Generating libpci library loader',
851          'process_outputs_as_sources': 1,
852        },
853      ],
854    },
855    {
856      'target_name': 'libresolv',
857      'type': 'none',
858      'link_settings': {
859        'libraries': [
860          '-lresolv',
861        ],
862      },
863    },
864    {
865      'target_name': 'libspeechd',
866      'type': 'static_library',
867      'direct_dependent_settings': {
868        'include_dirs': [
869          '<(SHARED_INTERMEDIATE_DIR)',
870        ],
871        'conditions': [
872          ['linux_link_libspeechd==1', {
873            'link_settings': {
874              'libraries': [
875                '-lspeechd',
876              ],
877            }
878          }],
879        ],
880      },
881      'include_dirs': [
882        '../..',
883      ],
884      'hard_dependency': 1,
885      'actions': [
886        {
887          'variables': {
888            'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libspeechd.h',
889            'output_cc': '<(INTERMEDIATE_DIR)/libspeechd_loader.cc',
890            'generator': '../../tools/generate_library_loader/generate_library_loader.py',
891
892            # speech-dispatcher >= 0.8 installs libspeechd.h into
893            # speech-dispatcher/libspeechd.h, whereas speech-dispatcher < 0.8
894            # puts libspeechd.h in the top-level include directory.
895            # Since we need to support both cases for now, we ship a copy of
896            # libspeechd.h in third_party/speech-dispatcher. If the user
897            # prefers to link against the speech-dispatcher directly, the
898            # `libspeechd_h_prefix' variable can be passed to gyp with a value
899            # such as "speech-dispatcher/" that will be prepended to
900            # "libspeechd.h" in the #include directive.
901            # TODO(phaldan.jr): Once we do not need to support
902            # speech-dispatcher < 0.8 we can get rid of all this (including
903            # third_party/speech-dispatcher) and just include
904            # speech-dispatcher/libspeechd.h unconditionally.
905            'libspeechd_h_prefix%': '',
906          },
907          'action_name': 'generate_libspeechd_loader',
908          'inputs': [
909            '<(generator)',
910          ],
911          'outputs': [
912            '<(output_h)',
913            '<(output_cc)',
914          ],
915          'action': ['python',
916                     '<(generator)',
917                     '--name', 'LibSpeechdLoader',
918                     '--output-h', '<(output_h)',
919                     '--output-cc', '<(output_cc)',
920                     '--header', '<<(libspeechd_h_prefix)libspeechd.h>',
921                     '--bundled-header',
922                     '"third_party/speech-dispatcher/libspeechd.h"',
923                     '--link-directly=<(linux_link_libspeechd)',
924                     'spd_open',
925                     'spd_say',
926                     'spd_stop',
927                     'spd_close',
928                     'spd_pause',
929                     'spd_resume',
930                     'spd_set_notification_on',
931                     'spd_set_voice_rate',
932                     'spd_set_voice_pitch',
933                     'spd_list_synthesis_voices',
934                     'spd_set_synthesis_voice',
935                     'spd_list_modules',
936                     'spd_set_output_module',
937          ],
938          'message': 'Generating libspeechd library loader',
939          'process_outputs_as_sources': 1,
940        },
941      ],
942    },
943    {
944      'target_name': 'pangocairo',
945      'type': 'none',
946      'toolsets': ['host', 'target'],
947      'conditions': [
948        ['_toolset=="target"', {
949          'direct_dependent_settings': {
950            'cflags': [
951              '<!@(<(pkg-config) --cflags pangocairo pangoft2)',
952            ],
953          },
954          'link_settings': {
955            'ldflags': [
956              '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)',
957            ],
958            'libraries': [
959              '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)',
960            ],
961          },
962        }, {
963          'direct_dependent_settings': {
964            'cflags': [
965              '<!@(pkg-config --cflags pangocairo pangoft2)',
966            ],
967          },
968          'link_settings': {
969            'ldflags': [
970              '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)',
971            ],
972            'libraries': [
973              '<!@(pkg-config --libs-only-l pangocairo pangoft2)',
974            ],
975          },
976        }],
977      ],
978    },
979    {
980      'target_name': 'ssl',
981      'type': 'none',
982      'conditions': [
983        ['_toolset=="target"', {
984          'conditions': [
985            ['use_openssl==1', {
986              'dependencies': [
987                '../../third_party/openssl/openssl.gyp:openssl',
988              ],
989            }],
990            ['use_openssl==0', {
991              'dependencies': [
992                '../../net/third_party/nss/ssl.gyp:libssl',
993              ],
994              'direct_dependent_settings': {
995                'include_dirs+': [
996                  # We need for our local copies of the libssl3 headers to come
997                  # before other includes, as we are shadowing system headers.
998                  '<(DEPTH)/net/third_party/nss/ssl',
999                ],
1000                'cflags': [
1001                  '<!@(<(pkg-config) --cflags nss)',
1002                ],
1003              },
1004              'link_settings': {
1005                'ldflags': [
1006                  '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
1007                ],
1008                'libraries': [
1009                  '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
1010                ],
1011              },
1012            }],
1013            ['use_openssl==0 and clang==1', {
1014              'direct_dependent_settings': {
1015                'cflags': [
1016                  # There is a broken header guard in /usr/include/nss/secmod.h:
1017                  # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
1018                  '-Wno-header-guard',
1019                ],
1020              },
1021            }],
1022          ]
1023        }],
1024      ],
1025    },
1026    {
1027      'target_name': 'udev',
1028      'type': 'none',
1029      'conditions': [
1030        # libudev is not available on *BSD
1031        ['_toolset=="target" and os_bsd!=1', {
1032          'direct_dependent_settings': {
1033            'cflags': [
1034              '<!@(<(pkg-config) --cflags libudev)'
1035            ],
1036          },
1037          'link_settings': {
1038            'ldflags': [
1039              '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)',
1040            ],
1041            'libraries': [
1042              '<!@(<(pkg-config) --libs-only-l libudev)',
1043            ],
1044          },
1045        }],
1046      ],
1047    },
1048  ],
1049}
1050