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") | |
10 | |
11 gypi_values = exec_script("//build/gypi_to_gn.py", | |
12 [ rebase_path("../../linux/system.gyp") ], | |
13 "scope", | |
14 [ "../../linux/system.gyp" ]) | |
15 | 9 |
16 config("sdk") { | 10 config("sdk") { |
17 if (sysroot != "") { | 11 if (sysroot != "") { |
18 cflags = [ "--sysroot=" + sysroot ] | 12 cflags = [ "--sysroot=" + sysroot ] |
19 ldflags = [ "--sysroot=" + sysroot ] | 13 ldflags = [ "--sysroot=" + sysroot ] |
20 | 14 |
21 # Need to get some linker flags out of the sysroot. | 15 # Need to get some linker flags out of the sysroot. |
22 ldflags += [ exec_script("sysroot_ld_path.py", | 16 ldflags += [ exec_script("sysroot_ld_path.py", |
23 [ | 17 [ |
24 rebase_path("//build/linux/sysroot_ld_path.sh", | 18 rebase_path("//build/linux/sysroot_ld_path.sh", |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 "-Wno-unused-function", | 151 "-Wno-unused-function", |
158 ] | 152 ] |
159 } | 153 } |
160 | 154 |
161 pkg_config("gconf") { | 155 pkg_config("gconf") { |
162 packages = [ "gconf-2.0" ] | 156 packages = [ "gconf-2.0" ] |
163 defines = [ "USE_GCONF" ] | 157 defines = [ "USE_GCONF" ] |
164 } | 158 } |
165 } | 159 } |
166 } | 160 } |
167 | |
168 # If brlapi isn't needed, don't require it to be installed. | |
169 if (use_brlapi) { | |
170 config("brlapi_config") { | |
171 defines = [ "USE_BRLAPI" ] | |
172 } | |
173 | |
174 # TODO(GYP) linux_link_brlapi support. Is this needed? | |
175 generate_library_loader("libbrlapi") { | |
176 name = "LibBrlapiLoader" | |
177 output_h = "libbrlapi.h" | |
178 output_cc = "libbrlapi_loader.cc" | |
179 header = "<brlapi.h>" | |
180 config = ":brlapi_config" | |
181 | |
182 functions = gypi_values.libbrlapi_functions | |
183 } | |
184 } | |
185 | |
186 pkg_config("gio_config") { | |
187 packages = [ "gio-2.0" ] | |
188 | |
189 # glib >=2.40 deprecate g_settings_list_schemas in favor of | |
190 # g_settings_schema_source_list_schemas. This function is not available on | |
191 # earlier versions that we still need to support (specifically, 2.32), so | |
192 # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define. | |
193 # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu 13.10 | |
194 # (saucy) and earlier. Update the code to use | |
195 # g_settings_schema_source_list_schemas instead. | |
196 defines = [ | |
197 "USE_GIO", | |
198 "GLIB_DISABLE_DEPRECATION_WARNINGS", | |
199 ] | |
200 | |
201 # TODO(brettw) Theoretically I think ignore_libs should be set so that we | |
202 # don't link directly to GIO and use the loader generated below. But the gio | |
203 # target in GYP doesn't make any sense to me and appears to link directly to | |
204 # GIO in addition to making a loader. This this uncommented, the link in | |
205 # component build fails, so I think this is closer to the GYP build. | |
206 #ignore_libs = true # Loader generated below. | |
207 } | |
208 | |
209 if (is_desktop_linux) { | |
210 # This generates a target named "gio". | |
211 generate_library_loader("gio") { | |
212 name = "LibGioLoader" | |
213 output_h = "libgio.h" | |
214 output_cc = "libgio_loader.cc" | |
215 header = "<gio/gio.h>" | |
216 config = ":gio_config" | |
217 | |
218 functions = gypi_values.libgio_functions | |
219 } | |
220 } | |
221 | |
222 # This generates a target named "libpci". | |
223 generate_library_loader("libpci") { | |
224 name = "LibPciLoader" | |
225 output_h = "libpci.h" | |
226 output_cc = "libpci_loader.cc" | |
227 header = "<pci/pci.h>" | |
228 | |
229 functions = gypi_values.libpci_functions | |
230 } | |
231 | |
232 # Looking for libspeechd? Use //third_party/speech-dispatcher | |
233 | |
234 # This generates a target named "udev0_loader". | |
235 generate_library_loader("udev0_loader") { | |
236 name = "LibUdev0Loader" | |
237 output_h = "libudev0.h" | |
238 output_cc = "libudev0_loader.cc" | |
239 header = "\"third_party/libudev/libudev0.h\"" | |
240 | |
241 functions = gypi_values.libudev_functions | |
242 } | |
243 | |
244 # This generates a target named "udev1_loader". | |
245 generate_library_loader("udev1_loader") { | |
246 name = "LibUdev1Loader" | |
247 output_h = "libudev1.h" | |
248 output_cc = "libudev1_loader.cc" | |
249 header = "\"third_party/libudev/libudev1.h\"" | |
250 | |
251 functions = gypi_values.libudev_functions | |
252 } | |
253 | |
254 group("udev") { | |
255 deps = [ | |
256 ":udev0_loader", | |
257 ":udev1_loader", | |
258 ] | |
259 } | |
OLD | NEW |