OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/linux/pkg_config.gni") | 5 import("//build/config/linux/pkg_config.gni") |
6 import("//build/config/features.gni") | 6 import("//build/config/features.gni") |
7 import("//build/config/sysroot.gni") | 7 import("//build/config/sysroot.gni") |
8 import("//build/config/ui.gni") | 8 import("//build/config/ui.gni") |
9 import("//tools/generate_library_loader/generate_library_loader.gni") | 9 import("//tools/generate_library_loader/generate_library_loader.gni") |
10 | 10 |
| 11 gypi_values = exec_script("//build/gypi_to_gn.py", |
| 12 [ rebase_path("../../linux/system.gyp") ], |
| 13 "scope", |
| 14 [ "../../linux/system.gyp" ]) |
| 15 |
11 config("sdk") { | 16 config("sdk") { |
12 if (sysroot != "") { | 17 if (sysroot != "") { |
13 cflags = [ "--sysroot=" + sysroot ] | 18 cflags = [ "--sysroot=" + sysroot ] |
14 ldflags = [ "--sysroot=" + sysroot ] | 19 ldflags = [ "--sysroot=" + sysroot ] |
15 | 20 |
16 # Need to get some linker flags out of the sysroot. | 21 # Need to get some linker flags out of the sysroot. |
17 ldflags += [ exec_script("sysroot_ld_path.py", | 22 ldflags += [ exec_script("sysroot_ld_path.py", |
18 [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir), | 23 [ |
19 sysroot ], | 24 rebase_path("//build/linux/sysroot_ld_path.sh", |
20 "value") ] | 25 root_build_dir), |
| 26 sysroot, |
| 27 ], |
| 28 "value") ] |
21 } | 29 } |
22 | 30 |
23 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like | 31 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like |
24 # OS_LINUX and the like. | 32 # OS_LINUX and the like. |
25 if (is_chromeos) { | 33 if (is_chromeos) { |
26 defines = [ "OS_CHROMEOS" ] | 34 defines = [ "OS_CHROMEOS" ] |
27 } | 35 } |
28 } | 36 } |
29 | 37 |
30 config("fontconfig") { | 38 config("fontconfig") { |
31 libs = [ "fontconfig" ] | 39 libs = [ "fontconfig" ] |
32 } | 40 } |
33 | 41 |
34 pkg_config("freetype2") { | 42 pkg_config("freetype2") { |
35 packages = [ "freetype2" ] | 43 packages = [ "freetype2" ] |
36 } | 44 } |
37 | 45 |
38 pkg_config("glib") { | 46 pkg_config("glib") { |
39 packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ] | 47 packages = [ |
| 48 "glib-2.0", |
| 49 "gmodule-2.0", |
| 50 "gobject-2.0", |
| 51 "gthread-2.0", |
| 52 ] |
40 } | 53 } |
41 | 54 |
42 pkg_config("pangocairo") { | 55 pkg_config("pangocairo") { |
43 packages = [ "pangocairo" ] | 56 packages = [ "pangocairo" ] |
44 } | 57 } |
45 | 58 |
46 pkg_config("pangoft2") { | 59 pkg_config("pangoft2") { |
47 packages = [ "pangoft2" ] | 60 packages = [ "pangoft2" ] |
48 } | 61 } |
49 | 62 |
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 | 63 # 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). | 64 # config (it will get added automatically if you depend on //dbus). |
56 pkg_config("dbus") { | 65 pkg_config("dbus") { |
57 packages = [ "dbus-1" ] | 66 packages = [ "dbus-1" ] |
58 } | 67 } |
59 | 68 |
60 if (use_evdev_gestures) { | 69 if (use_evdev_gestures) { |
61 pkg_config("libevdev-cros") { | 70 pkg_config("libevdev-cros") { |
62 packages = [ "libevdev-cros" ] | 71 packages = [ "libevdev-cros" ] |
63 } | 72 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 142 } |
134 | 143 |
135 # TODO(GYP) linux_link_brlapi support. Is this needed? | 144 # TODO(GYP) linux_link_brlapi support. Is this needed? |
136 generate_library_loader("libbrlapi") { | 145 generate_library_loader("libbrlapi") { |
137 name = "LibBrlapiLoader" | 146 name = "LibBrlapiLoader" |
138 output_h = "libbrlapi.h" | 147 output_h = "libbrlapi.h" |
139 output_cc = "libbrlapi_loader.cc" | 148 output_cc = "libbrlapi_loader.cc" |
140 header = "<brlapi.h>" | 149 header = "<brlapi.h>" |
141 config = ":brlapi_config" | 150 config = ":brlapi_config" |
142 | 151 |
143 functions = [ | 152 functions = gypi_values.libbrlapi_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 } | 153 } |
157 } | 154 } |
158 | 155 |
159 pkg_config("gio_config") { | 156 pkg_config("gio_config") { |
160 packages = [ "gio-2.0" ] | 157 packages = [ "gio-2.0" ] |
| 158 |
161 # glib >=2.40 deprecate g_settings_list_schemas in favor of | 159 # glib >=2.40 deprecate g_settings_list_schemas in favor of |
162 # g_settings_schema_source_list_schemas. This function is not available on | 160 # 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 | 161 # earlier versions that we still need to support (specifically, 2.32), so |
164 # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define. | 162 # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define. |
165 # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10 | 163 # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10 |
166 # (saucy) and earlier. Update the code to use | 164 # (saucy) and earlier. Update the code to use |
167 # g_settings_schema_source_list_schemas instead. | 165 # g_settings_schema_source_list_schemas instead. |
168 defines = [ "USE_GIO", "GLIB_DISABLE_DEPRECATION_WARNINGS" ] | 166 defines = [ |
169 | 167 "USE_GIO", |
| 168 "GLIB_DISABLE_DEPRECATION_WARNINGS", |
| 169 ] |
| 170 |
170 # TODO(brettw) Theoretically I think ignore_libs should be set so that we | 171 # 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 # 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 # 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 # 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 # component build fails, so I think this is closer to the GYP build. |
175 #ignore_libs = true # Loader generated below. | 176 #ignore_libs = true # Loader generated below. |
176 } | 177 } |
177 | 178 |
178 # This generates a target named "gio". | 179 # This generates a target named "gio". |
179 generate_library_loader("gio") { | 180 generate_library_loader("gio") { |
180 name = "LibGioLoader" | 181 name = "LibGioLoader" |
181 output_h = "libgio.h" | 182 output_h = "libgio.h" |
182 output_cc = "libgio_loader.cc" | 183 output_cc = "libgio_loader.cc" |
183 header = "<gio/gio.h>" | 184 header = "<gio/gio.h>" |
184 config = ":gio_config" | 185 config = ":gio_config" |
185 | 186 |
186 functions = [ | 187 functions = gypi_values.libgio_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 } | 188 } |
196 | 189 |
197 # This generates a target named "libpci". | 190 # This generates a target named "libpci". |
198 generate_library_loader("libpci") { | 191 generate_library_loader("libpci") { |
199 name = "LibPciLoader" | 192 name = "LibPciLoader" |
200 output_h = "libpci.h" | 193 output_h = "libpci.h" |
201 output_cc = "libpci_loader.cc" | 194 output_cc = "libpci_loader.cc" |
202 header = "<pci/pci.h>" | 195 header = "<pci/pci.h>" |
203 | 196 |
204 functions = [ | 197 functions = gypi_values.libpci_functions |
205 "pci_alloc", | |
206 "pci_init", | |
207 "pci_cleanup", | |
208 "pci_scan_bus", | |
209 "pci_fill_info", | |
210 "pci_lookup_name", | |
211 ] | |
212 } | 198 } |
213 | 199 |
214 # Looking for libspeechd? Use //third_party/speech-dispatcher | 200 # Looking for libspeechd? Use //third_party/speech-dispatcher |
| 201 |
| 202 # This generates a target named "udev0_loader". |
| 203 generate_library_loader("udev0_loader") { |
| 204 name = "LibUdev0Loader" |
| 205 output_h = "libudev0.h" |
| 206 output_cc = "libudev0_loader.cc" |
| 207 header = "\"third_party/libudev/libudev0.h\"" |
| 208 |
| 209 functions = gypi_values.libudev_functions |
| 210 } |
| 211 |
| 212 # This generates a target named "udev1_loader". |
| 213 generate_library_loader("udev1_loader") { |
| 214 name = "LibUdev1Loader" |
| 215 output_h = "libudev1.h" |
| 216 output_cc = "libudev1_loader.cc" |
| 217 header = "\"third_party/libudev/libudev1.h\"" |
| 218 |
| 219 functions = gypi_values.libudev_functions |
| 220 } |
| 221 |
| 222 group("udev") { |
| 223 deps = [ |
| 224 ":udev0_loader", |
| 225 ":udev1_loader", |
| 226 ] |
| 227 } |
OLD | NEW |