diff --git a/autobuild.xml b/autobuild.xml
index 7af52eea8296395b341db8876c5c1de6c539e8a4..98978ef06c720f682d98c5bd8169d5a7e2b65855 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1536,11 +1536,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>7fb5595afb2396aec2edc676e5621544</string>
+              <string>2d45b5e3157984fc38d9c57c0dacf89f</string>
               <key>hash_algorithm</key>
               <string>md5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/307532/arch/Darwin/installer/llceflib-1.3.1.307532-darwin-307532.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/307799/arch/Darwin/installer/llceflib-1.4.0.307799-darwin-307799.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1550,18 +1550,18 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>2b2bf3b2628b4412b37df8bf02776796</string>
+              <string>aa27060c311bf6e9e0f86fa5c5b25129</string>
               <key>hash_algorithm</key>
               <string>md5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/307532/arch/CYGWIN/installer/llceflib-1.3.1.307532-windows-307532.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llceflib_3p-llceflib/rev/307799/arch/CYGWIN/installer/llceflib-1.4.0.307799-windows-307799.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
         </map>
         <key>version</key>
-        <string>1.3.1.307532</string>
+        <string>1.4.0.307799</string>
       </map>
       <key>llphysicsextensions_source</key>
       <map>
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 1a3b6c511793283ae52122d6e9f1d4d021e6ebd5..86fc2dfff5d4fc06713e945e3b4356e4be106295 100755
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -166,6 +166,9 @@ if (LINUX)
       -pthread
       )
 
+  # force this platform to accept TOS via external browser
+  add_definitions(-DEXTERNAL_TOS)
+
   add_definitions(-DAPPID=secondlife)
   add_definitions(-fvisibility=hidden)
   # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work.  Sigh!  The viewer doesn't need to catch SIGCHLD anyway.
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt
index 16015be672ed082b2370a890470a3030d1a5ef38..1f6163e41e2227bce9b185704de7d0cf8d3b155f 100644
--- a/indra/media_plugins/cef/CMakeLists.txt
+++ b/indra/media_plugins/cef/CMakeLists.txt
@@ -61,7 +61,7 @@ set (media_plugin_cef_LINK_LIBRARIES
 if (LINUX)
   message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n"
     "  Please create a volume_catcher implementation for this platform.")
-    
+
 elseif (DARWIN)
   list(APPEND media_plugin_cef_SOURCE_FILES mac_volume_catcher.cpp)
   find_library(CORESERVICES_LIBRARY CoreServices)
@@ -98,7 +98,7 @@ if (WINDOWS)
   set_target_properties(
     media_plugin_cef
     PROPERTIES
-    LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
+    LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT"
     LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD"
     )
 endif (WINDOWS)
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index be69858d475f5bbf3745d148f09e97c9bade6486..60f6264db484f632b91dd2c29fcd58f0857e8a12 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -62,6 +62,7 @@ class MediaPluginCEF :
 	void onStatusMessageCallback(std::string value);
 	void onTitleChangeCallback(std::string title);
 	void onLoadStartCallback();
+	void onRequestExitCallback();
 	void onLoadEndCallback(int httpStatusCode);
 	void onAddressChangeCallback(std::string url);
 	void onNavigateURLCallback(std::string url, std::string target);
@@ -128,7 +129,6 @@ MediaPluginBase(host_send_func, host_user_data)
 //
 MediaPluginCEF::~MediaPluginCEF()
 {
-	mLLCEFLib->requestExit();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -199,6 +199,16 @@ void MediaPluginCEF::onLoadStartCallback()
 	sendMessage(message);
 }
 
+////////////////////////////////////////////////////////////////////////////////
+//
+void MediaPluginCEF::onRequestExitCallback()
+{
+	mLLCEFLib->shutdown();
+
+	LLPluginMessage message("base", "goodbye");
+	sendMessage(message);
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 //
 void MediaPluginCEF::onLoadEndCallback(int httpStatusCode)
@@ -344,8 +354,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
 			}
 			else if (message_name == "cleanup")
 			{
-                LLPluginMessage message("base", "goodbye");
-                sendMessage(message);
+				mLLCEFLib->requestExit();
 			}
 			else if (message_name == "shm_added")
 			{
@@ -401,6 +410,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
 				mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2));
 				mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4));
 				mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2));
+				mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this));
 
 				LLCEFLib::LLCEFLibSettings settings;
 				settings.initial_width = 1024;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5f378c64e8774aafd47965ebf815d00be92aa84d..6fac330db45551b9ef1967cc17a13f24c880f538 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2005,7 +2005,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
     <key>ChatBarCustomWidth</key>
     <map>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index dac610eda127027d3f14ccac6426eba6ea5e00ed..f7861fb4fd916f4886ba8e23ca3f0d54c7f1016e 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -108,6 +108,7 @@
 #include "llpluginclassmedia.h"
 #include "llteleporthistorystorage.h"
 #include "llproxy.h"
