[boringssl] Update build file generation

A few recent CLs have modified generated build files rather than the
scripts and templates that generate them (despite comments advising not
to do so).  This CL moves those changes to the correct locations.

Change-Id: I35bdd6cd26e73bcabf22aa05b6921f5148d45349
diff --git a/fuchsia/BUILD_template.gn b/fuchsia/BUILD_template.gn
index f7a51e9..0ee05e7 100644
--- a/fuchsia/BUILD_template.gn
+++ b/fuchsia/BUILD_template.gn
@@ -28,21 +28,25 @@
 
 # GENERATE comment - This file is a template used by 'fuchsia/generate.py'.
 
+  # TODO(aarongreen): Switch on asm and threads.
 config("boringssl_config") {
   include_dirs = [ "include" ]
-  libs = [ "magenta" ]
+  if (defined(is_fuchsia) && is_fuchsia) {
+    libs = [ "magenta" ]
+  }
+  defines = [
+    "OPENSSL_NO_THREADS",
+  ]
 }
 
 config("internal_config") {
   visibility = [ ":*" ]  # Only targets in this file can depend on this.
-  # TODO(aarongreen): Switch on asm and threads.
   defines = [
     "BORINGSSL_IMPLEMENTATION",
     "BORINGSSL_SHARED_LIBRARY",
     "BORINGSSL_NO_STATIC_INITIALIZER",
     "OPENSSL_SMALL",
     "OPENSSL_NO_ASM",
-    "OPENSSL_NO_THREADS",
     "_XOPEN_SOURCE=700" ,
   ]
   cflags_c = [ "-std=c11" ]
diff --git a/fuchsia/generate.py b/fuchsia/generate.py
index 722c4e6..e3ed2f0 100755
--- a/fuchsia/generate.py
+++ b/fuchsia/generate.py
@@ -196,6 +196,9 @@
       output: Path to the GN file to output.
     """
     output = os.path.join(FUCHSIA_ROOT, 'packages', 'gn', 'boringssl')
+    # Gather imports.
+    imports = []
+    imports.append('netstack')
     # Gather labels.
     labels = []
     labels.append('//third_party/boringssl:bssl')
@@ -216,6 +219,7 @@
            'bootfs_path': 'test/boringssl/data/%s' % os.path.basename(file)})
     # Output JSON module file.
     odict = OrderedDict()
+    odict['imports'] = imports
     odict['labels'] = labels
     odict['binaries'] = binaries
     odict['resources'] = resources