1 # Copyright (c) 2013 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.
5 import("//build/config/linux/pkg_config.gni")
6 import("//build/config/features.gni")
7 import("//build/config/sysroot.gni")
8 import("//build/config/ui.gni")
9 import("//tools/generate_library_loader/generate_library_loader.gni")
11 gypi_values = exec_script("//build/gypi_to_gn.py",
12 [ rebase_path("../../linux/system.gyp") ],
14 [ "../../linux/system.gyp" ])
18 cflags = [ "--sysroot=" + sysroot ]
19 ldflags = [ "--sysroot=" + sysroot ]
21 # Need to get some linker flags out of the sysroot.
22 ldflags += [ exec_script("sysroot_ld_path.py",
24 rebase_path("//build/linux/sysroot_ld_path.sh",
31 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like
32 # OS_LINUX and the like.
34 defines = [ "OS_CHROMEOS" ]
38 config("fontconfig") {
39 libs = [ "fontconfig" ]
42 pkg_config("freetype2") {
43 packages = [ "freetype2" ]
55 pkg_config("pangocairo") {
56 packages = [ "pangocairo" ]
59 pkg_config("pangoft2") {
60 packages = [ "pangoft2" ]
63 # Note: if your target also depends on //dbus, you don't need to add this
64 # config (it will get added automatically if you depend on //dbus).
66 packages = [ "dbus-1" ]
69 if (use_evdev_gestures) {
70 pkg_config("libevdev-cros") {
71 packages = [ "libevdev-cros" ]
74 pkg_config("libgestures") {
75 packages = [ "libgestures" ]
93 config("xcomposite") {
94 libs = [ "Xcomposite" ]
105 config("xscrnsaver") {
125 config("libresolv") {
129 # CrOS doesn't install GTK, gconf or any gnome packages.
131 # These packages should _only_ be expected when building for a target.
132 # If these extra checks are not run, gconf is required when building host
133 # tools for a CrOS build.
134 if (current_toolchain == default_toolchain) {
135 pkg_config("gconf") {
136 packages = [ "gconf-2.0" ]
137 defines = [ "USE_GCONF" ]
142 # If brlapi isn't needed, don't require it to be installed.
144 config("brlapi_config") {
145 defines = [ "USE_BRLAPI" ]
148 # TODO(GYP) linux_link_brlapi support. Is this needed?
149 generate_library_loader("libbrlapi") {
150 name = "LibBrlapiLoader"
151 output_h = "libbrlapi.h"
152 output_cc = "libbrlapi_loader.cc"
153 header = "<brlapi.h>"
154 config = ":brlapi_config"
156 functions = gypi_values.libbrlapi_functions
160 pkg_config("gio_config") {
161 packages = [ "gio-2.0" ]
163 # glib >=2.40 deprecate g_settings_list_schemas in favor of
164 # g_settings_schema_source_list_schemas. This function is not available on
165 # earlier versions that we still need to support (specifically, 2.32), so
166 # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define.
167 # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10
168 # (saucy) and earlier. Update the code to use
169 # g_settings_schema_source_list_schemas instead.
172 "GLIB_DISABLE_DEPRECATION_WARNINGS",
175 # TODO(brettw) Theoretically I think ignore_libs should be set so that we
176 # don't link directly to GIO and use the loader generated below. But the gio
177 # target in GYP doesn't make any sense to me and appears to link directly to
178 # GIO in addition to making a loader. This this uncommented, the link in
179 # component build fails, so I think this is closer to the GYP build.
180 #ignore_libs = true # Loader generated below.
183 if (is_desktop_linux) {
184 # This generates a target named "gio".
185 generate_library_loader("gio") {
186 name = "LibGioLoader"
187 output_h = "libgio.h"
188 output_cc = "libgio_loader.cc"
189 header = "<gio/gio.h>"
190 config = ":gio_config"
192 functions = gypi_values.libgio_functions
196 # This generates a target named "libpci".
197 generate_library_loader("libpci") {
198 name = "LibPciLoader"
199 output_h = "libpci.h"
200 output_cc = "libpci_loader.cc"
201 header = "<pci/pci.h>"
203 functions = gypi_values.libpci_functions
206 # Looking for libspeechd? Use //third_party/speech-dispatcher
208 # This generates a target named "udev0_loader".
209 generate_library_loader("udev0_loader") {
210 name = "LibUdev0Loader"
211 output_h = "libudev0.h"
212 output_cc = "libudev0_loader.cc"
213 header = "\"third_party/libudev/libudev0.h\""
215 functions = gypi_values.libudev_functions
218 # This generates a target named "udev1_loader".
219 generate_library_loader("udev1_loader") {
220 name = "LibUdev1Loader"
221 output_h = "libudev1.h"
222 output_cc = "libudev1_loader.cc"
223 header = "\"third_party/libudev/libudev1.h\""
225 functions = gypi_values.libudev_functions