# found in the LICENSE file.
import("//build/config/linux/pkg_config.gni")
+import("//build/config/features.gni")
import("//build/config/sysroot.gni")
+import("//build/config/ui.gni")
+import("//tools/generate_library_loader/generate_library_loader.gni")
config("sdk") {
if (sysroot != "") {
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("sysroot_ld_path.py",
- [ rebase_path("//build/linux/sysroot_ld_path.sh", ".", root_build_dir),
+ [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir),
sysroot ],
"value") ]
}
-}
-
-# Sets up the dynamic library search path to include our "lib" directory.
-config("executable_ldconfig") {
- ldflags = [
- # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as
- # required for ninja.
- "-Wl,-rpath=\\\$ORIGIN/lib/",
- "-Wl,-rpath-link=lib/",
- ]
+ # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like
+ # OS_LINUX and the like.
+ if (is_chromeos) {
+ defines = [ "OS_CHROMEOS" ]
+ }
}
config("fontconfig") {
packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ]
}
-pkg_config("gtk") {
- # Gtk requires gmodule, but it does not list it as a dependency in some
- # misconfigured systems.
- packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ]
-}
-
pkg_config("pangocairo") {
packages = [ "pangocairo" ]
}
+pkg_config("pangoft2") {
+ packages = [ "pangoft2" ]
+}
+
pkg_config("udev") {
packages = [ "libudev" ]
}
+# Note: if your target also depends on //dbus, you don't need to add this
+# config (it will get added automatically if you depend on //dbus).
+pkg_config("dbus") {
+ packages = [ "dbus-1" ]
+}
+
+if (use_evdev_gestures) {
+ pkg_config("libevdev-cros") {
+ packages = [ "libevdev-cros" ]
+ }
+
+ pkg_config("libgestures") {
+ packages = [ "libgestures" ]
+ }
+}
+
config("x11") {
# Don't bother running pkg-config for these X related libraries since it just
# returns the same libs, and forking pkg-config is slow.
"Xtst",
]
}
+
+config("xcomposite") {
+ libs = [ "Xcomposite" ]
+}
+
+config("xext") {
+ libs = [ "Xext" ]
+}
+
+config("xrandr") {
+ libs = [ "Xrandr" ]
+}
+
+config("xscrnsaver") {
+ libs = [ "Xss" ]
+}
+
+config("xfixes") {
+ libs = [ "Xfixes" ]
+}
+
+config("libcap") {
+ libs = [ "cap" ]
+}
+
+config("xi") {
+ libs = [ "Xi" ]
+}
+
+config("libresolv") {
+ libs = [ "resolv" ]
+}
+
+# CrOS doesn't install GTK, gconf or any gnome packages.
+if (!is_chromeos) {
+ pkg_config("gtk") {
+ # Gtk requires gmodule, but it does not list it as a dependency in some
+ # misconfigured systems.
+ packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ]
+ }
+
+ pkg_config("gtkprint") {
+ packages = [ "gtk+-unix-print-2.0" ]
+ }
+
+ pkg_config("gnome_keyring") {
+ packages = [ "gnome-keyring-1" ]
+ }
+
+ pkg_config("gconf") {
+ packages = [ "gconf-2.0" ]
+ defines = [ "USE_GCONF" ]
+ }
+}
+
+# If brlapi isn't needed, don't require it to be installed.
+if (use_brlapi) {
+ config("brlapi_config") {
+ defines = [ "USE_BRLAPI" ]
+ }
+
+ # TODO(GYP) linux_link_brlapi support. Is this needed?
+ generate_library_loader("libbrlapi") {
+ name = "LibBrlapiLoader"
+ output_h = "libbrlapi.h"
+ output_cc = "libbrlapi_loader.cc"
+ header = "<brlapi.h>"
+ config = ":brlapi_config"
+
+ functions = [
+ "brlapi_getHandleSize",
+ "brlapi_error_location",
+ "brlapi_strerror",
+ "brlapi__acceptKeys",
+ "brlapi__openConnection",
+ "brlapi__closeConnection",
+ "brlapi__getDisplaySize",
+ "brlapi__enterTtyModeWithPath",
+ "brlapi__leaveTtyMode",
+ "brlapi__writeDots",
+ "brlapi__readKey",
+ ]
+ }
+}
+
+pkg_config("gio_config") {
+ packages = [ "gio-2.0" ]
+ # glib >=2.40 deprecate g_settings_list_schemas in favor of
+ # g_settings_schema_source_list_schemas. This function is not available on
+ # earlier versions that we still need to support (specifically, 2.32), so
+ # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define.
+ # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10
+ # (saucy) and earlier. Update the code to use
+ # g_settings_schema_source_list_schemas instead.
+ defines = [ "USE_GIO", "GLIB_DISABLE_DEPRECATION_WARNINGS" ]
+
+ # TODO(brettw) Theoretically I think ignore_libs should be set so that we
+ # don't link directly to GIO and use the loader generated below. But the gio
+ # target in GYP doesn't make any sense to me and appears to link directly to
+ # GIO in addition to making a loader. This this uncommented, the link in
+ # component build fails, so I think this is closer to the GYP build.
+ #ignore_libs = true # Loader generated below.
+}
+
+# This generates a target named "gio".
+generate_library_loader("gio") {
+ name = "LibGioLoader"
+ output_h = "libgio.h"
+ output_cc = "libgio_loader.cc"
+ header = "<gio/gio.h>"
+ config = ":gio_config"
+
+ functions = [
+ "g_settings_new",
+ "g_settings_get_child",
+ "g_settings_get_string",
+ "g_settings_get_boolean",
+ "g_settings_get_int",
+ "g_settings_get_strv",
+ "g_settings_list_schemas",
+ ]
+}
+
+# This generates a target named "libpci".
+generate_library_loader("libpci") {
+ name = "LibPciLoader"
+ output_h = "libpci.h"
+ output_cc = "libpci_loader.cc"
+ header = "<pci/pci.h>"
+
+ functions = [
+ "pci_alloc",
+ "pci_init",
+ "pci_cleanup",
+ "pci_scan_bus",
+ "pci_fill_info",
+ "pci_lookup_name",
+ ]
+}
+
+# Looking for libspeechd? Use //third_party/speech-dispatcher