+#include "llweb.h"
 
 #include "lllogininstance.h"        // to check if logged in yet
 #include "llsdserialize.h"
@@ -1942,6 +1943,16 @@ BOOL LLPanelPreference::postBuild()
 		gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2));
 	}
 
+#ifdef EXTERNAL_TOS
+	LLRadioGroup* ext_browser_settings = getChild<LLRadioGroup>("preferred_browser_behavior");
+	if (ext_browser_settings)
+	{
+		// turn off ability to set external/internal browser
+		ext_browser_settings->setSelectedByValue(LLWeb::BROWSER_EXTERNAL_ONLY, true);
+		ext_browser_settings->setEnabled(false);
+	}
+#endif
+
 	apply();
 	return true;
 }
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index ae33acb8420449558df400bec79b19ce73632c47..4cb1ca6cc0d98cd49df9b8aa6f3de5556ec57640 100755
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -46,7 +46,6 @@
 #include "message.h"
 #include "llstartup.h"              // login_alert_done
 
-
 LLFloaterTOS::LLFloaterTOS(const LLSD& data)
 :	LLModalDialog( data["message"].asString() ),
 	mMessage(data["message"].asString()),
@@ -85,7 +84,7 @@ class LLIamHere : public LLHTTPClient::Responder
 	{
 		if ( mParent )
 		{
-			mParent->setSiteIsAlive( true );
+			mParent->setSiteIsAlive(true);
 		}
 	}
 
@@ -136,6 +135,20 @@ BOOL LLFloaterTOS::postBuild()
 	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
 	if ( web_browser )
 	{
+// if we are forced to send users to an external site in their system browser
+// (e.g.) Linux users because of lack of media support for HTML ToS page
+// remove exisiting UI and replace with a link to external page where users can accept ToS
+#ifdef EXTERNAL_TOS
+		LLTextBox* header = getChild<LLTextBox>("tos_heading");
+		if (header)
+			header->setVisible(false);
+
+		LLTextBox* external_prompt = getChild<LLTextBox>("external_tos_required");
+		if (external_prompt)
+			external_prompt->setVisible(true);
+
+		web_browser->setVisible(false);
+#else
 		web_browser->addObserver(this);
 
 		// Don't use the start_url parameter for this browser instance -- it may finish loading before we get to add our observer.
@@ -147,6 +160,7 @@ BOOL LLFloaterTOS::postBuild()
 			// All links from tos_html should be opened in external browser
 			media_plugin->setOverrideClickTarget("_external");
 		}
+#endif
 	}
 
 	return TRUE;
@@ -154,6 +168,13 @@ BOOL LLFloaterTOS::postBuild()
 
 void LLFloaterTOS::setSiteIsAlive( bool alive )
 {
+// if we are forced to send users to an external site in their system browser
+// (e.g.) Linux users because of lack of media support for HTML ToS page
+// force the regular HTML UI to deactivate so alternative is rendered instead.
+#ifdef EXTERNAL_TOS
+	mSiteAlive = false;
+#else
+
 	mSiteAlive = alive;
 	
 	// only do this for TOS pages
@@ -182,6 +203,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
 			tos_agreement->setEnabled( true );
 		}
 	}
+#endif
 }
 
 LLFloaterTOS::~LLFloaterTOS()
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 0be6e498342c70440b30e0574099337189979687..b37e41fb857429e0e2f8343f6b9eada2a52ea1a3 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -234,6 +234,9 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
 //static
 bool LLWeb::useExternalBrowser(const std::string &url)
 {
+#ifdef EXTERNAL_TOS
+	return true;
+#else
 	if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_EXTERNAL_ONLY)
 	{
 		return true;
@@ -250,4 +253,5 @@ bool LLWeb::useExternalBrowser(const std::string &url)
 		return !(boost::regex_search(uri_string, matches, pattern));
 	}
 	return false;
+#endif
 }
diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml
index af1617eb39d45690ce0e653033e60c26d4cf9939..c5313391c69d30b8c553c59a7aea16505748f4cf 100755
--- a/indra/newview/skins/default/xui/en/floater_tos.xml
+++ b/indra/newview/skins/default/xui/en/floater_tos.xml
@@ -57,6 +57,21 @@
      width="552">
         Please read the following Terms of Service and Privacy Policy carefully. To continue logging in to [SECOND_LIFE], you must accept the agreement.
     </text>
+     <text
+     type="string"
+     length="1"
+     follows="left|top"
+     font="SansSerif"
+     height="30"
+     layout="topleft"
+     left="16"
+     name="external_tos_required"
+     visible="false"
+     top="32"
+     word_wrap="true"
+     width="552">
+       To continue logging in to [SECOND_LIFE], you must accept the [https://id.secondlife.com/openid/login?return_to=https%3A%2F%2Fmy.secondlife.com%2Fopenid Terms of Service and Privacy Policy].
+     </text>
     <web_browser
       trusted_content="true" 
      follows="left|top"