Update BUILD.gn for [P]NaCl.

Now it's possible to build libvpx for [P]NaCl. It will be used to build
remoting PNaCl plugin.

BUG=512899
R=johannkoenig@google.com

Review URL: https://codereview.chromium.org/1326043003 .
diff --git a/BUILD.gn b/BUILD.gn
index 72d6779..ab50ae7 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -8,12 +8,6 @@
 import("//third_party/libvpx/libvpx_srcs.gni")
 import("//third_party/yasm/yasm_assemble.gni")
 
-if (is_posix && !is_mac) {
-  os_category = "linux"
-} else {
-  os_category = current_os
-}
-
 # Sets the architecture name for building libvpx.
 if (current_cpu == "x86") {
   cpu_arch_full = "ia32"
@@ -35,10 +29,22 @@
   cpu_arch_full = current_cpu
 }
 
+if (is_nacl) {
+  platform_include_dir = "//third_party/libvpx/source/config/nacl"
+} else {
+  if (is_posix && !is_mac) {
+    os_category = "linux"
+  } else {
+    os_category = current_os
+  }
+  platform_include_dir =
+      "//third_party/libvpx/source/config/$os_category/$cpu_arch_full"
+}
+
 config("libvpx_config") {
   include_dirs = [
     "//third_party/libvpx/source/config",
-    "//third_party/libvpx/source/config/$os_category/$cpu_arch_full",
+    platform_include_dir,
     "//third_party/libvpx/source/libvpx",
     "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h.
   ]
@@ -79,9 +85,9 @@
 
     defines = [ "CHROMIUM" ]
     include_dirs = [
-      "//third_party/libvpx/source/config/$os_category/$cpu_arch_full",
+      platform_include_dir,
       "//third_party/libvpx/source/config",
-     "//third_party/libvpx/source/libvpx",
+      "//third_party/libvpx/source/libvpx",
       target_gen_dir
     ]
   }
@@ -216,7 +222,9 @@
     configs += [ "//build/config/compiler:optimize_max" ]
   }
 
-  if (current_cpu == "x86") {
+  if (is_nacl) {
+    sources = libvpx_srcs_generic
+  } else if (current_cpu == "x86") {
     sources = libvpx_srcs_x86
   } else if (current_cpu == "x64") {
     if (is_msan) {