GN: Prefix WebRTC specific variables with "rtc_"

BUG=3441
TESTED=Trybots + Running GN in a Chromium checkout with
src/third_party/webrtc symlinked to the WebRTC checkout
with this CL applied, both with the default GN settings
and using: --args="os=\"android\" cpu_arch=\"arm\""

R=brettw@chromium.org

Review URL: https://webrtc-codereview.appspot.com/27379004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7095 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index 20290eb..ce20d86 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -57,13 +57,13 @@
       "WEBRTC_LINUX",
       "WEBRTC_ANDROID",
     ]
-    if (enable_android_opensl) {
+    if (rtc_enable_android_opensl) {
       defines += [ "WEBRTC_ANDROID_OPENSLES" ]
     }
   }
 }
 
-if (have_dbus_glib) {
+if (rtc_have_dbus_glib) {
   pkg_config("dbus-glib") {
     packages = [ "dbus-glib-1" ]
   }
@@ -72,11 +72,11 @@
 config("common_config") {
   cflags = []
   cflags_cc = []
-  if (restrict_webrtc_logging) {
+  if (rtc_restrict_logging) {
     defines = [ "WEBRTC_RESTRICT_LOGGING" ]
   }
 
-  if (have_dbus_glib) {
+  if (rtc_have_dbus_glib) {
     defines += [ "HAVE_DBUS_GLIB" ]
     # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
     # is still not found even if the execution of
@@ -85,7 +85,7 @@
     all_dependent_configs = [ "dbus-glib" ]
   }
 
-  if (enable_video) {
+  if (rtc_enable_video) {
     defines += [ "WEBRTC_MODULE_UTILITY_VIDEO" ]
   }
 
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index b0da45a..4e14ab1 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -102,11 +102,11 @@
   }
 }
 
-if (build_ssl == 0) {
+if (rtc_build_ssl == 0) {
   config("external_ssl_library") {
-    assert(webrtc_ssl_root != "",
-           "You must specify webrtc_ssl_root when build_ssl==0.")
-    include_dirs = [ webrtc_ssl_root ]
+    assert(rtc_ssl_root != "",
+           "You must specify rtc_ssl_root when rtc_build_ssl==0.")
+    include_dirs = [ rtc_ssl_root ]
   }
 }
 
@@ -425,10 +425,10 @@
         "win32socketserver.h",
       ]
     }
-    if (build_json) {
+    if (rtc_build_json) {
       deps += [ "//third_party/jsoncpp" ]
     } else {
-      include_dirs += [ webrtc_jsoncpp_root ]
+      include_dirs += [ rtc_jsoncpp_root ]
 
       # When defined changes the include path for json.h to where it is
       # expected to be when building json outside of the standalone build.
@@ -451,7 +451,7 @@
 
   if (use_openssl) {
     direct_dependent_configs += [ ":openssl_config" ]
-    if (build_ssl) {
+    if (rtc_build_ssl) {
       deps += [ "//third_party/boringssl" ]
     } else {
       configs += [ "external_ssl_library" ]
@@ -479,7 +479,7 @@
   if (is_ios) {
     all_dependent_configs += [ ":ios_config" ]
 
-    if (build_ssl) {
+    if (rtc_build_ssl) {
       deps += [ "//net/third_party/nss/ssl:libssl" ]
     } else {
       configs += [ "external_ssl_library" ]
@@ -507,7 +507,7 @@
       "dl",
       "rt",
     ]
-    if (build_ssl) {
+    if (rtc_build_ssl) {
       configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
     }
   }
@@ -600,7 +600,7 @@
   }
 
   if (is_mac || is_ios || is_win) {
-    if (build_ssl) {
+    if (rtc_build_ssl) {
       deps += [
         "//net/third_party/nss/ssl:libssl",
         "//third_party/nss:nspr",
@@ -615,7 +615,7 @@
     if (build_with_chromium) {
       deps += [ "//crypto:platform" ]
     } else {
-      if (build_ssl) {
+      if (rtc_build_ssl) {
         deps += [ ":linux_system_ssl" ]
       } else {
         configs += [ "external_ssl_library" ]
diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni
index 346a062..d46b8c6 100644
--- a/webrtc/build/webrtc.gni
+++ b/webrtc/build/webrtc.gni
@@ -15,40 +15,40 @@
   build_with_libjingle = true
 
   # Disable this to avoid building the Opus audio codec.
-  include_opus = true
+  rtc_include_opus = true
 
   # Used to specify an external Jsoncpp include path when not compiling the
-  # library that comes with WebRTC (i.e. build_json == 0).
-  webrtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
+  # library that comes with WebRTC (i.e. rtc_build_json == 0).
+  rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
 
   # Used to specify an external OpenSSL include path when not compiling the
-  # library that comes with WebRTC (i.e. build_ssl == 0).
-  webrtc_ssl_root = ""
+  # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
+  rtc_ssl_root = ""
 
   # Adds video support to dependencies shared by voice and video engine.
   # This should normally be enabled; the intended use is to disable only
   # when building voice engine exclusively.
-  enable_video = true
+  rtc_enable_video = true
 
   # Selects fixed-point code where possible.
-  prefer_fixed_point = false
+  rtc_prefer_fixed_point = false
 
   # Enable data logging. Produces text files with data logged within engines
   # which can be easily parsed for offline processing.
-  enable_data_logging = false
+  rtc_enable_data_logging = false
 
   # Enables the use of protocol buffers for debug recordings.
-  enable_protobuf = true
+  rtc_enable_protobuf = true
 
   # Disable these to not build components which can be externally provided.
-  build_json = true
-  build_libjpeg = true
-  build_libyuv = true
-  build_libvpx = true
-  build_ssl = true
+  rtc_build_json = true
+  rtc_build_libjpeg = true
+  rtc_build_libyuv = true
+  rtc_build_libvpx = true
+  rtc_build_ssl = true
 
   # Disable by default.
-  have_dbus_glib = false
+  rtc_have_dbus_glib = false
 
   # Enable to use the Mozilla internal settings.
   build_with_mozilla = false
@@ -59,26 +59,26 @@
   mips_dsp_rev = 0
   mips_fpu = true
 
-  enable_android_opensl = true
+  rtc_enable_android_opensl = true
 
   # Link-Time Optimizations.
   # Executes code generation at link-time instead of compile-time.
   # https://gcc.gnu.org/wiki/LinkTimeOptimization
-  use_lto = false
+  rtc_use_lto = false
 
   if (build_with_chromium) {
     # Exclude pulse audio on Chromium since its prerequisites don't require
     # pulse audio.
-    include_pulse_audio = false
+    rtc_include_pulse_audio = false
 
     # Exclude internal ADM since Chromium uses its own IO handling.
-    include_internal_audio_device = false
+    rtc_include_internal_audio_device = false
 
     # Exclude internal VCM in Chromium build.
-    include_internal_video_capture = false
+    rtc_include_internal_video_capture = false
 
     # Exclude internal video render module in Chromium build.
-    include_internal_video_render = false
+    rtc_include_internal_video_render = false
   } else {
     # Settings for the standalone (not-in-Chromium) build.
 
@@ -87,31 +87,31 @@
     # http://code.google.com/p/webrtc/issues/detail?id=163
     clang_use_chrome_plugins = false
 
-    include_pulse_audio = true
-    include_internal_audio_device = true
-    include_internal_video_capture = true
-    include_internal_video_render = true
+    rtc_include_pulse_audio = true
+    rtc_include_internal_audio_device = true
+    rtc_include_internal_video_capture = true
+    rtc_include_internal_video_render = true
   }
 
   if (build_with_libjingle) {
-    include_tests = false
-    restrict_webrtc_logging = true
+    rtc_include_tests = false
+    rtc_restrict_logging = true
   } else {
-    include_tests = true
-    restrict_webrtc_logging = false
+    rtc_include_tests = true
+    rtc_restrict_logging = false
   }
 
   if (is_ios) {
-    build_libjpeg = false
-    enable_protobuf = false
+    rtc_build_libjpeg = false
+    rtc_enable_protobuf = false
   }
 
   if (cpu_arch == "arm") {
-    prefer_fixed_point = true
+    rtc_prefer_fixed_point = true
   }
 
   # WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and
   # Android, which is why we currently cannot use the variables in
   # //build/config/arm.gni (since it disables Neon for Android).
-  build_armv7_neon = (cpu_arch == "arm" && arm_version == 7)
+  rtc_build_armv7_neon = (cpu_arch == "arm" && arm_version == 7)
 }
diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn
index 6b5fe9d..f9bbd6a 100644
--- a/webrtc/common_audio/BUILD.gn
+++ b/webrtc/common_audio/BUILD.gn
@@ -170,7 +170,7 @@
   }
 }
 
-if (build_armv7_neon) {
+if (rtc_build_armv7_neon) {
   source_set("common_audio_neon") {
     sources = [
       "fir_filter_neon.cc",
@@ -199,7 +199,7 @@
     ]
 
     # Disable LTO in audio_processing_neon target due to compiler bug.
-    if (use_lto) {
+    if (rtc_use_lto) {
       cflags -= [
         "-flto",
         "-ffat-lto-objects",
diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn
index d432543..1b9ad8c 100644
--- a/webrtc/common_video/BUILD.gn
+++ b/webrtc/common_video/BUILD.gn
@@ -42,7 +42,7 @@
 
   deps = [ "../system_wrappers" ]
 
-  if (build_libyuv) {
+  if (rtc_build_libyuv) {
     deps += [ "//third_party/libyuv" ]
   } else {
     # Need to add a directory normally exported by libyuv.
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 6e5a4ef..8972ff9 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -102,7 +102,7 @@
     "../../system_wrappers",
   ]
 
-  if (include_opus) {
+  if (rtc_include_opus) {
     defines += [ "WEBRTC_CODEC_OPUS" ]
     deps += [ ":webrtc_opus" ]
   }
@@ -453,7 +453,7 @@
     "../../system_wrappers",
   ]
 
-  if (build_armv7_neon) {
+  if (rtc_build_armv7_neon) {
     deps += [ ":isac_neon" ]
 
     # Enable compilation for the ARM v7 Neon instruction set. This is needed
@@ -497,7 +497,7 @@
     }
   }
 
-  if (build_armv7_neon) {
+  if (rtc_build_armv7_neon) {
     sources += [
       "codecs/isac/fix/source/lattice_c.c",
       "codecs/isac/fix/source/pitch_estimator_c.c",
@@ -505,7 +505,7 @@
   }
 }
 
-if (build_armv7_neon) {
+if (rtc_build_armv7_neon) {
   source_set("isac_neon") {
     sources = [
       "codecs/isac/fix/source/entropy_coding_neon.c",
@@ -521,7 +521,7 @@
     ]
 
     # Disable LTO in audio_processing_neon target due to compiler bug.
-    if (use_lto) {
+    if (rtc_use_lto) {
       cflags -= [
         "-flto",
         "-ffat-lto-objects",
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index afc5885..60a83dc 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -55,7 +55,7 @@
   if (is_android) {
     include_dirs += [ "android" ]
   }
-  if (include_internal_audio_device) {
+  if (rtc_include_internal_audio_device) {
     sources += [
       "linux/alsasymboltable_linux.cc",
       "linux/alsasymboltable_linux.h",
@@ -118,7 +118,7 @@
         "X11",
       ]
 
-      if (include_pulse_audio) {
+      if (rtc_include_pulse_audio) {
         sources += [
           "linux/audio_device_pulse_linux.cc",
           "linux/audio_device_pulse_linux.h",
diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn
index 57b721b..950dfff 100644
--- a/webrtc/modules/audio_processing/BUILD.gn
+++ b/webrtc/modules/audio_processing/BUILD.gn
@@ -89,12 +89,12 @@
     defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
   }
 
-  if (enable_protobuf) {
+  if (rtc_enable_protobuf) {
     defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
     deps += [ ":audioproc_debug_proto" ]
   }
 
-  if (prefer_fixed_point) {
+  if (rtc_prefer_fixed_point) {
     defines += [ "WEBRTC_NS_FIXED" ]
     sources += [
       "ns/include/noise_suppression_x.h",
@@ -124,7 +124,7 @@
     deps += [ ":audio_processing_sse2" ]
   }
 
-  if (build_armv7_neon) {
+  if (rtc_build_armv7_neon) {
     deps += [ ":audio_processing_neon" ]
   }
 
@@ -159,7 +159,7 @@
   ]
 }
 
-if (enable_protobuf) {
+if (rtc_enable_protobuf) {
   proto_library("audioproc_debug_proto") {
     sources = [ "debug.proto" ]
 
@@ -180,7 +180,7 @@
   }
 }
 
-if (build_armv7_neon) {
+if (rtc_build_armv7_neon) {
   source_set("audio_processing_neon") {
     sources = [
       "aec/aec_core_neon.c",
@@ -217,7 +217,7 @@
     ]
 
     # Disable LTO in audio_processing_neon target due to compiler bug.
-    if (use_lto) {
+    if (rtc_use_lto) {
       cflags -= [
         "-flto",
         "-ffat-lto-objects",
diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn
index 9856d2d..ff32112 100644
--- a/webrtc/modules/utility/BUILD.gn
+++ b/webrtc/modules/utility/BUILD.gn
@@ -42,7 +42,7 @@
     "../audio_coding",
     "../media_file",
   ]
-  if (enable_video) {
+  if (rtc_enable_video) {
     sources += [
       "source/frame_scaler.cc",
       "source/video_coder.cc",
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn
index 9c314ae..7d6ddc0 100644
--- a/webrtc/modules/video_capture/BUILD.gn
+++ b/webrtc/modules/video_capture/BUILD.gn
@@ -35,7 +35,7 @@
   libs = []
   deps = []
 
-  if (include_internal_video_capture) {
+  if (rtc_include_internal_video_capture) {
     if (is_linux) {
       sources += [
         "linux/device_info_linux.cc",
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index 49df400..42d5d5c 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -137,7 +137,7 @@
     "../../common_video",
     "../../system_wrappers",
   ]
-#  if (build_libvpx) {
+#  if (rtc_build_libvpx) {
 #    deps += [
 #      "//third_party/libvpx",
 #    ]
diff --git a/webrtc/modules/video_render/BUILD.gn b/webrtc/modules/video_render/BUILD.gn
index fe9259c..2c14b54 100644
--- a/webrtc/modules/video_render/BUILD.gn
+++ b/webrtc/modules/video_render/BUILD.gn
@@ -35,7 +35,7 @@
   libs = []
   deps = []
 
-  if (include_internal_video_render) {
+  if (rtc_include_internal_video_render) {
     defines += [ "WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER" ]
 
     if (is_linux) {
diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn
index 5b51e6f..67c47545a 100644
--- a/webrtc/system_wrappers/BUILD.gn
+++ b/webrtc/system_wrappers/BUILD.gn
@@ -119,7 +119,7 @@
     ":system_wrappers_inherited_config",
   ]
 
-  if (enable_data_logging) {
+  if (rtc_enable_data_logging) {
     sources += [ "source/data_log.cc" ]
   } else {
     sources += [ "source/data_log_no_op.cc" ]