Support for building on OpenBSD.

Change-Id: I89022b5008ba00bd5457c5625f0a87e8393c3d23
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/4160
Reviewed-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Petr Hosek <phosek@google.com>
Commit-Queue: Petr Hosek <phosek@google.com>
diff --git a/build/build_openbsd.ninja.template b/build/build_openbsd.ninja.template
new file mode 100644
index 0000000..f22ccb3
--- /dev/null
+++ b/build/build_openbsd.ninja.template
@@ -0,0 +1,19 @@
+rule cc
+  command = $cc -MMD -MF $out.d $defines $includes $cflags $cflags_c -c $in -o $out
+  description = CC $out
+  depfile = $out.d
+  deps = gcc
+
+rule cxx
+  command = $cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc -c $in -o $out
+  description = CXX $out
+  depfile = $out.d
+  deps = gcc
+
+rule alink_thin
+  command = rm -f $out && $ar rcs $out $in
+  description = AR $out
+
+rule link
+  command = $ld $ldflags -o $out -Wl,--start-group $in $libs -Wl,--end-group $solibs
+  description = LINK $out