aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni
blob: ca744b0b239ea3354c50adc31c212e0d3c97bd4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- build/toolchain/gcc_toolchain.gni.orig	2020-05-13 18:40:16 UTC
+++ build/toolchain/gcc_toolchain.gni
@@ -36,6 +36,11 @@ if (is_linux && target_os == "android") {
   enable_resource_whitelist_generation = false
 }
 
+declare_args() {
+  extra_cxxflags = ""
+  extra_ldflags = ""
+}
+
 # This template defines a toolchain for something that works like gcc
 # (including clang).
 #
@@ -589,13 +594,23 @@ template("clang_toolchain") {
   }
 
   gcc_toolchain(target_name) {
-    prefix = rebase_path("$clang_base_path/bin", root_build_dir)
-    cc = "$prefix/clang"
-    cxx = "$prefix/clang++"
-    ld = cxx
-    readelf = "${toolprefix}readelf"
-    ar = "${prefix}/llvm-ar"
-    nm = "${toolprefix}nm"
+    if (is_bsd) {
+      prefix = "/usr/local/bin"
+      cc = "cc"
+      cxx = "c++"
+      ld = cxx
+      readelf = "readelf"
+      ar = "${prefix}/ar"
+      nm = "${toolprefix}nm"
+    } else {
+      prefix = rebase_path("$clang_base_path/bin", root_build_dir)
+      cc = "$prefix/clang"
+      cxx = "$prefix/clang++"
+      ld = cxx
+      readelf = "${toolprefix}readelf"
+      ar = "${prefix}/llvm-ar"
+      nm = "${toolprefix}nm"
+    }
 
     forward_variables_from(invoker,
                            [