$OpenBSD: patch-build_config_BUILDCONFIG_gn,v 1.8 2018/03/12 13:48:34 robert Exp $

Index: build/config/BUILDCONFIG.gn
--- build/config/BUILDCONFIG.gn.orig
+++ build/config/BUILDCONFIG.gn
@@ -131,14 +131,14 @@ declare_args() {
   is_official_build = false
 
   # Whether we're a traditional desktop unix.
-  is_desktop_linux = current_os == "linux"
+  is_desktop_linux = current_os == "linux" || current_os == "openbsd"
 
   # Set to true when compiling with the Clang compiler. Typically this is used
   # to configure warnings.
   is_clang =
       current_os == "mac" || current_os == "ios" || current_os == "chromeos" ||
       current_os == "fuchsia" || current_os == "android" ||
-      current_os == "win" ||
+      current_os == "win" || current_os == "openbsd" ||
       (current_os == "linux" && current_cpu != "s390x" &&
        current_cpu != "s390" && current_cpu != "ppc64" &&
        current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64")
@@ -215,6 +215,8 @@ if (host_toolchain == "") {
     }
   } else if (host_os == "aix") {
     host_toolchain = "//build/toolchain/aix:$host_cpu"
+  } else if (host_os == "openbsd") {
+    host_toolchain = "//build/toolchain/openbsd:clang_$host_cpu"
   } else {
     assert(false, "Unsupported host_os: $host_os")
   }
@@ -256,6 +258,8 @@ if (target_os == "android") {
 } else if (target_os == "winrt_81" || target_os == "winrt_81_phone" ||
            target_os == "winrt_10") {
   _default_toolchain = "//build/toolchain/win:winrt_$target_cpu"
+} else if (target_os == "openbsd") {
+  _default_toolchain = host_toolchain
 } else {
   assert(false, "Unsupported target_os: $target_os")
 }
@@ -297,6 +301,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = false
   is_win = true
+  is_openbsd = false
 } else if (current_os == "mac") {
   is_android = false
   is_chromeos = false
@@ -307,6 +312,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "android") {
   is_android = true
   is_chromeos = false
@@ -317,6 +323,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "chromeos") {
   is_android = false
   is_chromeos = true
@@ -327,6 +334,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "nacl") {
   # current_os == "nacl" will be passed by the nacl toolchain definition.
   # It is not set by default or on the command line. We treat is as a
@@ -340,6 +348,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = true
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "fuchsia") {
   is_android = false
   is_chromeos = false
@@ -350,6 +359,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "ios") {
   is_android = false
   is_chromeos = false
@@ -360,6 +370,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "linux") {
   is_android = false
   is_chromeos = false
@@ -370,6 +381,7 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
 } else if (current_os == "aix") {
   is_android = false
   is_chromeos = false
@@ -379,6 +391,18 @@ if (current_os == "win" || current_os == "winrt_81" ||
   is_nacl = false
   is_posix = true
   is_win = false
+  is_openbsd = false
+} else if (current_os == "openbsd") {
+  is_fuchsia = false
+  is_android = false
+  is_chromeos = false
+  is_ios = false
+  is_linux = true
+  is_mac = false
+  is_nacl = false
+  is_posix = true
+  is_win = false
+  is_openbsd = true
 }
 
 # =============================================================================
