Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / build / config / linux / BUILD.gn
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.
4
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")
10
11 config("sdk") {
12   if (sysroot != "") {
13     cflags = [ "--sysroot=" + sysroot ]
14     ldflags = [ "--sysroot=" + sysroot ]
15
16     # Need to get some linker flags out of the sysroot.
17     ldflags += [ exec_script("sysroot_ld_path.py",
18         [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir),
19           sysroot ],
20         "value") ]
21   }
22
23   # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like
24   # OS_LINUX and the like.
25   if (is_chromeos) {
26     defines = [ "OS_CHROMEOS" ]
27   }
28 }
29
30 config("fontconfig") {
31   libs = [ "fontconfig" ]
32 }
33
34 pkg_config("freetype2") {
35   packages = [ "freetype2" ]
36 }
37
38 pkg_config("glib") {
39   packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ]
40 }
41
42 pkg_config("pangocairo") {
43   packages = [ "pangocairo" ]
44 }
45
46 pkg_config("pangoft2") {
47   packages = [ "pangoft2" ]
48 }
49
50 pkg_config("udev") {
51   packages = [ "libudev" ]
52 }
53
54 # Note: if your target also depends on //dbus, you don't need to add this
55 # config (it will get added automatically if you depend on //dbus).
56 pkg_config("dbus") {
57   packages = [ "dbus-1" ]
58 }
59
60 if (use_evdev_gestures) {
61   pkg_config("libevdev-cros") {
62     packages = [ "libevdev-cros" ]
63   }
64
65   pkg_config("libgestures") {
66     packages = [ "libgestures" ]
67   }
68 }
69
70 config("x11") {
71   libs = [
72     "X11",
73     "Xcomposite",
74     "Xcursor",
75     "Xdamage",
76     "Xext",
77     "Xfixes",
78     "Xi",
79     "Xrender",
80     "Xtst",
81   ]
82 }
83
84 config("xcomposite") {
85   libs = [ "Xcomposite" ]
86 }
87
88 config("xext") {
89   libs = [ "Xext" ]
90 }
91
92 config("xrandr") {
93   libs = [ "Xrandr" ]
94 }
95
96 config("xscrnsaver") {
97   libs = [ "Xss" ]
98 }
99
100 config("xfixes") {
101   libs = [ "Xfixes" ]
102 }
103
104 config("libcap") {
105   libs = [ "cap" ]
106 }
107
108 config("xi") {
109   libs = [ "Xi" ]
110 }
111
112 config("libresolv") {
113   libs = [ "resolv" ]
114 }
115
116 # CrOS doesn't install GTK, gconf or any gnome packages.
117 if (!is_chromeos) {
118   # These packages should _only_ be expected when building for a target.
119   # If these extra checks are not run, gconf is required when building host
120   # tools for a CrOS build.
121   if (current_toolchain == default_toolchain) {
122     pkg_config("gconf") {
123       packages = [ "gconf-2.0" ]
124       defines = [ "USE_GCONF" ]
125     }
126   }
127 }
128
129 # If brlapi isn't needed, don't require it to be installed.
130 if (use_brlapi) {
131   config("brlapi_config") {
132     defines = [ "USE_BRLAPI" ]
133   }
134
135   # TODO(GYP) linux_link_brlapi support. Is this needed?
136   generate_library_loader("libbrlapi") {
137     name = "LibBrlapiLoader"
138     output_h = "libbrlapi.h"
139     output_cc = "libbrlapi_loader.cc"
140     header = "<brlapi.h>"
141     config = ":brlapi_config"
142
143     functions = [
144       "brlapi_getHandleSize",
145       "brlapi_error_location",
146       "brlapi_strerror",
147       "brlapi__acceptKeys",
148       "brlapi__openConnection",
149       "brlapi__closeConnection",
150       "brlapi__getDisplaySize",
151       "brlapi__enterTtyModeWithPath",
152       "brlapi__leaveTtyMode",
153       "brlapi__writeDots",
154       "brlapi__readKey",
155     ]
156   }
157 }
158
159 pkg_config("gio_config") {
160   packages = [ "gio-2.0" ]
161   # glib >=2.40 deprecate g_settings_list_schemas in favor of
162   # g_settings_schema_source_list_schemas. This function is not available on
163   # earlier versions that we still need to support (specifically, 2.32), so
164   # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define.
165   # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10
166   # (saucy) and earlier. Update the code to use
167   # g_settings_schema_source_list_schemas instead.
168   defines = [ "USE_GIO", "GLIB_DISABLE_DEPRECATION_WARNINGS" ]
169  
170   # TODO(brettw) Theoretically I think ignore_libs should be set so that we
171   # don't link directly to GIO and use the loader generated below. But the gio
172   # target in GYP doesn't make any sense to me and appears to link directly to
173   # GIO in addition to making a loader. This this uncommented, the link in
174   # component build fails, so I think this is closer to the GYP build.
175   #ignore_libs = true  # Loader generated below.
176 }
177
178 # This generates a target named "gio".
179 generate_library_loader("gio") {
180   name = "LibGioLoader"
181   output_h = "libgio.h"
182   output_cc = "libgio_loader.cc"
183   header = "<gio/gio.h>"
184   config = ":gio_config"
185
186   functions = [
187     "g_settings_new",
188     "g_settings_get_child",
189     "g_settings_get_string",
190     "g_settings_get_boolean",
191     "g_settings_get_int",
192     "g_settings_get_strv",
193     "g_settings_list_schemas",
194   ]
195 }
196
197 # This generates a target named "libpci".
198 generate_library_loader("libpci") {
199   name = "LibPciLoader"
200   output_h = "libpci.h"
201   output_cc = "libpci_loader.cc"
202   header = "<pci/pci.h>"
203
204   functions = [
205     "pci_alloc",
206     "pci_init",
207     "pci_cleanup",
208     "pci_scan_bus",
209     "pci_fill_info",
210     "pci_lookup_name",
211   ]
212 }
213
214 # Looking for libspeechd? Use //third_party/speech-dispatcher