diff --git a/AUTHORS b/AUTHORS
index 30d3e77..fa2bd86 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -411,6 +411,7 @@
 Max Perepelitsyn <pph34r@gmail.com>
 Max Vujovic <mvujovic@adobe.com>
 Mayur Kankanwadi <mayurk.vk@samsung.com>
+Md Sami Uddin <md.sami@samsung.com>
 Michael Gilbert <floppymaster@gmail.com>
 Michael Lopez <lopes92290@gmail.com>
 Michael Morrison <codebythepound@gmail.com>
diff --git a/DEPS b/DEPS
index ecf0866..f31f3619 100644
--- a/DEPS
+++ b/DEPS
@@ -43,7 +43,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': '0d7b8ac7973c9e48776047115603f554d1d0f1f6',
+  'v8_revision': '3a619fb51c61ba005e74d36c91e15c4c178c41b2',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling swarming_client
   # and whatever else without interference from each other.
@@ -225,7 +225,7 @@
    Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067',
 
   'src/third_party/webrtc':
-    Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '1f04dc934d5d70b68cc0b5ba87bbdb56f91457f7', # commit position 12756
+    Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'f9cd81c50d73a05c66c9d14ecf0c69788f6e7eaa', # commit position 12765
 
   'src/third_party/openmax_dl':
     Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' +  Var('openmax_dl_revision'),
diff --git a/ash/mus/BUILD.gn b/ash/mus/BUILD.gn
index 6b8a563..da25a6e 100644
--- a/ash/mus/BUILD.gn
+++ b/ash/mus/BUILD.gn
@@ -129,24 +129,3 @@
     "//ash/resources:ash_test_resources_200_percent",
   ]
 }
-
-source_set("unittests") {
-  testonly = true
-
-  sources = [
-    "shelf_delegate_mus_unittest.cc",
-  ]
-
-  deps = [
-    "//base",
-    "//components/mus/public/interfaces",
-    "//mash/shelf/public/interfaces",
-    "//mojo/public/cpp/bindings",
-    "//services/shell/public/cpp:shell_test_support",
-  ]
-
-  data_deps = [
-    "//mash/session",
-    ":mus",
-  ]
-}
diff --git a/ash/mus/shelf_delegate_mus_unittest.cc b/ash/mus/shelf_delegate_mus_unittest.cc
deleted file mode 100644
index 0a59fdeb..0000000
--- a/ash/mus/shelf_delegate_mus_unittest.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <memory>
-
-#include "base/bind.h"
-#include "base/command_line.h"
-#include "base/run_loop.h"
-#include "components/mus/public/interfaces/window_server_test.mojom.h"
-#include "mash/shelf/public/interfaces/shelf.mojom.h"
-#include "mojo/public/cpp/bindings/associated_binding.h"
-#include "services/shell/public/cpp/shell_test.h"
-
-namespace {
-
-class TestShelfObserver : public mash::shelf::mojom::ShelfObserver {
- public:
-  explicit TestShelfObserver(mash::shelf::mojom::ShelfControllerPtr* shelf)
-      : observer_binding_(this) {
-    mash::shelf::mojom::ShelfObserverAssociatedPtrInfo ptr_info;
-    observer_binding_.Bind(&ptr_info, shelf->associated_group());
-    (*shelf)->AddObserver(std::move(ptr_info));
-  }
-
-  ~TestShelfObserver() override {}
-
-  mash::shelf::mojom::Alignment alignment() const { return alignment_; }
-  mash::shelf::mojom::AutoHideBehavior auto_hide() const { return auto_hide_; }
-
-  void WaitForIncomingMethodCalls(size_t expected_calls) {
-    DCHECK_EQ(0u, expected_calls_);
-    expected_calls_ = expected_calls;
-    DCHECK(!run_loop_ || !run_loop_->running());
-    run_loop_.reset(new base::RunLoop());
-    run_loop_->Run();
-  }
-
- private:
-  void OnMethodCall() {
-    DCHECK_LT(0u, expected_calls_);
-    DCHECK(run_loop_->running());
-    expected_calls_--;
-    if (expected_calls_ == 0u)
-      run_loop_->Quit();
-  }
-
-  // mash::shelf::mojom::ShelfObserver:
-  void OnAlignmentChanged(mash::shelf::mojom::Alignment alignment) override {
-    alignment_ = alignment;
-    OnMethodCall();
-  }
-  void OnAutoHideBehaviorChanged(
-      mash::shelf::mojom::AutoHideBehavior auto_hide) override {
-    auto_hide_ = auto_hide;
-    OnMethodCall();
-  }
-
-  mojo::AssociatedBinding<mash::shelf::mojom::ShelfObserver> observer_binding_;
-
-  mash::shelf::mojom::Alignment alignment_ =
-      mash::shelf::mojom::Alignment::BOTTOM;
-  mash::shelf::mojom::AutoHideBehavior auto_hide_ =
-      mash::shelf::mojom::AutoHideBehavior::NEVER;
-
-  size_t expected_calls_ = 0u;
-  std::unique_ptr<base::RunLoop> run_loop_;
-
-  DISALLOW_COPY_AND_ASSIGN(TestShelfObserver);
-};
-
-}  // namespace
-
-namespace ash {
-namespace sysui {
-
-void RunCallback(bool* success, const base::Closure& callback, bool result) {
-  *success = result;
-  callback.Run();
-}
-
-class ShelfDelegateMusTest : public shell::test::ShellTest {
- public:
-  ShelfDelegateMusTest() : ShellTest("exe:mash_unittests") {}
-  ~ShelfDelegateMusTest() override {}
-
- private:
-  void SetUp() override {
-    base::CommandLine::ForCurrentProcess()->AppendSwitch("use-test-config");
-    ShellTest::SetUp();
-  }
-
-  DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMusTest);
-};
-
-TEST_F(ShelfDelegateMusTest, AshSysUIHasDrawnWindow) {
-  // mash_session embeds ash_sysui, which paints the shelf.
-  connector()->Connect("mojo:mash_session");
-  mus::mojom::WindowServerTestPtr test_interface;
-  connector()->ConnectToInterface("mojo:mus", &test_interface);
-  base::RunLoop run_loop;
-  bool drawn = false;
-  test_interface->EnsureClientHasDrawnWindow(
-      "mojo:ash_sysui",
-      base::Bind(&RunCallback, &drawn, run_loop.QuitClosure()));
-  run_loop.Run();
-  EXPECT_TRUE(drawn);
-}
-
-TEST_F(ShelfDelegateMusTest, ShelfControllerAndObserverBasic) {
-  connector()->Connect("mojo:mash_session");
-  mash::shelf::mojom::ShelfControllerPtr shelf_controller;
-  connector()->ConnectToInterface("mojo:ash_sysui", &shelf_controller);
-
-  // Adding the observer should fire state initialization function calls.
-  TestShelfObserver observer(&shelf_controller);
-  observer.WaitForIncomingMethodCalls(2u);
-  EXPECT_EQ(mash::shelf::mojom::Alignment::BOTTOM, observer.alignment());
-  EXPECT_EQ(mash::shelf::mojom::AutoHideBehavior::NEVER, observer.auto_hide());
-
-  shelf_controller->SetAlignment(mash::shelf::mojom::Alignment::LEFT);
-  observer.WaitForIncomingMethodCalls(1u);
-  EXPECT_EQ(mash::shelf::mojom::Alignment::LEFT, observer.alignment());
-
-  shelf_controller->SetAutoHideBehavior(
-      mash::shelf::mojom::AutoHideBehavior::ALWAYS);
-  observer.WaitForIncomingMethodCalls(1u);
-  EXPECT_EQ(mash::shelf::mojom::AutoHideBehavior::ALWAYS, observer.auto_hide());
-}
-
-}  // namespace sysui
-}  // namespace ash
diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc
index 67b5571..f875424 100644
--- a/ash/shell/lock_view.cc
+++ b/ash/shell/lock_view.cc
@@ -30,7 +30,6 @@
                                   this, base::ASCIIToUTF16("Unlock"))) {
     unlock_button_->SetStyle(views::Button::STYLE_BUTTON);
     AddChildView(unlock_button_);
-    views::Button::ConfigureDefaultFocus(unlock_button_);
   }
   ~LockView() override {}
 
diff --git a/ash/system/tray/tray_popup_header_button.cc b/ash/system/tray/tray_popup_header_button.cc
index 062c759..517788aa 100644
--- a/ash/system/tray/tray_popup_header_button.cc
+++ b/ash/system/tray/tray_popup_header_button.cc
@@ -36,7 +36,6 @@
                     views::ImageButton::ALIGN_MIDDLE);
   SetAccessibleName(bundle.GetLocalizedString(accessible_name_id));
   Button::ConfigureDefaultFocus(this);
-  set_request_focus_on_press(false);
 
   SetFocusPainter(views::Painter::CreateSolidFocusPainter(
                       kFocusBorderColor,
diff --git a/ash/system/tray/tray_popup_label_button.cc b/ash/system/tray/tray_popup_label_button.cc
index 02fa9544e6..2fea3bdc 100644
--- a/ash/system/tray/tray_popup_label_button.cc
+++ b/ash/system/tray/tray_popup_label_button.cc
@@ -17,7 +17,6 @@
     : views::LabelButton(listener, text) {
   SetBorder(std::unique_ptr<views::Border>(new TrayPopupLabelButtonBorder));
   Button::ConfigureDefaultFocus(this);
-  set_request_focus_on_press(false);
   set_animate_on_state_change(false);
   SetHorizontalAlignment(gfx::ALIGN_CENTER);
   SetFocusPainter(views::Painter::CreateSolidFocusPainter(
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc
index 312d5a3cb..f1eed28 100644
--- a/ash/system/user/user_view.cc
+++ b/ash/system/user/user_view.cc
@@ -405,8 +405,6 @@
     }
     auto* button =
         new ButtonFromView(contents_view, this, !user_index_, insets);
-    // A click on the button should not trigger a focus change.
-    button->set_request_focus_on_press(false);
     user_card_view_ = button;
     is_user_card_button_ = true;
   }
@@ -461,7 +459,6 @@
                                               add_user_enabled_ ? this : NULL,
                                               add_user_enabled_,
                                               gfx::Insets(1, 1, 1, 1));
-  button->set_request_focus_on_press(false);
   button->SetAccessibleName(
       l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT));
   button->ForceBorderVisible(true);
diff --git a/base/logging.h b/base/logging.h
index 36c9c6f..0476a44 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -453,11 +453,17 @@
 // Make all CHECK functions discard their log strings to reduce code
 // bloat, and improve performance, for official release builds.
 
-// TODO(akalin): This would be more valuable if there were some way to
-// remove BreakDebugger() from the backtrace, perhaps by turning it
-// into a macro (like __debugbreak() on Windows).
+#if defined(COMPILER_GCC) || __clang__
+#define LOGGING_CRASH() __builtin_trap()
+#else
+#define LOGGING_CRASH() ((void)(*(volatile char*)0 = 0))
+#endif
+
+// This is not calling BreakDebugger since this is called frequently, and
+// calling an out-of-line function instead of a noreturn inline macro prevents
+// compiler optimizations.
 #define CHECK(condition)                                                \
-  !(condition) ? ::base::debug::BreakDebugger() : EAT_STREAM_PARAMETERS
+  !(condition) ? LOGGING_CRASH() : EAT_STREAM_PARAMETERS
 
 #define PCHECK(condition) CHECK(condition)
 
diff --git a/base/numerics/safe_math_impl.h b/base/numerics/safe_math_impl.h
index 154e45b..508a21c 100644
--- a/base/numerics/safe_math_impl.h
+++ b/base/numerics/safe_math_impl.h
@@ -201,7 +201,8 @@
 CheckedMul(T x, T y, RangeConstraint* validity) {
   // If either side is zero then the result will be zero.
   if (!x || !y) {
-    return RANGE_VALID;
+    *validity = RANGE_VALID;
+    return static_cast<T>(0);
 
   } else if (x > 0) {
     if (y > 0)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 5429f9f..267c920f 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -501,14 +501,8 @@
       }
     } else if (current_cpu == "arm") {
       if (is_clang && !is_android && !is_nacl) {
-        cflags += [
-          "-target",
-          "arm-linux-gnueabihf",
-        ]
-        ldflags += [
-          "-target",
-          "arm-linux-gnueabihf",
-        ]
+        cflags += [ "--target=arm-linux-gnueabihf" ]
+        ldflags += [ "--target=arm-linux-gnueabihf" ]
       }
       if (!is_nacl) {
         cflags += [
@@ -530,14 +524,10 @@
       if (mips_arch_variant == "r6") {
         if (is_clang) {
           cflags += [
-            "-target",
-            "mipsel-linux-gnu",
+            "--target=mipsel-linux-gnu",
             "-march=mips32r6",
           ]
-          ldflags += [
-            "-target",
-            "mipsel-linux-gnu",
-          ]
+          ldflags += [ "--target=mipsel-linux-gnu" ]
         } else {
           cflags += [
             "-mips32r6",
@@ -554,26 +544,18 @@
         if (is_clang) {
           if (is_android) {
             cflags += [
-              "-target",
-              "mipsel-linux-android",
+              "--target=mipsel-linux-android",
               "-march=mipsel",
               "-mcpu=mips32r2",
             ]
-            ldflags += [
-              "-target",
-              "mipsel-linux-android",
-            ]
+            ldflags += [ "--target=mipsel-linux-android" ]
           } else {
             cflags += [
-              "-target",
-              "mipsel-linux-gnu",
+              "--target=mipsel-linux-gnu",
               "-march=mipsel",
               "-mcpu=mips32r2",
             ]
-            ldflags += [
-              "-target",
-              "mipsel-linux-gnu",
-            ]
+            ldflags += [ "--target=mipsel-linux-gnu" ]
           }
         } else {
           cflags += [
@@ -588,26 +570,18 @@
         if (is_clang) {
           if (is_android) {
             cflags += [
-              "-target",
-              "mipsel-linux-android",
+              "--target=mipsel-linux-android",
               "-march=mipsel",
               "-mcpu=mips32",
             ]
-            ldflags += [
-              "-target",
-              "mipsel-linux-android",
-            ]
+            ldflags += [ "--target=mipsel-linux-android" ]
           } else {
             cflags += [
-              "-target",
-              "mipsel-linux-gnu",
+              "--target=mipsel-linux-gnu",
               "-march=mipsel",
               "-mcpu=mips32",
             ]
-            ldflags += [
-              "-target",
-              "mipsel-linux-gnu",
-            ]
+            ldflags += [ "--target=mipsel-linux-gnu" ]
           }
         } else {
           cflags += [
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index 1012216..ddff24a 100755
--- a/build/vs_toolchain.py
+++ b/build/vs_toolchain.py
@@ -279,8 +279,12 @@
   """Load a list of SHA1s corresponding to the toolchains that we want installed
   to build with."""
   if GetVisualStudioVersion() == '2015':
-    # Update 2.
-    return ['95ddda401ec5678f15eeed01d2bee08fcbc5ee97']
+    if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN_PRERELEASE', '0'))):
+      # Update 3 pre-release, May 16th.
+      return ['283cc362f57dbe240e0d21f48ae45f9d834a425a']
+    else:
+      # Update 2.
+      return ['95ddda401ec5678f15eeed01d2bee08fcbc5ee97']
   else:
     return ['03a4e939cd325d6bc5216af41b92d02dda1366a6']
 
diff --git a/chrome/VERSION b/chrome/VERSION
index 6d1b0377..461a14a 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=52
 MINOR=0
-BUILD=2739
+BUILD=2740
 PATCH=0
diff --git a/chrome/android/java/res/layout/new_tab_page_snippets_card.xml b/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
index 4c9600d..2a0c6905 100644
--- a/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
+++ b/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
@@ -18,7 +18,7 @@
         android:layout_height="wrap_content"
         android:layout_alignParentStart="true"
         android:layout_toStartOf="@+id/article_thumbnail"
-        android:maxLines="2"
+        android:lines="2"
         android:ellipsize="end"
         android:textSize="16sp"
         android:textColor="@color/snippets_headline_text_color"
@@ -32,7 +32,7 @@
         android:layout_below="@+id/article_headline"
         android:layout_toStartOf="@+id/article_thumbnail"
         android:layout_marginTop="8dp"
-        android:maxLines="2"
+        android:lines="2"
         android:ellipsize="end"
         android:textSize="14sp"
         android:textColor="@color/snippets_text_color"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUndoController.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUndoController.java
index d1cba8580..6f4cfa9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUndoController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUndoController.java
@@ -18,7 +18,6 @@
 /**
  * Shows an undo bar when the user modifies bookmarks,
  * allowing them to undo their changes.
- * TODO(danduong): Add move undo
  */
 public class BookmarkUndoController extends BookmarkModelObserver implements
         SnackbarManager.SnackbarController, BookmarkDeleteObserver {
@@ -83,13 +82,14 @@
         if (!isUndoable) return;
 
         if (titles.length == 1) {
-            mSnackbarManager.showSnackbar(Snackbar.make(titles[0], this, Snackbar.TYPE_ACTION)
+            mSnackbarManager.showSnackbar(Snackbar
+                    .make(titles[0], this, Snackbar.TYPE_ACTION, Snackbar.UMA_BOOKMARK_DELETE_UNDO)
                     .setTemplateText(mContext.getString(R.string.undo_bar_delete_message))
                     .setAction(mContext.getString(R.string.undo), null));
         } else {
             mSnackbarManager.showSnackbar(
                     Snackbar.make(String.format(Locale.getDefault(), "%d", titles.length), this,
-                            Snackbar.TYPE_ACTION)
+                            Snackbar.TYPE_ACTION, Snackbar.UMA_BOOKMARK_DELETE_UNDO)
                     .setTemplateText(mContext.getString(R.string.undo_bar_multiple_delete_message))
                     .setAction(mContext.getString(R.string.undo), null));
         }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
index 16fd041..b00d830 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
@@ -83,7 +83,8 @@
 
                         @Override
                         public void onAction(Object actionData) { }
-                    }, Snackbar.TYPE_NOTIFICATION).setSingleLine(false);
+                    }, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_BOOKMARK_ADDED)
+                    .setSingleLine(false);
             RecordUserAction.record("EnhancedBookmarks.AddingFailed");
         } else {
             String folderName = bookmarkModel.getBookmarkTitle(
@@ -92,13 +93,14 @@
                     createSnackbarControllerForEditButton(activity, bookmarkId);
             if (getLastUsedParent(activity) == null) {
                 snackbar = Snackbar.make(activity.getString(R.string.bookmark_page_saved),
-                        snackbarController, Snackbar.TYPE_ACTION);
+                        snackbarController, Snackbar.TYPE_ACTION, Snackbar.UMA_BOOKMARK_ADDED);
             } else {
-                snackbar = Snackbar.make(folderName, snackbarController, Snackbar.TYPE_ACTION)
+                snackbar = Snackbar.make(folderName, snackbarController, Snackbar.TYPE_ACTION,
+                        Snackbar.UMA_BOOKMARK_ADDED)
                         .setTemplateText(activity.getString(R.string.bookmark_page_saved_folder));
             }
-            snackbar.setSingleLine(false).setAction(
-                    activity.getString(R.string.bookmark_item_edit), null);
+            snackbar.setSingleLine(false).setAction(activity.getString(R.string.bookmark_item_edit),
+                    null);
         }
         snackbarManager.showSnackbar(snackbar);
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSnackbarController.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSnackbarController.java
index e676700..2b721e6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSnackbarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadSnackbarController.java
@@ -55,7 +55,7 @@
         if (getSnackbarManager() == null) return;
         Snackbar snackbar = Snackbar.make(
                 mContext.getString(R.string.download_succeeded_message, downloadInfo.getFileName()),
-                this, Snackbar.TYPE_NOTIFICATION);
+                this, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DOWNLOAD_SUCCEEDED);
         // TODO(qinmin): Coalesce snackbars if multiple downloads finish at the same time.
         snackbar.setDuration(SNACKBAR_DURATION_IN_MILLISECONDS).setSingleLine(false);
         Pair<DownloadInfo, Long> actionData = null;
@@ -71,13 +71,15 @@
     /**
      * Called to display the download failed snackbar.
      *
-     * @param filename File name of the failed download.
-     * @param whether to show all downloads in case the failure is caused by duplicated files.
+     * @param errorMessage     The message to show on the snackbar.
+     * @param showAllDownloads Whether to show all downloads in case the failure is caused by
+     *                         duplicated files.
      */
     public void onDownloadFailed(String errorMessage, boolean showAllDownloads) {
         if (getSnackbarManager() == null) return;
         // TODO(qinmin): Coalesce snackbars if multiple downloads finish at the same time.
-        Snackbar snackbar = Snackbar.make(errorMessage, this, Snackbar.TYPE_NOTIFICATION)
+        Snackbar snackbar = Snackbar
+                .make(errorMessage, this, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DOWNLOAD_FAILED)
                 .setSingleLine(false)
                 .setDuration(SNACKBAR_DURATION_IN_MILLISECONDS);
         if (showAllDownloads) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index cb1833de..dd5607c1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -656,8 +656,10 @@
             };
         }
         Context context = mNewTabPageView.getContext();
-        Snackbar snackbar = Snackbar.make(context.getString(R.string.most_visited_item_removed),
-                mMostVisitedItemRemovedController, Snackbar.TYPE_ACTION)
+        Snackbar snackbar = Snackbar
+                .make(context.getString(R.string.most_visited_item_removed),
+                        mMostVisitedItemRemovedController, Snackbar.TYPE_ACTION,
+                        Snackbar.UMA_NTP_MOST_VISITED_DELETE_UNDO)
                 .setAction(context.getString(R.string.undo), url);
         mTab.getSnackbarManager().showSnackbar(snackbar);
     }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
index 03d2c2e..ae2073b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
@@ -64,7 +64,7 @@
      * Do not remove or change existing values other than NUM_SNIPPETS_ACTIONS. */
     @IntDef({SNIPPETS_ACTION_SHOWN, SNIPPETS_ACTION_SCROLLED, SNIPPETS_ACTION_CLICKED,
              SNIPPETS_ACTION_DISMISSED_OBSOLETE, SNIPPETS_ACTION_DISMISSED_VISITED,
-             SNIPPETS_ACTION_DISMISSED_UNVISITED})
+             SNIPPETS_ACTION_DISMISSED_UNVISITED, SNIPPETS_ACTION_SCROLLED_BELOW_THE_FOLD_ONCE})
     @Retention(RetentionPolicy.SOURCE)
     public @interface SnippetsAction {}
     /** Snippets are enabled and are being shown to the user. */
@@ -79,8 +79,10 @@
     public static final int SNIPPETS_ACTION_DISMISSED_VISITED = 4;
     /** A snippet has been swiped away, it had not been viewed by the user (on this device). */
     public static final int SNIPPETS_ACTION_DISMISSED_UNVISITED = 5;
+    /** The snippet list has been scrolled below the fold (once per NTP load). */
+    public static final int SNIPPETS_ACTION_SCROLLED_BELOW_THE_FOLD_ONCE = 6;
     /** The number of possible actions. */
-    private static final int NUM_SNIPPETS_ACTIONS = 6;
+    private static final int NUM_SNIPPETS_ACTIONS = 7;
 
     /**
      * Records an action taken by the user on the NTP.
@@ -164,4 +166,38 @@
         RecordHistogram.recordEnumeratedHistogram(
                 "Android.NTP.Impression", impressionType, NUM_NTP_IMPRESSION);
     }
+
+    /**
+     * Snap state representing which part of the NTP the user is reading.
+     */
+    public enum SnapState {
+        ABOVE_THE_FOLD,
+        BELOW_THE_FOLD,
+    }
+
+    /**
+     * Snap state observer that records UMA actions or histograms.
+     */
+    public static class SnapStateObserver {
+        private SnapState mSnapState = SnapState.ABOVE_THE_FOLD;
+        private boolean mEverBelowTheFold = false;
+
+        public void updateSnapState(SnapState state) {
+            if (state == mSnapState) return;
+            mSnapState = state;
+
+            switch (state) {
+                case ABOVE_THE_FOLD:
+                    RecordUserAction.record("MobileNTP.Snippets.ScrolledAboveTheFold");
+                    break;
+                case BELOW_THE_FOLD:
+                    RecordUserAction.record("MobileNTP.Snippets.ScrolledBelowTheFold");
+                    if (!mEverBelowTheFold) {
+                        mEverBelowTheFold = true;
+                        recordSnippetAction(SNIPPETS_ACTION_SCROLLED_BELOW_THE_FOLD_ONCE);
+                    }
+                    break;
+            }
+        }
+    }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
index f9ce390f..878d2cb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -560,15 +560,24 @@
      * the RecyclerView.
      */
     private void initializeSearchBoxRecyclerViewScrollHandling() {
+        final NewTabPageUma.SnapStateObserver snapStateObserver =
+                new NewTabPageUma.SnapStateObserver();
+
         final Runnable mSnapScrollRunnable = new Runnable() {
             @Override
             public void run() {
                 assert mPendingSnapScroll;
+                NewTabPageUma.SnapState currentSnapState = updateSnapScroll();
+                snapStateObserver.updateSnapState(currentSnapState);
+            }
 
+            private NewTabPageUma.SnapState updateSnapScroll() {
                 // These calculations only work if the first item is visible (since
                 // computeVerticalScrollOffset only takes into account visible items).
                 // Luckily, we only need to perform the calculations if the first item is visible.
-                if (!mRecyclerView.isFirstItemVisible()) return;
+                if (!mRecyclerView.isFirstItemVisible()) {
+                    return NewTabPageUma.SnapState.BELOW_THE_FOLD;
+                }
 
                 final int currentScroll = getVerticalScroll();
 
@@ -580,7 +589,9 @@
 
                 assert currentScroll >= 0;
                 // Do not do any scrolling if the user is currently viewing articles.
-                if (currentScroll > topOfSnippetsScroll) return;
+                if (currentScroll >= topOfSnippetsScroll) {
+                    return NewTabPageUma.SnapState.BELOW_THE_FOLD;
+                }
 
                 // If Most Likely is fully visible when we are scrolled to the top, we have two
                 // snap points: the Top and Articles.
@@ -591,6 +602,7 @@
                 int targetScroll;
                 // Set peeking card vertical scroll to be vertical scroll.
                 mPeekingCardVerticalScrollStart = 0;
+                NewTabPageUma.SnapState snapState = NewTabPageUma.SnapState.ABOVE_THE_FOLD;
                 if (currentScroll < mNewTabPageLayout.getHeight() / 3) {
                     // In either case, if in the top 1/3 of the original NTP, snap to the top.
                     targetScroll = 0;
@@ -603,9 +615,11 @@
                 } else {
                     // Otherwise, snap to the Articles.
                     targetScroll = topOfSnippetsScroll;
+                    snapState = NewTabPageUma.SnapState.BELOW_THE_FOLD;
                 }
                 mRecyclerView.smoothScrollBy(0, targetScroll - currentScroll);
                 mPendingSnapScroll = false;
+                return snapState;
             }
         };
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
index 0e9c488..7340571 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
@@ -164,9 +164,8 @@
         Log.d(TAG, "showReloadSnackbar called with controller " + snackbarController);
         Snackbar snackbar =
                 Snackbar.make(context.getString(R.string.offline_pages_viewing_offline_page),
-                                snackbarController, Snackbar.TYPE_ACTION)
-                        .setSingleLine(false)
-                        .setAction(context.getString(R.string.reload), tabId);
+                        snackbarController, Snackbar.TYPE_ACTION, Snackbar.UMA_OFFLINE_PAGE_RELOAD)
+                        .setSingleLine(false).setAction(context.getString(R.string.reload), tabId);
         snackbar.setDuration(SNACKBAR_DURATION);
         snackbarManager.showSnackbar(snackbar);
     }
@@ -239,7 +238,7 @@
         int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
         if (scale == 0) return 0;
 
-        int percentage = (int) Math.round(100 * level / (float) scale);
+        int percentage = Math.round(100 * level / (float) scale);
         Log.d(TAG, "Battery Percentage is " + percentage);
         return percentage;
     }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationSnackbarController.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationSnackbarController.java
index 4f96e52..b133ced 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationSnackbarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationSnackbarController.java
@@ -83,7 +83,8 @@
         int durationMs = DeviceClassManager.isAccessibilityModeEnabled(view.getContext())
                 ? ACCESSIBILITY_SNACKBAR_DURATION_MS : SNACKBAR_DURATION_MS;
         final GeolocationSnackbarController controller = new GeolocationSnackbarController();
-        final Snackbar snackbar = Snackbar.make(message, controller, Snackbar.TYPE_ACTION)
+        final Snackbar snackbar = Snackbar
+                .make(message, controller, Snackbar.TYPE_ACTION, Snackbar.UMA_OMNIBOX_GEOLOCATION)
                 .setAction(settings, view)
                 .setSingleLine(false)
                 .setDuration(durationMs);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/DataUseSnackbarController.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/DataUseSnackbarController.java
index bdd2248..f731e101 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/DataUseSnackbarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/DataUseSnackbarController.java
@@ -44,13 +44,14 @@
      */
     public void showDataUseTrackingStartedBar() {
         assert DataUseTabUIManager.shouldShowDataUseStartedUI();
-        mSnackbarManager.showSnackbar(
-                Snackbar.make(DataUseTabUIManager.getDataUseUIString(
-                                      DataUseUIMessage.DATA_USE_TRACKING_STARTED_SNACKBAR_MESSAGE),
-                                this, Snackbar.TYPE_NOTIFICATION)
-                        .setAction(DataUseTabUIManager.getDataUseUIString(
-                                           DataUseUIMessage.DATA_USE_TRACKING_SNACKBAR_ACTION),
-                                STARTED_SNACKBAR));
+        mSnackbarManager.showSnackbar(Snackbar
+                .make(DataUseTabUIManager.getDataUseUIString(
+                        DataUseUIMessage.DATA_USE_TRACKING_STARTED_SNACKBAR_MESSAGE), this,
+                        Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DATA_USE_STARTED)
+                .setAction(
+                        DataUseTabUIManager.getDataUseUIString(
+                                DataUseUIMessage.DATA_USE_TRACKING_SNACKBAR_ACTION),
+                        STARTED_SNACKBAR));
         DataUseTabUIManager.recordDataUseUIAction(DataUsageUIAction.STARTED_SNACKBAR_SHOWN);
     }
 
@@ -64,7 +65,7 @@
         mSnackbarManager.showSnackbar(
                 Snackbar.make(DataUseTabUIManager.getDataUseUIString(
                                       DataUseUIMessage.DATA_USE_TRACKING_ENDED_SNACKBAR_MESSAGE),
-                                this, Snackbar.TYPE_NOTIFICATION)
+                                this, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DATA_USE_ENDED)
                         .setAction(DataUseTabUIManager.getDataUseUIString(
                                            DataUseUIMessage.DATA_USE_TRACKING_SNACKBAR_ACTION),
                                 ENDED_SNACKBAR));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/LofiBarController.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/LofiBarController.java
index 5a5c4d0..5cdc5619 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/LofiBarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/LofiBarController.java
@@ -100,9 +100,10 @@
                 .getString(isPreview ? R.string.data_reduction_lo_fi_preview_snackbar_action
                         : R.string.data_reduction_lo_fi_snackbar_action);
 
-        mSnackbarManager.showSnackbar(Snackbar.make(message, this, Snackbar.TYPE_NOTIFICATION)
-                .setAction(buttonText, isPreview ? PREVIEW_SNACKBAR : LOFI_SNACKBAR)
-                .setDuration(DEFAULT_LO_FI_SNACKBAR_SHOW_DURATION_MS));
+        mSnackbarManager.showSnackbar(
+                Snackbar.make(message, this, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_LOFI)
+                        .setAction(buttonText, isPreview ? PREVIEW_SNACKBAR : LOFI_SNACKBAR)
+                        .setDuration(DEFAULT_LO_FI_SNACKBAR_SHOW_DURATION_MS));
         DataReductionProxySettings.getInstance().incrementLoFiSnackbarShown();
         DataReductionProxyUma.dataReductionProxyLoFiUIAction(
                 DataReductionProxyUma.ACTION_LOAD_IMAGES_SNACKBAR_SHOWN);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
index e67388e..a825e13 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
@@ -14,7 +14,7 @@
  * set*() methods, and show it using {@link SnackbarManager#showSnackbar(Snackbar)}. Example:
  *
  *   SnackbarManager.showSnackbar(
- *           Snackbar.make("Closed example.com", controller)
+ *           Snackbar.make("Closed example.com", controller, Snackbar.UMA_TAB_CLOSE_UNDO)
  *           .setAction("undo", actionData));
  */
 public class Snackbar {
@@ -31,6 +31,25 @@
      */
     public static final int TYPE_NOTIFICATION = 1;
 
+    /**
+     * UMA Identifiers of features using snackbar. See SnackbarIdentifier enum in histograms.
+     */
+    public static final int UMA_TEST_SNACKBAR = -2;
+    public static final int UMA_UNKNOWN = -1;
+    public static final int UMA_BOOKMARK_ADDED = 0;
+    public static final int UMA_BOOKMARK_DELETE_UNDO = 1;
+    public static final int UMA_NTP_MOST_VISITED_DELETE_UNDO = 2;
+    public static final int UMA_OFFLINE_PAGE_RELOAD = 3;
+    public static final int UMA_AUTO_LOGIN = 4;
+    public static final int UMA_OMNIBOX_GEOLOCATION = 5;
+    public static final int UMA_LOFI = 6;
+    public static final int UMA_DATA_USE_STARTED = 7;
+    public static final int UMA_DATA_USE_ENDED = 8;
+    public static final int UMA_DOWNLOAD_SUCCEEDED = 9;
+    public static final int UMA_DOWNLOAD_FAILED = 10;
+    public static final int UMA_TAB_CLOSE_UNDO = 11;
+    public static final int UMA_TAB_CLOSE_ALL_UNDO = 12;
+
     private SnackbarController mController;
     private CharSequence mText;
     private String mTemplateText;
@@ -41,18 +60,22 @@
     private int mDurationMs;
     private Bitmap mProfileImage;
     private int mType;
+    private int mIdentifier = UMA_UNKNOWN;
 
     // Prevent instantiation.
     private Snackbar() {}
 
     /**
-     * Creates and returns a snackbar to display the given text.
+     * Creates and returns a snackbar to display the given text. If this is a snackbar for a new
+     * feature shown to the user, please add the feature name to SnackbarIdentifier in histograms.
      *
      * @param text The text to show on the snackbar.
      * @param controller The SnackbarController to receive callbacks about the snackbar's state.
      * @param type Type of the snackbar. Either {@link #TYPE_ACTION} or {@link #TYPE_NOTIFICATION}.
+     * @param identifier The feature code of the snackbar. Should be one of the UMA* constants above
      */
-    public static Snackbar make(CharSequence text, SnackbarController controller, int type) {
+    public static Snackbar make(CharSequence text, SnackbarController controller, int type,
+            int identifier) {
         Snackbar s = new Snackbar();
         s.mText = text;
         s.mController = controller;
@@ -145,6 +168,10 @@
         return mDurationMs;
     }
 
+    int getIdentifier() {
+        return mIdentifier;
+    }
+
     /**
      * If method returns zero, then default color for snackbar will be used.
      */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java
index 8b7da80..78c1a27 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java
@@ -10,6 +10,7 @@
 import android.view.ViewGroup;
 
 import org.chromium.base.VisibleForTesting;
+import org.chromium.base.metrics.RecordHistogram;
 import org.chromium.chrome.browser.device.DeviceClassManager;
 
 /**
@@ -105,6 +106,8 @@
      */
     public void showSnackbar(Snackbar snackbar) {
         if (!mActivityInForeground || mIsDisabledForTesting) return;
+        RecordHistogram.recordSparseSlowlyHistogram("Snackbar.Shown", snackbar.getIdentifier());
+
         mSnackbars.add(snackbar);
         updateView();
         mView.announceforAccessibility();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java
index d5d0eaa..bc6f562d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java
@@ -38,7 +38,8 @@
         if (snackbarManager == null) return;
         AutoSigninSnackbarController snackbarController =
                 new AutoSigninSnackbarController(snackbarManager, tab);
-        Snackbar snackbar = Snackbar.make(text, snackbarController, Snackbar.TYPE_NOTIFICATION);
+        Snackbar snackbar = Snackbar.make(text, snackbarController, Snackbar.TYPE_NOTIFICATION,
+                Snackbar.UMA_AUTO_LOGIN);
         Resources resources = tab.getWindowAndroid().getActivity().get().getResources();
         int backgroundColor = ApiCompatibilityUtils.getColor(resources, R.color.light_active_color);
         Bitmap icon = BitmapFactory.decodeResource(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java
index a1d7bae7..2c087f4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java
@@ -127,9 +127,10 @@
                 mSnackbarManager.isShowing() ? TAB_CLOSE_UNDO_TOAST_SHOWN_WARM
                                              : TAB_CLOSE_UNDO_TOAST_SHOWN_COLD,
                 TAB_CLOSE_UNDO_TOAST_COUNT);
-        mSnackbarManager.showSnackbar(Snackbar.make(content, this, Snackbar.TYPE_ACTION)
-                .setTemplateText(mContext.getString(R.string.undo_bar_close_message))
-                .setAction(mContext.getString(R.string.undo), tabId));
+        mSnackbarManager.showSnackbar(
+                Snackbar.make(content, this, Snackbar.TYPE_ACTION, Snackbar.UMA_TAB_CLOSE_UNDO)
+                        .setTemplateText(mContext.getString(R.string.undo_bar_close_message))
+                        .setAction(mContext.getString(R.string.undo), tabId));
     }
 
     /**
@@ -142,7 +143,8 @@
      */
     private void showUndoCloseAllBar(List<Integer> closedTabIds) {
         String content = String.format(Locale.getDefault(), "%d", closedTabIds.size());
-        mSnackbarManager.showSnackbar(Snackbar.make(content, this, Snackbar.TYPE_ACTION)
+        mSnackbarManager.showSnackbar(
+                Snackbar.make(content, this, Snackbar.TYPE_ACTION, Snackbar.UMA_TAB_CLOSE_ALL_UNDO)
                 .setTemplateText(mContext.getString(R.string.undo_bar_close_all_message))
                 .setAction(mContext.getString(R.string.undo), closedTabIds));
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/snackbar/SnackbarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/snackbar/SnackbarTest.java
index 74ff937a..994838b 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/snackbar/SnackbarTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/snackbar/SnackbarTest.java
@@ -38,9 +38,9 @@
     @MediumTest
     public void testStackQueueOrder() throws InterruptedException {
         final Snackbar stackbar = Snackbar.make("stack", mDefaultController,
-                Snackbar.TYPE_ACTION);
+                Snackbar.TYPE_ACTION, Snackbar.UMA_TEST_SNACKBAR);
         final Snackbar queuebar = Snackbar.make("queue", mDefaultController,
-                Snackbar.TYPE_NOTIFICATION);
+                Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_TEST_SNACKBAR);
         ThreadUtils.runOnUiThread(new Runnable() {
             @Override
             public void run() {
@@ -79,9 +79,9 @@
     @SmallTest
     public void testQueueStackOrder() throws InterruptedException {
         final Snackbar stackbar = Snackbar.make("stack", mDefaultController,
-                Snackbar.TYPE_ACTION);
+                Snackbar.TYPE_ACTION, Snackbar.UMA_TEST_SNACKBAR);
         final Snackbar queuebar = Snackbar.make("queue", mDefaultController,
-                Snackbar.TYPE_NOTIFICATION);
+                Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_TEST_SNACKBAR);
         ThreadUtils.runOnUiThread(new Runnable() {
             @Override
             public void run() {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/snackbar/SnackbarCollectionUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/snackbar/SnackbarCollectionUnitTest.java
index 87d678c0..a2f45be 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/snackbar/SnackbarCollectionUnitTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/snackbar/SnackbarCollectionUnitTest.java
@@ -147,11 +147,13 @@
     }
 
     private Snackbar makeActionSnackbar(SnackbarController controller) {
-        return Snackbar.make(ACTION_TITLE, controller, Snackbar.TYPE_ACTION);
+        return Snackbar.make(ACTION_TITLE, controller, Snackbar.TYPE_ACTION,
+                Snackbar.UMA_TEST_SNACKBAR);
     }
 
     private Snackbar makeNotificationSnackbar(SnackbarController controller) {
-        return Snackbar.make(NOTIFICATION_TITLE, controller, Snackbar.TYPE_NOTIFICATION);
+        return Snackbar.make(NOTIFICATION_TITLE, controller, Snackbar.TYPE_NOTIFICATION,
+                Snackbar.UMA_TEST_SNACKBAR);
     }
 
     private Snackbar makeActionSnackbar() {
diff --git a/chrome/app/delay_load_hook_win.cc b/chrome/app/delay_load_hook_win.cc
index 52384d41..fdbf540 100644
--- a/chrome/app/delay_load_hook_win.cc
+++ b/chrome/app/delay_load_hook_win.cc
@@ -16,8 +16,18 @@
 // Alternatively referencing the ChromeDelayLoadHook function somehow will
 // cause this declaration of these variables to take preference to the delay
 // load runtime's defaults (in delayimp.lib).
+#if _MSC_FULL_VER >= 190024112
+// Prior to Visual Studio 2015 Update 3, these hooks were non-const.  They were
+// made const to improve security (global, writable function pointers are bad).
+// This #ifdef is needed for testing of VS 2015 Update 3 pre-release and can be
+// removed when we formally switch to Update 3 or higher.
+// TODO(612313): remove the #if when we update toolchains.
+const PfnDliHook __pfnDliNotifyHook2 = ChromeDelayLoadHook;
+const PfnDliHook __pfnDliFailureHook2 = ChromeDelayLoadHook;
+#else
 PfnDliHook __pfnDliNotifyHook2 = ChromeDelayLoadHook;
 PfnDliHook __pfnDliFailureHook2 = ChromeDelayLoadHook;
+#endif
 
 
 namespace {
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 13393e94..ff2f1d1 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -469,8 +469,8 @@
       <message name="IDS_MD_HISTORY_HISTORY_MENU_ITEM" desc="Label displayed in history sidebar button to display history.">
         History
       </message>
-      <message name="IDS_MD_HISTORY_OPEN_TABS_MENU_ITEM" desc="Label displayed in history sidebar button to display open tabs.">
-        Open tabs
+      <message name="IDS_MD_HISTORY_OPEN_TABS_MENU_ITEM" desc="Label displayed in history sidebar button to display synced tabs from other devices.">
+        Synced tabs
       </message>
 
       <!-- Generic terms -->
diff --git a/chrome/app/settings_chromium_strings.grdp b/chrome/app/settings_chromium_strings.grdp
index 67df9f181..542328f 100644
--- a/chrome/app/settings_chromium_strings.grdp
+++ b/chrome/app/settings_chromium_strings.grdp
@@ -5,6 +5,16 @@
   <message name="IDS_SETTINGS_ABOUT_PROGRAM" desc="Menu title for the About Chromium page.">
     About Chromium
   </message>
+  <if expr="not chromeos">
+    <message name="IDS_SETTINGS_GET_HELP_USING_CHROME" desc="Text of the button which takes the user to the Chrome help page.">
+      Get help with Chromium
+    </message>
+  </if>
+  <if expr="chromeos">
+    <message name="IDS_SETTINGS_GET_HELP_USING_CHROME" desc="Text of the button which takes the user to the Chrome help page.">
+      Get help with Chromium OS
+    </message>
+  </if>
 
   <!-- Default Browser Page -->
   <if expr="not chromeos">
diff --git a/chrome/app/settings_google_chrome_strings.grdp b/chrome/app/settings_google_chrome_strings.grdp
index 0233846..339832e 100644
--- a/chrome/app/settings_google_chrome_strings.grdp
+++ b/chrome/app/settings_google_chrome_strings.grdp
@@ -12,6 +12,16 @@
       About Chrome
     </message>
   </if>
+  <if expr="not chromeos">
+    <message name="IDS_SETTINGS_GET_HELP_USING_CHROME" desc="Text of the button which takes the user to the Chrome help page.">
+      Get help with Chrome
+    </message>
+  </if>
+  <if expr="chromeos">
+    <message name="IDS_SETTINGS_GET_HELP_USING_CHROME" desc="Text of the button which takes the user to the Chrome help page.">
+      Get help with Chrome OS
+    </message>
+  </if>
 
   <!-- Default Browser Page -->
   <if expr="not chromeos">
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp
index 5086b29..b742b96a 100644
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -16,6 +16,11 @@
       Currently on <ph name="CHANNEL_NAME">$1<ex>stable</ex></ph>
     </message>
   </if>
+  <if expr="_google_chrome">
+    <message name="IDS_SETTINGS_ABOUT_PAGE_REPORT_AN_ISSUE" desc="Text of the button which allows the user to report an issue with Chrome.">
+      Report an issue
+    </message>
+  </if>
 
   <!-- Policy Indicators -->
   <message name="IDS_SETTINGS_CONTROLLED_SETTING_EXTENSION" desc="Text displayed in the controlled settings indicator tooltip when a setting's value is enforced by an extension.">
@@ -155,6 +160,24 @@
   <message name="IDS_SETTINGS_AUTOFILL" desc="Name for the autofill section and toggle.">
     Autofill settings
   </message>
+  <message name="IDS_SETTINGS_AUTOFILL_ADDRESSES_HEADING" desc="Title for the list of addresses that chrome has saved for use in filling in forms.">
+    Addresses
+  </message>
+  <message name="IDS_SETTINGS_AUTOFILL_ADD_ADDRESS_BUTTON" desc="Label for a button that allows a user to enter a new address that can be used to fill in forms.">
+    Add address
+  </message>
+  <message name="IDS_SETTINGS_AUTOFILL_CREDIT_CARD_HEADING" desc="Title for the list of saved passwords that can be used to fill in forms.">
+    Credit cards
+  </message>
+  <message name="IDS_SETTINGS_AUTOFILL_ADD_CREDIT_CARD_BUTTON" desc="Label for a button that allows a user to enter new credit card information that can be used to fill in forms.">
+    Add credit card
+  </message>
+  <message name="IDS_SETTINGS_AUTOFILL_CREDIT_CARD_TYPE_COLUMN_LABEL" desc="Label for the column containing the type of credit card that is saved. The type is in the format: `Visa ****1234`.">
+    Type
+  </message>
+  <message name="IDS_SETTINGS_AUTOFILL_CREDIT_CARD_EXPIRATION_COLUMN_LABEL" desc="Label for the heading containing the expiration date for the credit card that has been saved.">
+    Expiration date
+  </message>
   <message name="IDS_SETTINGS_AUTOFILL_DETAIL" desc="Description of what toggling the 'Autofill' setting does. Immediately underneath IDS_SETTINGS_AUTOFILL">
     Enable Autofill to fill out forms in a single click
   </message>
@@ -195,7 +218,7 @@
     Password
   </message>
   <message name="IDS_SETTINGS_PASSWORDS_MANAGE_PASSWORDS" desc="Shown in the passwords section of settings. Descriptive text to inform that passwords can be accessed online. Has a link.">
-    Access your passwords from any device at <ph name="BEGIN_LINK">&lt;a href="$1" target="_blank"&gt;</ph>passwords.google.com<ph name="END_LINK">&lt;/a&gt;</ph>
+    Access your passwords from any device at <ph name="BEGIN_LINK">&lt;a is="action-link" href="$1" target="_blank"&gt;</ph>passwords.google.com<ph name="END_LINK">&lt;/a&gt;</ph>
   </message>
 
   <!-- Default Browser Page -->
diff --git a/chrome/browser/chrome_browser_main_extra_parts_x11.cc b/chrome/browser/chrome_browser_main_extra_parts_x11.cc
index 993f4f97..13ff1f0f 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_x11.cc
+++ b/chrome/browser/chrome_browser_main_extra_parts_x11.cc
@@ -5,15 +5,19 @@
 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h"
 
 #include "base/bind.h"
+#include "base/command_line.h"
 #include "base/debug/debugger.h"
 #include "base/location.h"
 #include "base/sequenced_task_runner.h"
+#include "base/strings/string_number_conversions.h"
 #include "base/threading/sequenced_task_runner_handle.h"
 #include "chrome/browser/lifetime/application_lifetime.h"
 #include "chrome/common/chrome_result_codes.h"
+#include "chrome/common/chrome_switches.h"
 #include "content/public/browser/browser_thread.h"
 #include "ui/base/x/x11_util.h"
 #include "ui/base/x/x11_util_internal.h"
+#include "ui/events/platform/x11/x11_event_source.h"
 
 using content::BrowserThread;
 
@@ -93,6 +97,17 @@
   // main message loop has started. This will allow us to exit cleanly
   // if X exits before us.
   ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
+
+#if !defined(OS_CHROMEOS)
+  // Get a timestamp from the X server.  This makes our requests to the server
+  // less likely to be thrown away by the window manager.  Put the timestamp in
+  // a command line flag so we can forward it to an existing browser process if
+  // necessary.
+  base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+      switches::kWmUserTimeMs,
+      base::Uint64ToString(
+          ui::X11EventSource::GetInstance()->UpdateLastSeenServerTime()));
+#endif
 }
 
 void ChromeBrowserMainExtraPartsX11::PostMainMessageLoopRun() {
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc
index 2b414b7b..a13acb9 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.cc
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -1110,6 +1110,7 @@
     // Password visible button.
     passphrase_visible_button_ = new views::ToggleImageButton(this);
     views::Button::ConfigureDefaultFocus(passphrase_visible_button_);
+    passphrase_visible_button_->set_request_focus_on_press(true);
     passphrase_visible_button_->SetTooltipText(
         l10n_util::GetStringUTF16(
             IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE_SHOW));
diff --git a/chrome/browser/chromeos/options/wimax_config_view.cc b/chrome/browser/chromeos/options/wimax_config_view.cc
index 1399118c..d4d61072 100644
--- a/chrome/browser/chromeos/options/wimax_config_view.cc
+++ b/chrome/browser/chromeos/options/wimax_config_view.cc
@@ -270,6 +270,7 @@
     // Password visible button.
     passphrase_visible_button_ = new views::ToggleImageButton(this);
     views::Button::ConfigureDefaultFocus(passphrase_visible_button_);
+    passphrase_visible_button_->set_request_focus_on_press(true);
     passphrase_visible_button_->SetTooltipText(
         l10n_util::GetStringUTF16(
             IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE_SHOW));
diff --git a/chrome/browser/download/download_danger_prompt.cc b/chrome/browser/download/download_danger_prompt.cc
index f5b2e8f4..15deee4 100644
--- a/chrome/browser/download/download_danger_prompt.cc
+++ b/chrome/browser/download/download_danger_prompt.cc
@@ -4,30 +4,16 @@
 
 #include "chrome/browser/download/download_danger_prompt.h"
 
-#include "base/bind.h"
 #include "base/macros.h"
 #include "base/metrics/sparse_histogram.h"
 #include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/browser_process.h"
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/download/chrome_download_manager_delegate.h"
-#include "chrome/browser/download/download_stats.h"
-#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
-#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
-#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
 #include "chrome/common/safe_browsing/csd.pb.h"
 #include "chrome/common/safe_browsing/download_protection_util.h"
-#include "chrome/grit/chromium_strings.h"
-#include "chrome/grit/generated_resources.h"
-#include "content/public/browser/browser_context.h"
 #include "content/public/browser/download_danger_type.h"
 #include "content/public/browser/download_item.h"
-#include "grit/components_strings.h"
-#include "ui/base/l10n/l10n_util.h"
 
-using extensions::ExperienceSamplingEvent;
 using safe_browsing::ClientDownloadResponse;
 using safe_browsing::ClientSafeBrowsingReportRequest;
 using safe_browsing::download_protection_util::
@@ -37,239 +23,6 @@
 
 const char kDownloadDangerPromptPrefix[] = "Download.DownloadDangerPrompt";
 
-// TODO(wittman): Create a native web contents modal dialog implementation of
-// this dialog for non-Views platforms, to support bold formatting of the
-// message lead.
-
-// Implements DownloadDangerPrompt using a TabModalConfirmDialog.
-class DownloadDangerPromptImpl : public DownloadDangerPrompt,
-                                 public content::DownloadItem::Observer,
-                                 public TabModalConfirmDialogDelegate {
- public:
-  DownloadDangerPromptImpl(content::DownloadItem* item,
-                           content::WebContents* web_contents,
-                           bool show_context,
-                           const OnDone& done);
-  ~DownloadDangerPromptImpl() override;
-
-  // DownloadDangerPrompt:
-  void InvokeActionForTesting(Action action) override;
-
- private:
-  // content::DownloadItem::Observer:
-  void OnDownloadUpdated(content::DownloadItem* download) override;
-
-  // TabModalConfirmDialogDelegate:
-  base::string16 GetTitle() override;
-  base::string16 GetDialogMessage() override;
-  base::string16 GetAcceptButtonTitle() override;
-  base::string16 GetCancelButtonTitle() override;
-  void OnAccepted() override;
-  void OnCanceled() override;
-  void OnClosed() override;
-
-  void RunDone(Action action);
-
-  content::DownloadItem* download_;
-  bool show_context_;
-  OnDone done_;
-
-  std::unique_ptr<ExperienceSamplingEvent> sampling_event_;
-
-  DISALLOW_COPY_AND_ASSIGN(DownloadDangerPromptImpl);
-};
-
-DownloadDangerPromptImpl::DownloadDangerPromptImpl(
-    content::DownloadItem* download,
-    content::WebContents* web_contents,
-    bool show_context,
-    const OnDone& done)
-    : TabModalConfirmDialogDelegate(web_contents),
-      download_(download),
-      show_context_(show_context),
-      done_(done) {
-  DCHECK(!done_.is_null());
-  download_->AddObserver(this);
-  RecordOpenedDangerousConfirmDialog(download_->GetDangerType());
-
-  // ExperienceSampling: A malicious download warning is being shown to the
-  // user, so we start a new SamplingEvent and track it.
-  sampling_event_.reset(new ExperienceSamplingEvent(
-      ExperienceSamplingEvent::kDownloadDangerPrompt, download->GetURL(),
-      download->GetReferrerUrl(), download->GetBrowserContext()));
-}
-
-DownloadDangerPromptImpl::~DownloadDangerPromptImpl() {
-  // |this| might be deleted without invoking any callbacks. E.g. pressing Esc
-  // on GTK or if the user navigates away from the page showing the prompt.
-  RunDone(DISMISS);
-}
-
-void DownloadDangerPromptImpl::InvokeActionForTesting(Action action) {
-  switch (action) {
-    case ACCEPT:
-      Accept();
-      break;
-    case CANCEL:
-      Cancel();
-      break;
-    case DISMISS:
-      RunDone(DISMISS);
-      Cancel();
-      break;
-  }
-}
-
-void DownloadDangerPromptImpl::OnDownloadUpdated(
-    content::DownloadItem* download) {
-  // If the download is nolonger dangerous (accepted externally) or the download
-  // is in a terminal state, then the download danger prompt is no longer
-  // necessary.
-  if (!download->IsDangerous() || download->IsDone()) {
-    RunDone(DISMISS);
-    Cancel();
-  }
-}
-
-base::string16 DownloadDangerPromptImpl::GetTitle() {
-  if (show_context_)
-    return l10n_util::GetStringUTF16(IDS_CONFIRM_KEEP_DANGEROUS_DOWNLOAD_TITLE);
-  switch (download_->GetDangerType()) {
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
-    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
-      return l10n_util::GetStringUTF16(
-          IDS_RESTORE_KEEP_DANGEROUS_DOWNLOAD_TITLE);
-    }
-    default: {
-      return l10n_util::GetStringUTF16(
-          IDS_CONFIRM_KEEP_DANGEROUS_DOWNLOAD_TITLE);
-    }
-  }
-}
-
-base::string16 DownloadDangerPromptImpl::GetDialogMessage() {
-  if (show_context_) {
-    switch (download_->GetDangerType()) {
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: {
-        return l10n_util::GetStringFUTF16(
-            IDS_PROMPT_DANGEROUS_DOWNLOAD,
-            download_->GetFileNameToReportUser().LossyDisplayName());
-      }
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:  // Fall through
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: {
-        return l10n_util::GetStringFUTF16(
-            IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT,
-            download_->GetFileNameToReportUser().LossyDisplayName());
-      }
-      case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: {
-        return l10n_util::GetStringFUTF16(
-            IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT,
-            download_->GetFileNameToReportUser().LossyDisplayName());
-      }
-      case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
-        return l10n_util::GetStringFUTF16(
-            IDS_PROMPT_DOWNLOAD_CHANGES_SETTINGS,
-            download_->GetFileNameToReportUser().LossyDisplayName());
-      }
-      case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
-      case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT:
-      case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED:
-      case content::DOWNLOAD_DANGER_TYPE_MAX: {
-        break;
-      }
-    }
-  } else {
-    switch (download_->GetDangerType()) {
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
-      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: {
-        return l10n_util::GetStringUTF16(
-                   IDS_PROMPT_CONFIRM_KEEP_MALICIOUS_DOWNLOAD_LEAD) +
-               base::ASCIIToUTF16("\n\n") +
-               l10n_util::GetStringUTF16(
-                   IDS_PROMPT_CONFIRM_KEEP_MALICIOUS_DOWNLOAD_BODY);
-      }
-      default: {
-        return l10n_util::GetStringUTF16(
-            IDS_PROMPT_CONFIRM_KEEP_DANGEROUS_DOWNLOAD);
-      }
-    }
-  }
-  NOTREACHED();
-  return base::string16();
-}
-
-base::string16 DownloadDangerPromptImpl::GetAcceptButtonTitle() {
-  if (show_context_)
-    return l10n_util::GetStringUTF16(IDS_CONFIRM_DOWNLOAD);
-  switch (download_->GetDangerType()) {
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
-    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
-      return l10n_util::GetStringUTF16(IDS_CONFIRM_DOWNLOAD_AGAIN_MALICIOUS);
-    }
-    default:
-      return l10n_util::GetStringUTF16(IDS_CONFIRM_DOWNLOAD_AGAIN);
-  }
-}
-
-base::string16 DownloadDangerPromptImpl::GetCancelButtonTitle() {
-  if (show_context_)
-    return l10n_util::GetStringUTF16(IDS_CANCEL);
-  switch (download_->GetDangerType()) {
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
-    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
-    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
-      return l10n_util::GetStringUTF16(IDS_CONFIRM_CANCEL_AGAIN_MALICIOUS);
-    }
-    default:
-      return l10n_util::GetStringUTF16(IDS_CANCEL);
-  }
-}
-
-void DownloadDangerPromptImpl::OnAccepted() {
-  // ExperienceSampling: User proceeded through the warning.
-  sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kProceed);
-  RunDone(ACCEPT);
-}
-
-void DownloadDangerPromptImpl::OnCanceled() {
-  // ExperienceSampling: User canceled the warning.
-  sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
-  RunDone(CANCEL);
-}
-
-void DownloadDangerPromptImpl::OnClosed() {
-  // ExperienceSampling: User canceled the warning.
-  sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
-  RunDone(DISMISS);
-}
-
-void DownloadDangerPromptImpl::RunDone(Action action) {
-  // Invoking the callback can cause the download item state to change or cause
-  // the constrained window to close, and |callback| refers to a member
-  // variable.
-  OnDone done = done_;
-  done_.Reset();
-  if (download_ != NULL) {
-    const bool accept = action == DownloadDangerPrompt::ACCEPT;
-    RecordDownloadDangerPrompt(accept, *download_);
-    if (!download_->GetURL().is_empty() &&
-        !download_->GetBrowserContext()->IsOffTheRecord()) {
-      SendSafeBrowsingDownloadRecoveryReport(accept, *download_);
-    }
-    download_->RemoveObserver(this);
-    download_ = NULL;
-  }
-  if (!done.is_null())
-    done.Run(action);
-}
-
 // Converts DownloadDangerType into their corresponding string.
 const char* GetDangerTypeString(
     const content::DownloadDangerType& danger_type) {
@@ -298,21 +51,6 @@
 
 }  // namespace
 
-#if !defined(USE_AURA)
-// static
-DownloadDangerPrompt* DownloadDangerPrompt::Create(
-    content::DownloadItem* item,
-    content::WebContents* web_contents,
-    bool show_context,
-    const OnDone& done) {
-  DownloadDangerPromptImpl* prompt =
-      new DownloadDangerPromptImpl(item, web_contents, show_context, done);
-  // |prompt| will be deleted when the dialog is done.
-  TabModalConfirmDialog::Create(prompt, web_contents);
-  return prompt;
-}
-#endif
-
 void DownloadDangerPrompt::SendSafeBrowsingDownloadRecoveryReport(
     bool did_proceed,
     const content::DownloadItem& download) {
diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
index 2a47b7a..cad1ee66 100644
--- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
+++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
@@ -56,8 +56,6 @@
     "PageLoad.Timing2.NavigationToFirstImagePaint";
 const char kHistogramFirstContentfulPaint[] =
     "PageLoad.Timing2.NavigationToFirstContentfulPaint";
-const char kHistogramFirstContentfulPaintImmediate[] =
-    "PageLoad.Timing2.NavigationToFirstContentfulPaint.Immediate";
 const char kHistogramDomLoadingToFirstContentfulPaint[] =
     "PageLoad.Timing2.DOMLoadingToFirstContentfulPaint";
 const char kHistogramParseDuration[] = "PageLoad.Timing2.ParseDuration";
@@ -101,6 +99,60 @@
         "PageLoad.Timing2.ParseBlockedOnScriptLoadFromDocumentWrite."
         "ParseComplete.Background";
 
+// Immediate histogram variants, which are logged as soon as the associated
+// event is observed. These will eventually become our standard metrics, and the
+// Timing2 variants will be deprecated in M54.
+const char kHistogramDomContentLoadedImmediate[] =
+    "PageLoad.DocumentTiming.NavigationToDOMContentLoadedEventFired";
+const char kBackgroundHistogramDomContentLoadedImmediate[] =
+    "PageLoad.DocumentTiming.NavigationToDOMContentLoadedEventFired.Background";
+const char kHistogramLoadImmediate[] =
+    "PageLoad.DocumentTiming.NavigationToLoadEventFired";
+const char kBackgroundHistogramLoadImmediate[] =
+    "PageLoad.DocumentTiming.NavigationToLoadEventFired.Background";
+const char kHistogramFirstLayoutImmediate[] =
+    "PageLoad.DocumentTiming.NavigationToFirstLayout";
+const char kBackgroundHistogramFirstLayoutImmediate[] =
+    "PageLoad.DocumentTiming.NavigationToFirstLayout.Background";
+const char kHistogramFirstPaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstPaint";
+const char kBackgroundHistogramFirstPaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstPaint.Background";
+const char kHistogramFirstTextPaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstTextPaint";
+const char kBackgroundHistogramFirstTextPaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstTextPaint.Background";
+const char kHistogramFirstImagePaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstImagePaint";
+const char kBackgroundHistogramFirstImagePaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstImagePaint.Background";
+const char kHistogramFirstContentfulPaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstContentfulPaint";
+const char kBackgroundHistogramFirstContentfulPaintImmediate[] =
+    "PageLoad.PaintTiming.NavigationToFirstContentfulPaint.Background";
+const char kHistogramParseStartToFirstContentfulPaintImmediate[] =
+    "PageLoad.PaintTiming.ParseStartToFirstContentfulPaint";
+const char kBackgroundHistogramParseStartToFirstContentfulPaintImmediate[] =
+    "PageLoad.PaintTiming.ParseStartToFirstContentfulPaint.Background";
+const char kHistogramParseStartImmediate[] =
+    "PageLoad.ParseTiming.NavigationToParseStart";
+const char kBackgroundHistogramParseStartImmediate[] =
+    "PageLoad.ParseTiming.NavigationToParseStart.Background";
+const char kHistogramParseDurationImmediate[] =
+    "PageLoad.ParseTiming.ParseDuration";
+const char kBackgroundHistogramParseDurationImmediate[] =
+    "PageLoad.ParseTiming.ParseDuration.Background";
+const char kHistogramParseBlockedOnScriptLoadImmediate[] =
+    "PageLoad.ParseTiming.ParseBlockedOnScriptLoad";
+const char kBackgroundHistogramParseBlockedOnScriptLoadImmediate[] =
+    "PageLoad.ParseTiming.ParseBlockedOnScriptLoad.Background";
+const char kHistogramParseBlockedOnScriptLoadDocumentWriteImmediate[] =
+    "PageLoad.ParseTiming.ParseBlockedOnScriptLoadFromDocumentWrite";
+const char
+    kBackgroundHistogramParseBlockedOnScriptLoadDocumentWriteImmediate[] =
+        "PageLoad.ParseTiming.ParseBlockedOnScriptLoadFromDocumentWrite."
+        "Background";
+
 const char kHistogramFirstContentfulPaintHigh[] =
     "PageLoad.Timing2.NavigationToFirstContentfulPaint.HighResolutionClock";
 const char kHistogramFirstContentfulPaintLow[] =
@@ -132,6 +184,79 @@
 
 CorePageLoadMetricsObserver::~CorePageLoadMetricsObserver() {}
 
+void CorePageLoadMetricsObserver::OnDomContentLoadedEventStart(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(
+          timing.dom_content_loaded_event_start, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramDomContentLoadedImmediate,
+                        timing.dom_content_loaded_event_start);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramDomContentLoadedImmediate,
+                        timing.dom_content_loaded_event_start);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnLoadEventStart(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(timing.load_event_start, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramLoadImmediate,
+                        timing.load_event_start);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramLoadImmediate,
+                        timing.load_event_start);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnFirstLayout(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(timing.first_layout, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstLayoutImmediate,
+                        timing.first_layout);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramFirstLayoutImmediate,
+                        timing.first_layout);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnFirstPaint(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(timing.first_paint, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstPaintImmediate,
+                        timing.first_paint);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramFirstPaintImmediate,
+                        timing.first_paint);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnFirstTextPaint(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(timing.first_text_paint, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstTextPaintImmediate,
+                        timing.first_text_paint);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramFirstTextPaintImmediate,
+                        timing.first_text_paint);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnFirstImagePaint(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(timing.first_image_paint, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstImagePaintImmediate,
+                        timing.first_image_paint);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramFirstImagePaintImmediate,
+                        timing.first_image_paint);
+  }
+}
+
 void CorePageLoadMetricsObserver::OnFirstContentfulPaint(
     const page_load_metrics::PageLoadTiming& timing,
     const page_load_metrics::PageLoadExtraInfo& info) {
@@ -139,6 +264,53 @@
                                               info)) {
     PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstContentfulPaintImmediate,
                         timing.first_contentful_paint);
+    PAGE_LOAD_HISTOGRAM(
+        internal::kHistogramParseStartToFirstContentfulPaintImmediate,
+        timing.first_contentful_paint - timing.parse_start);
+  } else {
+    PAGE_LOAD_HISTOGRAM(
+        internal::kBackgroundHistogramFirstContentfulPaintImmediate,
+        timing.first_contentful_paint);
+    PAGE_LOAD_HISTOGRAM(
+        internal::kBackgroundHistogramParseStartToFirstContentfulPaintImmediate,
+        timing.first_contentful_paint - timing.parse_start);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnParseStart(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  if (WasStartedInForegroundEventInForeground(timing.parse_start, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramParseStartImmediate,
+                        timing.parse_start);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramParseStartImmediate,
+                        timing.parse_start);
+  }
+}
+
+void CorePageLoadMetricsObserver::OnParseStop(
+    const page_load_metrics::PageLoadTiming& timing,
+    const page_load_metrics::PageLoadExtraInfo& info) {
+  base::TimeDelta parse_duration = timing.parse_stop - timing.parse_start;
+  if (WasStartedInForegroundEventInForeground(timing.parse_stop, info)) {
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramParseDurationImmediate,
+                        parse_duration);
+    PAGE_LOAD_HISTOGRAM(internal::kHistogramParseBlockedOnScriptLoadImmediate,
+                        timing.parse_blocked_on_script_load_duration);
+    PAGE_LOAD_HISTOGRAM(
+        internal::kHistogramParseBlockedOnScriptLoadDocumentWriteImmediate,
+        timing.parse_blocked_on_script_load_from_document_write_duration);
+  } else {
+    PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramParseDurationImmediate,
+                        parse_duration);
+    PAGE_LOAD_HISTOGRAM(
+        internal::kBackgroundHistogramParseBlockedOnScriptLoadImmediate,
+        timing.parse_blocked_on_script_load_duration);
+    PAGE_LOAD_HISTOGRAM(
+        internal::
+            kBackgroundHistogramParseBlockedOnScriptLoadDocumentWriteImmediate,
+        timing.parse_blocked_on_script_load_from_document_write_duration);
   }
 }
 
@@ -296,6 +468,8 @@
         PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstContentfulPaintLow,
                             timing.first_contentful_paint);
       }
+      PAGE_LOAD_HISTOGRAM(internal::kHistogramParseStartToFirstContentfulPaint,
+                          timing.first_contentful_paint - timing.parse_start);
       PAGE_LOAD_HISTOGRAM(internal::kHistogramDomLoadingToFirstContentfulPaint,
                           timing.first_contentful_paint - timing.dom_loading);
     } else {
@@ -304,12 +478,6 @@
     }
   }
   if (!timing.parse_start.is_zero()) {
-    if (WasStartedInForegroundEventInForeground(timing.first_contentful_paint,
-                                                info)) {
-      PAGE_LOAD_HISTOGRAM(internal::kHistogramParseStartToFirstContentfulPaint,
-                          timing.first_contentful_paint - timing.parse_start);
-    }
-
     if (WasParseInForeground(timing.parse_start, timing.parse_stop, info)) {
       PAGE_LOAD_HISTOGRAM(internal::kHistogramParseBlockedOnScriptLoad,
                           timing.parse_blocked_on_script_load_duration);
diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.h
index a7a029e..67a24ff 100644
--- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.h
+++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.h
@@ -49,9 +49,33 @@
   ~CorePageLoadMetricsObserver() override;
 
   // page_load_metrics::PageLoadMetricsObserver:
+  void OnDomContentLoadedEventStart(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnLoadEventStart(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnFirstLayout(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnFirstPaint(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnFirstTextPaint(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnFirstImagePaint(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
   void OnFirstContentfulPaint(
       const page_load_metrics::PageLoadTiming& timing,
-      const page_load_metrics::PageLoadExtraInfo& info) override;
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnParseStart(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
+  void OnParseStop(
+      const page_load_metrics::PageLoadTiming& timing,
+      const page_load_metrics::PageLoadExtraInfo& extra_info) override;
   void OnComplete(const page_load_metrics::PageLoadTiming& timing,
                   const page_load_metrics::PageLoadExtraInfo& info) override;
   void OnFailedProvisionalLoad(
diff --git a/chrome/browser/resources/settings/about_page/about_page.html b/chrome/browser/resources/settings/about_page/about_page.html
index 5c832c1..e4dce0a5 100644
--- a/chrome/browser/resources/settings/about_page/about_page.html
+++ b/chrome/browser/resources/settings/about_page/about_page.html
@@ -1,4 +1,5 @@
 <link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://md-settings/about_page/about_page_browser_proxy.html">
 <link rel="import" href="chrome://md-settings/settings_page/main_page_behavior.html">
 <link rel="import" href="chrome://md-settings/settings_page/settings_animated_pages.html">
 <link rel="import" href="chrome://md-settings/settings_page/settings_section.html">
@@ -44,17 +45,14 @@
             </div>
             <paper-button class="secondary-action">Check for update</paper-button>
           </div>
-          <div class="settings-box two-line">
-            <!-- TODO(dpapad): Implement this. -->
-            <div class="start">
-              <div>Get help with Chrome</div>
-              <div class="secondary">Open the Help Center</div>
-            </div>
+          <div id="help" class="settings-box two-line" on-tap="onHelpTap_">
+            $i18n{aboutGetHelpUsingChrome}
           </div>
-          <div class="settings-box">
-            <!-- TODO(dpapad): Implement this. -->
-            Report an issue
+<if expr="_google_chrome">
+          <div id="reportIssue" class="settings-box" on-tap="onReportIssueTap_">
+            $i18n{aboutReportAnIssue}
           </div>
+</if>
 <if expr="chromeos">
           <div class="settings-box" on-tap="onDetailedBuildInfoTap_">
             <!-- TODO(dpapad): Localize string. -->
diff --git a/chrome/browser/resources/settings/about_page/about_page.js b/chrome/browser/resources/settings/about_page/about_page.js
index 677d7ff..44da2984 100644
--- a/chrome/browser/resources/settings/about_page/about_page.js
+++ b/chrome/browser/resources/settings/about_page/about_page.js
@@ -21,6 +21,9 @@
     },
   },
 
+  /** @private {?settings.AboutPageBrowserProxy} */
+  browserProxy_: null,
+
   /**
    * @type {string} Selector to get the sections.
    * TODO(michaelpg): replace duplicate docs with @override once b/24294625
@@ -28,11 +31,21 @@
    */
   sectionSelector: 'settings-section',
 
+  /** @override */
+  ready: function() {
+    this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance();
+  },
+
    /** @override */
   attached: function() {
     this.scroller = this.parentElement;
   },
 
+  /** @private */
+  onHelpTap_: function() {
+    this.browserProxy_.openHelpPage();
+  },
+
 <if expr="chromeos">
   /** @private */
   onDetailedBuildInfoTap_: function() {
@@ -41,4 +54,11 @@
     animatedPages.setSubpageChain(['detailed-build-info']);
   },
 </if>
+
+<if expr="_google_chrome">
+  /** @private */
+  onReportIssueTap_: function() {
+    this.browserProxy_.openFeedbackDialog();
+  },
+</if>
 });
diff --git a/chrome/browser/resources/settings/about_page/compiled_resources2.gyp b/chrome/browser/resources/settings/about_page/compiled_resources2.gyp
index 89d52b6..66b049c 100644
--- a/chrome/browser/resources/settings/about_page/compiled_resources2.gyp
+++ b/chrome/browser/resources/settings/about_page/compiled_resources2.gyp
@@ -6,6 +6,7 @@
     {
       'target_name': 'about_page',
       'dependencies': [
+        'about_page_browser_proxy',
         '../settings_page/compiled_resources2.gyp:main_page_behavior',
         '../settings_page/compiled_resources2.gyp:settings_animated_pages',
       ],
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
index 0566025..15cd965 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
@@ -1,10 +1,78 @@
+<link rel="import" href="chrome://resources/html/action_link.html">
 <link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
+<link rel="import" href="chrome://md-settings/passwords_and_forms_page/passwords_shared_css.html">
 <link rel="import" href="chrome://md-settings/settings_shared_css.html">
 
 <dom-module id="settings-autofill-section">
   <template>
-    <style include="settings-shared"></style>
-    <!-- TODO(hcarmona): Implement this. -->
+    <style include="settings-shared passwords-shared">
+      .link-item {
+        border-top: var(--settings-separator-line);
+      }
+
+      .type-column {
+        align-items: center;
+        flex: 2;
+      }
+
+      .expiration-column {
+        align-items: center;
+        display: flex;
+        flex: 1;
+      }
+
+      .expiration-date {
+        flex: 1;
+      }
+    </style>
+    <div class="heading">$i18n{addresses}</div>
+    <div class="item-list">
+      <iron-list id="addressList" items="[[addresses]]"
+          class="vertical-list list-section">
+        <template>
+          <div class="list-item two-line">
+            <div id="addressSummary" class="start">[[address_(item)]]</div>
+            <paper-icon-button id="addressMenu" icon="more-vert"
+                tabindex$="[[tabIndex]]">
+            </paper-icon-button>
+          </div>
+        </template>
+      </iron-list>
+      <div class="list-item link-item">
+        <a is="action-link" on-tap="onAddAddressTap_">$i18n{addAddress}</a>
+      </div>
+    </div>
+    <div class="heading">$i18n{creditCards}</div>
+    <div class="item-list">
+      <div class="list-item column-header">
+        <div class="type-column">$i18n{creditCardType}</div>
+        <div class="expiration-column">$i18n{creditCardExpiration}</div>
+      </div>
+      <iron-list id="creditCardList" items="[[creditCards]]"
+          class="vertical-list list-section list-with-header">
+        <template>
+          <div class="list-item two-line">
+            <div id="creditCardLabel"
+                class="type-column">[[item.metadata.summaryLabel]]</div>
+            <div class="expiration-column">
+              <div id="creditCardExpiration"
+                  class="expiration-date">[[expiration_(item)]]</div>
+              <paper-icon-button icon="more-vert"
+                  tabindex$="[[tabIndex]]">
+              </paper-icon-button>
+            </div>
+          </div>
+        </template>
+      </iron-list>
+      <div class="list-item link-item">
+        <a is="action-link" on-tap="onAddCreditCardTap_">
+          $i18n{addCreditCard}
+        </a>
+      </div>
+    </div>
   </template>
+  <link rel="import" type="css" href="chrome://resources/css/action_link.css">
   <script src="chrome://md-settings/passwords_and_forms_page/autofill_section.js"></script>
 </dom-module>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
index 9801b6e..1aa5352 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
@@ -7,9 +7,63 @@
  * addresses and credit cards for use in autofill.
  */
 (function() {
-'use strict';
+  'use strict';
 
-Polymer({
-  is: 'settings-autofill-section',
-});
+  Polymer({
+    is: 'settings-autofill-section',
+
+    properties: {
+      /**
+       * An array of saved addresses.
+       * @type {!Array<!chrome.autofillPrivate.AddressEntry>}
+       */
+      addresses: {
+        type: Array,
+      },
+
+      /**
+       * An array of saved addresses.
+       * @type {!Array<!chrome.autofillPrivate.CreditCardEntry>}
+       */
+      creditCards: {
+        type: Array,
+      },
+    },
+
+    /**
+     * Formats an AddressEntry so it's displayed as an address.
+     * @param {!chrome.autofillPrivate.AddressEntry} item
+     * @return {!string}
+     */
+    address_: function(item) {
+      return item.metadata.summaryLabel + item.metadata.summarySublabel;
+    },
+
+    /**
+     * Formats the expiration date so it's displayed as MM/YYYY.
+     * @param {!chrome.autofillPrivate.CreditCardEntry} item
+     * @return {!string}
+     */
+    expiration_: function(item) {
+      return item.expirationMonth + '/' + item.expirationYear;
+    },
+
+    /**
+     * Handles tapping on the "Add address" button.
+     * @param {!Event} e
+     */
+    onAddAddressTap_: function(e) {
+      // TODO(hcarmona): implement this.
+      e.preventDefault();
+    },
+
+    /**
+     * Handles tapping on the "Add credit card" button.
+     * @param {!Event} e
+     */
+    onAddCreditCardTap_: function(e) {
+      // TODO(hcarmona): implement this.
+      e.preventDefault();
+    },
+  });
 })();
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/compiled_resources2.gyp b/chrome/browser/resources/settings/passwords_and_forms_page/compiled_resources2.gyp
index 00bb73d..9395fccc 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/compiled_resources2.gyp
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/compiled_resources2.gyp
@@ -19,6 +19,9 @@
     },
     {
       'target_name': 'autofill_section',
+      'dependencies': [
+        '<(EXTERNS_GYP):autofill_private',
+      ],
       'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
     },
     {
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
index cfa7fa3..679e77a 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
@@ -1,30 +1,20 @@
 <link rel="import" href="chrome://resources/cr_elements/icons.html">
+<link rel="import" href="chrome://resources/html/action_link.html">
 <link rel="import" href="chrome://resources/html/polymer.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
 <link rel="import" href="chrome://resources/cr_elements/cr_shared_menu/cr_shared_menu.html">
 <link rel="import" href="chrome://md-settings/passwords_and_forms_page/password_edit_dialog.html">
+<link rel="import" href="chrome://md-settings/passwords_and_forms_page/passwords_shared_css.html">
 <link rel="import" href="chrome://md-settings/settings_shared_css.html">
 
 <dom-module id="passwords-section">
   <template>
-    <style include="settings-shared"></style>
-    <style>
-      :host {
-        display: flex;
-        flex-direction: column;
-      }
-
+    <style include="settings-shared passwords-shared">
       #manageLink {
-        -webkit-margin-start: 20px;
         margin-bottom: 24px;
       }
 
-      .heading {
-        -webkit-margin-start: 20px;
-        margin-bottom: 8px;
-      }
-
       #password {
         background-color: transparent;
         border: none;
@@ -33,17 +23,6 @@
         width: 0;
       }
 
-      #saved-password-columns {
-        -webkit-margin-end: 20px;
-        -webkit-margin-start: 56px;
-        color: var(--google-grey-500);
-        font-weight: 500;
-      }
-
-      #passwordList > div:first-of-type {
-        border-top: 1px solid #e0e0e0;
-      }
-
       .website-column {
         flex: 3;
       }
@@ -66,21 +45,6 @@
         width: 104px;
       }
 
-      paper-icon-button {
-        -webkit-margin-end: 0;
-        -webkit-margin-start: 20px;
-        -webkit-padding-end: 0;
-        -webkit-padding-start: 0;
-        color: var(--google-grey-600);
-        width: 20px;
-      }
-
-      iron-list {
-        -webkit-margin-end: 20px;
-        -webkit-margin-start: 56px;
-        margin-bottom: 16px;
-      }
-
       .list-link {
         color: black;
         text-decoration: none;
@@ -92,36 +56,38 @@
     </style>
     <div id="manageLink">$i18nRaw{managePasswordsLabel}</div>
     <div class="heading">$i18n{savedPasswordsHeading}</div>
-    <div id="saved-password-columns" class="list-item">
-      <div class="website-column">$i18n{editPasswordWebsiteLabel}</div>
-      <div class="username-column">
-        $i18n{editPasswordUsernameLabel}
-      </div>
-      <div class="password-column">
-        $i18n{editPasswordPasswordLabel}
-      </div>
-    </div>
-    <iron-list id="passwordList" class="vertical-list list-section"
-        items="[[savedPasswords]]">
-      <template>
-        <div class="list-item">
-          <a id="originUrl" href="[[item.linkUrl]]" target="_blank"
-              class="website-column list-link">[[item.loginPair.originUrl]]</a>
-          <div id="username"
-              class="username-column">[[item.loginPair.username]]</div>
-          <div class="password-column">
-            <!-- Password type and disabled in order to match mock. -->
-            <input id="password" type="password" disabled
-                value="[[getEmptyPassword_(item.numCharactersInPassword)]]">
-            </input>
-            <paper-icon-button id="passwordMenu" icon="cr:more-vert"
-                on-tap="onPasswordMenuTap_" alt="$i18n{passwordMenu}"
-                tabindex$="[[tabIndex]]">
-            </paper-icon-button>
-          </div>
+    <div class="item-list">
+      <div class="list-item column-header">
+        <div class="website-column">$i18n{editPasswordWebsiteLabel}</div>
+        <div class="username-column">
+          $i18n{editPasswordUsernameLabel}
         </div>
-      </template>
-    </iron-list>
+        <div class="password-column">
+          $i18n{editPasswordPasswordLabel}
+        </div>
+      </div>
+      <iron-list id="passwordList" items="[[savedPasswords]]"
+          class="vertical-list list-section list-with-header">
+        <template>
+          <div class="list-item">
+            <a id="originUrl" target="_blank" class="website-column list-link"
+                href="[[item.linkUrl]]">[[item.loginPair.originUrl]]</a>
+            <div id="username"
+                class="username-column">[[item.loginPair.username]]</div>
+            <div class="password-column">
+              <!-- Password type and disabled in order to match mock. -->
+              <input id="password" type="password" disabled
+                  value="[[getEmptyPassword_(item.numCharactersInPassword)]]">
+              </input>
+              <paper-icon-button id="passwordMenu" icon="cr:more-vert"
+                  on-tap="onPasswordMenuTap_" alt="$i18n{passwordMenu}"
+                  tabindex$="[[tabIndex]]">
+              </paper-icon-button>
+            </div>
+          </div>
+        </template>
+      </iron-list>
+    </div>
     <cr-shared-menu id="menu">
       <div id="menuEditPassword" class="list-item menu-item"
           on-tap="onMenuEditPasswordTap_"
@@ -131,8 +97,8 @@
     </cr-shared-menu>
     <password-edit-dialog id="passwordEditDialog"></password-edit-dialog>
     <div class="heading">$i18n{passwordExceptionsHeading}</div>
-    <iron-list id="passwordExceptionsList" class="vertical-list list-section"
-        items="[[passwordExceptions]]">
+    <iron-list id="passwordExceptionsList" items="[[passwordExceptions]]"
+        class="vertical-list list-section item-list">
       <template>
         <div class="list-item two-line">
           <a id="exception" href="[[item.linkUrl]]" target="_blank"
@@ -146,5 +112,7 @@
       </template>
     </iron-list>
   </template>
+  <!-- action_link.css is needed for the |managePasswordsLabel| link -->
+  <link rel="import" type="css" href="chrome://resources/css/action_link.css">
   <script src="chrome://md-settings/passwords_and_forms_page/passwords_section.js"></script>
 </dom-module>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html
new file mode 100644
index 0000000..8f3eef5
--- /dev/null
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html
@@ -0,0 +1,40 @@
+<!-- Common styles for Passwords and Forms -->
+<dom-module id="passwords-shared">
+  <template>
+    <style>
+      :host {
+        -webkit-margin-end: 20px;
+        -webkit-margin-start: 20px;
+        display: flex;
+        flex-direction: column;
+      }
+
+      .column-header {
+        color: var(--google-grey-500);
+        font-weight: 500;
+      }
+
+      .heading {
+        margin-bottom: 8px;
+      }
+
+      paper-icon-button {
+        -webkit-margin-end: 0;
+        -webkit-margin-start: 20px;
+        -webkit-padding-end: 0;
+        -webkit-padding-start: 0;
+        color: var(--google-grey-600);
+        width: 20px;
+      }
+
+      .item-list {
+        -webkit-margin-start: 36px;
+        margin-bottom: 16px;
+      }
+
+      .list-with-header > div:first-of-type {
+        border-top: var(--settings-separator-line);
+      }
+    </style>
+  </template>
+</dom-module>
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd
index fedd488..8d0e035 100644
--- a/chrome/browser/resources/settings/settings_resources.grd
+++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -483,6 +483,9 @@
       <structure name="IDR_SETTINGS_PASSWORDS_AND_FORMS_PAGE_JS"
                  file="passwords_and_forms_page/passwords_and_forms_page.js"
                  type="chrome_html" />
+      <structure name="IDR_SETTINGS_PASSWORDS_SHARED_CSS_HTML"
+                 file="passwords_and_forms_page/passwords_shared_css.html"
+                 type="chrome_html" />
       <structure name="IDR_SETTINGS_AUTOFILL_SECTION_HTML"
                  file="passwords_and_forms_page/autofill_section.html"
                  type="chrome_html" />
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
index 8ae03fb8..8785fa0a 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -565,6 +565,8 @@
 
   Mock::VerifyAndClearExpectations(sb_service_.get());
   Mock::VerifyAndClearExpectations(binary_feature_extractor_.get());
+
+  base::DeleteFile(tmp_path_, false);
 }
 
 
@@ -1201,6 +1203,8 @@
             GetClientDownloadRequest()->download_type());
   ClearClientDownloadRequest();
   Mock::VerifyAndClearExpectations(binary_feature_extractor_.get());
+
+  base::DeleteFile(tmp_path_, false);
 }
 
 TEST_F(DownloadProtectionServiceTest,
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 01851a6..d4d7089 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -431,6 +431,12 @@
               gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
               ".",
               "//chrome")
+
+      sources -= [
+        "views/extensions/extension_popup_aura.cc",
+        "views/extensions/extension_popup_aura.h",
+      ]
+
       deps += [ "//extensions/components/native_app_window" ]
     } else {
       sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
diff --git a/chrome/browser/ui/cocoa/create_application_shortcut_cocoa.mm b/chrome/browser/ui/cocoa/create_application_shortcut_cocoa.mm
new file mode 100644
index 0000000..1a064725
--- /dev/null
+++ b/chrome/browser/ui/cocoa/create_application_shortcut_cocoa.mm
@@ -0,0 +1,135 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import <Cocoa/Cocoa.h>
+
+#import "base/mac/scoped_nsobject.h"
+#import "chrome/browser/web_applications/web_app_mac.h"
+#import "ui/base/l10n/l10n_util_mac.h"
+#include "base/bind.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/cocoa/key_equivalent_constants.h"
+#include "chrome/grit/generated_resources.h"
+#include "grit/components_strings.h"
+#include "ui/gfx/image/image.h"
+
+@interface CrCreateAppShortcutCheckboxObserver : NSObject {
+ @private
+  NSButton* checkbox_;
+  NSButton* continueButton_;
+}
+
+- (id)initWithCheckbox:(NSButton*)checkbox
+        continueButton:(NSButton*)continueButton;
+- (void)startObserving;
+- (void)stopObserving;
+@end
+
+@implementation CrCreateAppShortcutCheckboxObserver
+
+- (id)initWithCheckbox:(NSButton*)checkbox
+        continueButton:(NSButton*)continueButton {
+  if ((self = [super init])) {
+    checkbox_ = checkbox;
+    continueButton_ = continueButton;
+  }
+  return self;
+}
+
+- (void)startObserving {
+  [checkbox_ addObserver:self forKeyPath:@"cell.state" options:0 context:nil];
+}
+
+- (void)stopObserving {
+  [checkbox_ removeObserver:self forKeyPath:@"cell.state"];
+}
+
+- (void)observeValueForKeyPath:(NSString*)keyPath
+                      ofObject:(id)object
+                        change:(NSDictionary*)change
+                       context:(void*)context {
+  [continueButton_ setEnabled:([checkbox_ state] == NSOnState)];
+}
+
+@end
+
+namespace {
+
+// Called when the app's ShortcutInfo (with icon) is loaded when creating app
+// shortcuts.
+void CreateAppShortcutInfoLoaded(
+    Profile* profile,
+    const extensions::Extension* app,
+    const base::Callback<void(bool)>& close_callback,
+    std::unique_ptr<web_app::ShortcutInfo> shortcut_info) {
+  base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]);
+
+  NSButton* continue_button = [alert
+      addButtonWithTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_COMMIT)];
+  [continue_button setKeyEquivalent:kKeyEquivalentReturn];
+
+  NSButton* cancel_button =
+      [alert addButtonWithTitle:l10n_util::GetNSString(IDS_CANCEL)];
+  [cancel_button setKeyEquivalent:kKeyEquivalentEscape];
+
+  [alert setMessageText:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_LABEL)];
+  [alert setAlertStyle:NSInformationalAlertStyle];
+
+  base::scoped_nsobject<NSButton> application_folder_checkbox(
+      [[NSButton alloc] initWithFrame:NSZeroRect]);
+  [application_folder_checkbox setButtonType:NSSwitchButton];
+  [application_folder_checkbox
+      setTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_APP_FOLDER_CHKBOX)];
+  [application_folder_checkbox setState:NSOnState];
+  [application_folder_checkbox sizeToFit];
+
+  base::scoped_nsobject<CrCreateAppShortcutCheckboxObserver> checkbox_observer(
+      [[CrCreateAppShortcutCheckboxObserver alloc]
+          initWithCheckbox:application_folder_checkbox
+            continueButton:continue_button]);
+  [checkbox_observer startObserving];
+
+  [alert setAccessoryView:application_folder_checkbox];
+
+  const int kIconPreviewSizePixels = 128;
+  const int kIconPreviewTargetSize = 64;
+  const gfx::Image* icon = shortcut_info->favicon.GetBest(
+      kIconPreviewSizePixels, kIconPreviewSizePixels);
+
+  if (icon && !icon->IsEmpty()) {
+    NSImage* icon_image = icon->ToNSImage();
+    [icon_image
+        setSize:NSMakeSize(kIconPreviewTargetSize, kIconPreviewTargetSize)];
+    [alert setIcon:icon_image];
+  }
+
+  bool dialog_accepted = false;
+  if ([alert runModal] == NSAlertFirstButtonReturn &&
+      [application_folder_checkbox state] == NSOnState) {
+    dialog_accepted = true;
+    CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER,
+                    web_app::ShortcutLocations(), profile, app);
+  }
+
+  [checkbox_observer stopObserving];
+
+  if (!close_callback.is_null())
+    close_callback.Run(dialog_accepted);
+}
+
+}  // namespace
+
+namespace chrome {
+
+void ShowCreateChromeAppShortcutsDialog(
+    gfx::NativeWindow /*parent_window*/,
+    Profile* profile,
+    const extensions::Extension* app,
+    const base::Callback<void(bool)>& close_callback) {
+  web_app::GetShortcutInfoForApp(
+      app, profile,
+      base::Bind(&CreateAppShortcutInfoLoaded, profile, app, close_callback));
+}
+
+}  // namespace chrome
diff --git a/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc b/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
new file mode 100644
index 0000000..b06411f37
--- /dev/null
+++ b/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
@@ -0,0 +1,272 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/download/download_danger_prompt.h"
+
+#include "base/macros.h"
+#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/download/download_stats.h"
+#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
+#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
+#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
+#include "chrome/grit/chromium_strings.h"
+#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/download_danger_type.h"
+#include "content/public/browser/download_item.h"
+#include "grit/components_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "url/gurl.h"
+
+using extensions::ExperienceSamplingEvent;
+
+namespace {
+
+// TODO(wittman): Create a native web contents modal dialog implementation of
+// this dialog for non-Views platforms, to support bold formatting of the
+// message lead.
+
+// Implements DownloadDangerPrompt using a TabModalConfirmDialog.
+class DownloadDangerPromptImpl : public DownloadDangerPrompt,
+                                 public content::DownloadItem::Observer,
+                                 public TabModalConfirmDialogDelegate {
+ public:
+  DownloadDangerPromptImpl(content::DownloadItem* item,
+                           content::WebContents* web_contents,
+                           bool show_context,
+                           const OnDone& done);
+  ~DownloadDangerPromptImpl() override;
+
+  // DownloadDangerPrompt:
+  void InvokeActionForTesting(Action action) override;
+
+ private:
+  // content::DownloadItem::Observer:
+  void OnDownloadUpdated(content::DownloadItem* download) override;
+
+  // TabModalConfirmDialogDelegate:
+  base::string16 GetTitle() override;
+  base::string16 GetDialogMessage() override;
+  base::string16 GetAcceptButtonTitle() override;
+  base::string16 GetCancelButtonTitle() override;
+  void OnAccepted() override;
+  void OnCanceled() override;
+  void OnClosed() override;
+
+  void RunDone(Action action);
+
+  content::DownloadItem* download_;
+  bool show_context_;
+  OnDone done_;
+
+  std::unique_ptr<ExperienceSamplingEvent> sampling_event_;
+
+  DISALLOW_COPY_AND_ASSIGN(DownloadDangerPromptImpl);
+};
+
+DownloadDangerPromptImpl::DownloadDangerPromptImpl(
+    content::DownloadItem* download,
+    content::WebContents* web_contents,
+    bool show_context,
+    const OnDone& done)
+    : TabModalConfirmDialogDelegate(web_contents),
+      download_(download),
+      show_context_(show_context),
+      done_(done) {
+  DCHECK(!done_.is_null());
+  download_->AddObserver(this);
+  RecordOpenedDangerousConfirmDialog(download_->GetDangerType());
+
+  // ExperienceSampling: A malicious download warning is being shown to the
+  // user, so we start a new SamplingEvent and track it.
+  sampling_event_.reset(new ExperienceSamplingEvent(
+      ExperienceSamplingEvent::kDownloadDangerPrompt, download->GetURL(),
+      download->GetReferrerUrl(), download->GetBrowserContext()));
+}
+
+DownloadDangerPromptImpl::~DownloadDangerPromptImpl() {
+  // |this| might be deleted without invoking any callbacks. E.g. pressing Esc
+  // on GTK or if the user navigates away from the page showing the prompt.
+  RunDone(DISMISS);
+}
+
+void DownloadDangerPromptImpl::InvokeActionForTesting(Action action) {
+  switch (action) {
+    case ACCEPT:
+      Accept();
+      break;
+    case CANCEL:
+      Cancel();
+      break;
+    case DISMISS:
+      RunDone(DISMISS);
+      Cancel();
+      break;
+  }
+}
+
+void DownloadDangerPromptImpl::OnDownloadUpdated(
+    content::DownloadItem* download) {
+  // If the download is nolonger dangerous (accepted externally) or the download
+  // is in a terminal state, then the download danger prompt is no longer
+  // necessary.
+  if (!download->IsDangerous() || download->IsDone()) {
+    RunDone(DISMISS);
+    Cancel();
+  }
+}
+
+base::string16 DownloadDangerPromptImpl::GetTitle() {
+  if (show_context_)
+    return l10n_util::GetStringUTF16(IDS_CONFIRM_KEEP_DANGEROUS_DOWNLOAD_TITLE);
+  switch (download_->GetDangerType()) {
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
+      return l10n_util::GetStringUTF16(
+          IDS_RESTORE_KEEP_DANGEROUS_DOWNLOAD_TITLE);
+    }
+    default: {
+      return l10n_util::GetStringUTF16(
+          IDS_CONFIRM_KEEP_DANGEROUS_DOWNLOAD_TITLE);
+    }
+  }
+}
+
+base::string16 DownloadDangerPromptImpl::GetDialogMessage() {
+  if (show_context_) {
+    switch (download_->GetDangerType()) {
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: {
+        return l10n_util::GetStringFUTF16(
+            IDS_PROMPT_DANGEROUS_DOWNLOAD,
+            download_->GetFileNameToReportUser().LossyDisplayName());
+      }
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:  // Fall through
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: {
+        return l10n_util::GetStringFUTF16(
+            IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT,
+            download_->GetFileNameToReportUser().LossyDisplayName());
+      }
+      case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: {
+        return l10n_util::GetStringFUTF16(
+            IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT,
+            download_->GetFileNameToReportUser().LossyDisplayName());
+      }
+      case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
+        return l10n_util::GetStringFUTF16(
+            IDS_PROMPT_DOWNLOAD_CHANGES_SETTINGS,
+            download_->GetFileNameToReportUser().LossyDisplayName());
+      }
+      case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
+      case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT:
+      case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED:
+      case content::DOWNLOAD_DANGER_TYPE_MAX: {
+        break;
+      }
+    }
+  } else {
+    switch (download_->GetDangerType()) {
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
+      case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: {
+        return l10n_util::GetStringUTF16(
+                   IDS_PROMPT_CONFIRM_KEEP_MALICIOUS_DOWNLOAD_LEAD) +
+               base::ASCIIToUTF16("\n\n") +
+               l10n_util::GetStringUTF16(
+                   IDS_PROMPT_CONFIRM_KEEP_MALICIOUS_DOWNLOAD_BODY);
+      }
+      default: {
+        return l10n_util::GetStringUTF16(
+            IDS_PROMPT_CONFIRM_KEEP_DANGEROUS_DOWNLOAD);
+      }
+    }
+  }
+  NOTREACHED();
+  return base::string16();
+}
+
+base::string16 DownloadDangerPromptImpl::GetAcceptButtonTitle() {
+  if (show_context_)
+    return l10n_util::GetStringUTF16(IDS_CONFIRM_DOWNLOAD);
+  switch (download_->GetDangerType()) {
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
+      return l10n_util::GetStringUTF16(IDS_CONFIRM_DOWNLOAD_AGAIN_MALICIOUS);
+    }
+    default:
+      return l10n_util::GetStringUTF16(IDS_CONFIRM_DOWNLOAD_AGAIN);
+  }
+}
+
+base::string16 DownloadDangerPromptImpl::GetCancelButtonTitle() {
+  if (show_context_)
+    return l10n_util::GetStringUTF16(IDS_CANCEL);
+  switch (download_->GetDangerType()) {
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: {
+      return l10n_util::GetStringUTF16(IDS_CONFIRM_CANCEL_AGAIN_MALICIOUS);
+    }
+    default:
+      return l10n_util::GetStringUTF16(IDS_CANCEL);
+  }
+}
+
+void DownloadDangerPromptImpl::OnAccepted() {
+  // ExperienceSampling: User proceeded through the warning.
+  sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kProceed);
+  RunDone(ACCEPT);
+}
+
+void DownloadDangerPromptImpl::OnCanceled() {
+  // ExperienceSampling: User canceled the warning.
+  sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
+  RunDone(CANCEL);
+}
+
+void DownloadDangerPromptImpl::OnClosed() {
+  // ExperienceSampling: User canceled the warning.
+  sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
+  RunDone(DISMISS);
+}
+
+void DownloadDangerPromptImpl::RunDone(Action action) {
+  // Invoking the callback can cause the download item state to change or cause
+  // the constrained window to close, and |callback| refers to a member
+  // variable.
+  OnDone done = done_;
+  done_.Reset();
+  if (download_ != NULL) {
+    const bool accept = action == DownloadDangerPrompt::ACCEPT;
+    RecordDownloadDangerPrompt(accept, *download_);
+    if (!download_->GetURL().is_empty() &&
+        !download_->GetBrowserContext()->IsOffTheRecord()) {
+      SendSafeBrowsingDownloadRecoveryReport(accept, *download_);
+    }
+    download_->RemoveObserver(this);
+    download_ = NULL;
+  }
+  if (!done.is_null())
+    done.Run(action);
+}
+
+}  // namespace
+
+// static
+DownloadDangerPrompt* DownloadDangerPrompt::Create(
+    content::DownloadItem* item,
+    content::WebContents* web_contents,
+    bool show_context,
+    const OnDone& done) {
+  DownloadDangerPromptImpl* prompt =
+      new DownloadDangerPromptImpl(item, web_contents, show_context, done);
+  // |prompt| will be deleted when the dialog is done.
+  TabModalConfirmDialog::Create(prompt, web_contents);
+  return prompt;
+}
diff --git a/chrome/browser/ui/proximity_auth/proximity_auth_error_bubble.cc b/chrome/browser/ui/proximity_auth/proximity_auth_error_bubble_stub.cc
similarity index 91%
rename from chrome/browser/ui/proximity_auth/proximity_auth_error_bubble.cc
rename to chrome/browser/ui/proximity_auth/proximity_auth_error_bubble_stub.cc
index d8015fc..e9a87817b 100644
--- a/chrome/browser/ui/proximity_auth/proximity_auth_error_bubble.cc
+++ b/chrome/browser/ui/proximity_auth/proximity_auth_error_bubble_stub.cc
@@ -6,7 +6,6 @@
 
 #include "base/logging.h"
 
-#if !defined(TOOLKIT_VIEWS) || !defined(USE_AURA)
 void ShowProximityAuthErrorBubble(const base::string16& message,
                                   const gfx::Range& link_range,
                                   const GURL& link_url,
@@ -18,4 +17,3 @@
 void HideProximityAuthErrorBubble() {
   NOTIMPLEMENTED();
 }
-#endif
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index 9572498..ae452e21 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -103,6 +103,10 @@
 #include "components/search_engines/desktop_search_utils.h"
 #endif
 
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
+#endif
+
 #if defined(ENABLE_PRINT_PREVIEW)
 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
@@ -715,6 +719,21 @@
   }
 #endif  // defined(OS_WIN)
 
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+  // Our request to Activate may be discarded on some linux window
+  // managers unless given a recent timestamp, so update the timestamp if
+  // we were given one.
+  if (command_line.HasSwitch(switches::kWmUserTimeMs)) {
+    uint64_t time;
+    std::string switch_value =
+        command_line.GetSwitchValueASCII(switches::kWmUserTimeMs);
+    if (base::StringToUint64(switch_value, &time)) {
+      views::X11DesktopHandler::get()->set_wm_user_time_ms(
+          static_cast<Time>(time));
+    }
+  }
+#endif
+
   chrome::startup::IsProcessStartup is_process_startup = process_startup ?
       chrome::startup::IS_PROCESS_STARTUP :
       chrome::startup::IS_NOT_PROCESS_STARTUP;
@@ -751,7 +770,6 @@
       last_used_profile = last_opened_profiles[0];
     }
 #endif
-
     // Launch the last used profile with the full command line, and the other
     // opened profiles without the URLs to launch.
     base::CommandLine command_line_without_urls(command_line.GetProgram());
@@ -775,7 +793,6 @@
           startup_pref.type == SessionStartupPref::DEFAULT &&
           !HasPendingUncleanExit(*it))
         continue;
-
       if (!LaunchBrowser((*it == last_used_profile) ? command_line
                                                     : command_line_without_urls,
                          *it, cur_dir, is_process_startup, is_first_run))
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
index bc96b31..70367a7f 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
@@ -63,6 +63,7 @@
     // Make the button focusable & give it alt-text so permissions can be
     // revoked using only the keyboard.
     Button::ConfigureDefaultFocus(this);
+    set_request_focus_on_press(true);
     SetTooltipText(l10n_util::GetStringFUTF16(
         IDS_APPLICATION_INFO_REVOKE_PERMISSION_ALT_TEXT, permission_message));
   }
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
index 7e4346e..3f04de8 100644
--- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc
+++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
@@ -25,10 +25,8 @@
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/gfx/animation/slide_animation.h"
 #include "ui/gfx/canvas.h"
-#include "ui/native_theme/native_theme.h"
 #include "ui/strings/grit/ui_strings.h"
 #include "ui/views/bubble/bubble_border.h"
-#include "ui/views/controls/button/label_button.h"
 #include "ui/views/controls/link.h"
 #include "ui/views/controls/link_listener.h"
 #include "ui/views/layout/box_layout.h"
@@ -44,7 +42,7 @@
 
 namespace {
 
-// Space between the site info label and the buttons / link.
+// Space between the site info label and the link.
 const int kMiddlePaddingPx = 30;
 
 const int kOuterPaddingHorizPx = 40;
@@ -53,40 +51,6 @@
 // Partially-transparent background color.
 const SkColor kBackgroundColor = SkColorSetARGB(0xcc, 0x28, 0x2c, 0x32);
 
-class ButtonView : public views::View {
- public:
-  ButtonView(views::ButtonListener* listener, int between_button_spacing);
-  ~ButtonView() override;
-
-  views::LabelButton* accept_button() const { return accept_button_; }
-  views::LabelButton* deny_button() const { return deny_button_; }
-
- private:
-  views::LabelButton* accept_button_;
-  views::LabelButton* deny_button_;
-  DISALLOW_COPY_AND_ASSIGN(ButtonView);
-};
-
-ButtonView::ButtonView(views::ButtonListener* listener,
-                       int between_button_spacing)
-    : accept_button_(nullptr), deny_button_(nullptr) {
-  accept_button_ = new views::LabelButton(listener, base::string16());
-  accept_button_->SetStyle(views::Button::STYLE_BUTTON);
-  accept_button_->SetFocusBehavior(FocusBehavior::NEVER);
-  AddChildView(accept_button_);
-
-  deny_button_ = new views::LabelButton(listener, base::string16());
-  deny_button_->SetStyle(views::Button::STYLE_BUTTON);
-  deny_button_->SetFocusBehavior(FocusBehavior::NEVER);
-  AddChildView(deny_button_);
-
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
-                                        between_button_spacing));
-}
-
-ButtonView::~ButtonView() {
-}
-
 // Class containing the exit instruction text. Contains fancy styling on the
 // keyboard key (not just a simple label).
 class InstructionView : public views::View {
@@ -183,22 +147,17 @@
 
 class ExclusiveAccessBubbleViews::ExclusiveAccessView
     : public views::View,
-      public views::ButtonListener,
       public views::LinkListener {
  public:
   ExclusiveAccessView(ExclusiveAccessBubbleViews* bubble,
                       const base::string16& accelerator,
-                      const GURL& url,
                       ExclusiveAccessBubbleType bubble_type);
   ~ExclusiveAccessView() override;
 
-  // views::ButtonListener
-  void ButtonPressed(views::Button* sender, const ui::Event& event) override;
-
   // views::LinkListener
   void LinkClicked(views::Link* source, int event_flags) override;
 
-  void UpdateContent(const GURL& url, ExclusiveAccessBubbleType bubble_type);
+  void UpdateContent(ExclusiveAccessBubbleType bubble_type);
 
  private:
   ExclusiveAccessBubbleViews* bubble_;
@@ -206,14 +165,8 @@
   // Clickable hint text for exiting fullscreen mode. (Non-simplified mode
   // only.)
   views::Link* link_;
-  // Informational label: 'www.foo.com has gone fullscreen'. (Non-simplified
-  // mode only.)
-  views::Label* message_label_;
-  // Clickable buttons to exit fullscreen. (Non-simplified mode only.)
-  // TODO(mgiuca): Delete this; it is no longer used on any code path.
-  ButtonView* button_view_;
   // Instruction for exiting fullscreen / mouse lock. Only present if there is
-  // no link or button (always present in simplified mode).
+  // no link (always present in simplified mode).
   InstructionView* exit_instruction_;
   const base::string16 browser_fullscreen_exit_accelerator_;
 
@@ -223,12 +176,9 @@
 ExclusiveAccessBubbleViews::ExclusiveAccessView::ExclusiveAccessView(
     ExclusiveAccessBubbleViews* bubble,
     const base::string16& accelerator,
-    const GURL& url,
     ExclusiveAccessBubbleType bubble_type)
     : bubble_(bubble),
       link_(nullptr),
-      message_label_(nullptr),
-      button_view_(nullptr),
       exit_instruction_(nullptr),
       browser_fullscreen_exit_accelerator_(accelerator) {
   const SkColor kForegroundColor = SK_ColorWHITE;
@@ -243,12 +193,6 @@
   const gfx::FontList& font_list =
       rb.GetFontList(ui::ResourceBundle::MediumFont);
 
-  if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
-    message_label_ = new views::Label(base::string16(), font_list);
-    message_label_->SetEnabledColor(kForegroundColor);
-    message_label_->SetBackgroundColor(kBackgroundColor);
-  }
-
   exit_instruction_ = new InstructionView(base::string16(), font_list,
                                           kForegroundColor, kBackgroundColor);
 
@@ -265,15 +209,8 @@
   link_->SetBackgroundColor(kBackgroundColor);
   link_->SetVisible(false);
 
-  button_view_ = new ButtonView(this, kPaddingPx);
-
   int outer_padding_horiz = kOuterPaddingHorizPx;
   int outer_padding_vert = kOuterPaddingVertPx;
-  if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
-    DCHECK(message_label_);
-    AddChildView(message_label_);
-  }
-  AddChildView(button_view_);
   AddChildView(exit_instruction_);
   AddChildView(link_);
 
@@ -282,21 +219,12 @@
                            outer_padding_vert, kMiddlePaddingPx);
   SetLayoutManager(layout);
 
-  UpdateContent(url, bubble_type);
+  UpdateContent(bubble_type);
 }
 
 ExclusiveAccessBubbleViews::ExclusiveAccessView::~ExclusiveAccessView() {
 }
 
-void ExclusiveAccessBubbleViews::ExclusiveAccessView::ButtonPressed(
-    views::Button* sender,
-    const ui::Event& event) {
-  if (sender == button_view_->accept_button())
-    bubble_->Accept();
-  else
-    bubble_->Cancel();
-}
-
 void ExclusiveAccessBubbleViews::ExclusiveAccessView::LinkClicked(
     views::Link* link,
     int event_flags) {
@@ -304,7 +232,6 @@
 }
 
 void ExclusiveAccessBubbleViews::ExclusiveAccessView::UpdateContent(
-    const GURL& url,
     ExclusiveAccessBubbleType bubble_type) {
   DCHECK_NE(EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE, bubble_type);
 
@@ -334,7 +261,6 @@
   link_->SetVisible(link_visible);
   exit_instruction_->SetText(bubble_->GetInstructionText(accelerator));
   exit_instruction_->SetVisible(!link_visible);
-  button_view_->SetVisible(false);
 }
 
 // ExclusiveAccessBubbleViews --------------------------------------------------
@@ -348,8 +274,7 @@
                             bubble_type),
       bubble_view_context_(context),
       popup_(nullptr),
-      animation_(new gfx::SlideAnimation(this)),
-      animated_attribute_(ExpectedAnimationAttribute()) {
+      animation_(new gfx::SlideAnimation(this)) {
   // With the simplified fullscreen UI flag, initially hide the bubble;
   // otherwise, initially show it.
   double initial_value =
@@ -362,7 +287,7 @@
       bubble_view_context_->GetAcceleratorProvider()
           ->GetAcceleratorForCommandId(IDC_FULLSCREEN, &accelerator);
   DCHECK(got_accelerator);
-  view_ = new ExclusiveAccessView(this, accelerator.GetShortcutText(), url,
+  view_ = new ExclusiveAccessView(this, accelerator.GetShortcutText(),
                                   bubble_type_);
 
   // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView.
@@ -427,7 +352,7 @@
 
   url_ = url;
   bubble_type_ = bubble_type;
-  view_->UpdateContent(url_, bubble_type_);
+  view_->UpdateContent(bubble_type_);
 
   gfx::Size size = GetPopupRect(true).size();
   view_->SetSize(size);
@@ -451,19 +376,8 @@
   return view_;
 }
 
-ExclusiveAccessBubbleViews::AnimatedAttribute
-ExclusiveAccessBubbleViews::ExpectedAnimationAttribute() {
-  // TODO(mgiuca): Delete this function.
-  return ANIMATED_ATTRIBUTE_OPACITY;
-}
-
 void ExclusiveAccessBubbleViews::UpdateMouseWatcher() {
-  bool should_watch_mouse = false;
-  if (popup_->IsVisible())
-    should_watch_mouse =
-        !exclusive_access_bubble::ShowButtonsForType(bubble_type_);
-  else
-    should_watch_mouse = CanMouseTriggerSlideIn();
+  bool should_watch_mouse = popup_->IsVisible() || CanMouseTriggerSlideIn();
 
   if (should_watch_mouse == IsWatchingMouse())
     return;
@@ -474,28 +388,6 @@
     StopWatchingMouse();
 }
 
-void ExclusiveAccessBubbleViews::UpdateForImmersiveState() {
-  AnimatedAttribute expected_animated_attribute = ExpectedAnimationAttribute();
-  if (animated_attribute_ != expected_animated_attribute) {
-    // If an animation is currently in progress, skip to the end because
-    // switching the animated attribute midway through the animation looks
-    // weird.
-    animation_->End();
-
-    animated_attribute_ = expected_animated_attribute;
-
-    // We may have finished hiding |popup_|. However, the bounds animation
-    // assumes |popup_| has the opacity when it is fully shown and the opacity
-    // animation assumes |popup_| has the bounds when |popup_| is fully shown.
-    if (animated_attribute_ == ANIMATED_ATTRIBUTE_BOUNDS)
-      popup_->SetOpacity(255);
-    else
-      UpdateBounds();
-  }
-
-  UpdateMouseWatcher();
-}
-
 void ExclusiveAccessBubbleViews::UpdateBounds() {
   gfx::Rect popup_rect(GetPopupRect(false));
   if (!popup_rect.IsEmpty()) {
@@ -510,21 +402,12 @@
 
 void ExclusiveAccessBubbleViews::AnimationProgressed(
     const gfx::Animation* animation) {
-  if (animated_attribute_ == ANIMATED_ATTRIBUTE_OPACITY) {
-    int opacity = animation_->CurrentValueBetween(0, 255);
-    if (opacity == 0) {
-      popup_->Hide();
-    } else {
-      popup_->Show();
-      popup_->SetOpacity(opacity);
-    }
+  int opacity = animation_->CurrentValueBetween(0, 255);
+  if (opacity == 0) {
+    popup_->Hide();
   } else {
-    if (GetPopupRect(false).IsEmpty()) {
-      popup_->Hide();
-    } else {
-      UpdateBounds();
-      popup_->Show();
-    }
+    popup_->Show();
+    popup_->SetOpacity(opacity);
   }
 }
 
@@ -557,14 +440,6 @@
   int desired_top = kSimplifiedPopupTopPx - view_->border()->GetInsets().top();
   int y = top_container_bottom + desired_top;
 
-  if (!ignore_animation_state &&
-      animated_attribute_ == ANIMATED_ATTRIBUTE_BOUNDS) {
-    int total_height = size.height() + desired_top;
-    int popup_bottom = animation_->CurrentValueBetween(total_height, 0);
-    int y_offset = std::min(popup_bottom, desired_top);
-    size.set_height(size.height() - popup_bottom + y_offset);
-    y -= y_offset;
-  }
   return gfx::Rect(gfx::Point(x, y), size);
 }
 
@@ -603,7 +478,7 @@
     const content::NotificationSource& source,
     const content::NotificationDetails& details) {
   DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
-  UpdateForImmersiveState();
+  UpdateMouseWatcher();
 }
 
 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged(
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.h b/chrome/browser/ui/views/exclusive_access_bubble_views.h
index b304f0e..979269e1 100644
--- a/chrome/browser/ui/views/exclusive_access_bubble_views.h
+++ b/chrome/browser/ui/views/exclusive_access_bubble_views.h
@@ -47,22 +47,10 @@
  private:
   class ExclusiveAccessView;
 
-  enum AnimatedAttribute {
-    ANIMATED_ATTRIBUTE_BOUNDS,
-    ANIMATED_ATTRIBUTE_OPACITY
-  };
-
-  // Returns the expected animated attribute based on flags and bubble type.
-  AnimatedAttribute ExpectedAnimationAttribute();
-
   // Starts or stops polling the mouse location based on |popup_| and
   // |bubble_type_|.
   void UpdateMouseWatcher();
 
-  // Updates any state which depends on whether the user is in immersive
-  // fullscreen.
-  void UpdateForImmersiveState();
-
   // Updates |popup|'s bounds given |animation_| and |animated_attribute_|.
   void UpdateBounds();
 
@@ -96,9 +84,6 @@
   // Animation controlling showing/hiding of the exit bubble.
   std::unique_ptr<gfx::SlideAnimation> animation_;
 
-  // Attribute animated by |animation_|.
-  AnimatedAttribute animated_attribute_;
-
   // The contents of the popup.
   ExclusiveAccessView* view_;
 
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index c41d3de..7e76a4c 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -155,7 +155,6 @@
 
   find_previous_button_->set_id(VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON);
   views::Button::ConfigureDefaultFocus(find_previous_button_);
-  find_previous_button_->set_request_focus_on_press(false);
   find_previous_button_->SetTooltipText(
       l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP));
   find_previous_button_->SetAccessibleName(
@@ -164,7 +163,6 @@
 
   find_next_button_->set_id(VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON);
   views::Button::ConfigureDefaultFocus(find_next_button_);
-  find_next_button_->set_request_focus_on_press(false);
   find_next_button_->SetTooltipText(
       l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP));
   find_next_button_->SetAccessibleName(
@@ -173,7 +171,6 @@
 
   close_button_->set_id(VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON);
   views::Button::ConfigureDefaultFocus(close_button_);
-  close_button_->set_request_focus_on_press(false);
   close_button_->SetTooltipText(
       l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP));
   close_button_->SetAccessibleName(
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_factory_mac.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_factory_mac.cc
deleted file mode 100644
index c655e81..0000000
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_factory_mac.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/views/frame/immersive_mode_controller_stub.h"
-
-namespace chrome {
-
-ImmersiveModeController* CreateImmersiveModeController() {
-  return new ImmersiveModeControllerStub();
-}
-
-}  // namespace chrome
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 6d2e02de..e9d55c0 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -161,6 +161,7 @@
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
   button->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont));
   views::Button::ConfigureDefaultFocus(button);
+  button->set_request_focus_on_press(true);
   button->SetTextColor(views::Button::STATE_NORMAL, GetInfobarTextColor());
   button->SetTextColor(views::Button::STATE_HOVERED, GetInfobarTextColor());
   return button;
@@ -275,10 +276,10 @@
       BarControlButton* close = new BarControlButton(this);
       close->SetIcon(gfx::VectorIconId::BAR_CLOSE,
                      base::Bind(&GetInfobarTextColor));
-      close->set_request_focus_on_press(false);
       close_button_ = close;
     } else {
       close_button_ = new views::ImageButton(this);
+      close_button_->set_request_focus_on_press(true);
       ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
       close_button_->SetImage(views::CustomButton::STATE_NORMAL,
                               rb.GetImageNamed(IDR_CLOSE_1).ToImageSkia());
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 9ab0636..e00db230 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -157,6 +157,7 @@
   back_button->SetImage(views::ImageButton::STATE_DISABLED,
                         rb->GetImageSkiaNamed(IDR_BACK_D));
   views::Button::ConfigureDefaultFocus(back_button);
+  back_button->set_request_focus_on_press(true);
   return back_button;
 }
 
@@ -176,6 +177,7 @@
         kButtonHeight + views::kRelatedControlVerticalSpacing));
     SetImage(STATE_NORMAL, icon);
     Button::ConfigureDefaultFocus(this);
+    set_request_focus_on_press(true);
   }
 
   ~BackgroundColorHoverButton() override {}
@@ -1404,6 +1406,7 @@
             gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 18,
                                   gfx::kChromeIconGrey));
         views::Button::ConfigureDefaultFocus(auth_error_email_button_);
+        auth_error_email_button_->set_request_focus_on_press(true);
         gfx::Insets insets =
             views::LabelButtonAssetBorder::GetDefaultInsetsForStyle(
                 views::Button::STYLE_TEXTBUTTON);
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
index 4f4ade4..8472090 100644
--- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
+++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
@@ -109,7 +109,6 @@
     continue_signin_button_ =
         new views::LabelButton(this, continue_signin_text);
     continue_signin_button_->SetStyle(views::Button::STYLE_BUTTON);
-    views::Button::ConfigureDefaultFocus(continue_signin_button_);
   }
   return continue_signin_button_;
 }
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 0d52854..d6db3cb 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -293,7 +293,6 @@
     // An InMenuButton should always be focusable regardless of the platform.
     // Hence we don't use Button::ConfigureDefaultFocus().
     SetFocusBehavior(FocusBehavior::ALWAYS);
-    set_request_focus_on_press(false);
     SetHorizontalAlignment(gfx::ALIGN_CENTER);
 
     in_menu_background_ = new InMenuButtonBackground(type);
@@ -569,7 +568,6 @@
     // Since |fullscreen_button_| will reside in a menu, make it ALWAYS
     // focusable regardless of the platform.
     fullscreen_button_->SetFocusBehavior(FocusBehavior::ALWAYS);
-    fullscreen_button_->set_request_focus_on_press(false);
     fullscreen_button_->set_tag(fullscreen_index);
     fullscreen_button_->SetImageAlignment(
         ImageButton::ALIGN_CENTER, ImageButton::ALIGN_MIDDLE);
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 97e513e2..8b006f04 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -73,12 +73,9 @@
   set_context_menu_controller(this);
 
   // If the button is within a menu, we need to make it focusable in order to
-  // have it accessible via keyboard navigation, but it shouldn't request focus
-  // (because that would close the menu).
-  if (delegate_->ShownInsideMenu()) {
-    set_request_focus_on_press(false);
+  // have it accessible via keyboard navigation.
+  if (delegate_->ShownInsideMenu())
     SetFocusBehavior(FocusBehavior::ALWAYS);
-  }
 
   UpdateState();
 }
diff --git a/chrome/browser/ui/views/website_settings/chosen_object_view.cc b/chrome/browser/ui/views/website_settings/chosen_object_view.cc
index db53708..ff0a826 100644
--- a/chrome/browser/ui/views/website_settings/chosen_object_view.cc
+++ b/chrome/browser/ui/views/website_settings/chosen_object_view.cc
@@ -46,6 +46,7 @@
   // Create the delete button.
   delete_button_ = new views::ImageButton(this);
   views::Button::ConfigureDefaultFocus(delete_button_);
+  delete_button_->set_request_focus_on_press(true);
   delete_button_->SetTooltipText(
       l10n_util::GetStringUTF16(info_->ui_info.delete_tooltip_string_id));
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
diff --git a/chrome/browser/ui/views/website_settings/permission_selector_view.cc b/chrome/browser/ui/views/website_settings/permission_selector_view.cc
index 18a9755..b0c69a6 100644
--- a/chrome/browser/ui/views/website_settings/permission_selector_view.cc
+++ b/chrome/browser/ui/views/website_settings/permission_selector_view.cc
@@ -72,6 +72,7 @@
   UpdateThemedBorder();
 
   Button::ConfigureDefaultFocus(this);
+  set_request_focus_on_press(true);
   is_rtl_display_ =
       base::i18n::RIGHT_TO_LEFT == base::i18n::GetStringDirection(text);
 }
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index 92fad12e7..48a8bff 100644
--- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -133,6 +133,11 @@
 #else
       {"aboutProductTitle", IDS_PRODUCT_NAME},
 #endif
+      {"aboutGetHelpUsingChrome", IDS_SETTINGS_GET_HELP_USING_CHROME},
+
+#if defined(GOOGLE_CHROME_BUILD)
+      {"aboutReportAnIssue", IDS_SETTINGS_ABOUT_PAGE_REPORT_AN_ISSUE},
+#endif
 
 #if defined(OS_CHROMEOS)
       {"aboutChannelStable", IDS_SETTINGS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE},
@@ -619,6 +624,13 @@
       {"passwordsAndAutofillPageTitle",
        IDS_SETTINGS_PASSWORDS_AND_AUTOFILL_PAGE_TITLE},
       {"autofill", IDS_SETTINGS_AUTOFILL},
+      {"addresses", IDS_SETTINGS_AUTOFILL_ADDRESSES_HEADING},
+      {"addAddress", IDS_SETTINGS_AUTOFILL_ADD_ADDRESS_BUTTON},
+      {"creditCards", IDS_SETTINGS_AUTOFILL_CREDIT_CARD_HEADING},
+      {"addCreditCard", IDS_SETTINGS_AUTOFILL_ADD_CREDIT_CARD_BUTTON},
+      {"creditCardType", IDS_SETTINGS_AUTOFILL_CREDIT_CARD_TYPE_COLUMN_LABEL},
+      {"creditCardExpiration",
+       IDS_SETTINGS_AUTOFILL_CREDIT_CARD_EXPIRATION_COLUMN_LABEL},
       {"autofillDetail", IDS_SETTINGS_AUTOFILL_DETAIL},
       {"passwords", IDS_SETTINGS_PASSWORDS},
       {"passwordsDetail", IDS_SETTINGS_PASSWORDS_DETAIL},
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 71f7d2ae..02228c28 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -38,7 +38,6 @@
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/browser/shell_integration.h"
 #include "chrome/browser/ui/app_list/app_list_service.h"
-#include "chrome/browser/ui/cocoa/key_equivalent_constants.h"
 #include "chrome/common/channel_info.h"
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/chrome_paths.h"
@@ -52,12 +51,10 @@
 #include "extensions/browser/extension_registry.h"
 #include "extensions/common/extension.h"
 #include "grit/chrome_unscaled_resources.h"
-#include "grit/components_strings.h"
 #import "skia/ext/skia_utils_mac.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/base/l10n/l10n_util.h"
-#import "ui/base/l10n/l10n_util_mac.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/image/image_family.h"
 
@@ -635,50 +632,6 @@
 
 }  // namespace
 
-@interface CrCreateAppShortcutCheckboxObserver : NSObject {
- @private
-  NSButton* checkbox_;
-  NSButton* continueButton_;
-}
-
-- (id)initWithCheckbox:(NSButton*)checkbox
-        continueButton:(NSButton*)continueButton;
-- (void)startObserving;
-- (void)stopObserving;
-@end
-
-@implementation CrCreateAppShortcutCheckboxObserver
-
-- (id)initWithCheckbox:(NSButton*)checkbox
-        continueButton:(NSButton*)continueButton {
-  if ((self = [super init])) {
-    checkbox_ = checkbox;
-    continueButton_ = continueButton;
-  }
-  return self;
-}
-
-- (void)startObserving {
-  [checkbox_ addObserver:self
-              forKeyPath:@"cell.state"
-                 options:0
-                 context:nil];
-}
-
-- (void)stopObserving {
-  [checkbox_ removeObserver:self
-                 forKeyPath:@"cell.state"];
-}
-
-- (void)observeValueForKeyPath:(NSString*)keyPath
-                      ofObject:(id)object
-                        change:(NSDictionary*)change
-                       context:(void*)context {
-  [continueButton_ setEnabled:([checkbox_ state] == NSOnState)];
-}
-
-@end
-
 namespace web_app {
 
 WebAppShortcutCreator::WebAppShortcutCreator(
@@ -1145,68 +1098,6 @@
   return true;
 }
 
-// Called when the app's ShortcutInfo (with icon) is loaded when creating app
-// shortcuts.
-void CreateAppShortcutInfoLoaded(
-    Profile* profile,
-    const extensions::Extension* app,
-    const base::Callback<void(bool)>& close_callback,
-    std::unique_ptr<ShortcutInfo> shortcut_info) {
-  base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]);
-
-  NSButton* continue_button = [alert
-      addButtonWithTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_COMMIT)];
-  [continue_button setKeyEquivalent:kKeyEquivalentReturn];
-
-  NSButton* cancel_button =
-      [alert addButtonWithTitle:l10n_util::GetNSString(IDS_CANCEL)];
-  [cancel_button setKeyEquivalent:kKeyEquivalentEscape];
-
-  [alert setMessageText:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_LABEL)];
-  [alert setAlertStyle:NSInformationalAlertStyle];
-
-  base::scoped_nsobject<NSButton> application_folder_checkbox(
-      [[NSButton alloc] initWithFrame:NSZeroRect]);
-  [application_folder_checkbox setButtonType:NSSwitchButton];
-  [application_folder_checkbox
-      setTitle:l10n_util::GetNSString(IDS_CREATE_SHORTCUTS_APP_FOLDER_CHKBOX)];
-  [application_folder_checkbox setState:NSOnState];
-  [application_folder_checkbox sizeToFit];
-
-  base::scoped_nsobject<CrCreateAppShortcutCheckboxObserver> checkbox_observer(
-      [[CrCreateAppShortcutCheckboxObserver alloc]
-          initWithCheckbox:application_folder_checkbox
-            continueButton:continue_button]);
-  [checkbox_observer startObserving];
-
-  [alert setAccessoryView:application_folder_checkbox];
-
-  const int kIconPreviewSizePixels = 128;
-  const int kIconPreviewTargetSize = 64;
-  const gfx::Image* icon = shortcut_info->favicon.GetBest(
-      kIconPreviewSizePixels, kIconPreviewSizePixels);
-
-  if (icon && !icon->IsEmpty()) {
-    NSImage* icon_image = icon->ToNSImage();
-    [icon_image
-        setSize:NSMakeSize(kIconPreviewTargetSize, kIconPreviewTargetSize)];
-    [alert setIcon:icon_image];
-  }
-
-  bool dialog_accepted = false;
-  if ([alert runModal] == NSAlertFirstButtonReturn &&
-      [application_folder_checkbox state] == NSOnState) {
-    dialog_accepted = true;
-    CreateShortcuts(
-        SHORTCUT_CREATION_BY_USER, ShortcutLocations(), profile, app);
-  }
-
-  [checkbox_observer stopObserving];
-
-  if (!close_callback.is_null())
-    close_callback.Run(dialog_accepted);
-}
-
 void UpdateShortcutsForAllApps(Profile* profile,
                                const base::Closure& callback) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -1292,21 +1183,3 @@
 }  // namespace internals
 
 }  // namespace web_app
-
-namespace chrome {
-
-void ShowCreateChromeAppShortcutsDialog(
-    gfx::NativeWindow /*parent_window*/,
-    Profile* profile,
-    const extensions::Extension* app,
-    const base::Callback<void(bool)>& close_callback) {
-  web_app::GetShortcutInfoForApp(
-      app,
-      profile,
-      base::Bind(&web_app::CreateAppShortcutInfoLoaded,
-                 profile,
-                 app,
-                 close_callback));
-}
-
-}  // namespace chrome
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index b5b11594..814c7e3 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -110,7 +110,6 @@
       'browser/ui/profile_error_dialog.cc',
       'browser/ui/profile_error_dialog.h',
       'browser/ui/protocol_dialog_delegate.h',
-      'browser/ui/proximity_auth/proximity_auth_error_bubble.cc',
       'browser/ui/proximity_auth/proximity_auth_error_bubble.h',
       'browser/ui/screen_capture_notification_ui.h',
       'browser/ui/search/instant_page.cc',
@@ -657,12 +656,33 @@
       'browser/ui/aura/tab_contents/web_drag_bookmark_handler_aura.h',
       'browser/ui/ime/ime_window.cc',
       'browser/ui/ime/ime_window.h',
+      'browser/ui/views/accelerator_utils_aura.cc',
+      'browser/ui/views/apps/app_window_desktop_native_widget_aura_win.cc',
+      'browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h',
+      'browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc',
+      'browser/ui/views/apps/app_window_desktop_window_tree_host_win.h',
+      'browser/ui/views/apps/app_window_easy_resize_window_targeter.cc',
+      'browser/ui/views/apps/app_window_easy_resize_window_targeter.h',
+      'browser/ui/views/apps/chrome_app_window_client_views_chromeos.cc',
+      'browser/ui/views/apps/chrome_app_window_client_views_win.cc',
+      'browser/ui/views/apps/chrome_native_app_window_views_aura.cc',
+      'browser/ui/views/apps/chrome_native_app_window_views_aura.h',
+      'browser/ui/views/apps/chrome_native_app_window_views_win.cc',
+      'browser/ui/views/apps/chrome_native_app_window_views_win.h',
+      'browser/ui/views/apps/glass_app_window_frame_view_win.cc',
+      'browser/ui/views/apps/glass_app_window_frame_view_win.h',
+      'browser/ui/views/apps/shaped_app_window_targeter.cc',
+      'browser/ui/views/apps/shaped_app_window_targeter.h',
+      'browser/ui/views/color_chooser_aura.cc',
+      'browser/ui/views/color_chooser_aura.h',
       'browser/ui/views/crypto_module_password_dialog_view.cc',
       'browser/ui/views/crypto_module_password_dialog_view.h',
       'browser/ui/views/desktop_capture/desktop_media_picker_views.cc',
       'browser/ui/views/desktop_capture/desktop_media_picker_views.h',
       'browser/ui/views/desktop_media_picker_views_deprecated.cc',
       'browser/ui/views/desktop_media_picker_views_deprecated.h',
+      'browser/ui/views/dropdown_bar_host_aura.cc',
+      'browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc',
       'browser/ui/views/ime/ime_window_frame_view.cc',
       'browser/ui/views/ime/ime_window_frame_view.h',
       'browser/ui/views/ime/ime_window_view.cc',
@@ -918,6 +938,7 @@
       'browser/ui/cocoa/content_settings/cookie_tree_node.mm',
       'browser/ui/cocoa/content_settings/cookies_tree_controller_bridge.h',
       'browser/ui/cocoa/content_settings/cookies_tree_controller_bridge.mm',
+      'browser/ui/cocoa/create_application_shortcut_cocoa.mm',
       'browser/ui/cocoa/create_native_web_modal_manager_cocoa.mm',
       'browser/ui/cocoa/custom_frame_view.h',
       'browser/ui/cocoa/custom_frame_view.mm',
@@ -925,6 +946,8 @@
       'browser/ui/cocoa/dev_tools_controller.mm',
       'browser/ui/cocoa/download/background_theme.h',
       'browser/ui/cocoa/download/background_theme.mm',
+      'browser/ui/cocoa/download/download_danger_prompt_impl.cc',
+      'browser/ui/cocoa/download/download_danger_prompt_impl.h',
       'browser/ui/cocoa/download/download_item_button.h',
       'browser/ui/cocoa/download/download_item_button.mm',
       'browser/ui/cocoa/download/download_item_cell.h',
@@ -1293,6 +1316,7 @@
       # See crbug.com/590850
       'browser/ui/content_settings/content_setting_media_menu_model.cc',
       'browser/ui/content_settings/content_setting_media_menu_model.h',
+      'browser/ui/proximity_auth/proximity_auth_error_bubble_stub.cc',
     ],
     # Files used only on desktop systems (not iOS, Android, ChromeOS).
     'chrome_browser_ui_desktop_sources': [
@@ -1360,6 +1384,8 @@
       'browser/ui/views/frame/native_browser_frame_factory_auralinux.cc',
       'browser/ui/views/javascript_app_modal_dialog_views_x11.cc',
       'browser/ui/views/javascript_app_modal_dialog_views_x11.h',
+      'browser/ui/views/panels/x11_panel_resizer.cc',
+      'browser/ui/views/panels/x11_panel_resizer.h',
       'browser/ui/views/status_icons/status_icon_linux_wrapper.cc',
       'browser/ui/views/status_icons/status_icon_linux_wrapper.h',
       'browser/ui/webui/help/version_updater_basic.cc',
@@ -2134,25 +2160,8 @@
     ],
     # Cross-platform (except Mac) views sources.
     'chrome_browser_ui_views_non_mac_sources': [
-      'browser/ui/views/accelerator_utils_aura.cc',
       'browser/ui/views/accessibility/invert_bubble_view.cc',
       'browser/ui/views/accessibility/invert_bubble_view.h',
-      'browser/ui/views/apps/app_window_desktop_native_widget_aura_win.cc',
-      'browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h',
-      'browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc',
-      'browser/ui/views/apps/app_window_desktop_window_tree_host_win.h',
-      'browser/ui/views/apps/app_window_easy_resize_window_targeter.cc',
-      'browser/ui/views/apps/app_window_easy_resize_window_targeter.h',
-      'browser/ui/views/apps/chrome_app_window_client_views_chromeos.cc',
-      'browser/ui/views/apps/chrome_app_window_client_views_win.cc',
-      'browser/ui/views/apps/chrome_native_app_window_views_aura.cc',
-      'browser/ui/views/apps/chrome_native_app_window_views_aura.h',
-      'browser/ui/views/apps/chrome_native_app_window_views_win.cc',
-      'browser/ui/views/apps/chrome_native_app_window_views_win.h',
-      'browser/ui/views/apps/glass_app_window_frame_view_win.cc',
-      'browser/ui/views/apps/glass_app_window_frame_view_win.h',
-      'browser/ui/views/apps/shaped_app_window_targeter.cc',
-      'browser/ui/views/apps/shaped_app_window_targeter.h',
       'browser/ui/views/autofill/autofill_popup_base_view.cc',
       'browser/ui/views/autofill/autofill_popup_base_view.h',
       'browser/ui/views/autofill/autofill_popup_view_views.cc',
@@ -2195,8 +2204,6 @@
       'browser/ui/views/chrome_javascript_native_dialog_factory_views.cc',
       'browser/ui/views/chrome_views_delegate_chromeos.cc',
       'browser/ui/views/chrome_web_dialog_view.cc',
-      'browser/ui/views/color_chooser_aura.cc',
-      'browser/ui/views/color_chooser_aura.h',
       'browser/ui/views/color_chooser_win.cc',
       'browser/ui/views/confirm_bubble_views.cc',
       'browser/ui/views/confirm_bubble_views.h',
@@ -2221,9 +2228,7 @@
       'browser/ui/views/download/download_started_animation_views.cc',
       'browser/ui/views/dropdown_bar_host.cc',
       'browser/ui/views/dropdown_bar_host.h',
-      'browser/ui/views/dropdown_bar_host_aura.cc',
       'browser/ui/views/dropdown_bar_host_delegate.h',
-      'browser/ui/views/dropdown_bar_host_mac.mm',
       'browser/ui/views/dropdown_bar_view.cc',
       'browser/ui/views/dropdown_bar_view.h',
       'browser/ui/views/elevation_icon_setter.cc',
@@ -2238,14 +2243,8 @@
       'browser/ui/views/frame/browser_command_handler_linux.h',
       'browser/ui/views/frame/browser_frame.cc',
       'browser/ui/views/frame/browser_frame.h',
-      'browser/ui/views/frame/browser_frame_mac.h',
-      'browser/ui/views/frame/browser_frame_mac.mm',
       'browser/ui/views/frame/browser_non_client_frame_view.cc',
       'browser/ui/views/frame/browser_non_client_frame_view.h',
-      'browser/ui/views/frame/browser_non_client_frame_view_factory_mac.mm',
-      'browser/ui/views/frame/browser_non_client_frame_view_factory_views.cc',
-      'browser/ui/views/frame/browser_non_client_frame_view_mac.h',
-      'browser/ui/views/frame/browser_non_client_frame_view_mac.mm',
       'browser/ui/views/frame/browser_root_view.cc',
       'browser/ui/views/frame/browser_root_view.h',
       'browser/ui/views/frame/browser_shutdown.cc',
@@ -2264,7 +2263,6 @@
       'browser/ui/views/frame/contents_web_view.h',
       'browser/ui/views/frame/immersive_mode_controller.cc',
       'browser/ui/views/frame/immersive_mode_controller.h',
-      'browser/ui/views/frame/immersive_mode_controller_factory_mac.cc',
       'browser/ui/views/frame/immersive_mode_controller_factory_views.cc',
       'browser/ui/views/frame/immersive_mode_controller_stub.cc',
       'browser/ui/views/frame/immersive_mode_controller_stub.h',
@@ -2274,7 +2272,6 @@
       'browser/ui/views/frame/native_browser_frame_factory.cc',
       'browser/ui/views/frame/native_browser_frame_factory.h',
       'browser/ui/views/frame/native_browser_frame_factory_chromeos.cc',
-      'browser/ui/views/frame/native_browser_frame_factory_mac.mm',
       'browser/ui/views/frame/system_menu_insertion_delegate_win.cc',
       'browser/ui/views/frame/system_menu_insertion_delegate_win.h',
       'browser/ui/views/frame/system_menu_model_builder.cc',
@@ -2359,8 +2356,6 @@
       'browser/ui/views/panels/panel_view.h',
       'browser/ui/views/panels/taskbar_window_thumbnailer_win.cc',
       'browser/ui/views/panels/taskbar_window_thumbnailer_win.h',
-      'browser/ui/views/panels/x11_panel_resizer.cc',
-      'browser/ui/views/panels/x11_panel_resizer.h',
       'browser/ui/views/passwords/account_chooser_dialog_view.cc',
       'browser/ui/views/passwords/account_chooser_dialog_view.h',
       'browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc',
@@ -2432,7 +2427,6 @@
       'browser/ui/views/tabs/window_finder.cc',
       'browser/ui/views/tabs/window_finder.h',
       'browser/ui/views/tabs/window_finder_chromeos.cc',
-      'browser/ui/views/tabs/window_finder_mac.mm',
       'browser/ui/views/tabs/window_finder_win.cc',
       'browser/ui/views/task_manager_view.cc',
       'browser/ui/views/theme_copying_widget.cc',
@@ -2509,7 +2503,15 @@
     # migrate from mac_views_browser to a chrome://flag.
     'chrome_browser_ui_views_mac_experimental_sources': [
       'browser/ui/views/apps/chrome_app_window_client_views_mac.mm',
+      'browser/ui/views/dropdown_bar_host_mac.mm',
+      'browser/ui/views/frame/browser_frame_mac.h',
+      'browser/ui/views/frame/browser_frame_mac.mm',
+      'browser/ui/views/frame/browser_non_client_frame_view_factory_mac.mm',
+      'browser/ui/views/frame/browser_non_client_frame_view_mac.h',
+      'browser/ui/views/frame/browser_non_client_frame_view_mac.mm',
+      'browser/ui/views/frame/native_browser_frame_factory_mac.mm',
       'browser/ui/views/infobars/legacy_infobars_mac.cc',
+      'browser/ui/views/tabs/window_finder_mac.mm',
     ],
     # Windows-only. Assume ash/aura/views.
     'chrome_browser_ui_win_sources': [
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 2607e91..c69f3971 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1016,6 +1016,7 @@
       'test/data/webui/settings/easy_unlock_browsertest_chromeos.js',
       'test/data/webui/settings/languages_page_browsertest.js',
       'test/data/webui/settings/on_startup_browsertest.js',
+      'test/data/webui/settings/settings_autofill_section_browsertest.js',
       'test/data/webui/settings/settings_page_browsertest.js',
       'test/data/webui/settings/settings_passwords_section_browsertest.js',
       'test/data/webui/settings/settings_subpage_browsertest.js',
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index cddfdc5f..7bc1151 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1139,6 +1139,9 @@
 
 // Specifies which password store to use (detect, default, gnome, kwallet).
 const char kPasswordStore[]                 = "password-store";
+
+// Updates X11Desktophandler::wm_user_time_ms with the latest X server time.
+const char kWmUserTimeMs[]              = "wm-user-time-ms";
 #endif
 
 #if defined(OS_MACOSX)
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 5afe5188..7a3c884 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -332,6 +332,7 @@
 extern const char kHelp[];
 extern const char kHelpShort[];
 extern const char kPasswordStore[];
+extern const char kWmUserTimeMs[];
 #endif
 
 #if defined(OS_MACOSX)
diff --git a/chrome/test/data/webui/settings/about_page_tests.js b/chrome/test/data/webui/settings/about_page_tests.js
index b18298c..f70c60c 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -11,6 +11,8 @@
   var TestAboutPageBrowserProxy = function() {
     settings.TestBrowserProxy.call(this, [
       'refreshUpdateStatus',
+      'openHelpPage',
+      'openFeedbackDialog',
       'getCurrentChannel',
       'getVersionInfo',
     ]);
@@ -47,17 +49,58 @@
       this.methodCalled('getVersionInfo');
       return Promise.resolve(this.versionInfo_);
     },
+
+    /** @override */
+    openFeedbackDialog: function() {
+      this.methodCalled('openFeedbackDialog');
+    },
+
+    /** @override */
+    openHelpPage: function() {
+      this.methodCalled('openHelpPage');
+    },
   };
 
   function registerAboutPageTests() {
-      suite('AboutPageTest', function() {
-        test('Initialization', function() {
-          // TODO(dpapad): Implement this test once <settings-about-page> is
-          // ready. Currently this is needed to avoid failing with
-          // "Failure: Mocha ran, but no mocha tests were run!" on non-ChromeOS
-          // test bots.
-        });
+    suite('AboutPageTest', function() {
+      var page = null;
+      var browserProxy = null;
+
+      setup(function() {
+        browserProxy = new TestAboutPageBrowserProxy();
+        settings.AboutPageBrowserProxyImpl.instance_ = browserProxy;
+        PolymerTest.clearBody();
+        page = document.createElement('settings-about-page');
+        document.body.appendChild(page);
       });
+
+      test('GetHelp', function() {
+        assertTrue(!!page.$.help);
+        MockInteractions.tap(page.$.help);
+        return browserProxy.whenCalled('openHelpPage');
+      });
+    });
+  }
+
+  function registerOfficialBuildTests() {
+    suite('AboutPageTest_OfficialBuild', function() {
+      var page = null;
+      var browserProxy = null;
+
+      setup(function() {
+        browserProxy = new TestAboutPageBrowserProxy();
+        settings.AboutPageBrowserProxyImpl.instance_ = browserProxy;
+        PolymerTest.clearBody();
+        page = document.createElement('settings-about-page');
+        document.body.appendChild(page);
+      });
+
+      test('ReportAnIssue', function() {
+        assertTrue(!!page.$.reportIssue);
+        MockInteractions.tap(page.$.reportIssue);
+        return browserProxy.whenCalled('openFeedbackDialog');
+      });
+    });
   }
 
   if (cr.isChromeOS) {
@@ -106,5 +149,6 @@
       }
       registerAboutPageTests();
     },
+    registerOfficialBuildTests: registerOfficialBuildTests,
   };
 });
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js
index 97c0483..9505683 100644
--- a/chrome/test/data/webui/settings/cr_settings_browsertest.js
+++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -91,6 +91,13 @@
   mocha.run();
 });
 
+GEN('#if defined(GOOGLE_CHROME_BUILD)');
+TEST_F('CrSettingsAboutPageTest', 'AboutPage_OfficialBuild', function() {
+  settings_about_page.registerOfficialBuildTests();
+  mocha.run();
+});
+GEN('#endif');
+
 GEN('#if defined(OS_CHROMEOS)');
 /**
  * Test fixture for
diff --git a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
new file mode 100644
index 0000000..ac82b06
--- /dev/null
+++ b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
@@ -0,0 +1,206 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/** @fileoverview Runs the Polymer Autofill Settings tests. */
+
+/** @const {string} Path to root from chrome/test/data/webui/settings/. */
+var ROOT_PATH = '../../../../../';
+
+// Polymer BrowserTest fixture.
+GEN_INCLUDE(
+    [ROOT_PATH + 'chrome/test/data/webui/polymer_browser_test_base.js']);
+
+/**
+ * @constructor
+ * @extends {PolymerTest}
+ */
+function SettingsAutofillSectionBrowserTest() {}
+
+SettingsAutofillSectionBrowserTest.prototype = {
+  __proto__: PolymerTest.prototype,
+
+  /** @override */
+  browsePreload:
+      'chrome://md-settings/passwords_and_forms_page/autofill_section.html',
+
+  /** @override */
+  extraLibraries: PolymerTest.getLibraries(ROOT_PATH),
+
+  /** @override */
+  setUp: function() {
+    PolymerTest.prototype.setUp.call(this);
+
+    // Test is run on an individual element that won't have a page language.
+    this.accessibilityAuditConfig.auditRulesToIgnore.push('humanLangMissing');
+  },
+
+  /**
+   * Replaces any 'x' in a string with a random number of the base.
+   * @param {!string} pattern The pattern that should be used as an input.
+   * @param {!number} base The number base. ie: 16 for hex or 10 for decimal.
+   * @return {!string}
+   * @private
+   */
+  patternMaker_: function(pattern, base) {
+    return pattern.replace(/x/g, function() {
+      return Math.floor(Math.random() * base).toString(base);
+    });
+  },
+
+  /**
+   * Creates a new random GUID for testing.
+   * @return {!string}
+   * @private
+   */
+  makeGuid_: function() {
+    return this.patternMaker_('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 16);
+  },
+
+  /**
+   * Creates a fake address entry for testing.
+   * @return {!chrome.autofillPrivate.AddressEntry}
+   * @private
+   */
+  createFakeAddressEntry_: function() {
+    var ret = {};
+    ret.guid = this.makeGuid_();
+    ret.fullNames = ['John', 'Doe'];
+    ret.companyName = 'Google';
+    ret.addressLines = this.patternMaker_('xxxx Main St', 10);
+    ret.addressLevel1 = "CA";
+    ret.addressLevel2 = "Venice";
+    ret.postalCode = this.patternMaker_('xxxxx', 10);
+    ret.countryCode = 'US';
+    ret.phoneNumbers = [this.patternMaker_('(xxx) xxx-xxxx', 10)];
+    ret.emailAddresses = [this.patternMaker_('userxxxx@gmail.com', 16)];
+    ret.languageCode = 'EN-US';
+    ret.metadata = {isLocal: true};
+    ret.metadata.summaryLabel = ret.fullNames[0];
+    ret.metadata.summarySublabel = ' ' + ret.addressLines;
+    return ret;
+  },
+
+  /**
+   * Creates a new random credit card entry for testing.
+   * @return {!chrome.autofillPrivate.CreditCardEntry}
+   * @private
+   */
+  createFakeCreditCardEntry_: function() {
+    var ret = {};
+    ret.guid = this.makeGuid_();
+    ret.name = 'Jane Doe';
+    ret.cardNumber = this.patternMaker_('xxxx xxxx xxxx xxxx', 10);
+    ret.expirationMonth = Math.ceil(Math.random() * 11).toString();
+    ret.expirationYear = (2016 + Math.floor(Math.random() * 5)).toString();
+    ret.metadata = {isLocal: true};
+    var cards = ['Visa', 'Mastercard', 'Discover', 'Card'];
+    var card = cards[Math.floor(Math.random() * cards.length)];
+    ret.metadata.summaryLabel = card + ' ' + '****' + ret.cardNumber.substr(-4);
+    return ret;
+  },
+
+  /**
+   * Allow the iron-list to be sized properly.
+   * @param {!Object} autofillSection
+   * @private
+   */
+  flushAutofillSection_: function(autofillSection) {
+    autofillSection.$.addressList.notifyResize();
+    autofillSection.$.creditCardList.notifyResize();
+    Polymer.dom.flush();
+  },
+  /**
+   * Creates the autofill section for the given lists.
+   * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList
+   * @param {!Array<!chrome.passwordsPrivate.ExceptionPair>} exceptionList
+   * @return {!Object}
+   * @private
+   */
+  createAutofillSection_: function(addresses, creditCards) {
+    // Create a passwords-section to use for testing.
+    var section = document.createElement('settings-autofill-section');
+    section.addresses = addresses;
+    section.creditCards = creditCards;
+    document.body.appendChild(section);
+    this.flushAutofillSection_(section);
+    return section;
+  },
+};
+
+/**
+ * This test will validate that the section is loaded with data.
+ */
+TEST_F('SettingsAutofillSectionBrowserTest', 'uiTests', function() {
+  var self = this;
+
+  suite('AutofillSection', function() {
+    test('verifyCreditCardCount', function() {
+      var creditCards = [
+        self.createFakeCreditCardEntry_(),
+        self.createFakeCreditCardEntry_(),
+        self.createFakeCreditCardEntry_(),
+        self.createFakeCreditCardEntry_(),
+        self.createFakeCreditCardEntry_(),
+        self.createFakeCreditCardEntry_(),
+      ];
+
+      var section = self.createAutofillSection_([], creditCards);
+
+      assertTrue(!!section);
+      var creditCardList = section.$.creditCardList;
+      assertTrue(!!creditCardList);
+      assertEquals(creditCards, creditCardList.items);
+      // +1 for the template element.
+      assertEquals(creditCards.length + 1, creditCardList.children.length);
+    });
+
+    test('verifyCreditCardFields', function() {
+      var creditCard = self.createFakeCreditCardEntry_();
+      var section = self.createAutofillSection_([], [creditCard]);
+      var creditCardList = section.$.creditCardList;
+      var row = creditCardList.children[1];  // Skip over the template.
+      assertTrue(!!row);
+
+      assertEquals(creditCard.metadata.summaryLabel,
+                   row.querySelector('#creditCardLabel').textContent);
+      assertEquals(creditCard.expirationMonth + '/' + creditCard.expirationYear,
+                   row.querySelector('#creditCardExpiration').textContent);
+    });
+
+    test('verifyAddressCount', function() {
+      var addresses = [
+        self.createFakeAddressEntry_(),
+        self.createFakeAddressEntry_(),
+        self.createFakeAddressEntry_(),
+        self.createFakeAddressEntry_(),
+        self.createFakeAddressEntry_(),
+      ];
+
+      var section = self.createAutofillSection_(addresses, []);
+
+      assertTrue(!!section);
+      var addressList = section.$.addressList;
+      assertTrue(!!addressList);
+      assertEquals(addresses, addressList.items);
+      // +1 for the template element.
+      assertEquals(addresses.length + 1, addressList.children.length);
+    });
+
+    test('verifyAddressFields', function() {
+      var address = self.createFakeAddressEntry_();
+      var section = self.createAutofillSection_([address], []);
+      var addressList = section.$.addressList;
+      var row = addressList.children[1];  // Skip over the template.
+      assertTrue(!!row);
+
+      var addressSummary = address.metadata.summaryLabel +
+                           address.metadata.summarySublabel;
+
+      assertEquals(addressSummary,
+                   row.querySelector('#addressSummary').textContent);
+    });
+  });
+
+  mocha.run();
+});
diff --git a/chromecast/browser/android/BUILD.gn b/chromecast/browser/android/BUILD.gn
index a739cea4..9ab6299 100644
--- a/chromecast/browser/android/BUILD.gn
+++ b/chromecast/browser/android/BUILD.gn
@@ -32,7 +32,6 @@
     "$java_src_dir/org/chromium/chromecast/shell/CastCrashUploader.java",
     "$java_src_dir/org/chromium/chromecast/shell/CastMetricsHelper.java",
     "$java_src_dir/org/chromium/chromecast/shell/CastShellActivity.java",
-    "$java_src_dir/org/chromium/chromecast/shell/CastSwitches.java",
     "$java_src_dir/org/chromium/chromecast/shell/CastSysInfoAndroid.java",
     "$java_src_dir/org/chromium/chromecast/shell/CastWindowAndroid.java",
     "$java_src_dir/org/chromium/chromecast/shell/CastWindowManager.java",
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastBrowserHelper.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastBrowserHelper.java
index 70fc9cd..6c2c317 100644
--- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastBrowserHelper.java
+++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastBrowserHelper.java
@@ -19,7 +19,6 @@
 import org.chromium.content.app.ContentApplication;
 import org.chromium.content.browser.BrowserStartupController;
 import org.chromium.content.browser.DeviceUtils;
-import org.chromium.content.common.ContentSwitches;
 import org.chromium.net.NetworkChangeNotifier;
 
 /**
@@ -59,9 +58,6 @@
             }
         }
 
-        CommandLine.getInstance().appendSwitchWithValue(
-                ContentSwitches.FORCE_DEVICE_SCALE_FACTOR, "1");
-
         waitForDebuggerIfNeeded();
 
         DeviceUtils.addDeviceSpecificUserAgentSwitch(context);
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastShellActivity.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastShellActivity.java
index 32231cca..4f36020 100644
--- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastShellActivity.java
+++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastShellActivity.java
@@ -19,13 +19,11 @@
 import android.view.WindowManager;
 import android.widget.Toast;
 
-import org.chromium.base.CommandLine;
 import org.chromium.base.Log;
 import org.chromium.content.browser.ActivityContentVideoViewEmbedder;
 import org.chromium.content.browser.ContentVideoViewEmbedder;
 import org.chromium.content.browser.ContentViewClient;
 import org.chromium.content.browser.ContentViewCore;
-import org.chromium.content.common.ContentSwitches;
 import org.chromium.ui.base.WindowAndroid;
 
 /**
@@ -36,9 +34,6 @@
     private static final boolean DEBUG = false;
 
     private static final String ACTIVE_SHELL_URL_KEY = "activeUrl";
-    private static final int DEFAULT_HEIGHT_PIXELS = 720;
-    public static final String ACTION_EXTRA_RESOLUTION_HEIGHT =
-            "org.chromium.chromecast.shell.intent.extra.RESOLUTION_HEIGHT";
 
     private CastWindowManager mCastWindowManager;
     private AudioManager mAudioManager;
@@ -112,7 +107,6 @@
                     finish();
                 }
             });
-        setResolution();
         mCastWindowManager.setWindow(new WindowAndroid(this));
 
         registerBroadcastReceiver();
@@ -270,29 +264,6 @@
         broadcastManager.unregisterReceiver(mBroadcastReceiver);
     }
 
-    private void setResolution() {
-        CommandLine commandLine = CommandLine.getInstance();
-        int defaultHeight = DEFAULT_HEIGHT_PIXELS;
-        if (commandLine.hasSwitch(CastSwitches.DEFAULT_RESOLUTION_HEIGHT)) {
-            String commandLineHeightString =
-                    commandLine.getSwitchValue(CastSwitches.DEFAULT_RESOLUTION_HEIGHT);
-            try {
-                defaultHeight = Integer.parseInt(commandLineHeightString);
-            } catch (NumberFormatException e) {
-                Log.w(TAG, "Ignored invalid height: %d", commandLineHeightString);
-            }
-        }
-        int requestedHeight =
-                getIntent().getIntExtra(ACTION_EXTRA_RESOLUTION_HEIGHT, defaultHeight);
-        int displayHeight = getResources().getDisplayMetrics().heightPixels;
-        // Clamp within [defaultHeight, displayHeight]
-        int desiredHeight = Math.min(displayHeight, Math.max(defaultHeight, requestedHeight));
-        double deviceScaleFactor = ((double) displayHeight) / desiredHeight;
-        Log.d(TAG, "Using scale factor %f to set height %d", deviceScaleFactor, desiredHeight);
-        commandLine.appendSwitchWithValue(
-                ContentSwitches.FORCE_DEVICE_SCALE_FACTOR, String.valueOf(deviceScaleFactor));
-    }
-
     private void exitIfUrlMissing() {
         Intent intent = getIntent();
         if (intent != null && intent.getData() != null && !intent.getData().equals(Uri.EMPTY)) {
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastSwitches.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastSwitches.java
deleted file mode 100644
index a61e28a0..0000000
--- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastSwitches.java
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chromecast.shell;
-
-/**
- * Contains command line switches specific to Cast on Android.
- */
-public final class CastSwitches {
-    // Default height to start an application at, unless the application explicitly requests
-    // a different height. If unspecified, this defaults to 720px.
-    public static final String DEFAULT_RESOLUTION_HEIGHT = "default-resolution-height";
-}
diff --git a/chromecast/browser/android/cast_window_android.cc b/chromecast/browser/android/cast_window_android.cc
index 8e4bfae5..95966aa 100644
--- a/chromecast/browser/android/cast_window_android.cc
+++ b/chromecast/browser/android/cast_window_android.cc
@@ -61,8 +61,7 @@
 }
 
 void CastWindowAndroid::Initialize() {
-  web_contents_ =
-      content_window_->CreateWebContents(gfx::Size(), browser_context_);
+  web_contents_ = content_window_->CreateWebContents(browser_context_);
   web_contents_->SetDelegate(this);
   content::WebContentsObserver::Observe(web_contents_.get());
 
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc
index 6d278e2..b4c86b0b 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -368,11 +368,7 @@
 #endif
 
 #if defined(USE_AURA)
-  // Screen can (and should) exist even with no displays connected. Its presence
-  // is assumed as an interface to access display information, e.g. from metrics
-  // code.  See CastContentWindow::CreateWindowTree for update when resolution
-  // is available.
-  cast_browser_process_->SetCastScreen(base::WrapUnique(new CastScreen));
+  cast_browser_process_->SetCastScreen(base::WrapUnique(new CastScreen()));
   DCHECK(!display::Screen::GetScreen());
   display::Screen::SetScreenInstance(cast_browser_process_->cast_screen());
 #endif
@@ -424,11 +420,10 @@
   // TODO(halliwell) move audio builds to use ozone_platform_cast, then can
   // simplify this by removing DISABLE_DISPLAY condition.  Should then also
   // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone.
-  video_plane_controller_.reset(
-      new media::VideoPlaneController(GetMediaTaskRunner()));
-  cast_browser_process_->cast_screen()->SetDisplayResizeCallback(
-      base::Bind(&media::VideoPlaneController::SetGraphicsPlaneResolution,
-                 base::Unretained(video_plane_controller_.get())));
+  gfx::Size display_size =
+      display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel();
+  video_plane_controller_.reset(new media::VideoPlaneController(
+      Size(display_size.width(), display_size.height()), GetMediaTaskRunner()));
   ui::OverlayManagerCast::SetOverlayCompositedCallback(
       base::Bind(&media::VideoPlaneController::SetGeometry,
                  base::Unretained(video_plane_controller_.get())));
diff --git a/chromecast/browser/cast_content_window.cc b/chromecast/browser/cast_content_window.cc
index 3223d83..cd7e7e2 100644
--- a/chromecast/browser/cast_content_window.cc
+++ b/chromecast/browser/cast_content_window.cc
@@ -14,6 +14,8 @@
 #include "content/public/browser/render_widget_host_view.h"
 #include "content/public/browser/web_contents.h"
 #include "ipc/ipc_message.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
 
 #if defined(USE_AURA)
 #include "chromecast/graphics/cast_screen.h"
@@ -68,21 +70,15 @@
 #endif
 }
 
-void CastContentWindow::CreateWindowTree(
-    const gfx::Size& initial_size,
-    content::WebContents* web_contents) {
+void CastContentWindow::CreateWindowTree(content::WebContents* web_contents) {
 #if defined(USE_AURA)
   // Aura initialization
-  CastScreen* cast_screen =
-      shell::CastBrowserProcess::GetInstance()->cast_screen();
-  if (!display::Screen::GetScreen())
-    display::Screen::SetScreenInstance(cast_screen);
-  if (cast_screen->GetPrimaryDisplay().size() != initial_size)
-    cast_screen->UpdateDisplaySize(initial_size);
-
+  DCHECK(display::Screen::GetScreen());
+  gfx::Size display_size =
+      display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel();
   CHECK(aura::Env::GetInstance());
   window_tree_host_.reset(
-      aura::WindowTreeHost::Create(gfx::Rect(initial_size)));
+      aura::WindowTreeHost::Create(gfx::Rect(display_size)));
   window_tree_host_->InitHost();
   window_tree_host_->window()->SetLayoutManager(
       new CastFillLayout(window_tree_host_->window()));
@@ -106,11 +102,14 @@
 }
 
 std::unique_ptr<content::WebContents> CastContentWindow::CreateWebContents(
-    const gfx::Size& initial_size,
     content::BrowserContext* browser_context) {
+  CHECK(display::Screen::GetScreen());
+  gfx::Size display_size =
+      display::Screen::GetScreen()->GetPrimaryDisplay().size();
+
   content::WebContents::CreateParams create_params(browser_context, NULL);
   create_params.routing_id = MSG_ROUTING_NONE;
-  create_params.initial_size = initial_size;
+  create_params.initial_size = display_size;
   content::WebContents* web_contents = content::WebContents::Create(
       create_params);
   content::WebContentsObserver::Observe(web_contents);
diff --git a/chromecast/browser/cast_content_window.h b/chromecast/browser/cast_content_window.h
index af4ce42..dfce908 100644
--- a/chromecast/browser/cast_content_window.h
+++ b/chromecast/browser/cast_content_window.h
@@ -37,12 +37,10 @@
   // CreateWindowTree).
   void SetTransparent() { transparent_ = true; }
 
-  // Create a window with the given size for |web_contents|.
-  void CreateWindowTree(const gfx::Size& initial_size,
-                        content::WebContents* web_contents);
+  // Create a full-screen window for |web_contents|.
+  void CreateWindowTree(content::WebContents* web_contents);
 
   std::unique_ptr<content::WebContents> CreateWebContents(
-      const gfx::Size& initial_size,
       content::BrowserContext* browser_context);
 
   // content::WebContentsObserver implementation:
diff --git a/chromecast/browser/service/cast_service_simple.cc b/chromecast/browser/service/cast_service_simple.cc
index 95a497f8..25ebc50 100644
--- a/chromecast/browser/service/cast_service_simple.cc
+++ b/chromecast/browser/service/cast_service_simple.cc
@@ -51,12 +51,9 @@
 }
 
 void CastServiceSimple::StartInternal() {
-  // This is the simple version that hard-codes the size.
-  gfx::Size initial_size(1280, 720);
-
   window_.reset(new CastContentWindow);
-  web_contents_ = window_->CreateWebContents(initial_size, browser_context());
-  window_->CreateWindowTree(initial_size, web_contents_.get());
+  web_contents_ = window_->CreateWebContents(browser_context());
+  window_->CreateWindowTree(web_contents_.get());
 
   web_contents_->GetController().LoadURL(startup_url_, content::Referrer(),
                                          ui::PAGE_TRANSITION_TYPED,
diff --git a/chromecast/browser/test/chromecast_browser_test_helper_default.cc b/chromecast/browser/test/chromecast_browser_test_helper_default.cc
index 2c5bf496..3830fc4 100644
--- a/chromecast/browser/test/chromecast_browser_test_helper_default.cc
+++ b/chromecast/browser/test/chromecast_browser_test_helper_default.cc
@@ -22,11 +22,10 @@
 
   content::WebContents* NavigateToURL(const GURL& url) override {
     window_.reset(new CastContentWindow);
-    gfx::Size initial_size(1280, 720);
 
     web_contents_ = window_->CreateWebContents(
-        initial_size, CastBrowserProcess::GetInstance()->browser_context());
-    window_->CreateWindowTree(initial_size, web_contents_.get());
+        CastBrowserProcess::GetInstance()->browser_context());
+    window_->CreateWindowTree(web_contents_.get());
 
     content::WaitForLoadStop(web_contents_.get());
     content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1);
diff --git a/chromecast/graphics/cast_screen.cc b/chromecast/graphics/cast_screen.cc
index b88d75a6..a31ebb20 100644
--- a/chromecast/graphics/cast_screen.cc
+++ b/chromecast/graphics/cast_screen.cc
@@ -6,9 +6,12 @@
 
 #include <stdint.h>
 
+#include "base/command_line.h"
+#include "chromecast/public/graphics_properties_shlib.h"
 #include "ui/aura/env.h"
 #include "ui/display/screen.h"
 #include "ui/gfx/geometry/rect_conversions.h"
+#include "ui/gfx/geometry/size.h"
 #include "ui/gfx/geometry/size_conversions.h"
 #include "ui/gfx/native_widget_types.h"
 
@@ -18,32 +21,23 @@
 
 const int64_t kDisplayId = 1;
 
-const int k720pWidth = 1280;
-const int k720pHeight = 720;
-
-// When CastScreen is first initialized, we may not have any display info
-// available. These constants hold the initial size that we default to, and
-// the size can be updated when we have actual display info at hand with
-// UpdateDisplaySize().
-const int kInitDisplayWidth = k720pWidth;
-const int kInitDisplayHeight = k720pHeight;
+// Helper to return the screen resolution (device pixels)
+// to use.
+gfx::Size GetScreenResolution() {
+  if (GraphicsPropertiesShlib::IsSupported(
+          GraphicsPropertiesShlib::k1080p,
+          base::CommandLine::ForCurrentProcess()->argv())) {
+    return gfx::Size(1920, 1080);
+  } else {
+    return gfx::Size(1280, 720);
+  }
+}
 
 }  // namespace
 
 CastScreen::~CastScreen() {
 }
 
-void CastScreen::SetDisplayResizeCallback(const DisplayResizeCallback& cb) {
-  DCHECK(!cb.is_null());
-  display_resize_cb_ = cb;
-}
-
-void CastScreen::UpdateDisplaySize(const gfx::Size& size) {
-  display_.SetScaleAndBounds(1.0f, gfx::Rect(size));
-  if (!display_resize_cb_.is_null())
-    display_resize_cb_.Run(Size(size.width(), size.height()));
-}
-
 gfx::Point CastScreen::GetCursorScreenPoint() {
   return aura::Env::GetInstance()->last_mouse_location();
 }
@@ -89,8 +83,10 @@
 void CastScreen::RemoveObserver(display::DisplayObserver* observer) {}
 
 CastScreen::CastScreen() : display_(kDisplayId) {
-  display_.SetScaleAndBounds(1.0f,
-                             gfx::Rect(kInitDisplayWidth, kInitDisplayHeight));
+  // Device scale factor computed relative to 720p display
+  const gfx::Size size = GetScreenResolution();
+  const float device_scale_factor = size.height() / 720.0f;
+  display_.SetScaleAndBounds(device_scale_factor, gfx::Rect(size));
 }
 
 }  // namespace chromecast
diff --git a/chromecast/graphics/cast_screen.h b/chromecast/graphics/cast_screen.h
index a8d497c..c100a89 100644
--- a/chromecast/graphics/cast_screen.h
+++ b/chromecast/graphics/cast_screen.h
@@ -5,7 +5,6 @@
 #ifndef CHROMECAST_GRAPHICS_CAST_SCREEN_H_
 #define CHROMECAST_GRAPHICS_CAST_SCREEN_H_
 
-#include "base/callback.h"
 #include "base/macros.h"
 #include "chromecast/public/graphics_types.h"
 #include "ui/display/display.h"
@@ -25,12 +24,6 @@
  public:
   ~CastScreen() override;
 
-  using DisplayResizeCallback = base::Callback<void(const Size&)>;
-  void SetDisplayResizeCallback(const DisplayResizeCallback& cb);
-
-  // Updates the primary display size.
-  void UpdateDisplaySize(const gfx::Size& size);
-
   // display::Screen overrides:
   gfx::Point GetCursorScreenPoint() override;
   bool IsWindowUnderCursor(gfx::NativeWindow window) override;
@@ -50,7 +43,6 @@
   CastScreen();
 
   display::Display display_;
-  DisplayResizeCallback display_resize_cb_;
 
   friend class shell::CastBrowserMainParts;
 
diff --git a/chromecast/media/base/video_plane_controller.cc b/chromecast/media/base/video_plane_controller.cc
index 00b45e5..2c0864e 100644
--- a/chromecast/media/base/video_plane_controller.cc
+++ b/chromecast/media/base/video_plane_controller.cc
@@ -140,12 +140,12 @@
 };
 
 VideoPlaneController::VideoPlaneController(
+    const Size& graphics_resolution,
     scoped_refptr<base::SingleThreadTaskRunner> media_task_runner)
     : is_paused_(false),
       have_screen_res_(false),
-      have_graphics_plane_res_(false),
       screen_res_(0, 0),
-      graphics_plane_res_(0, 0),
+      graphics_plane_res_(graphics_resolution),
       have_video_plane_geometry_(false),
       video_plane_display_rect_(0, 0),
       video_plane_transform_(VideoPlane::TRANSFORM_NONE),
@@ -195,27 +195,6 @@
   MaybeRunSetGeometry();
 }
 
-void VideoPlaneController::SetGraphicsPlaneResolution(const Size& resolution) {
-  DCHECK(thread_checker_.CalledOnValidThread());
-  DCHECK(ResolutionSizeValid(resolution));
-  if (have_graphics_plane_res_ && SizeEqual(resolution, graphics_plane_res_)) {
-    VLOG(2) << "No change found in graphics plane resolution.";
-    return;
-  }
-
-  VLOG(1) << "New graphics plane resolution " << resolution.width << "x"
-          << resolution.height;
-
-  have_graphics_plane_res_ = true;
-  graphics_plane_res_ = resolution;
-
-  // Any cached video plane geometry parameters are no longer valid since they
-  // were relative to the PREVIOUS graphics plane resolution. Thus, the cached
-  // parameters are cleared, and it's the caller's responsibility to call
-  // SetGeometry() with arguments relative to the NEW graphics plane if needed.
-  ClearVideoPlaneGeometry();
-}
-
 void VideoPlaneController::Pause() {
   DCHECK(thread_checker_.CalledOnValidThread());
   VLOG(1) << "Pausing controller. No more VideoPlane SetGeometry calls.";
@@ -267,8 +246,7 @@
 }
 
 bool VideoPlaneController::HaveDataForSetGeometry() const {
-  return have_screen_res_ && have_graphics_plane_res_ &&
-         have_video_plane_geometry_;
+  return have_screen_res_ && have_video_plane_geometry_;
 }
 
 void VideoPlaneController::ClearVideoPlaneGeometry() {
diff --git a/chromecast/media/base/video_plane_controller.h b/chromecast/media/base/video_plane_controller.h
index 04e9b943..3d08d14a 100644
--- a/chromecast/media/base/video_plane_controller.h
+++ b/chromecast/media/base/video_plane_controller.h
@@ -32,7 +32,8 @@
 // constructed on.
 class VideoPlaneController {
  public:
-  explicit VideoPlaneController(
+  VideoPlaneController(
+      const Size& graphics_resolution,
       scoped_refptr<base::SingleThreadTaskRunner> media_task_runner);
   ~VideoPlaneController();
   // Sets the video plane geometry in *graphics plane coordinates*. If there is
@@ -46,13 +47,6 @@
   // from the last call to this method, it is a no-op.
   void SetScreenResolution(const Size& resolution);
 
-  // Sets graphics hardware plane resolution, and clears any cached video plane
-  // geometry parameters. This must be called at least once when the hardware
-  // graphics plane resolution (same resolution as display::Screen) is known,
-  // then later when it changes. If there is no change to the graphics plane
-  // resolution from the last call to this method, it is a no-op.
-  void SetGraphicsPlaneResolution(const Size& resolution);
-
   // After Pause is called, no further calls to VideoPlane::SetGeometry will be
   // made except for any pending calls already scheduled on the media thread.
   // The Set methods will however update cached parameters that will take
@@ -84,9 +78,8 @@
 
   // Current resolutions
   bool have_screen_res_;
-  bool have_graphics_plane_res_;
   Size screen_res_;
-  Size graphics_plane_res_;
+  const Size graphics_plane_res_;
 
   // Saved video plane parameters (in graphics plane coordinates)
   // for use when screen resolution changes.
diff --git a/components/BUILD.gn b/components/BUILD.gn
index faab3f48..9efab1e 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -65,6 +65,7 @@
     "//components/browser_sync/browser:unit_tests",
     "//components/bubble:unit_tests",
     "//components/captive_portal:unit_tests",
+    "//components/certificate_reporting:unit_tests",
     "//components/client_update_protocol:unit_tests",
     "//components/cloud_devices/common:unit_tests",
     "//components/component_updater:unit_tests",
diff --git a/components/certificate_reporting/cert_logger.proto b/components/certificate_reporting/cert_logger.proto
index 846c7f9..a89fe92 100644
--- a/components/certificate_reporting/cert_logger.proto
+++ b/components/certificate_reporting/cert_logger.proto
@@ -91,4 +91,10 @@
   // |cert_chain|, which is the chain the client built during
   // verification.
   optional string unverified_cert_chain = 8;
-};
\ No newline at end of file
+
+  // True if the certificate was rooted at a standard CA root ,as opposed to a
+  // user-installed root, but is only meaningful if the underlying certificate
+  // validation library built a trusted chain (i.e. the Chrome net stack set the
+  // error, not the library).
+  optional bool is_issued_by_known_root = 9;
+};
diff --git a/components/certificate_reporting/error_report.cc b/components/certificate_reporting/error_report.cc
index c5233ee0..1fb98c4 100644
--- a/components/certificate_reporting/error_report.cc
+++ b/components/certificate_reporting/error_report.cc
@@ -77,6 +77,7 @@
   }
 
   cert_report_->add_pin(ssl_info.pinning_failure_log);
+  cert_report_->set_is_issued_by_known_root(ssl_info.is_issued_by_known_root);
 
   AddCertStatusToReportErrors(ssl_info.cert_status, cert_report_.get());
 }
diff --git a/components/certificate_reporting/error_report_unittest.cc b/components/certificate_reporting/error_report_unittest.cc
index b1345b7..18ef459 100644
--- a/components/certificate_reporting/error_report_unittest.cc
+++ b/components/certificate_reporting/error_report_unittest.cc
@@ -68,15 +68,9 @@
   return cert_data;
 }
 
-// Test that a serialized ErrorReport can be deserialized as
-// a CertLoggerRequest protobuf (which is the format that the receiving
-// server expects it in) with the right data in it.
-TEST(ErrorReportTest, SerializedReportAsProtobuf) {
+void VerifyErrorReportSerialization(const ErrorReport& report,
+                                    const SSLInfo& ssl_info) {
   std::string serialized_report;
-  SSLInfo ssl_info;
-  ASSERT_NO_FATAL_FAILURE(
-      GetTestSSLInfo(INCLUDE_UNVERIFIED_CERT_CHAIN, &ssl_info));
-  ErrorReport report(kDummyHostname, ssl_info);
   ASSERT_TRUE(report.Serialize(&serialized_report));
 
   CertLoggerRequest deserialized_report;
@@ -86,12 +80,32 @@
   EXPECT_EQ(GetPEMEncodedChain(), deserialized_report.unverified_cert_chain());
   EXPECT_EQ(1, deserialized_report.pin().size());
   EXPECT_EQ(kDummyFailureLog, deserialized_report.pin().Get(0));
-
+  EXPECT_EQ(
+      ssl_info.is_issued_by_known_root,
+      deserialized_report.is_issued_by_known_root());
   EXPECT_THAT(
       deserialized_report.cert_error(),
       UnorderedElementsAre(kFirstReportedCertError, kSecondReportedCertError));
 }
 
+// Test that a serialized ErrorReport can be deserialized as
+// a CertLoggerRequest protobuf (which is the format that the receiving
+// server expects it in) with the right data in it.
+TEST(ErrorReportTest, SerializedReportAsProtobuf) {
+  SSLInfo ssl_info;
+  ASSERT_NO_FATAL_FAILURE(
+      GetTestSSLInfo(INCLUDE_UNVERIFIED_CERT_CHAIN, &ssl_info));
+  ErrorReport report_known(kDummyHostname, ssl_info);
+  ASSERT_NO_FATAL_FAILURE(
+      VerifyErrorReportSerialization(report_known, ssl_info));
+  // Test that both values for |is_issued_by_known_root| are serialized
+  // correctly.
+  ssl_info.is_issued_by_known_root = false;
+  ErrorReport report_unknown(kDummyHostname, ssl_info);
+  ASSERT_NO_FATAL_FAILURE(
+      VerifyErrorReportSerialization(report_unknown, ssl_info));
+}
+
 TEST(ErrorReportTest, SerializedReportAsProtobufWithInterstitialInfo) {
   std::string serialized_report;
   SSLInfo ssl_info;
@@ -120,6 +134,9 @@
             deserialized_report.interstitial_info().interstitial_reason());
   EXPECT_EQ(true, deserialized_report.interstitial_info().user_proceeded());
   EXPECT_EQ(true, deserialized_report.interstitial_info().overridable());
+  EXPECT_EQ(
+      ssl_info.is_issued_by_known_root,
+      deserialized_report.is_issued_by_known_root());
 
   EXPECT_THAT(
       deserialized_report.cert_error(),
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 0328cea..eb121d1 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -421,8 +421,11 @@
       'offline_pages/background/save_page_request_unittest.cc',
     ],
     'offline_pages_unittest_sources': [
+      'offline_pages/archive_manager_unittest.cc',
+      'offline_pages/client_policy_controller_unittest.cc',
       'offline_pages/offline_page_metadata_store_impl_unittest.cc',
       'offline_pages/offline_page_model_unittest.cc',
+      'offline_pages/offline_page_storage_manager_unittest.cc',
       'offline_pages/snapshot_controller_unittest.cc',
     ],
     'omnibox_unittest_sources': [
diff --git a/components/offline_pages.gypi b/components/offline_pages.gypi
index e6bc62a89..304b9676 100644
--- a/components/offline_pages.gypi
+++ b/components/offline_pages.gypi
@@ -22,6 +22,8 @@
         'offline_pages_proto',
       ],
       'sources': [
+        'offline_pages/archive_manager.cc',
+        'offline_pages/archive_manager.h',
         'offline_pages/client_policy_controller.cc',
         'offline_pages/client_policy_controller.h',
         'offline_pages/offline_page_archiver.h',
diff --git a/components/offline_pages/BUILD.gn b/components/offline_pages/BUILD.gn
index 450ea67..5cd40e69 100644
--- a/components/offline_pages/BUILD.gn
+++ b/components/offline_pages/BUILD.gn
@@ -9,6 +9,8 @@
 # GYP: //components/offline_pages.gypi:offline_pages
 static_library("offline_pages") {
   sources = [
+    "archive_manager.cc",
+    "archive_manager.h",
     "client_policy_controller.cc",
     "client_policy_controller.h",
     "offline_page_archiver.h",
@@ -77,6 +79,7 @@
 source_set("unit_tests") {
   testonly = true
   sources = [
+    "archive_manager_unittest.cc",
     "client_policy_controller_unittest.cc",
     "offline_page_metadata_store_impl_unittest.cc",
     "offline_page_model_unittest.cc",
diff --git a/components/offline_pages/archive_manager.cc b/components/offline_pages/archive_manager.cc
new file mode 100644
index 0000000..019dcc5
--- /dev/null
+++ b/components/offline_pages/archive_manager.cc
@@ -0,0 +1,76 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/files/file_util.h"
+#include "base/location.h"
+#include "base/logging.h"
+#include "components/offline_pages/archive_manager.h"
+
+namespace offline_pages {
+
+namespace {
+
+void EnsureArchivesDirCreatedImpl(const base::FilePath& archives_dir) {
+  CHECK(base::CreateDirectory(archives_dir));
+}
+
+void ExistsArchiveImpl(const base::FilePath& file_path, bool* exists) {
+  DCHECK(exists);
+  *exists = base::PathExists(file_path);
+}
+
+void DeleteArchivesImpl(const std::vector<base::FilePath>& file_paths,
+                        bool* result) {
+  DCHECK(result);
+  for (const auto& file_path : file_paths) {
+    // Make sure delete happens on the left of || so that it is always executed.
+    *result = base::DeleteFile(file_path, false) || *result;
+  }
+}
+
+void CompleteBooleanCallback(const base::Callback<void(bool)>& callback,
+                             bool* exists) {
+  callback.Run(*exists);
+}
+}  // namespace
+
+ArchiveManager::ArchiveManager(
+    const base::FilePath& archives_dir,
+    const scoped_refptr<base::SequencedTaskRunner>& task_runner)
+    : archives_dir_(archives_dir), task_runner_(task_runner) {}
+
+ArchiveManager::~ArchiveManager() {}
+
+void ArchiveManager::EnsureArchivesDirCreated(const base::Closure& callback) {
+  task_runner_->PostTaskAndReply(
+      FROM_HERE, base::Bind(EnsureArchivesDirCreatedImpl, archives_dir_),
+      callback);
+}
+
+void ArchiveManager::ExistsArchive(const base::FilePath& archive_path,
+                                   const base::Callback<void(bool)>& callback) {
+  bool* result = new bool(false);
+  task_runner_->PostTaskAndReply(
+      FROM_HERE, base::Bind(ExistsArchiveImpl, archive_path, result),
+      base::Bind(CompleteBooleanCallback, callback, base::Owned(result)));
+}
+
+void ArchiveManager::DeleteArchive(const base::FilePath& archive_path,
+                                   const base::Callback<void(bool)>& callback) {
+  std::vector<base::FilePath> archive_paths = {archive_path};
+  DeleteMultipleArchives(archive_paths, callback);
+}
+
+void ArchiveManager::DeleteMultipleArchives(
+    const std::vector<base::FilePath>& archive_paths,
+    const base::Callback<void(bool)>& callback) {
+  bool* result = new bool(false);
+  task_runner_->PostTaskAndReply(
+      FROM_HERE, base::Bind(DeleteArchivesImpl, archive_paths, result),
+      base::Bind(CompleteBooleanCallback, callback, base::Owned(result)));
+}
+
+}  // namespace offline_pages
diff --git a/components/offline_pages/archive_manager.h b/components/offline_pages/archive_manager.h
new file mode 100644
index 0000000..221d08636
--- /dev/null
+++ b/components/offline_pages/archive_manager.h
@@ -0,0 +1,58 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_
+#define COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_
+
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "base/files/file_path.h"
+#include "base/memory/ref_counted.h"
+
+namespace base {
+class SequencedTaskRunner;
+}  // namespace base
+
+namespace offline_pages {
+
+// Class that manages all archive files for offline pages. They are all stored
+// in a specific archive directory.
+// All tasks are performed using |task_runner_|.
+class ArchiveManager {
+ public:
+  ArchiveManager(const base::FilePath& archives_dir,
+                 const scoped_refptr<base::SequencedTaskRunner>& task_runner);
+  virtual ~ArchiveManager();
+
+  // Creates archives directory if one does not exist yet;
+  virtual void EnsureArchivesDirCreated(const base::Closure& callback);
+
+  // Checks whether an archive with specified |archive_path| exists.
+  virtual void ExistsArchive(const base::FilePath& archive_path,
+                             const base::Callback<void(bool)>& callback);
+
+  // Deletes an archive with specified |archive_path|.
+  // It is considered successful to attempt to delete a file that does not
+  // exist.
+  virtual void DeleteArchive(const base::FilePath& archive_path,
+                             const base::Callback<void(bool)>& callback);
+
+  // Deletes multiple archives that are specified in |archive_paths|.
+  // It is considered successful to attempt to delete a file that does not
+  // exist.
+  virtual void DeleteMultipleArchives(
+      const std::vector<base::FilePath>& archive_paths,
+      const base::Callback<void(bool)>& callback);
+
+ private:
+  // Path under which all of the managed archives should be stored.
+  base::FilePath archives_dir_;
+  // Task runner for running file operations.
+  scoped_refptr<base::SequencedTaskRunner> task_runner_;
+};
+
+}  // namespace offline_pages
+
+#endif  // COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_
diff --git a/components/offline_pages/archive_manager_unittest.cc b/components/offline_pages/archive_manager_unittest.cc
new file mode 100644
index 0000000..4252dcb8
--- /dev/null
+++ b/components/offline_pages/archive_manager_unittest.cc
@@ -0,0 +1,209 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/offline_pages/archive_manager.h"
+
+#include <memory>
+
+#include "base/bind.h"
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
+#include "base/files/scoped_temp_dir.h"
+#include "base/test/test_simple_task_runner.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace offline_pages {
+
+namespace {
+const base::FilePath::CharType kMissingArchivePath[] = FILE_PATH_LITERAL(
+    "missing_archive.path");
+}  // namespace
+
+enum class CallbackStatus {
+  NOT_CALLED,
+  CALLED_FALSE,
+  CALLED_TRUE,
+};
+
+class ArchiveManagerTest : public testing::Test {
+ public:
+  ArchiveManagerTest();
+  void SetUp() override;
+
+  void PumpLoop();
+  void ResetResults();
+
+  void ResetManager(const base::FilePath& file_path);
+  void Callback(bool result);
+
+  ArchiveManager* manager() { return manager_.get(); }
+  const base::FilePath& temp_path() const { return temp_dir_.path(); }
+  CallbackStatus callback_status() const { return callback_status_; }
+
+ private:
+  scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
+  base::ThreadTaskRunnerHandle task_runner_handle_;
+  base::ScopedTempDir temp_dir_;
+
+  std::unique_ptr<ArchiveManager> manager_;
+  CallbackStatus callback_status_;
+};
+
+ArchiveManagerTest::ArchiveManagerTest()
+    : task_runner_(new base::TestSimpleTaskRunner),
+      task_runner_handle_(task_runner_),
+      callback_status_(CallbackStatus::NOT_CALLED) {}
+
+void ArchiveManagerTest::SetUp() {
+  ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+  ResetManager(temp_dir_.path());
+}
+
+void ArchiveManagerTest::PumpLoop() {
+  task_runner_->RunUntilIdle();
+}
+
+void ArchiveManagerTest::ResetResults() {
+  callback_status_ = CallbackStatus::NOT_CALLED;
+}
+
+void ArchiveManagerTest::ResetManager(const base::FilePath& file_path) {
+  manager_.reset(
+      new ArchiveManager(file_path, base::ThreadTaskRunnerHandle::Get()));
+}
+
+void ArchiveManagerTest::Callback(bool result) {
+  callback_status_ =
+      result ? CallbackStatus::CALLED_TRUE : CallbackStatus::CALLED_FALSE;
+}
+
+TEST_F(ArchiveManagerTest, EnsureArchivesDirCreated) {
+  base::FilePath archive_dir =
+      temp_path().Append(FILE_PATH_LITERAL("test_path"));
+  ResetManager(archive_dir);
+  EXPECT_FALSE(base::PathExists(archive_dir));
+
+  // Ensure archives dir exists, when it doesn't.
+  manager()->EnsureArchivesDirCreated(
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this), true));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_TRUE(base::PathExists(archive_dir));
+
+  // Try again when the file already exists.
+  ResetResults();
+  manager()->EnsureArchivesDirCreated(
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this), true));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_TRUE(base::PathExists(archive_dir));
+}
+
+TEST_F(ArchiveManagerTest, ExistsArchive) {
+  base::FilePath archive_path = temp_path().Append(kMissingArchivePath);
+  manager()->ExistsArchive(
+      archive_path,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_FALSE, callback_status());
+
+  ResetResults();
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path));
+
+  manager()->ExistsArchive(
+      archive_path,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+}
+
+TEST_F(ArchiveManagerTest, DeleteMultipleArchives) {
+  base::FilePath archive_path_1;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path_1));
+  base::FilePath archive_path_2;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path_2));
+  base::FilePath archive_path_3;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path_3));
+
+  std::vector<base::FilePath> archive_paths = {archive_path_1, archive_path_2};
+
+  manager()->DeleteMultipleArchives(
+      archive_paths,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_FALSE(base::PathExists(archive_path_1));
+  EXPECT_FALSE(base::PathExists(archive_path_2));
+  EXPECT_TRUE(base::PathExists(archive_path_3));
+}
+
+TEST_F(ArchiveManagerTest, DeleteMultipleArchivesSomeDoNotExist) {
+  base::FilePath archive_path_1 = temp_path().Append(kMissingArchivePath);
+  base::FilePath archive_path_2;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path_2));
+  base::FilePath archive_path_3;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path_3));
+
+  std::vector<base::FilePath> archive_paths = {archive_path_1, archive_path_2};
+
+  EXPECT_FALSE(base::PathExists(archive_path_1));
+
+  manager()->DeleteMultipleArchives(
+      archive_paths,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_FALSE(base::PathExists(archive_path_1));
+  EXPECT_FALSE(base::PathExists(archive_path_2));
+  EXPECT_TRUE(base::PathExists(archive_path_3));
+}
+
+TEST_F(ArchiveManagerTest, DeleteMultipleArchivesNoneExist) {
+  base::FilePath archive_path_1 = temp_path().Append(kMissingArchivePath);
+  base::FilePath archive_path_2 = temp_path().Append(FILE_PATH_LITERAL(
+      "other_missing_file.mhtml"));
+  base::FilePath archive_path_3;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path_3));
+
+  std::vector<base::FilePath> archive_paths = {archive_path_1, archive_path_2};
+
+  EXPECT_FALSE(base::PathExists(archive_path_1));
+  EXPECT_FALSE(base::PathExists(archive_path_2));
+
+  manager()->DeleteMultipleArchives(
+      archive_paths,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_FALSE(base::PathExists(archive_path_1));
+  EXPECT_FALSE(base::PathExists(archive_path_2));
+  EXPECT_TRUE(base::PathExists(archive_path_3));
+}
+
+TEST_F(ArchiveManagerTest, DeleteArchive) {
+  base::FilePath archive_path;
+  EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_path(), &archive_path));
+
+  manager()->DeleteArchive(
+      archive_path,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_FALSE(base::PathExists(archive_path));
+}
+
+TEST_F(ArchiveManagerTest, DeleteArchiveThatDoesNotExist) {
+  base::FilePath archive_path = temp_path().Append(kMissingArchivePath);
+  EXPECT_FALSE(base::PathExists(archive_path));
+
+  manager()->DeleteArchive(
+      archive_path,
+      base::Bind(&ArchiveManagerTest::Callback, base::Unretained(this)));
+  PumpLoop();
+  EXPECT_EQ(CallbackStatus::CALLED_TRUE, callback_status());
+  EXPECT_FALSE(base::PathExists(archive_path));
+}
+
+}  // namespace offline_pages
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 5f5ff65..297c229 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -34,7 +34,7 @@
 class Time;
 class TimeDelta;
 class TimeTicks;
-}
+}  // namespace base
 
 namespace offline_pages {
 
diff --git a/components/offline_pages/offline_page_storage_manager.h b/components/offline_pages/offline_page_storage_manager.h
index eebcff6..fd7f206d 100644
--- a/components/offline_pages/offline_page_storage_manager.h
+++ b/components/offline_pages/offline_page_storage_manager.h
@@ -36,6 +36,8 @@
   // This interface should be implemented by clients managed by storage manager.
   class Client {
    public:
+    virtual ~Client() {}
+
     // Asks the client to get all offline pages and invoke |callback|.
     virtual void GetAllPages(
         const MultipleOfflinePageItemCallback& callback) = 0;
diff --git a/components/offline_pages/offline_page_storage_manager_unittest.cc b/components/offline_pages/offline_page_storage_manager_unittest.cc
index 3f4890c4..65c2bc6 100644
--- a/components/offline_pages/offline_page_storage_manager_unittest.cc
+++ b/components/offline_pages/offline_page_storage_manager_unittest.cc
@@ -50,6 +50,8 @@
       AddPages(setting);
   }
 
+  ~StorageManagerTestClient() override;
+
   void GetAllPages(const MultipleOfflinePageItemCallback& callback) override {
     callback.Run(pages_);
   }
@@ -79,6 +81,8 @@
   int64_t next_offline_id_;
 };
 
+StorageManagerTestClient::~StorageManagerTestClient() {}
+
 void StorageManagerTestClient::AddPages(const PageSettings& setting) {
   std::string name_space = setting.name_space;
   int fresh_pages_count = setting.fresh_pages_count;
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
index 27748953..721bfd6 100644
--- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json
@@ -30,7 +30,7 @@
 
     // Increment this if you change the data in ways that mean users with
     // existing data should get a new version.
-    "kCurrentDataVersion": 90
+    "kCurrentDataVersion": 91
   },
 
   // The following engines are included in country lists and are added to the
@@ -578,7 +578,7 @@
     "yandex_by": {
       "name": "\u042f\u043d\u0434\u0435\u043a\u0441",
       "keyword": "yandex.by",
-      "favicon_url": "https://yandex.st/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
+      "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
       "search_url": "https://yandex.by/{yandex:searchPath}?text={searchTerms}",
       "suggest_url": "https://api.browser.yandex.by/suggest/get?part={searchTerms}",
       "image_url": "https://yandex.by/images/search/?rpt=imageview",
@@ -591,7 +591,7 @@
     "yandex_kz": {
       "name": "\u042f\u043d\u0434\u0435\u043a\u0441",
       "keyword": "yandex.kz",
-      "favicon_url": "https://yandex.st/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
+      "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
       "search_url": "https://yandex.kz/{yandex:searchPath}?text={searchTerms}",
       "suggest_url": "https://api.browser.yandex.kz/suggest/get?part={searchTerms}",
       "image_url": "https://yandex.kz/images/search/?rpt=imageview",
@@ -604,7 +604,7 @@
     "yandex_ru": {
       "name": "\u042f\u043d\u0434\u0435\u043a\u0441",
       "keyword": "yandex.ru",
-      "favicon_url": "https://yandex.st/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
+      "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
       "search_url": "https://yandex.ru/{yandex:searchPath}?text={searchTerms}",
       "suggest_url": "https://api.browser.yandex.ru/suggest/get?part={searchTerms}",
       "image_url": "https://yandex.ru/images/search/?rpt=imageview",
@@ -617,7 +617,7 @@
     "yandex_tr": {
       "name": "Yandex",
       "keyword": "yandex.com.tr",
-      "favicon_url": "https://yandex.st/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico",
+      "favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico",
       "search_url": "https://www.yandex.com.tr/{yandex:searchPath}?text={searchTerms}",
       "suggest_url": "https://api.browser.yandex.com.tr/suggest/get?part={searchTerms}",
       "image_url": "https://yandex.com.tr/gorsel/search?rpt=imageview",
@@ -630,7 +630,7 @@
     "yandex_ua": {
       "name": "\u042f\u043d\u0434\u0435\u043a\u0441",
       "keyword": "yandex.ua",
-      "favicon_url": "https://yandex.st/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
+      "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
       "search_url": "https://yandex.ua/{yandex:searchPath}?text={searchTerms}",
       "suggest_url": "https://api.browser.yandex.ua/suggest/get?part={searchTerms}",
       "image_url": "https://yandex.ua/images/search/?rpt=imageview",
diff --git a/components/signin/core/browser/signin_manager_base.h b/components/signin/core/browser/signin_manager_base.h
index 57382e4..ddf20d8 100644
--- a/components/signin/core/browser/signin_manager_base.h
+++ b/components/signin/core/browser/signin_manager_base.h
@@ -93,17 +93,13 @@
   AccountInfo GetAuthenticatedAccountInfo() const;
 
   // If a user has previously signed in (and has not signed out), this returns
-  // the account id. Otherwise, it returns an empty string.  This id can be used
-  // to uniquely identify an account, so for example can be used as a key to
-  // map accounts to data.
-  //
-  // TODO(rogerta): eventually the account id should be an obfuscated gaia id.
-  // For now though, this function returns the same value as
-  // GetAuthenticatedAccountInfo().email since lots of code assumes the unique
-  // id for an account is the username.  For code that needs a unique id to
-  // represent the connected account, call this method. Example: the
-  // AccountStatusMap type in MutableProfileOAuth2TokenService.  For code that
-  // needs to know the normalized email address of the connected account, use
+  // the account id. Otherwise, it returns an empty string.  This id is the
+  // G+/Focus obfuscated gaia id of the user. It can be used to uniquely
+  // identify an account, so for example as a key to map accounts to data. For
+  // code that needs a unique id to represent the connected account, call this
+  // method. Example: the AccountStatusMap type in
+  // MutableProfileOAuth2TokenService. For code that needs to know the
+  // normalized email address of the connected account, use
   // GetAuthenticatedAccountInfo().email.  Example: to show the string "Signed
   // in as XXX" in the hotdog menu.
   const std::string& GetAuthenticatedAccountId() const;
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc
index 45c147c..5e917c3 100644
--- a/content/browser/service_worker/service_worker_browsertest.cc
+++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -1168,7 +1168,7 @@
   cross_origin_server.ServeFilesFromSourceDirectory("content/test/data");
   cross_origin_server.RegisterRequestHandler(
       base::Bind(&VerifySaveDataNotInAccessControlRequestHeader));
-  cross_origin_server.Start();
+  ASSERT_TRUE(cross_origin_server.Start());
 
   MockContentBrowserClient content_browser_client;
   content_browser_client.set_data_saver_enabled(true);
diff --git a/content/ppapi_plugin/ppapi_blink_platform_impl.cc b/content/ppapi_plugin/ppapi_blink_platform_impl.cc
index 01c04ec..d1753ee8 100644
--- a/content/ppapi_plugin/ppapi_blink_platform_impl.cc
+++ b/content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -200,8 +200,7 @@
 }
 
 blink::WebString PpapiBlinkPlatformImpl::defaultLocale() {
-  NOTREACHED();
-  return blink::WebString();
+  return blink::WebString::fromUTF8("en");
 }
 
 blink::WebThemeEngine* PpapiBlinkPlatformImpl::themeEngine() {
diff --git a/gpu/command_buffer/common/capabilities.cc b/gpu/command_buffer/common/capabilities.cc
index 11dbcc8..9cf78dc6 100644
--- a/gpu/command_buffer/common/capabilities.cc
+++ b/gpu/command_buffer/common/capabilities.cc
@@ -84,6 +84,8 @@
       surfaceless(false),
       flips_vertically(false),
       msaa_is_slow(false),
+      disable_webgl_multisampling_color_mask_usage(false),
+      disable_webgl_rgb_multisampling_usage(false),
       chromium_image_rgb_emulation(false),
       major_version(2),
       minor_version(0) {}
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc
index 38ad7659..9ab4f86 100644
--- a/gpu/ipc/service/gpu_channel.cc
+++ b/gpu/ipc/service/gpu_channel.cc
@@ -894,13 +894,15 @@
 void GpuChannel::OnCreateCommandBuffer(
     const GPUCreateCommandBufferConfig& init_params,
     int32_t route_id,
-    base::SharedMemoryHandle shared_state_shm,
+    base::SharedMemoryHandle shared_state_handle,
     bool* result,
     gpu::Capabilities* capabilities) {
   TRACE_EVENT2("gpu", "GpuChannel::OnCreateCommandBuffer", "route_id", route_id,
                "offscreen", (init_params.surface_handle == kNullSurfaceHandle));
+  std::unique_ptr<base::SharedMemory> shared_state_shm(
+      new base::SharedMemory(shared_state_handle, false));
   std::unique_ptr<GpuCommandBufferStub> stub =
-      CreateCommandBuffer(init_params, route_id, shared_state_shm);
+      CreateCommandBuffer(init_params, route_id, std::move(shared_state_shm));
   if (stub) {
     *result = true;
     *capabilities = stub->decoder()->GetCapabilities();
@@ -914,7 +916,7 @@
 std::unique_ptr<GpuCommandBufferStub> GpuChannel::CreateCommandBuffer(
     const GPUCreateCommandBufferConfig& init_params,
     int32_t route_id,
-    base::SharedMemoryHandle shared_state_shm) {
+    std::unique_ptr<base::SharedMemory> shared_state_shm) {
   if (init_params.surface_handle != kNullSurfaceHandle &&
       !allow_view_command_buffers_) {
     DLOG(ERROR) << "GpuChannel::CreateCommandBuffer(): attempt to create a "
@@ -960,18 +962,14 @@
     return nullptr;
   }
 
-  std::unique_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
-      this, sync_point_manager_, task_runner_.get(), share_group,
-      init_params.surface_handle, mailbox_manager_.get(), preempted_flag_.get(),
-      init_params.size, disallowed_features_, init_params.attribs,
-      init_params.gpu_preference, stream_id, route_id, watchdog_,
-      init_params.active_url));
-
   scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id);
   if (!queue)
     queue = CreateStream(stream_id, stream_priority);
 
-  if (!stub->Initialize(shared_state_shm)) {
+  std::unique_ptr<GpuCommandBufferStub> stub(GpuCommandBufferStub::Create(
+      this, share_group, init_params, route_id, std::move(shared_state_shm)));
+
+  if (!stub) {
     DestroyStreamIfNecessary(queue);
     return nullptr;
   }
diff --git a/gpu/ipc/service/gpu_channel.h b/gpu/ipc/service/gpu_channel.h
index 5eca4df..1712e087 100644
--- a/gpu/ipc/service/gpu_channel.h
+++ b/gpu/ipc/service/gpu_channel.h
@@ -84,6 +84,22 @@
     return gpu_channel_manager_;
   }
 
+  SyncPointManager* sync_point_manager() const { return sync_point_manager_; }
+
+  GpuWatchdog* watchdog() const { return watchdog_; }
+
+  const scoped_refptr<gles2::MailboxManager>& mailbox_manager() const {
+    return mailbox_manager_;
+  }
+
+  const scoped_refptr<base::SingleThreadTaskRunner>& task_runner() const {
+    return task_runner_;
+  }
+
+  const scoped_refptr<PreemptionFlag>& preempted_flag() const {
+    return preempted_flag_;
+  }
+
   const std::string& channel_id() const { return channel_id_; }
 
   virtual base::ProcessId GetClientPID() const;
@@ -200,7 +216,7 @@
   std::unique_ptr<GpuCommandBufferStub> CreateCommandBuffer(
       const GPUCreateCommandBufferConfig& init_params,
       int32_t route_id,
-      base::SharedMemoryHandle shared_state_shm);
+      std::unique_ptr<base::SharedMemory> shared_state_shm);
 
   // The lifetime of objects of this class is managed by a GpuChannelManager.
   // The GpuChannelManager destroy all the GpuChannels that they own when they
@@ -245,7 +261,6 @@
 
   scoped_refptr<gles2::MailboxManager> mailbox_manager_;
 
-  gles2::DisallowedFeatures disallowed_features_;
   GpuWatchdog* const watchdog_;
 
   // Map of stream id to appropriate message queue.
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
index adc9cea0..932b4bb 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -164,99 +164,36 @@
 
 }  // namespace
 
+std::unique_ptr<GpuCommandBufferStub> GpuCommandBufferStub::Create(
+    GpuChannel* channel,
+    GpuCommandBufferStub* share_command_buffer_stub,
+    const GPUCreateCommandBufferConfig& init_params,
+    int32_t route_id,
+    std::unique_ptr<base::SharedMemory> shared_state_shm) {
+  std::unique_ptr<GpuCommandBufferStub> stub(
+      new GpuCommandBufferStub(channel, init_params, route_id));
+  if (!stub->Initialize(share_command_buffer_stub, init_params,
+                        std::move(shared_state_shm)))
+    return nullptr;
+  return stub;
+}
+
 GpuCommandBufferStub::GpuCommandBufferStub(
     GpuChannel* channel,
-    SyncPointManager* sync_point_manager,
-    base::SingleThreadTaskRunner* task_runner,
-    GpuCommandBufferStub* share_group,
-    SurfaceHandle surface_handle,
-    gles2::MailboxManager* mailbox_manager,
-    PreemptionFlag* preempt_by_flag,
-    const gfx::Size& size,
-    const gles2::DisallowedFeatures& disallowed_features,
-    const std::vector<int32_t>& attribs,
-    gfx::GpuPreference gpu_preference,
-    int32_t stream_id,
-    int32_t route_id,
-    GpuWatchdog* watchdog,
-    const GURL& active_url)
+    const GPUCreateCommandBufferConfig& init_params,
+    int32_t route_id)
     : channel_(channel),
-      sync_point_manager_(sync_point_manager),
-      task_runner_(task_runner),
       initialized_(false),
-      surface_handle_(surface_handle),
-      initial_size_(size),
-      disallowed_features_(disallowed_features),
-      requested_attribs_(attribs),
-      gpu_preference_(gpu_preference),
+      surface_handle_(init_params.surface_handle),
       use_virtualized_gl_context_(false),
       command_buffer_id_(GetCommandBufferID(channel->client_id(), route_id)),
-      stream_id_(stream_id),
+      stream_id_(init_params.stream_id),
       route_id_(route_id),
       last_flush_count_(0),
-      surface_format_(gfx::GLSurface::SURFACE_DEFAULT),
-      watchdog_(watchdog),
       waiting_for_sync_point_(false),
       previous_processed_num_(0),
-      preemption_flag_(preempt_by_flag),
-      active_url_(active_url) {
-  active_url_hash_ = base::Hash(active_url.possibly_invalid_spec());
-  FastSetActiveURL(active_url_, active_url_hash_, channel_);
-
-  gles2::ContextCreationAttribHelper attrib_parser;
-  attrib_parser.Parse(requested_attribs_);
-
-  if (share_group) {
-    context_group_ = share_group->context_group_;
-    DCHECK(context_group_->bind_generates_resource() ==
-           attrib_parser.bind_generates_resource);
-  } else {
-    scoped_refptr<gles2::FeatureInfo> feature_info = new gles2::FeatureInfo(
-        channel_->gpu_channel_manager()->gpu_driver_bug_workarounds());
-    context_group_ = new gles2::ContextGroup(
-        channel_->gpu_channel_manager()->gpu_preferences(), mailbox_manager,
-        new GpuCommandBufferMemoryTracker(channel,
-                                          command_buffer_id_.GetUnsafeValue()),
-        channel_->gpu_channel_manager()->shader_translator_cache(),
-        channel_->gpu_channel_manager()->framebuffer_completeness_cache(),
-        feature_info, attrib_parser.bind_generates_resource);
-  }
-
-// Virtualize PreferIntegratedGpu contexts by default on OS X to prevent
-// performance regressions when enabling FCM.
-// http://crbug.com/180463
-#if defined(OS_MACOSX)
-  if (gpu_preference_ == gfx::PreferIntegratedGpu)
-    use_virtualized_gl_context_ = true;
-#endif
-
-  use_virtualized_gl_context_ |=
-      context_group_->feature_info()->workarounds().use_virtualized_gl_contexts;
-
-  // MailboxManagerSync synchronization correctness currently depends on having
-  // only a single context. See crbug.com/510243 for details.
-  use_virtualized_gl_context_ |= mailbox_manager->UsesSync();
-
-#if defined(OS_ANDROID)
-  if (attrib_parser.red_size <= 5 &&
-      attrib_parser.green_size <= 6 &&
-      attrib_parser.blue_size <= 5 &&
-      attrib_parser.alpha_size == 0)
-    surface_format_ = gfx::GLSurface::SURFACE_RGB565;
-  gfx::GLSurface* defaultOffscreenSurface =
-      channel_->gpu_channel_manager()->GetDefaultOffscreenSurface();
-  bool is_onscreen = (surface_handle_ != kNullSurfaceHandle);
-  if (surface_format_ != defaultOffscreenSurface->GetFormat() && is_onscreen)
-    use_virtualized_gl_context_ = false;
-#endif
-
-  if ((surface_handle_ == kNullSurfaceHandle) && initial_size_.IsEmpty()) {
-    // If we're an offscreen surface with zero width and/or height, set to a
-    // non-zero size so that we have a complete framebuffer for operations like
-    // glClear.
-    initial_size_ = gfx::Size(1, 1);
-  }
-}
+      active_url_(init_params.active_url),
+      active_url_hash_(base::Hash(active_url_.possibly_invalid_spec())) {}
 
 GpuCommandBufferStub::~GpuCommandBufferStub() {
   Destroy();
@@ -347,7 +284,7 @@
   base::TimeTicks current_time = base::TimeTicks::Now();
   DCHECK(!process_delayed_work_time_.is_null());
   if (process_delayed_work_time_ > current_time) {
-    task_runner_->PostDelayedTask(
+    channel_->task_runner()->PostDelayedTask(
         FROM_HERE, base::Bind(&GpuCommandBufferStub::PollWork, AsWeakPtr()),
         process_delayed_work_time_ - current_time);
     return;
@@ -436,7 +373,7 @@
   }
 
   process_delayed_work_time_ = current_time + delay;
-  task_runner_->PostDelayedTask(
+  channel_->task_runner()->PostDelayedTask(
       FROM_HERE, base::Bind(&GpuCommandBufferStub::PollWork, AsWeakPtr()),
       delay);
 }
@@ -503,69 +440,118 @@
   surface_ = NULL;
 }
 
-scoped_refptr<gfx::GLSurface> GpuCommandBufferStub::CreateSurface() {
-  GpuChannelManager* manager = channel_->gpu_channel_manager();
-  scoped_refptr<gfx::GLSurface> surface;
-  if (surface_handle_ != kNullSurfaceHandle) {
-    surface = ImageTransportSurface::CreateNativeSurface(
-        manager, this, surface_handle_, surface_format_);
-    if (!surface || !surface->Initialize(surface_format_))
-      return nullptr;
-  } else {
-    surface = manager->GetDefaultOffscreenSurface();
-  }
-  return surface;
-}
-
 bool GpuCommandBufferStub::Initialize(
-    base::SharedMemoryHandle shared_state_handle) {
+    GpuCommandBufferStub* share_command_buffer_stub,
+    const GPUCreateCommandBufferConfig& init_params,
+    std::unique_ptr<base::SharedMemory> shared_state_shm) {
   TRACE_EVENT0("gpu", "GpuCommandBufferStub::Initialize");
-  DCHECK(!command_buffer_.get());
+  FastSetActiveURL(active_url_, active_url_hash_, channel_);
 
-  std::unique_ptr<base::SharedMemory> shared_state_shm(
-      new base::SharedMemory(shared_state_handle, false));
-
-  command_buffer_.reset(new CommandBufferService(
-      context_group_->transfer_buffer_manager()));
+  gles2::ContextCreationAttribHelper attrib_helper;
+  if (!attrib_helper.Parse(init_params.attribs))
+    return false;
 
   GpuChannelManager* manager = channel_->gpu_channel_manager();
   DCHECK(manager);
 
+  if (share_command_buffer_stub) {
+    context_group_ = share_command_buffer_stub->context_group_;
+    DCHECK(context_group_->bind_generates_resource() ==
+           attrib_helper.bind_generates_resource);
+  } else {
+    scoped_refptr<gles2::FeatureInfo> feature_info =
+        new gles2::FeatureInfo(manager->gpu_driver_bug_workarounds());
+    context_group_ = new gles2::ContextGroup(
+        manager->gpu_preferences(), channel_->mailbox_manager(),
+        new GpuCommandBufferMemoryTracker(channel_,
+                                          command_buffer_id_.GetUnsafeValue()),
+        manager->shader_translator_cache(),
+        manager->framebuffer_completeness_cache(), feature_info,
+        attrib_helper.bind_generates_resource);
+  }
+
+#if defined(OS_MACOSX)
+  // Virtualize PreferIntegratedGpu contexts by default on OS X to prevent
+  // performance regressions when enabling FCM.
+  // http://crbug.com/180463
+  if (init_params.gpu_preference == gfx::PreferIntegratedGpu)
+    use_virtualized_gl_context_ = true;
+#endif
+
+  use_virtualized_gl_context_ |=
+      context_group_->feature_info()->workarounds().use_virtualized_gl_contexts;
+
+  // MailboxManagerSync synchronization correctness currently depends on having
+  // only a single context. See crbug.com/510243 for details.
+  use_virtualized_gl_context_ |= channel_->mailbox_manager()->UsesSync();
+
+  gfx::GLSurface::Format surface_format = gfx::GLSurface::SURFACE_DEFAULT;
+  bool offscreen = (surface_handle_ == kNullSurfaceHandle);
+#if defined(OS_ANDROID)
+  if (attrib_helper.red_size <= 5 &&
+      attrib_helper.green_size <= 6 &&
+      attrib_helper.blue_size <= 5 &&
+      attrib_helper.alpha_size == 0)
+    surface_format = gfx::GLSurface::SURFACE_RGB565;
+  gfx::GLSurface* default_surface = manager->GetDefaultOffscreenSurface();
+  // We can only use virtualized contexts for onscreen command buffers if their
+  // config is compatible with the offscreen ones - otherwise MakeCurrent fails.
+  if (surface_format != default_surface->GetFormat() && !offscreen)
+    use_virtualized_gl_context_ = false;
+#endif
+
+  gfx::Size initial_size = init_params.size;
+  if (offscreen && initial_size.IsEmpty()) {
+    // If we're an offscreen surface with zero width and/or height, set to a
+    // non-zero size so that we have a complete framebuffer for operations like
+    // glClear.
+    initial_size = gfx::Size(1, 1);
+  }
+
+  command_buffer_.reset(new CommandBufferService(
+      context_group_->transfer_buffer_manager()));
+
   decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get()));
   executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(),
                                       decoder_.get()));
-  sync_point_client_ = sync_point_manager_->CreateSyncPointClient(
+  sync_point_client_ = channel_->sync_point_manager()->CreateSyncPointClient(
       channel_->GetSyncPointOrderData(stream_id_),
       CommandBufferNamespace::GPU_IO, command_buffer_id_);
 
-  if (preemption_flag_.get())
-    executor_->SetPreemptByFlag(preemption_flag_);
+  executor_->SetPreemptByFlag(channel_->preempted_flag());
 
   decoder_->set_engine(executor_.get());
 
-  surface_ = CreateSurface();
-  if (!surface_.get()) {
-    DLOG(ERROR) << "Failed to create surface.";
-    return false;
+  if (offscreen) {
+    surface_ = manager->GetDefaultOffscreenSurface();
+    DCHECK(surface_);
+  } else {
+    surface_ = ImageTransportSurface::CreateNativeSurface(
+        manager, this, surface_handle_, surface_format);
+    if (!surface_ || !surface_->Initialize(surface_format)) {
+      surface_ = nullptr;
+      DLOG(ERROR) << "Failed to create surface.";
+      return false;
+    }
   }
 
   scoped_refptr<gfx::GLContext> context;
-  gfx::GLShareGroup* share_group = channel_->share_group();
-  if (use_virtualized_gl_context_ && share_group) {
-    context = share_group->GetSharedContext();
+  gfx::GLShareGroup* gl_share_group = channel_->share_group();
+  if (use_virtualized_gl_context_ && gl_share_group) {
+    context = gl_share_group->GetSharedContext();
     if (!context.get()) {
       context = gl::init::CreateGLContext(
-          channel_->share_group(),
-          channel_->gpu_channel_manager()->GetDefaultOffscreenSurface(),
-          gpu_preference_);
+          gl_share_group,
+          manager->GetDefaultOffscreenSurface(),
+          init_params.gpu_preference);
       if (!context.get()) {
         DLOG(ERROR) << "Failed to create shared context for virtualization.";
         return false;
       }
       // Ensure that context creation did not lose track of the intended
-      // share_group.
-      DCHECK(context->share_group() == share_group);
-      share_group->SetSharedContext(context.get());
+      // gl_share_group.
+      DCHECK(context->share_group() == gl_share_group);
+      gl_share_group->SetSharedContext(context.get());
     }
     // This should be either:
     // (1) a non-virtual GL context, or
@@ -573,19 +559,18 @@
     DCHECK(context->GetHandle() ||
            gfx::GetGLImplementation() == gfx::kGLImplementationMockGL);
     context = new GLContextVirtual(
-        share_group, context.get(), decoder_->AsWeakPtr());
-    if (!context->Initialize(surface_.get(), gpu_preference_)) {
+        gl_share_group, context.get(), decoder_->AsWeakPtr());
+    if (!context->Initialize(surface_.get(), init_params.gpu_preference)) {
       // The real context created above for the default offscreen surface
       // might not be compatible with this surface.
       context = NULL;
-
       DLOG(ERROR) << "Failed to initialize virtual GL context.";
       return false;
     }
   }
   if (!context.get()) {
-    context =
-        gl::init::CreateGLContext(share_group, surface_.get(), gpu_preference_);
+    context = gl::init::CreateGLContext(gl_share_group, surface_.get(),
+                                        init_params.gpu_preference);
   }
   if (!context.get()) {
     DLOG(ERROR) << "Failed to create context.";
@@ -604,20 +589,18 @@
 
   if (!context_group_->has_program_cache() &&
       !context_group_->feature_info()->workarounds().disable_program_cache) {
-    context_group_->set_program_cache(
-        channel_->gpu_channel_manager()->program_cache());
+    context_group_->set_program_cache(manager->program_cache());
   }
 
   // Initialize the decoder with either the view or pbuffer GLContext.
-  bool offscreen = (surface_handle_ == kNullSurfaceHandle);
-  if (!decoder_->Initialize(surface_, context, offscreen, initial_size_,
-                            disallowed_features_, requested_attribs_)) {
+  if (!decoder_->Initialize(surface_, context, offscreen, initial_size,
+                            gpu::gles2::DisallowedFeatures(),
+                            init_params.attribs)) {
     DLOG(ERROR) << "Failed to initialize decoder.";
     return false;
   }
 
-  if (channel_->gpu_channel_manager()->
-      gpu_preferences().enable_gpu_service_logging) {
+  if (manager->gpu_preferences().enable_gpu_service_logging) {
     decoder_->set_log_commands(true);
   }
 
@@ -639,7 +622,7 @@
   command_buffer_->SetParseErrorCallback(
       base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this)));
 
-  if (watchdog_) {
+  if (channel_->watchdog()) {
     executor_->SetCommandProcessedCallback(base::Bind(
         &GpuCommandBufferStub::OnCommandProcessed, base::Unretained(this)));
   }
@@ -652,7 +635,7 @@
   command_buffer_->SetSharedStateBuffer(MakeBackingFromSharedMemory(
       std::move(shared_state_shm), kSharedStateSize));
 
-  if ((surface_handle_ == kNullSurfaceHandle) && !active_url_.is_empty())
+  if (offscreen && !active_url_.is_empty())
     manager->delegate()->DidCreateOffscreenContext(active_url_);
 
   initialized_ = true;
@@ -674,18 +657,6 @@
   latency_info_callback_ = callback;
 }
 
-int32_t GpuCommandBufferStub::GetRequestedAttribute(int attr) const {
-  // The command buffer is pairs of enum, value
-  // search for the requested attribute, return the value.
-  for (std::vector<int32_t>::const_iterator it = requested_attribs_.begin();
-       it != requested_attribs_.end(); ++it) {
-    if (*it++ == attr) {
-      return *it;
-    }
-  }
-  return -1;
-}
-
 void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
                                           IPC::Message* reply_message) {
   TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
@@ -848,8 +819,8 @@
 }
 
 void GpuCommandBufferStub::OnCommandProcessed() {
-  if (watchdog_)
-    watchdog_->CheckArmed();
+  DCHECK(channel_->watchdog());
+  channel_->watchdog()->CheckArmed();
 }
 
 void GpuCommandBufferStub::ReportState() { command_buffer_->UpdateState(); }
@@ -879,7 +850,7 @@
 void GpuCommandBufferStub::OnSignalSyncToken(const SyncToken& sync_token,
                                              uint32_t id) {
   scoped_refptr<SyncPointClientState> release_state =
-      sync_point_manager_->GetSyncPointClientState(
+      channel_->sync_point_manager()->GetSyncPointClientState(
           sync_token.namespace_id(), sync_token.command_buffer_id());
 
   if (release_state) {
@@ -939,8 +910,8 @@
   DCHECK(executor_->scheduled());
 
   scoped_refptr<SyncPointClientState> release_state =
-      sync_point_manager_->GetSyncPointClientState(namespace_id,
-                                                   command_buffer_id);
+      channel_->sync_point_manager()->GetSyncPointClientState(
+          namespace_id, command_buffer_id);
 
   if (!release_state)
     return true;
@@ -954,7 +925,7 @@
                            this);
   waiting_for_sync_point_ = true;
   sync_point_client_->WaitNonThreadSafe(
-      release_state.get(), release, task_runner_,
+      release_state.get(), release, channel_->task_runner(),
       base::Bind(&GpuCommandBufferStub::OnWaitFenceSyncCompleted,
                  this->AsWeakPtr(), namespace_id, command_buffer_id, release));
 
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.h b/gpu/ipc/service/gpu_command_buffer_stub.h
index 811ca5d..de9b1ee 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.h
+++ b/gpu/ipc/service/gpu_command_buffer_stub.h
@@ -46,6 +46,7 @@
 }
 }
 
+struct GPUCreateCommandBufferConfig;
 struct GpuCommandBufferMsg_CreateImage_Params;
 struct GpuCommandBufferMsg_SwapBuffersCompleted_Params;
 
@@ -72,23 +73,12 @@
   typedef base::Callback<void(const std::vector<ui::LatencyInfo>&)>
       LatencyInfoCallback;
 
-  GpuCommandBufferStub(
-      GpuChannel* channel,
-      SyncPointManager* sync_point_manager,
-      base::SingleThreadTaskRunner* task_runner,
-      GpuCommandBufferStub* share_group,
-      SurfaceHandle surface_handle,
-      gles2::MailboxManager* mailbox_manager,
-      PreemptionFlag* preempt_by_flag,
-      const gfx::Size& size,
-      const gles2::DisallowedFeatures& disallowed_features,
-      const std::vector<int32_t>& attribs,
-      gfx::GpuPreference gpu_preference,
-      int32_t stream_id,
-      int32_t route_id,
-      GpuWatchdog* watchdog,
-      const GURL& active_url);
-  bool Initialize(base::SharedMemoryHandle shared_state_shm);
+  static std::unique_ptr<GpuCommandBufferStub> Create(
+    GpuChannel* channel,
+    GpuCommandBufferStub* share_group,
+    const GPUCreateCommandBufferConfig& init_params,
+    int32_t route_id,
+    std::unique_ptr<base::SharedMemory> shared_state_shm);
 
   ~GpuCommandBufferStub() override;
 
@@ -120,10 +110,6 @@
   // Identifies the stream for this command buffer.
   int32_t stream_id() const { return stream_id_; }
 
-  gfx::GpuPreference gpu_preference() { return gpu_preference_; }
-
-  int32_t GetRequestedAttribute(int attr) const;
-
   // Sends a message to the console.
   void SendConsoleMessage(int32_t id, const std::string& message);
 
@@ -146,19 +132,24 @@
                                  base::TimeDelta interval);
 
  private:
+  GpuCommandBufferStub(GpuChannel* channel,
+                       const GPUCreateCommandBufferConfig& init_params,
+                       int32_t route_id);
+
+  bool Initialize(GpuCommandBufferStub* share_group,
+                  const GPUCreateCommandBufferConfig& init_params,
+                  std::unique_ptr<base::SharedMemory> shared_state_shm);
+
   GpuMemoryManager* GetMemoryManager() const;
 
   void Destroy();
 
   bool MakeCurrent();
 
-  scoped_refptr<gfx::GLSurface> CreateSurface();
-
   // Message handlers:
   void OnSetGetBuffer(int32_t shm_id, IPC::Message* reply_message);
   void OnTakeFrontBuffer(const Mailbox& mailbox);
-  void OnReturnFrontBuffer(const Mailbox& mailbox,
-                           bool is_lost);
+  void OnReturnFrontBuffer(const Mailbox& mailbox, bool is_lost);
   void OnGetState(IPC::Message* reply_message);
   void OnWaitForTokenInRange(int32_t start,
                              int32_t end,
@@ -224,21 +215,11 @@
   // are destroyed. So a raw pointer is safe.
   GpuChannel* const channel_;
 
-  // Outlives the stub.
-  SyncPointManager* const sync_point_manager_;
-
-  // Task runner for main thread.
-  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
-
   // The group of contexts that share namespaces with this context.
   scoped_refptr<gles2::ContextGroup> context_group_;
 
   bool initialized_;
   const SurfaceHandle surface_handle_;
-  gfx::Size initial_size_;
-  gles2::DisallowedFeatures disallowed_features_;
-  std::vector<int32_t> requested_attribs_;
-  gfx::GpuPreference gpu_preference_;
   bool use_virtualized_gl_context_;
   const CommandBufferId command_buffer_id_;
   const int32_t stream_id_;
@@ -250,9 +231,6 @@
   std::unique_ptr<CommandExecutor> executor_;
   std::unique_ptr<SyncPointClient> sync_point_client_;
   scoped_refptr<gfx::GLSurface> surface_;
-  gfx::GLSurface::Format surface_format_;
-
-  GpuWatchdog* watchdog_;
 
   base::ObserverList<DestructionObserver> destruction_observers_;
 
@@ -262,8 +240,6 @@
   uint32_t previous_processed_num_;
   base::TimeTicks last_idle_time_;
 
-  scoped_refptr<PreemptionFlag> preemption_flag_;
-
   LatencyInfoCallback latency_info_callback_;
 
   GURL active_url_;
diff --git a/gpu/vulkan/vulkan_command_buffer.cc b/gpu/vulkan/vulkan_command_buffer.cc
index 5f345256..2519026 100644
--- a/gpu/vulkan/vulkan_command_buffer.cc
+++ b/gpu/vulkan/vulkan_command_buffer.cc
@@ -148,14 +148,20 @@
     // using the asynchronous SubmissionFinished() function.
     VkDevice device = device_queue_->GetVulkanDevice();
     vkWaitForFences(device, 1, &submission_fence_, true, UINT64_MAX);
-
-    vkResetCommandBuffer(command_buffer_, 0);
-    record_type_ = RECORD_TYPE_EMPTY;
+    VkResult result = vkResetCommandBuffer(command_buffer_, 0);
+    if (VK_SUCCESS != result) {
+      DLOG(ERROR) << "vkResetCommandBuffer() failed: " << result;
+    } else {
+      record_type_ = RECORD_TYPE_EMPTY;
+    }
   }
 }
 
 CommandBufferRecorderBase::~CommandBufferRecorderBase() {
-  vkEndCommandBuffer(handle_);
+  VkResult result = vkEndCommandBuffer(handle_);
+  if (VK_SUCCESS != result) {
+    DLOG(ERROR) << "vkEndCommandBuffer() failed: " << result;
+  }
 };
 
 ScopedMultiUseCommandBufferRecorder::ScopedMultiUseCommandBufferRecorder(
@@ -164,7 +170,11 @@
   ValidateMultiUse(command_buffer);
   VkCommandBufferBeginInfo begin_info = {};
   begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
-  vkBeginCommandBuffer(handle_, &begin_info);
+  VkResult result = vkBeginCommandBuffer(handle_, &begin_info);
+
+  if (VK_SUCCESS != result) {
+    DLOG(ERROR) << "vkBeginCommandBuffer() failed: " << result;
+  }
 }
 
 ScopedSingleUseCommandBufferRecorder::ScopedSingleUseCommandBufferRecorder(
@@ -174,7 +184,11 @@
   VkCommandBufferBeginInfo begin_info = {};
   begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
   begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
-  vkBeginCommandBuffer(handle_, &begin_info);
+  VkResult result = vkBeginCommandBuffer(handle_, &begin_info);
+
+  if (VK_SUCCESS != result) {
+    DLOG(ERROR) << "vkBeginCommandBuffer() failed: " << result;
+  }
 }
 
 }  // namespace gpu
diff --git a/mash/BUILD.gn b/mash/BUILD.gn
index 1e437de..42f43bd 100644
--- a/mash/BUILD.gn
+++ b/mash/BUILD.gn
@@ -24,7 +24,6 @@
 
 test("mash_unittests") {
   deps = [
-    "//ash/mus:unittests",
     "//base",
     "//base/test:test_config",
     "//base/test:test_support",
diff --git a/mash/browser_driver/BUILD.gn b/mash/browser_driver/BUILD.gn
index 58f00d0f..2b42fc5 100644
--- a/mash/browser_driver/BUILD.gn
+++ b/mash/browser_driver/BUILD.gn
@@ -19,6 +19,7 @@
     "//components/mus/common:mus_common",
     "//components/mus/public/interfaces",
     "//mash/public/interfaces",
+    "//services/catalog/public/interfaces",
     "//services/shell/public/cpp:sources",
   ]
 
diff --git a/mash/browser_driver/browser_driver_application_delegate.cc b/mash/browser_driver/browser_driver_application_delegate.cc
index 4335d3c..e384773 100644
--- a/mash/browser_driver/browser_driver_application_delegate.cc
+++ b/mash/browser_driver/browser_driver_application_delegate.cc
@@ -58,6 +58,33 @@
 
 BrowserDriverApplicationDelegate::~BrowserDriverApplicationDelegate() {}
 
+void BrowserDriverApplicationDelegate::OnAvailableCatalogEntries(
+    const mojo::Array<catalog::mojom::EntryPtr>& entries) {
+  if (entries.empty()) {
+    LOG(ERROR) << "Unable to install accelerators for launching chrome.";
+    return;
+  }
+
+  mus::mojom::AcceleratorRegistrarPtr registrar;
+  connector_->ConnectToInterface(entries[0]->name, &registrar);
+
+  if (binding_.is_bound())
+    binding_.Unbind();
+  registrar->SetHandler(binding_.CreateInterfacePtrAndBind());
+  // If the window manager restarts, the handler pipe will close and we'll need
+  // to re-add our accelerators when the window manager comes back up.
+  binding_.set_connection_error_handler(
+      base::Bind(&BrowserDriverApplicationDelegate::AddAccelerators,
+                 weak_factory_.GetWeakPtr()));
+
+  for (const AcceleratorSpec& spec : g_spec) {
+    registrar->AddAccelerator(
+        static_cast<uint32_t>(spec.id),
+        mus::CreateKeyMatcher(spec.keyboard_code, spec.event_flags),
+        base::Bind(&AssertTrue));
+  }
+}
+
 void BrowserDriverApplicationDelegate::Initialize(
     shell::Connector* connector,
     const shell::Identity& identity,
@@ -100,26 +127,11 @@
 }
 
 void BrowserDriverApplicationDelegate::AddAccelerators() {
-  // TODO(beng): find some other way to get the window manager. I don't like
-  //             having to specify it by URL because it may differ per display.
-  mus::mojom::AcceleratorRegistrarPtr registrar;
-  connector_->ConnectToInterface("mojo:desktop_wm", &registrar);
-
-  if (binding_.is_bound())
-    binding_.Unbind();
-  registrar->SetHandler(binding_.CreateInterfacePtrAndBind());
-  // If the window manager restarts, the handler pipe will close and we'll need
-  // to re-add our accelerators when the window manager comes back up.
-  binding_.set_connection_error_handler(
-      base::Bind(&BrowserDriverApplicationDelegate::AddAccelerators,
+  connector_->ConnectToInterface("mojo:catalog", &catalog_);
+  catalog_->GetEntriesProvidingClass(
+      "mus:window_manager",
+      base::Bind(&BrowserDriverApplicationDelegate::OnAvailableCatalogEntries,
                  weak_factory_.GetWeakPtr()));
-
-  for (const AcceleratorSpec& spec : g_spec) {
-    registrar->AddAccelerator(
-        static_cast<uint32_t>(spec.id),
-        mus::CreateKeyMatcher(spec.keyboard_code, spec.event_flags),
-        base::Bind(&AssertTrue));
-  }
 }
 
 }  // namespace browser_driver
diff --git a/mash/browser_driver/browser_driver_application_delegate.h b/mash/browser_driver/browser_driver_application_delegate.h
index 73c34aad..eeea9af 100644
--- a/mash/browser_driver/browser_driver_application_delegate.h
+++ b/mash/browser_driver/browser_driver_application_delegate.h
@@ -14,6 +14,7 @@
 #include "base/memory/weak_ptr.h"
 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
 #include "mojo/public/cpp/bindings/binding.h"
+#include "services/catalog/public/interfaces/catalog.mojom.h"
 #include "services/shell/public/cpp/shell_client.h"
 
 namespace mash {
@@ -26,6 +27,9 @@
   ~BrowserDriverApplicationDelegate() override;
 
  private:
+  void OnAvailableCatalogEntries(
+      const mojo::Array<catalog::mojom::EntryPtr>& entries);
+
   // shell::ShellClient:
   void Initialize(shell::Connector* connector,
                   const shell::Identity& identity,
@@ -39,6 +43,7 @@
   void AddAccelerators();
 
   shell::Connector* connector_;
+  catalog::mojom::CatalogPtr catalog_;
   mojo::Binding<mus::mojom::AcceleratorHandler> binding_;
   base::WeakPtrFactory<BrowserDriverApplicationDelegate> weak_factory_;
 
diff --git a/mash/browser_driver/manifest.json b/mash/browser_driver/manifest.json
index 4882f475..d864b2f 100644
--- a/mash/browser_driver/manifest.json
+++ b/mash/browser_driver/manifest.json
@@ -4,9 +4,14 @@
   "display_name": "Browser Driver",
   "capabilities": {
     "required": {
-      "*": { "classes": [ "mash:launchable" ] },
-      "mojo:desktop_wm": {
-        "interfaces": [ "mus::mojom::AcceleratorRegistrar" ]
+      "*": {
+        "classes": [ "mus:window_manager" ]
+      },
+      "exe:chrome": {
+        "classes": [ "mash:launchable" ]
+      },
+      "mojo:catalog": {
+        "interfaces": [ "catalog::mojom::Catalog" ]
       }
     }
   }
diff --git a/mash/unittests_manifest.json b/mash/unittests_manifest.json
index 37ff6fb..07461b1 100644
--- a/mash/unittests_manifest.json
+++ b/mash/unittests_manifest.json
@@ -5,9 +5,6 @@
   "capabilities": {
     "required": {
       "*": { "classes": [ "app" ] },
-      "mojo:ash_sysui": {
-        "interfaces": [ "mash::shelf::mojom::ShelfController" ]
-      },
       "mojo:desktop_wm": {
         "interfaces": [
           "mus::mojom::AcceleratorRegistrar",
diff --git a/mash/wm/manifest.json b/mash/wm/manifest.json
index 7c1fbcd..ed94194 100644
--- a/mash/wm/manifest.json
+++ b/mash/wm/manifest.json
@@ -3,6 +3,9 @@
   "name": "mojo:desktop_wm",
   "display_name": "Window Manager",
   "capabilities": {
+    "provided": {
+      "mus:window_manager" : [ "mus::mojom::AcceleratorRegistrar" ]
+    },
     "required": {
       "*": { "classes": [ "app" ] },
       "mojo:mus": { "interfaces": [ "mus::mojom::WindowManagerFactoryService" ] }
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java
index d2ba20d..f02a027a 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java
@@ -59,11 +59,6 @@
             if (pathname.getName().startsWith("conformance_mthd13_good_2")) {
                 return false;
             }
-            // TODO(yzshen): skip enum validation tests because the feature is
-            // not supported in Java yet. crbug.com/581392
-            if (pathname.getName().indexOf("enum") != -1) {
-                return false;
-            }
             return pathname.isFile() && pathname.getName().startsWith(mPrefix)
                     && pathname.getName().endsWith(".data");
         }
diff --git a/mojo/edk/system/node_channel.cc b/mojo/edk/system/node_channel.cc
index 885750d..d60a2ab 100644
--- a/mojo/edk/system/node_channel.cc
+++ b/mojo/edk/system/node_channel.cc
@@ -172,8 +172,9 @@
 #endif
 
   base::AutoLock lock(channel_lock_);
-  DCHECK(channel_);
-  channel_->Start();
+  // ShutDown() may have already been called, in which case |channel_| is null.
+  if (channel_)
+    channel_->Start();
 }
 
 void NodeChannel::ShutDown() {
@@ -527,7 +528,7 @@
           new Channel::Message(payload_size, num_handles));
       message->SetHandles(std::move(handles));
       memcpy(message->mutable_payload(), payload, payload_size);
-      delegate_->OnPortsMessage(std::move(message));
+      delegate_->OnPortsMessage(remote_node_name_, std::move(message));
       return;
     }
 
diff --git a/mojo/edk/system/node_channel.h b/mojo/edk/system/node_channel.h
index c8a97caf..1aeccda 100644
--- a/mojo/edk/system/node_channel.h
+++ b/mojo/edk/system/node_channel.h
@@ -53,7 +53,8 @@
     virtual void OnAcceptBrokerClient(const ports::NodeName& from_node,
                                       const ports::NodeName& broker_name,
                                       ScopedPlatformHandle broker_channel) = 0;
-    virtual void OnPortsMessage(Channel::MessagePtr message) = 0;
+    virtual void OnPortsMessage(const ports::NodeName& from_node,
+                                Channel::MessagePtr message) = 0;
     virtual void OnRequestPortMerge(const ports::NodeName& from_node,
                                     const ports::PortName& connector_port_name,
                                     const std::string& token) = 0;
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 7c49bde..1f26c8c 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -790,20 +790,28 @@
   DVLOG(1) << "Child " << name_ << " accepted by broker " << broker_name;
 }
 
-void NodeController::OnPortsMessage(Channel::MessagePtr channel_message) {
+void NodeController::OnPortsMessage(const ports::NodeName& from_node,
+                                    Channel::MessagePtr channel_message) {
   DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
 
   void* data;
   size_t num_data_bytes;
   NodeChannel::GetPortsMessageData(
       channel_message.get(), &data, &num_data_bytes);
+  if (!num_data_bytes) {
+    DropPeer(from_node);
+    return;
+  }
 
   size_t num_header_bytes, num_payload_bytes, num_ports_bytes;
-  ports::Message::Parse(data,
-                        num_data_bytes,
-                        &num_header_bytes,
-                        &num_payload_bytes,
-                        &num_ports_bytes);
+  if (!ports::Message::Parse(data,
+                             num_data_bytes,
+                             &num_header_bytes,
+                             &num_payload_bytes,
+                             &num_ports_bytes)) {
+    DropPeer(from_node);
+    return;
+  }
 
   CHECK(channel_message);
   ports::ScopedMessage message(
@@ -938,7 +946,7 @@
 
   if (destination == name_) {
     // Great, we can deliver this message locally.
-    OnPortsMessage(std::move(message));
+    OnPortsMessage(from_node, std::move(message));
     return;
   }
 
diff --git a/mojo/edk/system/node_controller.h b/mojo/edk/system/node_controller.h
index 4e12e14..815690c 100644
--- a/mojo/edk/system/node_controller.h
+++ b/mojo/edk/system/node_controller.h
@@ -162,7 +162,8 @@
   void OnAcceptBrokerClient(const ports::NodeName& from_node,
                             const ports::NodeName& broker_name,
                             ScopedPlatformHandle broker_channel) override;
-  void OnPortsMessage(Channel::MessagePtr message) override;
+  void OnPortsMessage(const ports::NodeName& from_node,
+                      Channel::MessagePtr message) override;
   void OnRequestPortMerge(const ports::NodeName& from_node,
                           const ports::PortName& connector_port_name,
                           const std::string& token) override;
diff --git a/mojo/edk/system/ports/message.cc b/mojo/edk/system/ports/message.cc
index 2106c156..5d3c000 100644
--- a/mojo/edk/system/ports/message.cc
+++ b/mojo/edk/system/ports/message.cc
@@ -14,11 +14,13 @@
 namespace ports {
 
 // static
-void Message::Parse(const void* bytes,
+bool Message::Parse(const void* bytes,
                     size_t num_bytes,
                     size_t* num_header_bytes,
                     size_t* num_payload_bytes,
                     size_t* num_ports_bytes) {
+  if (num_bytes < sizeof(EventHeader))
+    return false;
   const EventHeader* header = static_cast<const EventHeader*>(bytes);
   switch (header->type) {
     case EventType::kUser:
@@ -41,24 +43,32 @@
       *num_header_bytes = sizeof(EventHeader) + sizeof(MergePortEventData);
       break;
     default:
-      CHECK(false) << "Bad event type";
-      return;
+      return false;
   }
 
   if (header->type == EventType::kUser) {
+    if (num_bytes < sizeof(EventHeader) + sizeof(UserEventData))
+      return false;
     const UserEventData* event_data =
         reinterpret_cast<const UserEventData*>(
             reinterpret_cast<const char*>(header + 1));
+    if (event_data->num_ports > std::numeric_limits<uint16_t>::max())
+      return false;
     *num_header_bytes = sizeof(EventHeader) +
                         sizeof(UserEventData) +
                         event_data->num_ports * sizeof(PortDescriptor);
     *num_ports_bytes = event_data->num_ports * sizeof(PortName);
+    if (num_bytes < *num_header_bytes + *num_ports_bytes)
+      return false;
     *num_payload_bytes = num_bytes - *num_header_bytes - *num_ports_bytes;
   } else {
+    if (*num_header_bytes != num_bytes)
+      return false;
     *num_payload_bytes = 0;
     *num_ports_bytes = 0;
-    DCHECK_EQ(num_bytes, *num_header_bytes);
   }
+
+  return true;
 }
 
 Message::Message(size_t num_payload_bytes, size_t num_ports)
diff --git a/mojo/edk/system/ports/message.h b/mojo/edk/system/ports/message.h
index 60bdd70..95fa046 100644
--- a/mojo/edk/system/ports/message.h
+++ b/mojo/edk/system/ports/message.h
@@ -27,8 +27,9 @@
  public:
   virtual ~Message() {}
 
-  // Inspect the message at |bytes| and return the size of each section.
-  static void Parse(const void* bytes,
+  // Inspect the message at |bytes| and return the size of each section. Returns
+  // |false| if the message is malformed and |true| otherwise.
+  static bool Parse(const void* bytes,
                     size_t num_bytes,
                     size_t* num_header_bytes,
                     size_t* num_payload_bytes,
diff --git a/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd16_uknown_non_extensible_enum_map_entry.data b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd16_uknown_non_extensible_enum_map_entry.data
new file mode 100644
index 0000000..8940a61
--- /dev/null
+++ b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd16_uknown_non_extensible_enum_map_entry.data
@@ -0,0 +1,34 @@
+[dist4]message_header  // num_bytes
+[u4]0                  // version
+[u4]0                  // interface ID
+[u4]16                 // name
+[u4]0                  // flags
+[u4]0                  // padding
+[anchr]message_header
+
+[dist4]method16_params  // num_bytes
+[u4]0                   // version
+[dist8]map_data_ptr     // param0
+[anchr]method16_params
+
+[anchr]map_data_ptr
+[dist4]map_data_struct_header  // num_bytes
+[u4]0                          // version
+[dist8]key_array_ptr
+[dist8]value_array_ptr
+[anchr]map_data_struct_header
+
+[anchr]key_array_ptr
+[dist4]key_array_member     // num_bytes
+[u4]2                       // num_elements
+[u4]0x5678                  // Unknown value is not allowed for non-extensible
+                            // enum.
+[u4]1
+[anchr]key_array_member
+
+[anchr]value_array_ptr
+[dist4]value_array_member   // num_bytes
+[u4]2                       // num_elements
+[u4]0x5678                  // Unknown value is allowed for extensible enum.
+[u4]1
+[anchr]value_array_member
diff --git a/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd16_uknown_non_extensible_enum_map_entry.expected b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd16_uknown_non_extensible_enum_map_entry.expected
new file mode 100644
index 0000000..9ef4ce3
--- /dev/null
+++ b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd16_uknown_non_extensible_enum_map_entry.expected
@@ -0,0 +1 @@
+VALIDATION_ERROR_UNKNOWN_ENUM_VALUE
diff --git a/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom b/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom
index f5d575b..9a1d63d 100644
--- a/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom
+++ b/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom
@@ -82,6 +82,7 @@
   Method13(InterfaceA? param0, uint32 param1, InterfaceA? param2);
   Method14(EnumA param0, EnumB param1);
   Method15(array<EnumA>? param0, array<EnumB>? param1);
+  Method16(map<EnumA, EnumB>? param0);
 };
 
 struct BasicStruct {
diff --git a/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl
index 2c459332..5cf9a68 100644
--- a/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl
@@ -122,6 +122,19 @@
 {{variable}} = {{kind|java_type}}.decode(decoder{{level}}, {{offset}});
 {% else %}
 {{variable}} = decoder{{level}}.{{kind|decode_method(offset, bit)}};
+{%   if kind|is_array_kind and kind.kind|is_enum_kind %}
+{%     if kind|is_nullable_kind %}
+if ({{variable}} != null) {
+{%     else %}
+{
+{%     endif %}
+    for (int i{{level}} = 0; i{{level}} < {{variable}}.length; ++i{{level}}) {
+        {{kind.kind|java_class_for_enum}}.validate({{variable}}[i{{level}}]);
+    }
+}
+{%   elif kind|is_enum_kind %}
+    {{kind|java_class_for_enum}}.validate({{variable}});
+{%   endif %}
 {% endif %}
 {% endmacro %}
 
diff --git a/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl
index a16c178e..814e3e28 100644
--- a/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl
@@ -15,6 +15,25 @@
     public static final int {{field|name}} = {{enum_value(enum, field, loop.index0)}};
 {% endfor %}
 
+    private static final boolean IS_EXTENSIBLE = {% if enum.extensible %}true{% else %}false{% endif %};
+
+    public static boolean isKnownValue(int value) {
+        switch (value) {
+{%- for enum_field in enum.fields|groupby('numeric_value') %}
+            case {{enum_field[0]}}:
+{%- endfor %}
+                return true;
+        }
+        return false;
+    }
+
+    public static void validate(int value) {
+        if (IS_EXTENSIBLE || isKnownValue(value))
+            return;
+
+        throw new DeserializationException("Invalid enum value.");
+    }
+
     private {{enum|name}}() {}
 
 }
diff --git a/mojo/public/tools/bindings/generators/java_templates/header.java.tmpl b/mojo/public/tools/bindings/generators/java_templates/header.java.tmpl
index 6a23c66..1d67890 100644
--- a/mojo/public/tools/bindings/generators/java_templates/header.java.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/header.java.tmpl
@@ -11,3 +11,4 @@
 package {{package}};
 
 import org.chromium.base.annotations.SuppressFBWarnings;
+import org.chromium.mojo.bindings.DeserializationException;
\ No newline at end of file
diff --git a/mojo/public/tools/bindings/generators/mojom_java_generator.py b/mojo/public/tools/bindings/generators/mojom_java_generator.py
index 3104c13..481efbc 100644
--- a/mojo/public/tools/bindings/generators/mojom_java_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_java_generator.py
@@ -237,6 +237,10 @@
   elements += _GetNameHierachy(kind)
   return '.'.join(elements)
 
+@contextfilter
+def GetJavaClassForEnum(context, kind):
+  return GetNameForKind(context, kind)
+
 def GetBoxedJavaType(context, kind, with_generics=True):
   unboxed_type = GetJavaType(context, kind, False, with_generics)
   if unboxed_type in _java_primitive_to_boxed_type:
@@ -416,6 +420,7 @@
     'interface_response_name': GetInterfaceResponseName,
     'is_array_kind': mojom.IsArrayKind,
     'is_any_handle_kind': mojom.IsAnyHandleKind,
+    "is_enum_kind": mojom.IsEnumKind,
     'is_interface_request_kind': mojom.IsInterfaceRequestKind,
     'is_map_kind': mojom.IsMapKind,
     'is_nullable_kind': mojom.IsNullableKind,
@@ -424,6 +429,7 @@
     'is_struct_kind': mojom.IsStructKind,
     'is_union_array_kind': IsUnionArrayKind,
     'is_union_kind': mojom.IsUnionKind,
+    'java_class_for_enum': GetJavaClassForEnum,
     'java_true_false': GetJavaTrueFalse,
     'java_type': GetJavaType,
     'method_ordinal_name': GetMethodOrdinalName,
diff --git a/net/dns/address_sorter_win.cc b/net/dns/address_sorter_win.cc
index f76c1ccc..71ad0c0 100644
--- a/net/dns/address_sorter_win.cc
+++ b/net/dns/address_sorter_win.cc
@@ -14,7 +14,6 @@
 #include "base/macros.h"
 #include "base/memory/free_deleter.h"
 #include "base/threading/worker_pool.h"
-#include "base/win/windows_version.h"
 #include "net/base/address_list.h"
 #include "net/base/ip_address.h"
 #include "net/base/ip_endpoint.h"
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index a8fd56b..4e568a3 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -26,7 +26,6 @@
 #include "base/time/time.h"
 #include "base/win/registry.h"
 #include "base/win/scoped_handle.h"
-#include "base/win/windows_version.h"
 #include "net/base/ip_address.h"
 #include "net/base/network_change_notifier.h"
 #include "net/dns/dns_hosts.h"
@@ -531,12 +530,7 @@
   config->ndots = 1;
 
   if (!settings.append_to_multi_label_name.set) {
-    // The default setting is true for XP, false for Vista+.
-    if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
-      config->append_to_multi_label_name = false;
-    } else {
-      config->append_to_multi_label_name = true;
-    }
+    config->append_to_multi_label_name = false;
   } else {
     config->append_to_multi_label_name =
         (settings.append_to_multi_label_name.value != 0);
diff --git a/net/dns/dns_config_service_win_unittest.cc b/net/dns/dns_config_service_win_unittest.cc
index 00d27db..5975e88a 100644
--- a/net/dns/dns_config_service_win_unittest.cc
+++ b/net/dns/dns_config_service_win_unittest.cc
@@ -6,7 +6,6 @@
 
 #include "base/logging.h"
 #include "base/memory/free_deleter.h"
-#include "base/win/windows_version.h"
 #include "net/base/ip_address.h"
 #include "net/dns/dns_protocol.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -329,7 +328,6 @@
       { "a.b", "connection.suffix" },
     },
     {  // Devolution disabled when no explicit level.
-       // Windows XP and Vista use a default level = 2, but we don't.
       {
         { false },
         { false },
@@ -395,16 +393,11 @@
     { 0 },
   };
 
-  // The default setting was true pre-Vista.
-  bool default_value = (base::win::GetVersion() < base::win::VERSION_VISTA);
-
   const struct TestCase {
     internal::DnsSystemSettings::RegDword input;
     bool expected_output;
   } cases[] = {
-    { { true, 0 }, false },
-    { { true, 1 }, true },
-    { { false, 0 }, default_value },
+      {{true, 0}, false}, {{true, 1}, true}, {{false, 0}, false},
   };
 
   for (const auto& t : cases) {
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index a1f5d253..e3065c0 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -133,7 +133,7 @@
   // This is the equivalent of calling InitializeAndListen() followed by
   // StartAcceptingConnections().
   // Returns whether a listening socket has been successfully created.
-  bool Start();
+  bool Start() WARN_UNUSED_RESULT;
 
   // Starts listening for incoming connections but will not yet accept them.
   // Returns whether a listening socket has been succesfully created.
diff --git a/services/catalog/instance.h b/services/catalog/instance.h
index 673518a..a353c7d9 100644
--- a/services/catalog/instance.h
+++ b/services/catalog/instance.h
@@ -36,9 +36,6 @@
   void CacheReady(EntryCache* cache);
 
  private:
-  using MojoNameAliasMap =
-      std::map<std::string, std::pair<std::string, std::string>>;
-
   // shell::mojom::ShellResolver:
   void ResolveMojoName(const mojo::String& mojo_name,
                        const ResolveMojoNameCallback& callback) override;
diff --git a/services/shell/public/cpp/lib/shell_connection_ref.cc b/services/shell/public/cpp/lib/shell_connection_ref.cc
index a843bd66..8b06bb79 100644
--- a/services/shell/public/cpp/lib/shell_connection_ref.cc
+++ b/services/shell/public/cpp/lib/shell_connection_ref.cc
@@ -7,6 +7,7 @@
 #include "base/bind.h"
 #include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
+#include "base/threading/thread_checker.h"
 #include "base/threading/thread_task_runner_handle.h"
 
 namespace shell {
@@ -14,68 +15,54 @@
 class ShellConnectionRefImpl : public ShellConnectionRef {
  public:
   ShellConnectionRefImpl(
-      ShellConnectionRefFactory* factory,
+      base::WeakPtr<ShellConnectionRefFactory> factory,
       scoped_refptr<base::SingleThreadTaskRunner> shell_client_task_runner)
       : factory_(factory),
-        shell_client_task_runner_(shell_client_task_runner) {}
-  ~ShellConnectionRefImpl() override {
-#ifndef NDEBUG
-    // Ensure that this object is used on only one thread at a time, or else
-    // there could be races where the object is being reset on one thread and
-    // cloned on another.
-    if (clone_task_runner_)
-      DCHECK(clone_task_runner_->BelongsToCurrentThread());
-#endif
+        shell_client_task_runner_(shell_client_task_runner) {
+    // This object is not thread-safe but may be used exclusively on a different
+    // thread from the one which constructed it.
+    thread_checker_.DetachFromThread();
+  }
 
-    if (shell_client_task_runner_->BelongsToCurrentThread()) {
+  ~ShellConnectionRefImpl() override {
+    DCHECK(thread_checker_.CalledOnValidThread());
+
+    if (shell_client_task_runner_->BelongsToCurrentThread() && factory_) {
       factory_->Release();
     } else {
       shell_client_task_runner_->PostTask(
           FROM_HERE,
-          base::Bind(&ShellConnectionRefFactory::Release,
-                     base::Unretained(factory_)));
+          base::Bind(&ShellConnectionRefFactory::Release, factory_));
     }
   }
 
  private:
   // ShellConnectionRef:
   std::unique_ptr<ShellConnectionRef> Clone() override {
-    if (shell_client_task_runner_->BelongsToCurrentThread()) {
+    DCHECK(thread_checker_.CalledOnValidThread());
+
+    if (shell_client_task_runner_->BelongsToCurrentThread() && factory_) {
       factory_->AddRef();
     } else {
       shell_client_task_runner_->PostTask(
           FROM_HERE,
-          base::Bind(&ShellConnectionRefFactory::AddRef,
-                     base::Unretained(factory_)));
+          base::Bind(&ShellConnectionRefFactory::AddRef, factory_));
     }
 
-#ifndef NDEBUG
-    // Ensure that this object is used on only one thread at a time, or else
-    // there could be races where the object is being reset on one thread and
-    // cloned on another.
-    if (clone_task_runner_) {
-      DCHECK(clone_task_runner_->BelongsToCurrentThread());
-    } else {
-      clone_task_runner_ = base::ThreadTaskRunnerHandle::Get();
-    }
-#endif
-
     return base::WrapUnique(
         new ShellConnectionRefImpl(factory_, shell_client_task_runner_));
   }
 
-  ShellConnectionRefFactory* factory_;
+  base::WeakPtr<ShellConnectionRefFactory> factory_;
   scoped_refptr<base::SingleThreadTaskRunner> shell_client_task_runner_;
-
-#ifndef NDEBUG
-  scoped_refptr<base::SingleThreadTaskRunner> clone_task_runner_;
-#endif
+  base::ThreadChecker thread_checker_;
 
   DISALLOW_COPY_AND_ASSIGN(ShellConnectionRefImpl);
 };
 
 ShellConnectionRefFactory::ShellConnectionRefFactory(
-    const base::Closure& quit_closure) : quit_closure_(quit_closure) {
+    const base::Closure& quit_closure)
+    : quit_closure_(quit_closure), weak_factory_(this) {
   DCHECK(!quit_closure_.is_null());
 }
 
@@ -84,7 +71,8 @@
 std::unique_ptr<ShellConnectionRef> ShellConnectionRefFactory::CreateRef() {
   AddRef();
   return base::WrapUnique(
-      new ShellConnectionRefImpl(this, base::ThreadTaskRunnerHandle::Get()));
+      new ShellConnectionRefImpl(weak_factory_.GetWeakPtr(),
+                                 base::ThreadTaskRunnerHandle::Get()));
 }
 
 void ShellConnectionRefFactory::AddRef() {
diff --git a/services/shell/public/cpp/shell_connection_ref.h b/services/shell/public/cpp/shell_connection_ref.h
index 29444bed..b22e12e 100644
--- a/services/shell/public/cpp/shell_connection_ref.h
+++ b/services/shell/public/cpp/shell_connection_ref.h
@@ -9,6 +9,7 @@
 
 #include "base/callback.h"
 #include "base/macros.h"
+#include "base/memory/weak_ptr.h"
 
 namespace shell {
 
@@ -48,6 +49,7 @@
 
   const base::Closure quit_closure_;
   int ref_count_ = 0;
+  base::WeakPtrFactory<ShellConnectionRefFactory> weak_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(ShellConnectionRefFactory);
 };
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index a62db5a..e888a77d 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1172,7 +1172,6 @@
 crbug.com/610300 [ Linux Trusty ] css3/fonts/font-style-matching-5.html [ Failure Pass ]
 crbug.com/610300 [ Linux Trusty ] css3/fonts/font-style-matching-7.html [ Failure Pass ]
 crbug.com/610300 [ Linux Trusty ] css3/fonts/font-style-matching-8.html [ Failure Pass ]
-
 crbug.com/524646 [ Mac10.10 ] fast/dom/shadow/shadowdom-for-button.html [ Failure ]
 
 crbug.com/538717 [ Win Mac Linux ] http/tests/permissions/chromium/test-request-multiple-window.html [ Failure Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/animations/css-animation-overrides-svg-presentation-attribute-animation-expected.txt b/third_party/WebKit/LayoutTests/animations/css-animation-overrides-svg-presentation-attribute-animation-expected.txt
index d21c9910..4409e5c 100644
--- a/third_party/WebKit/LayoutTests/animations/css-animation-overrides-svg-presentation-attribute-animation-expected.txt
+++ b/third_party/WebKit/LayoutTests/animations/css-animation-overrides-svg-presentation-attribute-animation-expected.txt
@@ -1,4 +1,4 @@
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 FAIL CSS animations always override SVG presentation attribute animations assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/svg-startOffset-interpolation-expected.txt b/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/svg-startOffset-interpolation-expected.txt
index 9337278..19564db 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/svg-startOffset-interpolation-expected.txt
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/svg-startOffset-interpolation-expected.txt
@@ -1,5 +1,5 @@
 CONSOLE WARNING: SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 PASS This test uses interpolation-test.js. 
 PASS SMIL: Interpolate attribute <startOffset> from replace [1] to replace [6] at (0) is [1] 
 PASS SMIL: Interpolate attribute <startOffset> from replace [1] to replace [6] at (0.2) is [2] 
diff --git a/third_party/WebKit/LayoutTests/css3/calc/calc-errors-expected.txt b/third_party/WebKit/LayoutTests/css3/calc/calc-errors-expected.txt
deleted file mode 100644
index cccfcc9..0000000
--- a/third_party/WebKit/LayoutTests/css3/calc/calc-errors-expected.txt
+++ /dev/null
@@ -1,144 +0,0 @@
-unclosed calc
-unclosed calc with garbage
-garbage
-garbage
-dpi
-dpi / number
-dpi + dpi
-fr
-zero division
-mod10
-1mod
-70px+40px no whitespace around +
-70px +40px no whitespace on right of +
-70px+ 40px no whitespace on left of +
-70px+-40px no whitespace around +
-70px-40px no whitespace around -
-70px -40px no whitespace on right of -
-70px- 40px no whitespace on left of -
-70px-+40px no whitespace around -
-70px+/**/40px no whitespace around +
-70px/**/+40px no whitespace around +
-70px+/**/40px no whitespace around +
-70px +/**/40px no whitespace on right of +
-70px/**/+ 40px no whitespace on left of +
-70px/**/+-40px no whitespace around +
-70px+/**/-40px no whitespace around +
-70px/**/+/**/-40px no whitespace around +
-70px-/**/40px no whitespace around -
-70px/**/-40px no whitespace around -
-70px/**/-/**/40px no whitespace around -
-70px -/**/40px no whitespace on right of -
-70px/**/- 40px no whitespace on left of -
-70px/**/-+40px no whitespace around -
-70px-/**/+40px no whitespace around -
-70px/**/-/**/+40px no whitespace around -
-too many nests
-end with operator
-start with operator
-no expressions
-too many pluses
-no binary operator
-two binary operators
-invalid operator '@'
-invalid operator 'flim'
-invalid operator '@'
-invalid operator 'flim'
-invalid operator 'flim' with parens
-non length
-number + length
-length + number
-percent + number
-number + percent
-angle + number
-number + angle
-angle + length
-length + angle
-angle + percent
-percent + angle
-angle + time
-time + angle
-angle + frequency
-frequency + angle
-time + number
-number + time
-time + length
-length + time
-time + percent
-percent + time
-time + angle
-angle + time
-time + frequency
-frequency + time
-length - number
-number - length
-percent - number
-number - percent
-angle - number
-number - angle
-angle - length
-length - angle
-angle - percent
-percent - angle
-angle - time
-time - angle
-angle - frequency
-frequency - angle
-time - number
-number - time
-time - length
-length - time
-time - percent
-percent - time
-time - angle
-angle - time
-time - frequency
-frequency - time
-length * length
-length * percent
-percent * length
-percent * percent
-angle * length
-length * angle
-angle * percent
-percent * angle
-angle * time
-time * angle
-angle * frequency
-frequency * angle
-time * length
-length * time
-time * percent
-percent * time
-time * angle
-angle * time
-time * frequency
-frequency * time
-number / length
-number / percent
-length / length
-length / percent
-percent / length
-percent / percent
-number / angle
-angle / length
-length / angle
-angle / percent
-percent / angle
-angle / time
-time / angle
-angle / frequency
-frequency / angle
-number / time
-time / length
-length / time
-time / percent
-percent / time
-time / angle
-angle / time
-time / frequency
-frequency / time
-This is a testharness.js-based test.
-PASS Tests invalid calc() expression handling. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/cssom/cssvalue-comparison-expected.txt b/third_party/WebKit/LayoutTests/cssom/cssvalue-comparison-expected.txt
deleted file mode 100644
index 96c8b29..0000000
--- a/third_party/WebKit/LayoutTests/cssom/cssvalue-comparison-expected.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-This test verifies that CSSValue objects comparison works correctly.
-
-This is a testharness.js-based test.
-PASS Two CSSValues "20%" for property "width" are equal. 
-PASS Two CSSValues "2em" for property "width" are equal. 
-PASS Two CSSValues "2rem" for property "width" are equal. 
-PASS Two CSSValues "20px" for property "width" are equal. 
-PASS Two CSSValues "2cm" for property "width" are equal. 
-PASS Two CSSValues "20mm" for property "width" are equal. 
-PASS Two CSSValues "4in" for property "width" are equal. 
-PASS Two CSSValues "20pt" for property "width" are equal. 
-PASS Two CSSValues "10pc" for property "width" are equal. 
-PASS Two CSSValues "6vw" for property "width" are equal. 
-PASS Two CSSValues "6vh" for property "width" are equal. 
-PASS Two CSSValues "4vmin" for property "width" are equal. 
-PASS Two CSSValues "10vmax" for property "width" are equal. 
-PASS Two CSSValues "-webkit-calc(-100px + 100%)" for property "width" are equal. 
-PASS Two CSSValues "20%" and "2em" for property "width" are not equal. 
-PASS Two CSSValues "rotate(15deg)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "rotate(1.55rad)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "rotate(200grad)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "rotate(0.5turn)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "rotate(15deg)" and "rotate(1.55rad)" for property "-webkit-transform" are not equal. 
-PASS Two CSSValues "url(dummy://test.png)" for property "background-image" are equal. 
-PASS Two CSSValues "url(dummy://green.png)" for property "background-image" are equal. 
-PASS Two CSSValues "url(dummy://test.png)" and "url(dummy://green.png)" for property "background-image" are not equal. 
-PASS Two CSSValues "counter(a)" for property "content" are equal. 
-PASS Two CSSValues "counters(a, '.')" for property "content" are equal. 
-PASS Two CSSValues "counter(a)" and "counters(a, '.')" for property "content" are not equal. 
-PASS Two CSSValues "attr(a)" for property "content" are equal. 
-PASS Two CSSValues "attr(p)" for property "content" are equal. 
-PASS Two CSSValues "attr(a)" and "attr(p)" for property "content" are not equal. 
-PASS Two CSSValues "rect(40px, 0, 45px, -5px)" for property "clip" are equal. 
-PASS Two CSSValues "rect(10px, 5px, 15px, -10px)" for property "clip" are equal. 
-PASS Two CSSValues "rect(40px, 0, 45px, -5px)" and "rect(10px, 5px, 15px, -10px)" for property "clip" are not equal. 
-PASS Two CSSValues "30px 75px 15px 15px" for property "border-radius" are equal. 
-PASS Two CSSValues "164px / 82px" for property "border-radius" are equal. 
-PASS Two CSSValues "40px" for property "border-radius" are equal. 
-PASS Two CSSValues "30px 75px 15px 15px" and "164px / 82px" for property "border-radius" are not equal. 
-PASS Two CSSValues "rgb(255,0,0)" for property "stop-color" are equal. 
-PASS Two CSSValues "#FF5566" for property "stop-color" are equal. 
-PASS Two CSSValues "rgb(255,0,0)" and "#FF5566" for property "stop-color" are not equal. 
-PASS Two CSSValues "polygon(evenodd, 10px 75px, 180px 180px, 100px 10px, 10px 180px, 180px 75px, 10px 75px)" for property "-webkit-clip-path" are equal. 
-PASS Two CSSValues "polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)" for property "-webkit-clip-path" are equal. 
-PASS Two CSSValues "polygon(evenodd, 10px 75px, 180px 180px, 100px 10px, 10px 180px, 180px 75px, 10px 75px)" and "polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)" for property "-webkit-clip-path" are not equal. 
-PASS Two CSSValues "10s" for property "-webkit-animation-duration" are equal. 
-PASS Two CSSValues "100ms" for property "-webkit-animation-duration" are equal. 
-PASS Two CSSValues "10s" and "100ms" for property "-webkit-animation-duration" are not equal. 
-PASS Two CSSValues "red" for property "color" are equal. 
-PASS Two CSSValues "blue" for property "color" are equal. 
-PASS Two CSSValues "red" and "blue" for property "color" are not equal. 
-PASS Two CSSValues "url(resources/greenbox.png)" for property "border-image-source" are equal. 
-PASS Two CSSValues "url(resources/redbox.png)" for property "border-image-source" are equal. 
-PASS Two CSSValues "url(resources/greenbox.png)" and "url(resources/redbox.png)" for property "border-image-source" are not equal. 
-PASS Two CSSValues "1 2 3 4" for property "border-image-slice" are equal. 
-PASS Two CSSValues "2 3 4 5" for property "border-image-slice" are equal. 
-PASS Two CSSValues "1 2 3 4" and "2 3 4 5" for property "border-image-slice" are not equal. 
-PASS Two CSSValues "url(resources/greenbox.png) 0 0, pointer" for property "cursor" are equal. 
-PASS Two CSSValues "url(resources/cursor.png) 1 1, wait" for property "cursor" are equal. 
-PASS Two CSSValues "url(resources/greenbox.png) 0 0, pointer" and "url(resources/cursor.png) 1 1, wait" for property "cursor" are not equal. 
-PASS Two CSSValues "italic" for property "font-style" are equal. 
-PASS Two CSSValues "oblique" for property "font-style" are equal. 
-PASS Two CSSValues "italic" and "oblique" for property "font-style" are not equal. 
-PASS Two CSSValues "normal" for property "font-variant-ligatures" are equal. 
-PASS Two CSSValues "discretionary-ligatures" for property "font-variant-ligatures" are equal. 
-PASS Two CSSValues "normal" and "discretionary-ligatures" for property "font-variant-ligatures" are not equal. 
-PASS Two CSSValues "normal" for property "font-variant-caps" are equal. 
-PASS Two CSSValues "small-caps" for property "font-variant-caps" are equal. 
-PASS Two CSSValues "normal" and "small-caps" for property "font-variant-caps" are not equal. 
-PASS Two CSSValues "bold" for property "font-weight" are equal. 
-PASS Two CSSValues "bolder" for property "font-weight" are equal. 
-PASS Two CSSValues "bold" and "bolder" for property "font-weight" are not equal. 
-PASS Two CSSValues "semi-condensed" for property "font-stretch" are equal. 
-PASS Two CSSValues "expanded" for property "font-stretch" are equal. 
-PASS Two CSSValues "semi-condensed" and "expanded" for property "font-stretch" are not equal. 
-PASS Two CSSValues "12px" for property "font-size" are equal. 
-PASS Two CSSValues "8px" for property "font-size" are equal. 
-PASS Two CSSValues "12px" and "8px" for property "font-size" are not equal. 
-PASS Two CSSValues "30pz" for property "line-height" are equal. 
-PASS Two CSSValues "16px" for property "line-height" are equal. 
-PASS Two CSSValues "30pz" and "16px" for property "line-height" are not equal. 
-PASS Two CSSValues "arial" for property "font-family" are equal. 
-PASS Two CSSValues "helvetica" for property "font-family" are equal. 
-PASS Two CSSValues "arial" and "helvetica" for property "font-family" are not equal. 
-PASS Two CSSValues "-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000))" for property "background-image" are equal. 
-PASS Two CSSValues "-webkit-gradient(radial, 45 45, 0, 52 50, 0, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62))" for property "background-image" are equal. 
-PASS Two CSSValues "-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000))" and "-webkit-gradient(radial, 45 45, 0, 52 50, 0, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62))" for property "background-image" are not equal. 
-PASS Two CSSValues "radial-gradient(circle, #ccc, #000)" for property "background-image" are equal. 
-PASS Two CSSValues "linear-gradient(#000, #234)" for property "background-image" are equal. 
-PASS Two CSSValues "linear-gradient(to top, #000, #234)" for property "background-image" are equal. 
-PASS Two CSSValues "linear-gradient(#000, #234)" and "linear-gradient(to top, #000, #234)" for property "background-image" are not equal. 
-PASS Two CSSValues "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)" for property "background-image" are equal. 
-PASS Two CSSValues "-webkit-cross-fade(url(dummy://background.png), url(dummy://foreground.png), 80%)" for property "background-image" are equal. 
-PASS Two CSSValues "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)" and "-webkit-cross-fade(url(dummy://background.png), url(dummy://foreground.png), 80%)" for property "background-image" are not equal. 
-PASS Two CSSValues "below 10px" for property "-webkit-box-reflect" are equal. 
-PASS Two CSSValues "below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(10, 55, 234, 1)))" for property "-webkit-box-reflect" are equal. 
-PASS Two CSSValues "below 10px" and "below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(10, 55, 234, 1)))" for property "-webkit-box-reflect" are not equal. 
-PASS Two CSSValues "0 -20px 10px red, 0 20px 10px blue" for property "-webkit-box-shadow" are equal. 
-PASS Two CSSValues "0 20px 10px blue" for property "-webkit-box-shadow" are equal. 
-PASS Two CSSValues "5px 5px 5px rgba(0, 0, 0, 0.3)" for property "-webkit-box-shadow" are equal. 
-PASS Two CSSValues "0 -20px 10px red, 0 20px 10px blue" and "0 20px 10px blue" for property "-webkit-box-shadow" are not equal. 
-PASS Two CSSValues "cubic-bezier(0.25, 0.1, 0.25, 1)" for property "-webkit-transition-timing-function" are equal. 
-PASS Two CSSValues "linear" for property "-webkit-transition-timing-function" are equal. 
-PASS Two CSSValues "steps(3, end)" for property "-webkit-transition-timing-function" are equal. 
-PASS Two CSSValues "cubic-bezier(0.25, 0.1, 0.25, 1)" and "linear" for property "-webkit-transition-timing-function" are not equal. 
-PASS Two CSSValues "rotate(30deg)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "translate(50px,50px)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "scale(2,4)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "skew(30deg,20deg)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "matrix(0.4,0.5,-0.5,0.4,0,0)" for property "-webkit-transform" are equal. 
-PASS Two CSSValues "rotate(30deg)" and "translate(50px,50px)" for property "-webkit-transform" are not equal. 
-PASS Two CSSValues "inline-box" for property "-webkit-line-box-contain" are equal. 
-PASS Two CSSValues "font" for property "-webkit-line-box-contain" are equal. 
-PASS Two CSSValues "glyphs" for property "-webkit-line-box-contain" are equal. 
-PASS Two CSSValues "replaced" for property "-webkit-line-box-contain" are equal. 
-PASS Two CSSValues "inline-box" and "font" for property "-webkit-line-box-contain" are not equal. 
-PASS Two CSSValues "-webkit-image-set(url(dummy://test.png) 1x, url(dummy://test.png) 2x)" for property "background-image" are equal. 
-PASS Two CSSValues "-webkit-image-set(url(dummy://small.png) 2x, url(dummy://big.png) 3x)" for property "background-image" are equal. 
-PASS Two CSSValues "-webkit-image-set(url(dummy://test.png) 1x, url(dummy://test.png) 2x)" and "-webkit-image-set(url(dummy://small.png) 2x, url(dummy://big.png) 3x)" for property "background-image" are not equal. 
-PASS Two CSSValues "grayscale(100%) sepia(100%)" for property "-webkit-filter" are equal. 
-PASS Two CSSValues "sepia(10%) grayscale(50%)" for property "-webkit-filter" are equal. 
-PASS Two CSSValues "grayscale(100%) sepia(100%)" and "sepia(10%) grayscale(50%)" for property "-webkit-filter" are not equal. 
-PASS Two CSSValues "dashboard-region(label circle)" for property "-webkit-dashboard-region" are equal. 
-PASS Two CSSValues "dashboard-region(label circle 1px 2px 3px 4px) dashboard-region(label rectangle 5px 6px 7px 8px)" for property "-webkit-dashboard-region" are equal. 
-PASS Two CSSValues "dashboard-region(label circle)" and "dashboard-region(label circle 1px 2px 3px 4px) dashboard-region(label rectangle 5px 6px 7px 8px)" for property "-webkit-dashboard-region" are not equal. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/css/variables/no-assert-serializing-shorthand-variable-references-expected.txt b/third_party/WebKit/LayoutTests/fast/css/variables/no-assert-serializing-shorthand-variable-references-expected.txt
deleted file mode 100644
index 11c43a3..0000000
--- a/third_party/WebKit/LayoutTests/fast/css/variables/no-assert-serializing-shorthand-variable-references-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-:root { --bgcolor: green; background: 10px var(--bgcolor); }
-This is a testharness.js-based test.
-PASS shorthand variable references can be serialized 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt
index b1acd09..52fc083 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt
@@ -1,4 +1,3 @@
-
 This is a testharness.js-based test.
 PASS naturalWidth/Height of SVG in <img>, width/height in pixels 
 FAIL naturalWidth/Height of SVG in <img>, width in pixels; height unspecified assert_equals: expected "500x0" but got "500x150"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash.html b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash.html
index 4cb6819..fb8d2b3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash.html
@@ -5,11 +5,20 @@
 if (window.testRunner) {
     testRunner.waitUntilDone();
     testRunner.dumpAsText();
+} 
+var observer, div;
+
+function initializeObserver() {
+    observer = new MutationObserver(
+                   function() {console.log('Should not appear')});
+    div = document.createElement('div');
+    observer.observe(div, {attributes: true});
+    div.id = 'foo';
 }
-var observer = new MutationObserver(function() {console.log('Should not appear')});
-var div = document.createElement('div');
-observer.observe(div, {attributes: true});
-div.id = 'foo';
+
+// Do initialization work in an inner function to avoid references to objects
+// remaining live on this function's stack frame (http://crbug.com/595672/).
+initializeObserver();
 div = null;
 observer = null;
 gc();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable.html b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable.html
index 0016cb0..95e9d9e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable.html
@@ -19,7 +19,10 @@
 var i = 1;
 for (var kind in nodeListKind) {
     var code = nodeListKind[kind];
-    eval(code).customProperty = i;
+    // Do initialization work in an inner function to avoid references to
+    // objects remaining live on this function's stack frame
+    // (http://crbug.com/595672/).
+    (() => {eval(code).customProperty = i})();
     gc();
     shouldBe(code + '.customProperty', '' + i++);
 }
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers.html b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers.html
index 5bb3d7cd..9994a0b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers.html
@@ -31,7 +31,10 @@
     function test(expr, expectedType, testWhat)
     {
         shouldBe(expr + ".type", expectedType);
-        eval(expr + "." + testWhat).foo = "bar"
+        // Do initialization work in an inner function to avoid references to
+        // objects remaining live on this function's stack frame
+        // (http://crbug.com/595672/).
+        (() => {eval(expr + "." + testWhat).foo = "bar";})();
         gc();
         shouldBe(expr + "." + testWhat + ".foo", "'bar'");
     }
diff --git a/third_party/WebKit/LayoutTests/fast/dom/cross-frame-accessor-throw-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/cross-frame-accessor-throw-expected.txt
index 14e512ee..8b2b0ee 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/cross-frame-accessor-throw-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/cross-frame-accessor-throw-expected.txt
@@ -1,5 +1,4 @@
 CONSOLE WARNING: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
-
 This is a testharness.js-based test.
 PASS Check that exception is created in called function's context. 
 PASS Check that DOM exception is created in setter's context. 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-collected-shadowroot-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-collected-shadowroot-crash-expected.txt
index 25c029c..42a1d839 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-collected-shadowroot-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-collected-shadowroot-crash-expected.txt
@@ -1,3 +1,3 @@
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-eYyYGmKWdhpUewohaXk9o8IaLSw='". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 8: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-eYyYGmKWdhpUewohaXk9o8IaLSw='". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-shadowroot-from-document-and-destroy-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-shadowroot-from-document-and-destroy-crash-expected.txt
index 25c029c..25ec934 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-shadowroot-from-document-and-destroy-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-shadowroot-from-document-and-destroy-crash-expected.txt
@@ -1,3 +1,3 @@
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-eYyYGmKWdhpUewohaXk9o8IaLSw='". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 9: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-eYyYGmKWdhpUewohaXk9o8IaLSw='". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution.
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt
index bcd5f648..5b116a46 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-event-properties-expected.txt
@@ -1,5 +1,3 @@
-Test that pointer properties propagates from touches to PointerEvents
-
 This is a testharness.js-based test.
 FAIL Pointer property propagation from touches to PointerEvents assert_not_equals: window.PointerEvent got disallowed value undefined
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt
index 26b8201..92058226 100644
--- a/third_party/WebKit/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://disallowed.example.com/' because it violates the following Content Security Policy directive: "connect-src http://invalid http://127.0.0.1".
+CONSOLE ERROR: line 40: Refused to connect to 'http://disallowed.example.com/' because it violates the following Content Security Policy directive: "connect-src http://invalid http://127.0.0.1".
 
 Test EventSource constructor functionality. Should print a series of PASS messages followed by DONE.
 
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scroll-expected.txt
deleted file mode 100644
index 8064c9d..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scroll-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scroll on the main frame's document element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scrollBy-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scrollBy-expected.txt
deleted file mode 100644
index b372df5b..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scrollBy-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollBy on the main frame's document element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:-30, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:-35, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:-3900, y:-3850, smooth:true 
-PASS Scroll x:4050, y:4000, smooth:true 
-PASS Scroll x:-4000, y:-4100, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scrollTo-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scrollTo-expected.txt
deleted file mode 100644
index a627167..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-element-scrollTo-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollTo on the main frame's document element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-interrupted-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-interrupted-scroll-expected.txt
deleted file mode 100644
index 90cda022..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-interrupted-scroll-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Test that interrupting a smooth scroll on the main frame works with both scroll behaviors and with input
-
-This is a testharness.js-based test.
-PASS instant scroll 
-PASS smooth scroll 
-PASS touch scroll 
-PASS wheel scroll 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scroll-expected.txt
deleted file mode 100644
index b477e6d..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scroll-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scroll on the main frame works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollBy-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollBy-expected.txt
deleted file mode 100644
index edb24e0..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollBy-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollBy on the main frame works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:-30, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:-35, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:-3900, y:-3850, smooth:true 
-PASS Scroll x:4050, y:4000, smooth:true 
-PASS Scroll x:-4000, y:-4100, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollLeft-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollLeft-expected.txt
deleted file mode 100644
index dec060a..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollLeft-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that setting scrollLeft on the main frame works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:0, smooth:false 
-PASS Scroll x:4, y:0, smooth:false 
-PASS Scroll x:20, y:0, smooth:true 
-PASS Scroll x:40, y:0, smooth:true 
-PASS Scroll x:4000, y:0, smooth:true 
-PASS Scroll x:10, y:0, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollTo-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollTo-expected.txt
deleted file mode 100644
index 6efa162..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollTo-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollTo on the main frame works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollTop-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollTop-expected.txt
deleted file mode 100644
index 47e368d..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/main-frame-scrollTop-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that setting scrollTop on the main frame works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:0, y:2, smooth:false 
-PASS Scroll x:0, y:4, smooth:false 
-PASS Scroll x:0, y:25, smooth:true 
-PASS Scroll x:0, y:45, smooth:true 
-PASS Scroll x:0, y:4100, smooth:true 
-PASS Scroll x:0, y:20, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scroll-expected.txt
deleted file mode 100644
index fb5492c..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scroll-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scroll on an overflow:hidden element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollBy-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollBy-expected.txt
deleted file mode 100644
index 5d47fad..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollBy-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollBy on an overflow:hidden element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:-30, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:-35, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:-3900, y:-3850, smooth:true 
-PASS Scroll x:4050, y:4000, smooth:true 
-PASS Scroll x:-4000, y:-4100, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollLeft-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollLeft-expected.txt
deleted file mode 100644
index 56793032..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollLeft-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that setting scrollLeft on an overflow:hidden element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:0, smooth:false 
-PASS Scroll x:4, y:0, smooth:false 
-PASS Scroll x:20, y:0, smooth:true 
-PASS Scroll x:40, y:0, smooth:true 
-PASS Scroll x:4000, y:0, smooth:true 
-PASS Scroll x:10, y:0, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollTo-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollTo-expected.txt
deleted file mode 100644
index ad876443..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollTo-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollTo on an overflow:hidden element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollTop-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollTop-expected.txt
deleted file mode 100644
index 1b6e95b..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-hidden-scrollTop-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that setting scrollTop on an overflow:hidden element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:0, y:2, smooth:false 
-PASS Scroll x:0, y:4, smooth:false 
-PASS Scroll x:0, y:25, smooth:true 
-PASS Scroll x:0, y:45, smooth:true 
-PASS Scroll x:0, y:4100, smooth:true 
-PASS Scroll x:0, y:20, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-interrupted-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-interrupted-scroll-expected.txt
deleted file mode 100644
index 40ac2da..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-interrupted-scroll-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Test that interrupting a smooth scroll on an overflow:scroll element works with both scroll behaviors and with input
-
-This is a testharness.js-based test.
-PASS instant scroll 
-PASS smooth scroll 
-PASS touch scroll 
-PASS wheel scroll 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scroll-expected.txt
deleted file mode 100644
index 68a18f4..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scroll-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scroll on an overflow:scroll element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollBy-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollBy-expected.txt
deleted file mode 100644
index aa50d65..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollBy-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollBy on an overflow:scroll element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:-30, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:-35, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:-3900, y:-3850, smooth:true 
-PASS Scroll x:4050, y:4000, smooth:true 
-PASS Scroll x:-4000, y:-4100, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollLeft-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollLeft-expected.txt
deleted file mode 100644
index 23addc6..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollLeft-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that setting scrollLeft on an overflow:scroll element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:0, smooth:false 
-PASS Scroll x:4, y:0, smooth:false 
-PASS Scroll x:20, y:0, smooth:true 
-PASS Scroll x:40, y:0, smooth:true 
-PASS Scroll x:4000, y:0, smooth:true 
-PASS Scroll x:10, y:0, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollTo-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollTo-expected.txt
deleted file mode 100644
index 17198d55..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollTo-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Test that calling scrollTo on an overflow:scroll element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollTop-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollTop-expected.txt
deleted file mode 100644
index 927d0a7..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-scrollTop-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test that setting scrollTop on an overflow:scroll element works with both scroll behaviors
-
-This is a testharness.js-based test.
-PASS Scroll x:0, y:2, smooth:false 
-PASS Scroll x:0, y:4, smooth:false 
-PASS Scroll x:0, y:25, smooth:true 
-PASS Scroll x:0, y:45, smooth:true 
-PASS Scroll x:0, y:4100, smooth:true 
-PASS Scroll x:0, y:20, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scroll-expected.txt
deleted file mode 100644
index a0f76a8c..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scroll-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test that calling scroll on a subframe's document element works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scrollBy-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scrollBy-expected.txt
deleted file mode 100644
index b72cd5c..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scrollBy-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test that calling scrollBy on a subframe's document element works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:-30, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:-35, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:-3900, y:-3850, smooth:true 
-PASS Scroll x:4050, y:4000, smooth:true 
-PASS Scroll x:-4000, y:-4100, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scrollTo-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scrollTo-expected.txt
deleted file mode 100644
index 86bde31b..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-element-scrollTo-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test that calling scrollTo on a subframe's document element works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-interrupted-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-interrupted-scroll-expected.txt
deleted file mode 100644
index 726a0c84..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-interrupted-scroll-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Test that interrupting a smooth scroll on a subframe works with both scroll behaviors and with input
-
-
-This is a testharness.js-based test.
-PASS instant scroll 
-PASS smooth scroll 
-PASS touch scroll 
-PASS wheel scroll 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scroll-expected.txt
deleted file mode 100644
index 75f590672..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scroll-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test that calling scroll on a subframe works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollBy-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollBy-expected.txt
deleted file mode 100644
index cbacda2..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollBy-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test that calling scrollBy on a subframe works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:-30, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:-35, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:-3900, y:-3850, smooth:true 
-PASS Scroll x:4050, y:4000, smooth:true 
-PASS Scroll x:-4000, y:-4100, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollLeft-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollLeft-expected.txt
deleted file mode 100644
index d1e30f5..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollLeft-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Test that setting scrollLeft on a subframe works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:0, smooth:false 
-PASS Scroll x:4, y:0, smooth:false 
-PASS Scroll x:20, y:0, smooth:true 
-PASS Scroll x:40, y:0, smooth:true 
-PASS Scroll x:4000, y:0, smooth:true 
-PASS Scroll x:10, y:0, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollTo-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollTo-expected.txt
deleted file mode 100644
index fe91c3480..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollTo-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test that calling scrollTo on a subframe works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:1, y:2, smooth:false 
-PASS Scroll x:2, y:3, smooth:false 
-PASS Scroll x:3, y:4, smooth:false 
-PASS Scroll x:4, y:5, smooth:false 
-PASS Scroll x:3, y:undefined, smooth:false 
-PASS Scroll x:undefined, y:4, smooth:false 
-PASS Scroll x:undefined, y:undefined, smooth:false 
-PASS Scroll x:10, y:15, smooth:true 
-PASS Scroll x:20, y:25, smooth:true 
-PASS Scroll x:30, y:35, smooth:true 
-PASS Scroll x:40, y:45, smooth:true 
-PASS Scroll x:45, y:undefined, smooth:true 
-PASS Scroll x:undefined, y:40, smooth:true 
-PASS Scroll x:4000, y:4100, smooth:true 
-PASS Scroll x:15, y:20, smooth:true 
-PASS Scroll x:4100, y:4000, smooth:true 
-PASS Scroll x:10, y:5, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollTop-expected.txt b/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollTop-expected.txt
deleted file mode 100644
index ff7a58b..0000000
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/subframe-scrollTop-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Test that setting scrollTop on a subframe works with both scroll behaviors
-
-
-This is a testharness.js-based test.
-PASS Scroll x:0, y:2, smooth:false 
-PASS Scroll x:0, y:4, smooth:false 
-PASS Scroll x:0, y:25, smooth:true 
-PASS Scroll x:0, y:45, smooth:true 
-PASS Scroll x:0, y:4100, smooth:true 
-PASS Scroll x:0, y:20, smooth:true 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right-expected.txt b/third_party/WebKit/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right-expected.txt
index 66ae7a07..806a46a 100644
--- a/third_party/WebKit/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right-expected.txt
@@ -1,17 +1,3 @@
-The block squares should wrap around the top of the blue shape. They should not overlap the shape.
-
-X
-X
-X
-X
-X
-X
-X
-X
-X
-X
-X
-X
 This is a testharness.js-based test.
 PASS 1st square doesn't overlap shape. 
 FAIL 2nd square is properly affected by shape. assert_approx_equals: expected 97 +/- 0.5 but got 97.6875
diff --git a/third_party/WebKit/LayoutTests/fast/sub-pixel/width-of-inline-in-float-expected.txt b/third_party/WebKit/LayoutTests/fast/sub-pixel/width-of-inline-in-float-expected.txt
deleted file mode 100644
index 2e08ce94..0000000
--- a/third_party/WebKit/LayoutTests/fast/sub-pixel/width-of-inline-in-float-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Customer Supportz
-The reported inner width must be the same as the outer width.
-
-This is a testharness.js-based test.
-PASS Test reported width of inline in float 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt
index 8ed67d1..9c60e5c 100644
--- a/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt
@@ -1,8 +1,3 @@
-CACACACA
-CACACACA
-CACACACA
-56
-56
 This is a testharness.js-based test.
 FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 282.96875 but got 138.359375
 FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 282.96875 but got 138.359375
diff --git a/third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi-expected.html b/third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi-expected.html
new file mode 100644
index 0000000..8aa62d58
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi-expected.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Language Attribute Test</title>
+<style type="text/css">
+@font-face {
+    font-family: NotoX;
+    src: url("../../third_party/NotoSans/NotoSansDevanagari-Regular-uni091D.ttf") format("truetype");
+}
+</style>
+</head>
+<body>
+    <h3>The glyph for JHA should look different for Nepali and Hindi.</h3>
+	<h3>You First should change system Language to Nepali or Hindi</h3>
+    <p lang="hi" style="font-family: NotoX">JHA &#x091D; </p><br>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi.html b/third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi.html
new file mode 100644
index 0000000..13d67c0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<title>Language Attribute Test</title>
+<style type="text/css">
+@font-face {
+    font-family: NotoX;
+    src: url("../../third_party/NotoSans/NotoSansDevanagari-Regular-uni091D.ttf") format("truetype");
+}
+</style>
+</head>
+<body>
+    <h3>The glyph for JHA should look different for Nepali and Hindi.</h3>
+	<h3>You First should change system Language to Nepali or Hindi</h3>
+    <p style="font-family: NotoX">JHA &#x091D; </p><br>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-open-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-open-exceptions-expected.txt
index a34bf3c..1da48a0 100644
--- a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-open-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-open-exceptions-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://not.example.com/' because it violates the following Content Security Policy directive: "connect-src http://example.com".
+CONSOLE ERROR: line 23: Refused to connect to 'http://not.example.com/' because it violates the following Content Security Policy directive: "connect-src http://example.com".
 
 This tests that exceptions thrown by XHR.open() have reasonable messages.
 
diff --git a/third_party/WebKit/LayoutTests/fast/xpath/xpath-iterator-result-should-mark-its-nodeset.html b/third_party/WebKit/LayoutTests/fast/xpath/xpath-iterator-result-should-mark-its-nodeset.html
index 56760a6..98c9f18b 100644
--- a/third_party/WebKit/LayoutTests/fast/xpath/xpath-iterator-result-should-mark-its-nodeset.html
+++ b/third_party/WebKit/LayoutTests/fast/xpath/xpath-iterator-result-should-mark-its-nodeset.html
@@ -20,10 +20,18 @@
 
         function test(type)
         {
-            var doc = (new DOMParser).parseFromString("<html><body><span></span></body></html>", "text/xml");
-            doc.getElementsByTagName("span")[0].foo = "PASS";
-            var result = doc.evaluate("//span", doc.documentElement, null, type, null);
-            doc = 0;
+            var doc, result;
+            function initialize() {
+              doc = (new DOMParser).parseFromString("<html><body><span></span></body></html>", "text/xml");
+              doc.getElementsByTagName("span")[0].foo = "PASS";
+              result = doc.evaluate("//span", doc.documentElement, null, type, null);
+              doc = 0;
+            }
+
+            // Do initialization work in an inner function to avoid references
+            // to objects remaining live on this function's stack frame
+            // (http://crbug.com/595672/).
+            initialize();
             gc();
             var console = document.getElementById("console");
             console.appendChild(document.createTextNode(result.iterateNext().foo));
diff --git a/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html b/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html
index 91bb596..ef694731 100644
--- a/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html
+++ b/third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html
@@ -20,9 +20,17 @@
 
         function test(type)
         {
-            document.getElementsByTagName("span")[0].foo = "PASS";
-            var result = document.evaluate("//span", document.documentElement, null, type, null);
-            document.body.removeChild(document.getElementsByTagName("span")[0]);
+            var result;
+            function initialize() {
+                document.getElementsByTagName("span")[0].foo = "PASS";
+                result = document.evaluate("//span", document.documentElement, null, type, null);
+                document.body.removeChild(document.getElementsByTagName("span")[0]);
+            }
+
+            // Do initialization work in an inner function to avoid references
+            // to objects remaining live on this function's stack frame
+            // (http://crbug.com/595672/).
+            initialize();
             gc();
             var console = document.getElementById("console");
             console.appendChild(document.createTextNode(result.singleNodeValue.foo));
diff --git a/third_party/WebKit/LayoutTests/fast/xpath/xpath-snapshot-result-should-mark-its-nodeset.html b/third_party/WebKit/LayoutTests/fast/xpath/xpath-snapshot-result-should-mark-its-nodeset.html
index aae0b63..3028a3d 100644
--- a/third_party/WebKit/LayoutTests/fast/xpath/xpath-snapshot-result-should-mark-its-nodeset.html
+++ b/third_party/WebKit/LayoutTests/fast/xpath/xpath-snapshot-result-should-mark-its-nodeset.html
@@ -18,9 +18,17 @@
 
         function test(type)
         {
-            var result = document.evaluate("//div", document.documentElement, null, type, null);
-            result.snapshotItem(0).foo = "PASS";
-            document.body.removeChild(result.snapshotItem(0));
+            var result;
+            function initialize() {
+                result = document.evaluate("//div", document.documentElement, null, type, null);
+                result.snapshotItem(0).foo = "PASS";
+                document.body.removeChild(result.snapshotItem(0));
+            }
+
+            // Do initialization work in an inner function to avoid references
+            // to objects remaining live on this function's stack frame
+            // (http://crbug.com/595672/).
+            initialize();
             gc();
             var console = document.getElementById("console");
             console.appendChild(document.createTextNode(result.snapshotItem(0).foo));
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason-expected.txt
index 843fe36..a701b55 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to load the script 'https://www.example.com/csp.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+CONSOLE ERROR: line 11: Refused to load the script 'https://www.example.com/csp.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
 
 Tests that blocked reason is recognized correctly.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-inline-warning-contains-stacktrace-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-inline-warning-contains-stacktrace-expected.txt
index af7560c..5f6dfc7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-inline-warning-contains-stacktrace-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-inline-warning-contains-stacktrace-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-HrJuWKcugzFU0cfwpneJtqIgGmzTNONbCyuhI6DsQp8='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 4: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-HrJuWKcugzFU0cfwpneJtqIgGmzTNONbCyuhI6DsQp8='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This test injects an inline script from JavaScript. The resulting console error should contain a stack trace.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setInterval-warning-contains-stacktrace-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setInterval-warning-contains-stacktrace-expected.txt
index a4d3409..90ce322 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setInterval-warning-contains-stacktrace-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setInterval-warning-contains-stacktrace-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+CONSOLE ERROR: line 11: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
 
 This test attempts to evaluate script via setInterval. The resulting console error should contain a stack trace tied to line 11.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setTimeout-warning-contains-stacktrace-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setTimeout-warning-contains-stacktrace-expected.txt
index 681b2ab..01d3338c7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setTimeout-warning-contains-stacktrace-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/csp-setTimeout-warning-contains-stacktrace-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+CONSOLE ERROR: line 11: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
 
 This test attempts to evaluate script via setTimeout. The resulting console error should contain a stack trace tied to line 11.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/mime/reload-subresource-when-type-changes-expected.txt b/third_party/WebKit/LayoutTests/http/tests/mime/reload-subresource-when-type-changes-expected.txt
index 89a703a..8cafe531 100644
--- a/third_party/WebKit/LayoutTests/http/tests/mime/reload-subresource-when-type-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/mime/reload-subresource-when-type-changes-expected.txt
@@ -1,5 +1,4 @@
 CONSOLE ERROR: Refused to execute script from 'http://127.0.0.1:8000/loading/resources/image2.png' because its MIME type ('image/png') is not executable.
-
 This is a testharness.js-based test.
 PASS Script should load as script after being loaded as image. 
 PASS Image should load after being prefetched. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/base-uri-deny-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/base-uri-deny-expected.txt
index d412ff7b..c048435 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/base-uri-deny-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/base-uri-deny-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to set the document's base URI to 'http://example.com/' because it violates the following Content Security Policy directive: "base-uri 'self'".
+CONSOLE ERROR: line 24: Refused to set the document's base URI to 'http://example.com/' because it violates the following Content Security Policy directive: "base-uri 'self'".
 
 Check that base URIs cannot be set if they violate the page's policy.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked-expected.txt
index f2ef88d6..15f2b72 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to frame 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.html' because it violates the following Content Security Policy directive: "child-src 'none'".
+CONSOLE ERROR: line 13: Refused to frame 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.html' because it violates the following Content Security Policy directive: "child-src 'none'".
 
 Frames should be governed by 'child-src'.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked-expected.txt
index 07ed9a0..dfd5cb3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to create a child context containing 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.js' because it violates the following Content Security Policy directive: "child-src 'none'".
+CONSOLE ERROR: line 1: Refused to create a child context containing 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.js' because it violates the following Content Security Policy directive: "child-src 'none'".
 
 Workers should be governed by 'child-src'.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-blocked-expected.txt
index 3a77452..02e2545 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to create a child context containing 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.js' because it violates the following Content Security Policy directive: "child-src 'none'".
+CONSOLE ERROR: line 1: Refused to create a child context containing 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.js' because it violates the following Content Security Policy directive: "child-src 'none'".
 
 SharedWorkers should be governed by 'child-src'.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt
index deb3094..372073a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to send form data to 'javascript:alert("FAIL!")' because it violates the following Content Security Policy directive: "form-action 'none'".
+CONSOLE ERROR: line 14: Refused to send form data to 'javascript:alert("FAIL!")' because it violates the following Content Security Policy directive: "form-action 'none'".
 
   
 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a JavaScript alert.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid-expected.txt
index 19dbd7d..3ac3880c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid-expected.txt
@@ -1,34 +1,34 @@
 CONSOLE ERROR: 'plugin-types' Content Security Policy directive is empty; all plugins will be blocked.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types '.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types '.
 
 CONSOLE ERROR: 'plugin-types' Content Security Policy directive is empty; all plugins will be blocked.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types '.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types '.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: ''none''. Did you mean to set the object-src directive to 'none'?
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types 'none''.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types 'none''.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: 'text'.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text'.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text'.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: 'text/'.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/'.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/'.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: '/text'.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types /text'.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types /text'.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: 'text//plain'.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text//plain'.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text//plain'.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: 'text/plainapplication/nospace'.
 
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/plainapplication/nospace'.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/plainapplication/nospace'.
 
 CONSOLE ERROR: Invalid plugin type in 'plugin-types' Content Security Policy directive: 'text'.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked-expected.txt
index 9da2e45..13b408d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked-expected.txt
@@ -1,3 +1,3 @@
-CONSOLE ERROR: Refused to load '' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/plain'.
+CONSOLE ERROR: line 7: Refused to load '' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/plain'.
 
 This test passes if there is a console message saying the plugin was blocked. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02-expected.txt
index 96d127c..92e893c2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02-expected.txt
@@ -1,8 +1,8 @@
-CONSOLE ERROR: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/plain'.
+CONSOLE ERROR: line 16: Refused to load 'data:application/x-blink-test-plugin,' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types text/plain'.
 
-CONSOLE ERROR: Refused to load 'http://127.0.0.1:8000/plugins/resources/mock-plugin.pl?url-doesnt-match-csp' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types application/x-shockwave-flash'.
+CONSOLE ERROR: line 16: Refused to load 'http://127.0.0.1:8000/plugins/resources/mock-plugin.pl?url-doesnt-match-csp' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types application/x-shockwave-flash'.
 
-CONSOLE ERROR: Refused to load 'http://127.0.0.1:8000/plugins/resources/mock-plugin-unknown-type.pl?type-attribute-doesnt-match-csp' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types application/x-unknown-type'.
+CONSOLE ERROR: line 16: Refused to load 'http://127.0.0.1:8000/plugins/resources/mock-plugin-unknown-type.pl?type-attribute-doesnt-match-csp' (MIME type 'application/x-blink-test-plugin') because it violates the following Content Security Policy Directive: 'plugin-types application/x-unknown-type'.
 
 This tests our handling of non-`data:` URLs, given a `plugin-types` CSP directive. Consider this test passing if none of the following frames contains "FAIL" and four sets of console logs appear above.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-basic-blocked-error-event-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-basic-blocked-error-event-expected.txt
index 9062c3c..087a40b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-basic-blocked-error-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-basic-blocked-error-event-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'sha256-deadbeef'". Either the 'unsafe-inline' keyword, a hash ('sha256-ZbQewvwidB/diiqNqVYuj5TxIArbdd1TUb2cl6rIyyg='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 9: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'sha256-deadbeef'". Either the 'unsafe-inline' keyword, a hash ('sha256-ZbQewvwidB/diiqNqVYuj5TxIArbdd1TUb2cl6rIyyg='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This is a testharness.js-based test.
 PASS CSP script-hash block causes error event 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event-expected.txt
index 5c12986..389fc1c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event-expected.txt
@@ -2,11 +2,9 @@
 
 CONSOLE ERROR: line 62: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 28: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: line 62: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
-
-A test paragraph
+CONSOLE ERROR: line 37: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This is a testharness.js-based test.
 PASS Test that paragraph remains green and error events received. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-svg-style-basic-blocked-error-event-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-svg-style-basic-blocked-error-event-expected.txt
index 7c6bffd0..37e3444 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-svg-style-basic-blocked-error-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-svg-style-basic-blocked-error-event-expected.txt
@@ -1,10 +1,8 @@
 CONSOLE ERROR: line 54: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 19: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: line 54: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
-
-A test paragraph
+CONSOLE ERROR: line 28: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This is a testharness.js-based test.
 PASS Test that paragraph remains green and error events received. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-allowed-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-allowed-expected.txt
index 1b083fec..ce24318d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-allowed-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-allowed-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-noncynonce' 'nonce-noncy+/=nonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-SKwGvORdKBYTYiM4lxIkanDyKH8J0qJ5Ix8LGkKsbhw='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 95: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-noncynonce' 'nonce-noncy+/=nonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-SKwGvORdKBYTYiM4lxIkanDyKH8J0qJ5Ix8LGkKsbhw='), or a nonce ('nonce-...') is required to enable inline execution.
 
 CONSOLE ERROR: line 11: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-noncynonce' 'nonce-noncy+/=nonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-kv95ImKKneBhnSXrPlx5XNiVbPjFnuiudpQxG+M00io='), or a nonce ('nonce-...') is required to enable inline execution.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-basic-blocked-error-event-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-basic-blocked-error-event-expected.txt
index 0dc2c50..1cec67e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-basic-blocked-error-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-basic-blocked-error-event-expected.txt
@@ -1,10 +1,8 @@
 CONSOLE ERROR: line 53: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 19: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: line 53: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
-
-A test paragraph
+CONSOLE ERROR: line 28: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This is a testharness.js-based test.
 PASS Test that paragraph remains green and error events received. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-blocked-expected.txt
index 7bb4597..1ebd82a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-SKwGvORdKBYTYiM4lxIkanDyKH8J0qJ5Ix8LGkKsbhw='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 95: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-SKwGvORdKBYTYiM4lxIkanDyKH8J0qJ5Ix8LGkKsbhw='), or a nonce ('nonce-...') is required to enable inline execution.
 
 CONSOLE ERROR: line 6: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-cJwexfn/a5FXM2RqRmS0smWyEV/8Q3yAJM91YiT55c4='), or a nonce ('nonce-...') is required to enable inline execution.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-svg-style-basic-blocked-error-event-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-svg-style-basic-blocked-error-event-expected.txt
index 17995de..7f155c4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-svg-style-basic-blocked-error-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylenonce-svg-style-basic-blocked-error-event-expected.txt
@@ -1,10 +1,8 @@
 CONSOLE ERROR: line 54: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 19: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-pckGv9YvNcB5xy+Y4fbqhyo+ib850wyiuWeNbZvLi00='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: line 54: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
-
-A test paragraph
+CONSOLE ERROR: line 28: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-nonceynonce'". Either the 'unsafe-inline' keyword, a hash ('sha256-QSqLgiKqPxCeZH1d3vWR+4HJOthCVhvG1P/AFaVJfR4='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This is a testharness.js-based test.
 PASS Test that paragraph remains green and error events received. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked-expected.txt
index 9bf7d2b..623820fe 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://127.0.0.1:8000/security/contentSecurityPolicy/echo-report.php' because it violates the following Content Security Policy directive: "connect-src http://localhost:8000".
+CONSOLE ERROR: line 19: Refused to connect to 'http://127.0.0.1:8000/security/contentSecurityPolicy/echo-report.php' because it violates the following Content Security Policy directive: "connect-src http://localhost:8000".
 
 Pass
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-blocked-expected.txt
index 81ee64b..3aee2b2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://127.0.0.1:8000/eventsource/resources/simple-event-stream.asis' because it violates the following Content Security Policy directive: "connect-src http://localhost:8000".
+CONSOLE ERROR: line 19: Refused to connect to 'http://127.0.0.1:8000/eventsource/resources/simple-event-stream.asis' because it violates the following Content Security Policy directive: "connect-src http://localhost:8000".
 
 Pass
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-websocket-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-websocket-blocked-expected.txt
index b5c62d5..0ac27cb 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-websocket-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-websocket-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'ws://localhost:8880/echo' because it violates the following Content Security Policy directive: "connect-src ws://127.0.0.1:8880".
+CONSOLE ERROR: line 19: Refused to connect to 'ws://localhost:8880/echo' because it violates the following Content Security Policy directive: "connect-src ws://127.0.0.1:8880".
 
 Pass
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked-expected.txt
index 31efcdd..685a333 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://localhost:8000/xmlhttprequest/resources/get.txt' because it violates the following Content Security Policy directive: "connect-src http://127.0.0.1:8000".
+CONSOLE ERROR: line 20: Refused to connect to 'http://localhost:8000/xmlhttprequest/resources/get.txt' because it violates the following Content Security Policy directive: "connect-src http://127.0.0.1:8000".
 
 Pass
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/default-src-inline-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/default-src-inline-blocked-expected.txt
index be1823c..541e93f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/default-src-inline-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/default-src-inline-blocked-expected.txt
@@ -1,5 +1,5 @@
 CONSOLE ERROR: line 9: Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-tfI8qh894SA5Ci6mTaIpM7Yc7ipVIuo6Z6xxEBkkQBA='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
 
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-Oyx3ttLvegYcsNPXU1IceH1NLku4Or68MYQJkVE4Igk='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 1: Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-Oyx3ttLvegYcsNPXU1IceH1NLku4Or68MYQJkVE4Igk='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 This test passes if it doesn't alert fail.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report-expected.txt
index 25488ab..69ab139 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
 
 ALERT: PASS: eval() allowed!
 CSP report received:
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-expected.txt
index 29f78bcb..94513ae 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-expected.txt
@@ -1,5 +1,5 @@
 CONSOLE ERROR: The Content Security Policy 'script-src 'self' 'unsafe-inline'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header.
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
 
 ALERT: PASS: eval() executed as expected.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setInterval-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setInterval-blocked-expected.txt
index d7dfdf43..1e96f35 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setInterval-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setInterval-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline'".
+CONSOLE ERROR: line 13: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline'".
 
 ALERT: PASS
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setTimeout-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setTimeout-blocked-expected.txt
index d7dfdf43..1e96f35 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setTimeout-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-scripts-setTimeout-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline'".
+CONSOLE ERROR: line 13: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline'".
 
 ALERT: PASS
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt
index 62afd86..60b1693a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to frame 'http://localhost:8000/security/contentSecurityPolicy/resources/target-for-frame-that-navigates-itself.html' because it violates the following Content Security Policy directive: "frame-src https://localhost:8443".
+CONSOLE ERROR: line 7: Refused to frame 'http://localhost:8000/security/contentSecurityPolicy/resources/target-for-frame-that-navigates-itself.html' because it violates the following Content Security Policy directive: "frame-src https://localhost:8443".
 
 The test verifies that Content-Security-Policy from the main frame restricts child frame's location even when the location is changed as a result of a navigation trigerred from within the child frame (which might reside in another renderer process due to --site-per-process).  
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/icon-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/icon-blocked-expected.txt
index 6e880ba7..6d398cc0 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/icon-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/icon-blocked-expected.txt
@@ -1,3 +1,3 @@
-CONSOLE ERROR: Refused to load the image 'http://localhost/foo?q=from_icon' because it violates the following Content Security Policy directive: "img-src 'none'".
+CONSOLE ERROR: line 16: Refused to load the image 'http://localhost/foo?q=from_icon' because it violates the following Content Security Policy directive: "img-src 'none'".
 
 Use callbacks to show that favicons are not loaded in violation of CSP when link tags are dynamically added to the page.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-script-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-script-blocked-expected.txt
index 5b2e5cb2..39be7ac8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-script-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-script-blocked-expected.txt
@@ -1,5 +1,5 @@
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-zzMJ3EAHvQC0JOIzV5P991E7bH90GtwKGbeeZ9GQ65k='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 1: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-zzMJ3EAHvQC0JOIzV5P991E7bH90GtwKGbeeZ9GQ65k='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-+IIpv5YdyPg0NE3RA3z60RAAqIwtwpl71DiXhHiCqUY='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 5: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-+IIpv5YdyPg0NE3RA3z60RAAqIwtwpl71DiXhHiCqUY='), or a nonce ('nonce-...') is required to enable inline execution.
 
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-style-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-style-blocked-expected.txt
index 81a3b2be..f724910 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-style-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/injected-inline-style-blocked-expected.txt
@@ -1,6 +1,6 @@
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-JoOXycn65NWevqnYP4bWv2kUYtndRvELR1lwjplqWBE='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 1: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-JoOXycn65NWevqnYP4bWv2kUYtndRvELR1lwjplqWBE='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-YPha+h5Ju1jLGet9Z1UtYlcjA8foA1NdOh6M6EZwTG0='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 5: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-YPha+h5Ju1jLGet9Z1UtYlcjA8foA1NdOh6M6EZwTG0='), or a nonce ('nonce-...') is required to enable inline execution.
 
 PASS 1/2
 PASS 2/2
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-event-handler-blocked-after-injecting-meta-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-event-handler-blocked-after-injecting-meta-expected.txt
index bc1f2aa4..6765c31 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-event-handler-blocked-after-injecting-meta-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-event-handler-blocked-after-injecting-meta-expected.txt
@@ -2,6 +2,6 @@
 CONSOLE MESSAGE: line 21: PASS: Event handler triggered pre-policy.
 CONSOLE MESSAGE: line 14: Injecting Content-Security-Policy.
 CONSOLE MESSAGE: line 19: Clicking a link, post-policy:
-CONSOLE ERROR: line 21: Refused to execute inline event handler because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 20: Refused to execute inline event handler because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 This test checks that CSP is evaluated on each call to an inline event handler, even if it's been executed pre-policy. It passes if one 'PASS' and no 'FAIL' messages appear.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-script-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-script-blocked-expected.txt
index 505d42d..ab03103b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-script-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-script-blocked-expected.txt
@@ -1,5 +1,5 @@
 CONSOLE ERROR: line 9: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-tfI8qh894SA5Ci6mTaIpM7Yc7ipVIuo6Z6xxEBkkQBA='), or a nonce ('nonce-...') is required to enable inline execution.
 
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-Oyx3ttLvegYcsNPXU1IceH1NLku4Or68MYQJkVE4Igk='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 1: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://127.0.0.1:*". Either the 'unsafe-inline' keyword, a hash ('sha256-Oyx3ttLvegYcsNPXU1IceH1NLku4Or68MYQJkVE4Igk='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This test passes if it doesn't alert fail.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt
index 855548b..94928d8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-SKwGvORdKBYTYiM4lxIkanDyKH8J0qJ5Ix8LGkKsbhw='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 95: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-SKwGvORdKBYTYiM4lxIkanDyKH8J0qJ5Ix8LGkKsbhw='), or a nonce ('nonce-...') is required to enable inline execution.
 
 CONSOLE ERROR: line 77: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-E8Yv3p3nivzZKSVWxu7y2Pr+w7Nco7lvx8r5nBVoLFA='), or a nonce ('nonce-...') is required to enable inline execution.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt
index d58c109..a44c2224 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to load manifest from 'http://127.0.0.1:8000/security/contentSecurityPolicy/manifest.test/manifest.json' because it violates the following Content Security Policy directive: "manifest-src 'none'".
+CONSOLE ERROR: line 7: Refused to load manifest from 'http://127.0.0.1:8000/security/contentSecurityPolicy/manifest.test/manifest.json' because it violates the following Content Security Policy directive: "manifest-src 'none'".
 
 ALERT: Pass
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-expected.txt
index 6a50a38..2a584b3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-expected.txt
@@ -1,3 +1,3 @@
-CONSOLE ERROR: Refused to load plugin data from '' because it violates the following Content Security Policy directive: "object-src 'none'".
+CONSOLE ERROR: line 7: Refused to load plugin data from '' because it violates the following Content Security Policy directive: "object-src 'none'".
 
 This test passes if there is a console message saying the plugin was blocked. 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt
index fff336f..5458d5f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to load plugin data from 'data:application/x-blink-test-plugin,' because it violates the following Content Security Policy directive: "object-src 'none'".
+CONSOLE ERROR: line 16: Refused to load plugin data from 'data:application/x-blink-test-plugin,' because it violates the following Content Security Policy directive: "object-src 'none'".
 
 
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-expected.txt
index 243a514f..8d3e88b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-expected.txt
@@ -2,7 +2,7 @@
 
 ALERT: PASS (1/3)
 ALERT: PASS (2/3)
-CONSOLE ERROR: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "img-src https:".
+CONSOLE ERROR: line 49: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "img-src https:".
 
 ALERT: PASS (3/3)
 This test ensures that registering a scheme as bypassing CSP actually bypasses CSP. This test passes if three PASSes are generated.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-partial-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-partial-expected.txt
index 1dd6142..5956ea0e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-partial-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/register-bypassing-scheme-partial-expected.txt
@@ -6,7 +6,7 @@
 CONSOLE MESSAGE: line 15: PASS (2/12)
 CONSOLE MESSAGE: line 15: PASS (3/12)
 CONSOLE MESSAGE: line 15: PASS (4/12)
-CONSOLE ERROR: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "default-src https:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 27: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "default-src https:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 15: PASS (5/12)
 CONSOLE ERROR: line 1: Refused to load the stylesheet 'http://127.0.0.1:8000/security/resources/cssStyle.css' because it violates the following Content Security Policy directive: "default-src https:". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
@@ -16,11 +16,11 @@
 CONSOLE ERROR: line 1: Refused to load the stylesheet 'http://127.0.0.1:8000/security/resources/cssStyle.css' because it violates the following Content Security Policy directive: "default-src https:". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 15: PASS (8/12)
-CONSOLE ERROR: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "default-src https:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 27: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "default-src https:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 15: PASS (9/12)
 CONSOLE MESSAGE: line 15: PASS (10/12)
-CONSOLE ERROR: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "default-src https:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 27: Refused to load the image 'http://127.0.0.1:8000/security/resources/abe.png' because it violates the following Content Security Policy directive: "default-src https:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 15: PASS (11/12)
 CONSOLE ERROR: line 1: Refused to load the stylesheet 'http://127.0.0.1:8000/security/resources/cssStyle.css' because it violates the following Content Security Policy directive: "default-src https:". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-02-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-02-expected.txt
index 5e898f7..cbda82f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-02-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-02-expected.txt
@@ -1,12 +1,12 @@
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
 
 PingLoader dispatched to 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/does-not-exist'.
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
 
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
 
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
 
-CONSOLE ERROR: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
+CONSOLE ERROR: line 12: [Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'unsafe-inline' 'self'".
 
 This tests that multiple violations on a page trigger multiple reports if and only if the violations are distinct. This test passes if only one. PingLoader callback is visible in the output.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-appended-script-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-appended-script-expected.txt
index 6f2e47a..eda5907 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-appended-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-appended-script-expected.txt
@@ -1,3 +1,3 @@
-CONSOLE ERROR: Refused to load the script 'http://localhost:8000/security/contentSecurityPolicy/resources/script.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline'".
+CONSOLE ERROR: line 14: Refused to load the script 'http://localhost:8000/security/contentSecurityPolicy/resources/script.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline'".
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/service-worker-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/service-worker-blocked-expected.txt
index c13ecd8..212517a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/service-worker-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/service-worker-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to create a child context containing 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/service-worker.js' because it violates the following Content Security Policy directive: "child-src 'none'".
+CONSOLE ERROR: line 9: Refused to create a child context containing 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/service-worker.js' because it violates the following Content Security Policy directive: "child-src 'none'".
 
 This is a testharness.js-based test.
 PASS Test that a service worker cannot be registered if the CSP does not allow it 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/source-list-parsing-malformed-meta-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/source-list-parsing-malformed-meta-expected.txt
index ccb8eab..2994344 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/source-list-parsing-malformed-meta-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/source-list-parsing-malformed-meta-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://127.0.0.1:8000/xmlhttprequest/resources/get.txt' because it violates the following Content Security Policy directive: "connect-src http://localhost:8000".
+CONSOLE ERROR: line 20: Refused to connect to 'http://127.0.0.1:8000/xmlhttprequest/resources/get.txt' because it violates the following Content Security Policy directive: "connect-src http://localhost:8000".
 
 Pass
 This test passes if the malformed meta tag doesn't cause a crash and the resource is blocked.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/style-src-blocked-error-event-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/style-src-blocked-error-event-expected.txt
index 37771145..1319a2b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/style-src-blocked-error-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/style-src-blocked-error-event-expected.txt
@@ -1,7 +1,5 @@
 CONSOLE ERROR: line 21: Refused to load the stylesheet 'http://localhost:8000/security/contentSecurityPolicy/resources/style-set-red.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'".
 
-A test paragraph
-
 This is a testharness.js-based test.
 PASS Style element has error on bad style nonce 
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-expected.txt
index e7106b3..ec1bb247 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to load the script 'http://localhost:8000/security/contentSecurityPolicy/resources/post-message.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline' http://127.0.0.1:8000".
+CONSOLE ERROR: line 1: Refused to load the script 'http://localhost:8000/security/contentSecurityPolicy/resources/post-message.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline' http://127.0.0.1:8000".
 
 This is a testharness.js-based test.
 PASS Blob worker inherits CSP 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-connect-src-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-connect-src-blocked-expected.txt
index 8e55dd3..ee386a9 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-connect-src-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-connect-src-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to connect to 'http://127.0.0.1:8000/xmlhttprequest/resources/get.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
+CONSOLE ERROR: line 5: Refused to connect to 'http://127.0.0.1:8000/xmlhttprequest/resources/get.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
 
 ALERT: xhr blocked
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-importscripts-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-importscripts-blocked-expected.txt
index 5528c7f..80c3b04 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-importscripts-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-importscripts-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to load the script 'http://localhost:8000/security/contentSecurityPolicy/resources/post-message.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'unsafe-inline' 127.0.0.1:8000".
+CONSOLE ERROR: line 4: Refused to load the script 'http://localhost:8000/security/contentSecurityPolicy/resources/post-message.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'unsafe-inline' 127.0.0.1:8000".
 
 PASS result is "importScripts blocked: NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:8000/security/contentSecurityPolicy/resources/post-message.js' failed to load."
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-set-timeout-blocked-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-set-timeout-blocked-expected.txt
index 8a492d2..3159c77 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-set-timeout-blocked-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worker-set-timeout-blocked-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+CONSOLE ERROR: line 5: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
 
 ALERT: setTimeout blocked
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-script-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-script-expected.txt
index 6b742df9..a8b3ec7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-script-expected.txt
@@ -1,13 +1,13 @@
 CONSOLE MESSAGE: line 33: Injecting in main world: this should fail.
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-09Et/dqtUwF1zPoVDKo5ZDj2NUXqkLUxcQfh9UtQQt0='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 21: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-09Et/dqtUwF1zPoVDKo5ZDj2NUXqkLUxcQfh9UtQQt0='), or a nonce ('nonce-...') is required to enable inline execution.
 
 CONSOLE MESSAGE: line 38: Injecting into isolated world without bypass: this should fail.
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-weyW8ZEkQAD8it2iIcRJESCAdVG/APiGxF6JYEqMvKo='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 4: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-weyW8ZEkQAD8it2iIcRJESCAdVG/APiGxF6JYEqMvKo='), or a nonce ('nonce-...') is required to enable inline execution.
 
 CONSOLE MESSAGE: line 43: Starting to bypass main world's CSP: this should pass!
 CONSOLE MESSAGE: line 1: EXECUTED in isolated world.
 CONSOLE MESSAGE: line 49: Injecting into main world again: this should fail.
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-09Et/dqtUwF1zPoVDKo5ZDj2NUXqkLUxcQfh9UtQQt0='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 21: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-09Et/dqtUwF1zPoVDKo5ZDj2NUXqkLUxcQfh9UtQQt0='), or a nonce ('nonce-...') is required to enable inline execution.
 
 This test ensures that scripts run in isolated worlds marked with their own Content Security Policy aren't affected by the page's content security policy. Extensions, for example, should be able to inject inline JavaScript (even though it's probably a bad idea to do so).
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-style-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-style-expected.txt
index bf364f6..1bed163 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-style-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-inline-style-expected.txt
@@ -1,19 +1,19 @@
 CONSOLE MESSAGE: line 58: Injecting in main world: this should fail.
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-VW0vOGrZCqH0TKtw5B5uFtLP1DqNIIUce/tDyu/378c='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 20: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-VW0vOGrZCqH0TKtw5B5uFtLP1DqNIIUce/tDyu/378c='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 31: PASS: Style assignment in test 4 was not blocked by CSP.
 CONSOLE MESSAGE: line 62: Injecting into isolated world without bypass: this should fail.
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-mqk0x+ZowQUO8stz3Tm8e/4c044WSEbqlTVrz4jf9ko='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 8: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-mqk0x+ZowQUO8stz3Tm8e/4c044WSEbqlTVrz4jf9ko='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 19: PASS: Style assignment in test 3 was not blocked by CSP.
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-ZBTj5RHLnrF+IxdRZM2RuLfjTJQXNSi7fLQHr09onfY='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 6: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-ZBTj5RHLnrF+IxdRZM2RuLfjTJQXNSi7fLQHr09onfY='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 17: PASS: Style attribute assignment in test 3 was not blocked by CSP.
 CONSOLE MESSAGE: line 67: Starting to bypass main world's CSP: this should pass!
 CONSOLE MESSAGE: line 12: PASS: Style assignment in test 2 was blocked by CSP.
 CONSOLE MESSAGE: line 10: PASS: Style attribute assignment in test 2 was blocked by CSP.
 CONSOLE MESSAGE: line 73: Injecting into main world again: this should fail.
-CONSOLE ERROR: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-bUBNmssmL79UBWplbQJyN9Hi2tRE9H345W5DVyjdUq4='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
+CONSOLE ERROR: line 20: Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-bUBNmssmL79UBWplbQJyN9Hi2tRE9H345W5DVyjdUq4='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
 
 CONSOLE MESSAGE: line 31: PASS: Style assignment in test 1 was not blocked by CSP.
 This test ensures that style applied in isolated worlds marked with their own Content Security Policy aren't affected by the page's content security policy. Extensions, for example, should be able to inject inline CSS (even though it's probably a bad idea to do so).
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-expected.txt
index 6bb2c4c..820c27fa 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-expected.txt
@@ -1,10 +1,10 @@
-CONSOLE ERROR: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
+CONSOLE ERROR: line 95: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
 
-CONSOLE ERROR: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
+CONSOLE ERROR: line 13: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
 
-CONSOLE ERROR: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
+CONSOLE ERROR: line 13: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
 
-CONSOLE ERROR: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
+CONSOLE ERROR: line 95: Refused to connect to 'http://localhost:8000/security/isolatedWorld/resources/cross-origin-xhr.txt' because it violates the following Content Security Policy directive: "connect-src 'none'".
 
 Tests that isolated worlds can have XHRs that the page's CSP wouldn't allow.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/no-bypass-main-world-csp-for-delayed-execution-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/no-bypass-main-world-csp-for-delayed-execution-expected.txt
index b5372d0..5ec6490 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/no-bypass-main-world-csp-for-delayed-execution-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/isolatedWorld/no-bypass-main-world-csp-for-delayed-execution-expected.txt
@@ -2,7 +2,7 @@
 CONSOLE MESSAGE: line 1: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
 
 ALERT: PASS: Case 2 was blocked by a CSP.
-CONSOLE ERROR: line 1: Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 45: Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
 
 ALERT: PASS: Case 1 was blocked by a CSP.
 Test a script that bypasses the main world's CSP to see if its *content* bypasses the main world as well (it should not).
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/active-subresource-in-http-iframe-not-blocked.https-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/active-subresource-in-http-iframe-not-blocked.https-expected.txt
index 7ccfaa1..35d72ae1 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/active-subresource-in-http-iframe-not-blocked.https-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/active-subresource-in-http-iframe-not-blocked.https-expected.txt
@@ -1,8 +1,5 @@
 CONSOLE WARNING: Mixed Content: The page at 'https://127.0.0.1:8443/security/mixedContent/active-subresource-in-http-iframe-not-blocked.https.html' was loaded over HTTPS, but requested an insecure resource 'http://127.0.0.1:8000/security/mixedContent/resources/frame-loads-insecure-script.html'. This content should also be served over HTTPS.
 CONSOLE WARNING: Mixed Content: The page at 'https://127.0.0.1:8443/security/mixedContent/active-subresource-in-http-iframe-not-blocked.https.html' was loaded over HTTPS, but requested an insecure script 'http://127.0.0.1:8000/security/mixedContent/resources/script-post-message.js'. This content should also be served over HTTPS.
-This test passes if the active subresource in the frame below is allowed.
-
-
 This is a testharness.js-based test.
 PASS Testing an insecure script in a mixed iframe 
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/close.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/close.html
deleted file mode 100644
index 2609c32..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/close.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<title>ServiceWorkerGlobalScope: close operation</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script src="../resources/test-helpers.js"></script>
-<script>
-
-service_worker_test(
-  'resources/close-worker.js', 'ServiceWorkerGlobalScope: close operation');
-
-</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/close-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/close-worker.js
deleted file mode 100644
index a1342b1..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/close-worker.js
+++ /dev/null
@@ -1,8 +0,0 @@
-importScripts('../../resources/interfaces.js');
-importScripts('../../resources/worker-testharness.js');
-
-test(function() {
-  assert_throws({name: 'InvalidAccessError'}, function() {
-    self.close();
-  });
-}, 'ServiceWorkerGlobalScope close operation');
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-mixed-content-to-outscope-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-mixed-content-to-outscope-expected.txt
index bf6a0d8..5e9a805 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-mixed-content-to-outscope-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-mixed-content-to-outscope-expected.txt
@@ -1,6 +1,6 @@
 CONSOLE ERROR: Mixed Content: The page at 'https://127.0.0.1:8443/serviceworker/resources/fetch-mixed-content-iframe-inscope-to-outscope.html' was loaded over HTTPS, but requested an insecure image 'http://127.0.0.1:8000/serviceworker/resources/fetch-access-control.php?PNGIMAGE'. This request has been blocked; the content must be served over HTTPS.
 CONSOLE ERROR: Mixed Content: The page at 'https://127.0.0.1:8443/serviceworker/resources/fetch-mixed-content-iframe-inscope-to-outscope.html' was loaded over HTTPS, but requested an insecure image 'http://localhost:8000/serviceworker/resources/fetch-access-control.php?PNGIMAGE'. This request has been blocked; the content must be served over HTTPS.
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 PASS Verify Mixed content of fetch() in a Service Worker 
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/interfaces-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/interfaces-worker.js
index a72adbd..88eeaea 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/interfaces-worker.js
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/interfaces-worker.js
@@ -8,7 +8,6 @@
                      self,
                      {
                        clients: 'object',
-                       close: 'function',
                        registration: 'object',
                        skipWaiting: 'function',
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
index df94076..7f0f5d8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -1199,7 +1199,6 @@
     method btoa
     method clearInterval
     method clearTimeout
-    method close
     method constructor
     method createImageBitmap
     method fetch
@@ -1353,7 +1352,6 @@
     getter onpush
     getter onsync
     getter registration
-    method close
     method fetch
     method gc
     method skipWaiting
@@ -1366,7 +1364,8 @@
     setter onnotificationclose
     setter onpush
     setter onsync
-This is a testharness.js-based test.
-PASS Verify the interface of ServiceWorkerGlobalScope 
-Harness: the test ran to completion.
+PASS Verify the interface of ServiceWorkerGlobalScope
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker.html
index 1a3a958d..1d51329 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker.html
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker.html
@@ -2,33 +2,54 @@
 <html>
 <head>
   <title>ServiceWorkerGlobalScope expose test.</title>
-  <script src="../../resources/testharness.js"></script>
-  <script src="../../resources/testharnessreport.js"></script>
-  <script src="../resources/test-helpers.js"></script>
+  <script src="../../js-test-resources/js-test.js"></script>
 </head>
 <body>
-  <script>
+<div id="console"></div>
+<script>
+// We can't use testharness.js in this test because this needs to dump text
+// other than PASS/FAIL.
 
-    async_test(function(t) {
-        service_worker_unregister_and_register(
-            t, 'resources/global-interface-listing-worker.js',
-            'resources/global-interface-listing-worker')
-          .then(function(registration) {
-              var sw = registration.installing;
-              var message_channel = new MessageChannel;
-              message_channel.port1.onmessage = t.step_func(on_message);
-              sw.postMessage(null, [message_channel.port2]);
-            }).catch(unreached_rejection(t));
+jsTestIsAsync = true;
 
-        function on_message(evt) {
-          var pre = document.createElement('pre');
-          pre.appendChild(document.createTextNode(evt.data.result.join('\n')));
-          document.body.appendChild(pre);
+function unregister_service_worker(document_url) {
+  return navigator.serviceWorker.getRegistration(document_url)
+    .then(registration => {
+        if (registration)
+          return registration.unregister();
+    });
+}
 
-          service_worker_unregister_and_done(t);
-        };
-      }, 'Verify the interface of ServiceWorkerGlobalScope');
-
-  </script>
+var scope = 'resources/global-interface-listing-worker';
+var options = { scope: scope };
+unregister_service_worker(scope)
+  .then(() => {
+      return navigator.serviceWorker.register(
+          'resources/global-interface-listing-worker.js',
+          options);
+    })
+  .then(registration => {
+      var sw = registration.installing;
+      return new Promise(resolve => {
+          var message_channel = new MessageChannel;
+          message_channel.port1.onmessage = (evt => resolve(evt));
+          sw.postMessage(null, [message_channel.port2]);
+        });
+    })
+  .then(evt => {
+      var pre = document.createElement('pre');
+      pre.appendChild(document.createTextNode(evt.data.result.join('\n')));
+      document.body.insertBefore(pre, document.body.firstChild);
+      return unregister_service_worker(scope);
+    })
+  .then(() => {
+      testPassed('Verify the interface of ServiceWorkerGlobalScope');
+      finishJSTest();
+    })
+  .catch(error =>  {
+      testFailed('error: ' + (error.message || error.name || error));
+      finishJSTest();
+    });
+</script>
 </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/abort-after-send-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/abort-after-send-expected.txt
deleted file mode 100644
index 15fa598..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/abort-after-send-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Correct progress event sequencing on abort(), bug 315488.
-This is a testharness.js-based test.
-PASS Progress event delivery on abort(), post-send() (async) 
-PASS Progress event delivery on abort(), post-send() (sync) 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-must-not-contain-cookie-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-must-not-contain-cookie-expected.txt
index 6f6e27e..134af4ce 100644
--- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-must-not-contain-cookie-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-must-not-contain-cookie-expected.txt
@@ -1,7 +1,6 @@
 CONSOLE WARNING: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
 ALERT: http://localhost:8000/cookies/resources/cookie-utility.php?queryfunction=setFooCookie
 ALERT: XHR response - Set the foo cookie
-
 This is a testharness.js-based test.
 FAIL Preflight request must not contain any cookie header assert_equals: expected "awesomevalue" but got ""
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/lists/DOMTokenList-value-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/lists/DOMTokenList-value-expected.txt
index d26bb0a1..9b874de 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/lists/DOMTokenList-value-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/lists/DOMTokenList-value-expected.txt
@@ -1,4 +1,4 @@
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 FAIL DOMTokenList value assert_equals: length should be the number of tokens expected 2 but got 3
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding/idlharness-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding/idlharness-expected.txt
index 1fec0cb4..3f45599 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding/idlharness-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding/idlharness-expected.txt
@@ -1,7 +1,3 @@
-idlharness test
-
-This test validates the WebIDL included in the Encoding Living Standard.
-
 This is a testharness.js-based test.
 PASS TextDecoder interface: existence and properties of interface object 
 PASS TextDecoder interface object length 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-document-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-document-expected.txt
index dab53ad5..e26c1a6 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-document-expected.txt
@@ -1,4 +1,3 @@
-
 This is a testharness.js-based test.
 FAIL Test document type embedding assert_true: expected true got false
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-table-element/delete-caption-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-table-element/delete-caption-expected.txt
deleted file mode 100644
index 2e0e87b5..0000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-table-element/delete-caption-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Nested caption
-This is a testharness.js-based test.
-PASS deleteCaption() delete only caption on table 
-PASS deleteCaption() returns undefined 
-PASS deleteCaption() 
-PASS deleteCaption() does not throw any exceptions when called on a table without a caption 
-PASS deleteCaption() does not delete captions in descendent tables 
-PASS deleteCaption() handles captions from different namespaces 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/syntax/serializing-html-fragments/initial-linefeed-pre-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/syntax/serializing-html-fragments/initial-linefeed-pre-expected.txt
index d4431dc..9defb85 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/syntax/serializing-html-fragments/initial-linefeed-pre-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/syntax/serializing-html-fragments/initial-linefeed-pre-expected.txt
@@ -1,10 +1,3 @@
-x
-
-x
- 
-x
-
-x
 This is a testharness.js-based test.
 FAIL outer div assert_equals: expected "\n<div id=\"inner\">\n<pre id=\"pre1\">x</pre>\n<pre id=\"pre2\">\n\nx</pre>\n<textarea id=\"textarea1\">x</textarea>\n<textarea id=\"textarea2\">\n\nx</textarea>\n<listing id=\"listing1\">x</listing>\n<listing id=\"listing2\">\n\nx</listing>\n</div>\n" but got "\n<div id=\"inner\">\n<pre id=\"pre1\">x</pre>\n<pre id=\"pre2\">\nx</pre>\n<textarea id=\"textarea1\">x</textarea>\n<textarea id=\"textarea2\">\nx</textarea>\n<listing id=\"listing1\">x</listing>\n<listing id=\"listing2\">\nx</listing>\n</div>\n"
 FAIL inner div assert_equals: expected "\n<pre id=\"pre1\">x</pre>\n<pre id=\"pre2\">\n\nx</pre>\n<textarea id=\"textarea1\">x</textarea>\n<textarea id=\"textarea2\">\n\nx</textarea>\n<listing id=\"listing1\">x</listing>\n<listing id=\"listing2\">\n\nx</listing>\n" but got "\n<pre id=\"pre1\">x</pre>\n<pre id=\"pre2\">\nx</pre>\n<textarea id=\"textarea1\">x</textarea>\n<textarea id=\"textarea2\">\nx</textarea>\n<listing id=\"listing1\">x</listing>\n<listing id=\"listing2\">\nx</listing>\n"
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1-expected.txt
index de554c9..305f14c 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1-expected.txt
@@ -1,5 +1,4 @@
 CONSOLE ERROR: line 2: Uncaught ReferenceError: thereIsNoSuchCallable is not defined
- 
 This is a testharness.js-based test.
 FAIL The error event from an event listener should fire on that listener's global assert_true: expected true got false
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2-expected.txt
index de554c9..305f14c 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2-expected.txt
@@ -1,5 +1,4 @@
 CONSOLE ERROR: line 2: Uncaught ReferenceError: thereIsNoSuchCallable is not defined
- 
 This is a testharness.js-based test.
 FAIL The error event from an event listener should fire on that listener's global assert_true: expected true got false
 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharnessreport.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharnessreport.js
index 56dcac54..1cd3133e 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharnessreport.js
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharnessreport.js
@@ -107,12 +107,11 @@
 
         function done() {
             if (self.testRunner) {
-                var logDiv = document.getElementById('log');
-                if ((isCSSWGTest() || isJSTest()) && logDiv) {
-                    // Assume it's a CSSWG style test, and anything other than
-                    // the log div isn't material to the testrunner output, so
+                if (isCSSWGTest() || isJSTest()) {
+                    // Anything isn't material to the testrunner output, so
                     // should be hidden from the text dump.
-                    document.body.textContent = '';
+                    if (document.body)
+                        document.body.textContent = '';
                 }
             }
 
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-event-handler-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-event-handler-expected.txt
index f8da67e..dcea0fd 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-event-handler-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-event-handler-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: line 13: Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 4: Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
 
 Tests that pause on exception works for inline event handlers blocked by CSP.
 
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-injection-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-injection-expected.txt
index d844d82..08e0f7e 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-injection-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-injection-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-nHVu6nggsoh0Xg7erdTs8Fo23plZcLWC+mnUoDHxja4='), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 5: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-nHVu6nggsoh0Xg7erdTs8Fo23plZcLWC+mnUoDHxja4='), or a nonce ('nonce-...') is required to enable inline execution.
 
 Tests that pause on exception works for inline scripts blocked by CSP.
 
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-url-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-url-expected.txt
index e01d9ed..d39d6b5 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-url-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-blocked-script-url-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: line 1: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
+CONSOLE ERROR: line 6: Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
 
 Tests that pause on exception works for inline script URLs blocked by CSP.
 
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-receive-response-event-expected.txt b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-receive-response-event-expected.txt
index 38805bb..088ca5b6 100644
--- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-receive-response-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-receive-response-event-expected.txt
@@ -6,7 +6,7 @@
 ResourceFinish
 EventDispatch
     FunctionCall
-    ResourceSendRequest
+        ResourceSendRequest
 ResourceReceiveResponse
 ResourceReceivedData
 ResourceFinish
diff --git a/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out-expected.txt b/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out-expected.txt
deleted file mode 100644
index 096f394..0000000
--- a/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-EXPECTED (getComputedStyle(controls).opacity == '1') OK
-
-EXPECTED (getComputedStyle(controls).opacity == '0') OK
-
-This is a testharness.js-based test.
-PASS This tests that controls do not fade out when the video is playing remotely. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/media/media-audio-no-spurious-repaints-expected.txt b/third_party/WebKit/LayoutTests/media/media-audio-no-spurious-repaints-expected.txt
index 570e437c..4ba842027 100644
--- a/third_party/WebKit/LayoutTests/media/media-audio-no-spurious-repaints-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/media-audio-no-spurious-repaints-expected.txt
@@ -26,7 +26,7 @@
   ]
 }
 
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 FAIL Verifies there are no spurious repaints for audio in a video tag. Cannot read property 'length' of undefined
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/media/track/opera/interfaces/VTTCue/getCueAsHTMLCrash-expected.txt b/third_party/WebKit/LayoutTests/media/track/opera/interfaces/VTTCue/getCueAsHTMLCrash-expected.txt
index f434113f..b94cf9db 100644
--- a/third_party/WebKit/LayoutTests/media/track/opera/interfaces/VTTCue/getCueAsHTMLCrash-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/track/opera/interfaces/VTTCue/getCueAsHTMLCrash-expected.txt
@@ -1,4 +1,3 @@
-Test passes if it does not induce a crash.
 This is a testharness.js-based test.
 PASS , creating the cue 
 FAIL , > assert_false: hasChildNodes() expected false got true
diff --git a/third_party/WebKit/LayoutTests/media/video-not-paused-while-looping-expected.txt b/third_party/WebKit/LayoutTests/media/video-not-paused-while-looping-expected.txt
deleted file mode 100644
index 757f4ece..0000000
--- a/third_party/WebKit/LayoutTests/media/video-not-paused-while-looping-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-EVENT(seeked)
-EVENT(seeking)
-This is a testharness.js-based test.
-PASS video is not paused while looping 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt
index 3a4bb4b..15cb175 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt
@@ -1,8 +1,3 @@
-CACACACA
-CACACACA
-CACACACA
-56
-56
 This is a testharness.js-based test.
 FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.546875 but got 140
 FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.546875 but got 140
diff --git a/third_party/WebKit/LayoutTests/resources/testharnessreport.js b/third_party/WebKit/LayoutTests/resources/testharnessreport.js
index 56dcac54..1cd3133e 100644
--- a/third_party/WebKit/LayoutTests/resources/testharnessreport.js
+++ b/third_party/WebKit/LayoutTests/resources/testharnessreport.js
@@ -107,12 +107,11 @@
 
         function done() {
             if (self.testRunner) {
-                var logDiv = document.getElementById('log');
-                if ((isCSSWGTest() || isJSTest()) && logDiv) {
-                    // Assume it's a CSSWG style test, and anything other than
-                    // the log div isn't material to the testrunner output, so
+                if (isCSSWGTest() || isJSTest()) {
+                    // Anything isn't material to the testrunner output, so
                     // should be hidden from the text dump.
-                    document.body.textContent = '';
+                    if (document.body)
+                        document.body.textContent = '';
                 }
             }
 
diff --git a/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt
index f36b2b8..bd0da04 100644
--- a/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt
+++ b/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt
@@ -6,7 +6,7 @@
 CONSOLE ERROR: Error: <foreignObject> attribute width: Expected length, "inherit".
 CONSOLE ERROR: Error: <svg> attribute width: Expected length, "foo".
 CONSOLE ERROR: Error: <foreignObject> attribute width: Expected length, "foo".
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 PASS Test width 'auto' on SVGSVGElement 
 PASS Test width 'auto' on SVGForeignObject 
 PASS Test width 'initial' on SVGSVGElement 
diff --git a/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox-expected.txt b/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox-expected.txt
deleted file mode 100644
index f1218a7e..0000000
--- a/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-ABCDEFGH
-ABCDEFGH
-This is a testharness.js-based test.
-PASS Hit-test of text with fractional (< 1) font-size and small (high scalefactor) viewBox 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-expected.txt b/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-expected.txt
deleted file mode 100644
index a79151f..0000000
--- a/third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-SELECT
- This is a testharness.js-based test.
-PASS Hit-test of <text> does not hit-test the "background" (w/ small font size) 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/bidi-getcharnumatpos-expected.txt b/third_party/WebKit/LayoutTests/svg/text/bidi-getcharnumatpos-expected.txt
deleted file mode 100644
index e6ff57f9..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/bidi-getcharnumatpos-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Foo הפוך
-Foo הפוך
- This is a testharness.js-based test.
-PASS BiDi getCharNumAtPosition(), direction=ltr. 
-PASS BiDi getCharNumAtPosition(), direction=rtl. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/bidi-getcomputedtextlength-expected.txt b/third_party/WebKit/LayoutTests/svg/text/bidi-getcomputedtextlength-expected.txt
deleted file mode 100644
index 5c3c229f..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/bidi-getcomputedtextlength-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-إعلانات
-إعلانات
-نه با
-نه با
- This is a testharness.js-based test.
-PASS Direction does not affect computed text length. 
-PASS Direction does not affect computed text length - whitespace. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/bidi-getsubstringlength-expected.txt b/third_party/WebKit/LayoutTests/svg/text/bidi-getsubstringlength-expected.txt
deleted file mode 100644
index 68fa3a4..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/bidi-getsubstringlength-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-إعلانات
-إعلانات
-Fooإعلانات
-Fooإعلانات
- This is a testharness.js-based test.
-PASS "direction" does not affect sub string lengths. 
-PASS "direction" does not affect sub string lengths across BiDi runs w/ different levels. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/getcharnumatposition-multiple-fragments-expected.txt b/third_party/WebKit/LayoutTests/svg/text/getcharnumatposition-multiple-fragments-expected.txt
deleted file mode 100644
index 0f3b477..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/getcharnumatposition-multiple-fragments-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-AAAA
- This is a testharness.js-based test.
-PASS SVGTextContentElement.getCharNumAtPosition w/ multiple fragments per text box. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/getextentofchar-nonbmp-expected.txt b/third_party/WebKit/LayoutTests/svg/text/getextentofchar-nonbmp-expected.txt
deleted file mode 100644
index 7b29510..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/getextentofchar-nonbmp-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-𝄞𝄞
- This is a testharness.js-based test.
-PASS SVGTextContentElement.getExtentOfChar, non-BMP characters. 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/svgtextcontentelement-glyphqueries-rtl-expected.txt b/third_party/WebKit/LayoutTests/svg/text/svgtextcontentelement-glyphqueries-rtl-expected.txt
deleted file mode 100644
index 58122cc..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/svgtextcontentelement-glyphqueries-rtl-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-הפוך
- This is a testharness.js-based test.
-PASS SVGTextContentElement query interface RTL, getStartPositionOfChar(). 
-PASS SVGTextContentElement query interface RTL, getEndPositionOfChar(). 
-PASS SVGTextContentElement query interface RTL, getExtentOfChar(). 
-PASS SVGTextContentElement query interface RTL, getCharNumAtPosition(). 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/svg/text/textquery-collapsed-whitespace-expected.txt b/third_party/WebKit/LayoutTests/svg/text/textquery-collapsed-whitespace-expected.txt
deleted file mode 100644
index c507e6b..0000000
--- a/third_party/WebKit/LayoutTests/svg/text/textquery-collapsed-whitespace-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-A B C
-A B C
-A B C
-A B C
-A B C
-A B C
- This is a testharness.js-based test.
-PASS Text queries on elements with collapsed whitespace 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/transforms/transform-parsing-expected.txt b/third_party/WebKit/LayoutTests/transforms/transform-parsing-expected.txt
index a24bc6ac..06788b7 100644
--- a/third_party/WebKit/LayoutTests/transforms/transform-parsing-expected.txt
+++ b/third_party/WebKit/LayoutTests/transforms/transform-parsing-expected.txt
@@ -1,4 +1,4 @@
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 PASS "transform: initial;" should parse as "initial" 
 PASS "transform: initial;" should be computed to "none" 
 PASS "transform: inherit;" should parse as "inherit" 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssNumberValue.html b/third_party/WebKit/LayoutTests/typedcssom/cssNumberValue.html
new file mode 100644
index 0000000..c8644114
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssNumberValue.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<script>
+var values = [
+  {input: new CSSNumberValue(0), cssString: '0'},
+  {input: new CSSNumberValue(1), cssString: '1'},
+  {input: new CSSNumberValue(-2), cssString: '-2'},
+  {input: new CSSNumberValue(3.4), cssString: '3.4'}
+];
+
+test(function() {
+  for (var i = 0; i < values.length; ++i) {
+    assert_equals(values[i].input.cssString, values[i].cssString);
+  }
+}, "Test that the css string for CSSNumberValue is correct.");
+
+</script>
+
+<body>
+</body>
+
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html
index 5a3fea1..2b91905 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html
@@ -16,13 +16,13 @@
 test(function() {
   // TODO(meade): Use a property that supports multiple values when that is available.
   assert_throws(new TypeError(), function() {
-    testElement.styleMap.append('width', new NumberValue(70));
+    testElement.styleMap.append('width', new CSSNumberValue(70));
   });
 }, "Appending an invalid type to a property throws");
 
 test(function() {
   assert_throws(new TypeError(), function() {
-    testElement.styleMap.append('lemons', new NumberValue(6));
+    testElement.styleMap.append('lemons', new CSSNumberValue(6));
   });
 }, "Attempting to append to an invalid property throws");
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_setGet.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_setGet.html
index f5c6cb3..3ee25740 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_setGet.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_setGet.html
@@ -30,21 +30,21 @@
 
 test(function() {
   assert_throws(new TypeError(), function() {
-    testElement.styleMap.set('width', new NumberValue(4));
+    testElement.styleMap.set('width', new CSSNumberValue(4));
   });
 }, "Attempting to set an invalid type for a property throws");
 
 test(function() {
   testElement.styleMap.set('width', new SimpleLength(2, 'px'));
   assert_throws(new TypeError(), function() {
-    testElement.styleMap.set('width', new NumberValue(4));
+    testElement.styleMap.set('width', new CSSNumberValue(4));
   });
   assert_equals(testElement.styleMap.get('width').cssString, '2px');
 }, "Attempting to set an invalid type for a property does not change the value");
 
 test(function() {
   assert_throws(new TypeError(), function() {
-    testElement.styleMap.set('lemons', new NumberValue(4));
+    testElement.styleMap.set('lemons', new CSSNumberValue(4));
   });
   assert_throws(new TypeError(), function() {
     testElement.styleMap.set('lemons', null);
diff --git a/third_party/WebKit/LayoutTests/typedcssom/numberValue.html b/third_party/WebKit/LayoutTests/typedcssom/numberValue.html
deleted file mode 100644
index 7d6f7e9..0000000
--- a/third_party/WebKit/LayoutTests/typedcssom/numberValue.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-
-<script>
-var values = [
-  {input: new NumberValue(0), cssString: '0'},
-  {input: new NumberValue(1), cssString: '1'},
-  {input: new NumberValue(-2), cssString: '-2'},
-  {input: new NumberValue(3.4), cssString: '3.4'}
-];
-
-test(function() {
-  for (var i = 0; i < values.length; ++i) {
-    assert_equals(values[i].input.cssString, values[i].cssString);
-  }
-}, "Test that the css string for NumberValue is correct.");
-
-</script>
-
-<body>
-</body>
-
diff --git a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointer-event-properties-expected.txt b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointer-event-properties-expected.txt
index 1394201..ce6886d 100644
--- a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointer-event-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointer-event-properties-expected.txt
@@ -1,5 +1,3 @@
-Test that pointer properties propagates from touches to PointerEvents
-
 This is a testharness.js-based test.
 PASS Pointer property propagation from touches to PointerEvents 
 PASS Pointer event properties for pointer 1 on pointerdown 
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
index 929a073..151ea1d 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -638,7 +638,6 @@
     method btoa
     method clearInterval
     method clearTimeout
-    method close
     method constructor
     method createImageBitmap
     method fetch
@@ -788,7 +787,6 @@
     getter onpush
     getter onsync
     getter registration
-    method close
     method fetch
     method gc
     method skipWaiting
@@ -800,7 +798,8 @@
     setter onnotificationclose
     setter onpush
     setter onsync
-This is a testharness.js-based test.
-PASS Verify the interface of ServiceWorkerGlobalScope 
-Harness: the test ran to completion.
+PASS Verify the interface of ServiceWorkerGlobalScope
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
index 124ea4a..aabe1c5f6 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -653,7 +653,6 @@
 [Worker]     method btoa
 [Worker]     method clearInterval
 [Worker]     method clearTimeout
-[Worker]     method close
 [Worker]     method constructor
 [Worker]     method createImageBitmap
 [Worker]     method fetch
@@ -855,6 +854,7 @@
 [Worker]     attribute internals
 [Worker]     getter caches
 [Worker]     getter onmessage
+[Worker]     method close
 [Worker]     method gc
 [Worker]     method postMessage
 [Worker]     method webkitRequestFileSystem
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
index 4ce8dbc0e..30df7f6 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -645,7 +645,6 @@
 [Worker]     method btoa
 [Worker]     method clearInterval
 [Worker]     method clearTimeout
-[Worker]     method close
 [Worker]     method constructor
 [Worker]     method createImageBitmap
 [Worker]     method fetch
@@ -848,6 +847,7 @@
 [Worker]     getter caches
 [Worker]     getter name
 [Worker]     getter onconnect
+[Worker]     method close
 [Worker]     method gc
 [Worker]     method webkitRequestFileSystem
 [Worker]     method webkitRequestFileSystemSync
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
index dfe35e5..d0c9095 100644
--- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -1215,7 +1215,6 @@
 [Worker]     method btoa
 [Worker]     method clearInterval
 [Worker]     method clearTimeout
-[Worker]     method close
 [Worker]     method constructor
 [Worker]     method createImageBitmap
 [Worker]     method fetch
@@ -1420,6 +1419,7 @@
 [Worker]     attribute internals
 [Worker]     getter caches
 [Worker]     getter onmessage
+[Worker]     method close
 [Worker]     method gc
 [Worker]     method postMessage
 [Worker]     method webkitRequestFileSystem
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
index bd2256b..e682d60 100644
--- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -447,6 +447,10 @@
     getter namespaceURI
     getter prefix
     method constructor
+interface CSSNumberValue : StyleValue
+    attribute @@toStringTag
+    getter value
+    method constructor
 interface CSSPageRule : CSSRule
     attribute @@toStringTag
     getter selectorText
@@ -4021,10 +4025,6 @@
     setter onclose
     setter onerror
     setter onshow
-interface NumberValue : StyleValue
-    attribute @@toStringTag
-    getter value
-    method constructor
 interface OfflineAudioCompletionEvent : Event
     attribute @@toStringTag
     getter renderedBuffer
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
index e24bae6..5594bad9 100644
--- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -1207,7 +1207,6 @@
 [Worker]     method btoa
 [Worker]     method clearInterval
 [Worker]     method clearTimeout
-[Worker]     method close
 [Worker]     method constructor
 [Worker]     method createImageBitmap
 [Worker]     method fetch
@@ -1413,6 +1412,7 @@
 [Worker]     getter caches
 [Worker]     getter name
 [Worker]     getter onconnect
+[Worker]     method close
 [Worker]     method gc
 [Worker]     method webkitRequestFileSystem
 [Worker]     method webkitRequestFileSystemSync
diff --git a/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp b/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp
index 48376d05..f87775d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/Microtask.cpp
@@ -31,7 +31,6 @@
 #include "bindings/core/v8/Microtask.h"
 
 #include "platform/ScriptForbiddenScope.h"
-#include "platform/Task.h"
 #include "wtf/PtrUtil.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h b/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h
index c283399..4005f55 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h
@@ -72,6 +72,13 @@
         m_handle.SetWeak(parameters, callback, type);
     }
 
+    // Turns this handle into a weak phantom handle without
+    // finalization callback.
+    void setPhantom()
+    {
+        m_handle.SetWeak();
+    }
+
     void clearWeak()
     {
         m_handle.template ClearWeak<void>();
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
index ef0744db..bc4fef05 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
@@ -439,7 +439,7 @@
 
     // notifyFinished might already be called, or it might be called in the
     // future (if the parsing finishes earlier because of a parse error).
-    m_loadingTaskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&ScriptStreamer::streamingComplete, AllowCrossThreadAccess(this)));
+    m_loadingTaskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&ScriptStreamer::streamingComplete, wrapCrossThreadPersistent(this)));
 
     // The task might delete ScriptStreamer, so it's not safe to do anything
     // after posting it. Note that there's no way to guarantee that this
@@ -547,7 +547,7 @@
             return;
         }
 
-        ScriptStreamerThread::shared()->postTask(threadSafeBind(&ScriptStreamerThread::runScriptStreamingTask, passed(std::move(scriptStreamingTask)), AllowCrossThreadAccess(this)));
+        ScriptStreamerThread::shared()->postTask(threadSafeBind(&ScriptStreamerThread::runScriptStreamingTask, passed(std::move(scriptStreamingTask)), wrapCrossThreadPersistent(this)));
         recordStartedStreamingHistogram(m_scriptType, 1);
     }
     if (m_stream)
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index ccd7a6f..6117ad4 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -458,11 +458,16 @@
     }
     if (!depth)
         TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function));
-    v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
-    ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
-    v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
-    crashIfIsolateIsDead(isolate);
-    ThreadDebugger::didExecuteScript(isolate);
+    v8::MaybeLocal<v8::Value> result;
+    {
+        // Create an extra block so FunctionCall trace event end phase is recorded after
+        // v8::MicrotasksScope destructor, as the latter is running microtasks.
+        v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+        ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
+        result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
+        crashIfIsolateIsDead(isolate);
+        ThreadDebugger::didExecuteScript(isolate);
+    }
     if (!depth)
         TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
     return result;
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi
index 3eb8cbb..b6c2c5e 100644
--- a/third_party/WebKit/Source/core/core.gypi
+++ b/third_party/WebKit/Source/core/core.gypi
@@ -41,13 +41,13 @@
             'css/WebKitCSSMatrix.idl',
             'css/cssom/CSSAngleValue.idl',
             'css/cssom/CSSKeywordValue.idl',
+            'css/cssom/CSSNumberValue.idl',
             'css/cssom/CSSPositionValue.idl',
             'css/cssom/CSSRotation.idl',
             'css/cssom/CSSTranslation.idl',
             'css/cssom/CalcLength.idl',
             'css/cssom/LengthValue.idl',
             'css/cssom/Matrix.idl',
-            'css/cssom/NumberValue.idl',
             'css/cssom/Perspective.idl',
             'css/cssom/Scale.idl',
             'css/cssom/SimpleLength.idl',
@@ -1330,6 +1330,7 @@
             'css/cssom/CSSAngleValue.h',
             'css/cssom/CSSKeywordValue.cpp',
             'css/cssom/CSSKeywordValue.h',
+            'css/cssom/CSSNumberValue.h',
             'css/cssom/CSSOMKeywords.h',
             'css/cssom/CSSOMTypes.h',
             'css/cssom/CSSPositionValue.cpp',
@@ -1346,7 +1347,6 @@
             'css/cssom/MatrixTransformComponent.cpp',
             'css/cssom/MatrixTransformComponent.h',
             'css/cssom/MutableStylePropertyMap.h',
-            'css/cssom/NumberValue.h',
             'css/cssom/PerspectiveTransformComponent.cpp',
             'css/cssom/PerspectiveTransformComponent.h',
             'css/cssom/ScaleTransformComponent.cpp',
diff --git a/third_party/WebKit/Source/core/css/cssom/NumberValue.h b/third_party/WebKit/Source/core/css/cssom/CSSNumberValue.h
similarity index 72%
rename from third_party/WebKit/Source/core/css/cssom/NumberValue.h
rename to third_party/WebKit/Source/core/css/cssom/CSSNumberValue.h
index 88d45ab4..ef098a01 100644
--- a/third_party/WebKit/Source/core/css/cssom/NumberValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSNumberValue.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef NumberValue_h
-#define NumberValue_h
+#ifndef CSSNumberValue_h
+#define CSSNumberValue_h
 
 #include "bindings/core/v8/ScriptWrappable.h"
 #include "core/CoreExport.h"
@@ -13,13 +13,13 @@
 
 namespace blink {
 
-class CORE_EXPORT NumberValue final : public StyleValue {
-    WTF_MAKE_NONCOPYABLE(NumberValue);
+class CORE_EXPORT CSSNumberValue final : public StyleValue {
+    WTF_MAKE_NONCOPYABLE(CSSNumberValue);
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static NumberValue* create(double value)
+    static CSSNumberValue* create(double value)
     {
-        return new NumberValue(value);
+        return new CSSNumberValue(value);
     }
 
     double value() const { return m_value; }
@@ -32,7 +32,7 @@
 
     StyleValueType type() const override { return StyleValueType::NumberType; }
 private:
-    NumberValue(double value) : m_value(value) {}
+    CSSNumberValue(double value) : m_value(value) {}
 
     double m_value;
 };
diff --git a/third_party/WebKit/Source/core/css/cssom/NumberValue.idl b/third_party/WebKit/Source/core/css/cssom/CSSNumberValue.idl
similarity index 86%
rename from third_party/WebKit/Source/core/css/cssom/NumberValue.idl
rename to third_party/WebKit/Source/core/css/cssom/CSSNumberValue.idl
index 06bc109ef..d2234df 100644
--- a/third_party/WebKit/Source/core/css/cssom/NumberValue.idl
+++ b/third_party/WebKit/Source/core/css/cssom/CSSNumberValue.idl
@@ -5,6 +5,6 @@
 [
     Constructor(double value),
     RuntimeEnabled=CSSTypedOM
-] interface NumberValue : StyleValue {
+] interface CSSNumberValue : StyleValue {
     readonly attribute double value;
 };
diff --git a/third_party/WebKit/Source/core/editing/DragCaretController.cpp b/third_party/WebKit/Source/core/editing/DragCaretController.cpp
index ae43f46..d0917317 100644
--- a/third_party/WebKit/Source/core/editing/DragCaretController.cpp
+++ b/third_party/WebKit/Source/core/editing/DragCaretController.cpp
@@ -32,7 +32,7 @@
 namespace blink {
 
 DragCaretController::DragCaretController()
-    : CaretBase(CaretVisibility::Visible)
+    : m_caretBase(new CaretBase(CaretVisibility::Visible))
 {
 }
 
@@ -54,18 +54,18 @@
     DisableCompositingQueryAsserts disabler;
 
     if (Node* node = m_position.deepEquivalent().anchorNode())
-        invalidateCaretRect(node);
+        m_caretBase->invalidateCaretRect(node);
     m_position = createVisiblePosition(position);
     Document* document = nullptr;
     if (Node* node = m_position.deepEquivalent().anchorNode()) {
-        invalidateCaretRect(node);
+        m_caretBase->invalidateCaretRect(node);
         document = &node->document();
     }
     if (m_position.isNull() || m_position.isOrphan()) {
-        clearCaretRect();
+        m_caretBase->clearCaretRect();
     } else {
         document->updateLayoutTree();
-        updateCaretRect(m_position);
+        m_caretBase->updateCaretRect(m_position);
     }
 }
 
@@ -114,7 +114,7 @@
 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext& context, const LayoutPoint& paintOffset) const
 {
     if (m_position.deepEquivalent().anchorNode()->document().frame() == frame)
-        paintCaret(m_position.deepEquivalent().anchorNode(), context, paintOffset);
+        m_caretBase->paintCaret(m_position.deepEquivalent().anchorNode(), context, paintOffset);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/DragCaretController.h b/third_party/WebKit/Source/core/editing/DragCaretController.h
index 863f69e..bcb0134 100644
--- a/third_party/WebKit/Source/core/editing/DragCaretController.h
+++ b/third_party/WebKit/Source/core/editing/DragCaretController.h
@@ -28,11 +28,11 @@
 
 #include "core/editing/CaretBase.h"
 
+#include <memory>
+
 namespace blink {
 
-class CullRect;
-
-class DragCaretController final : public GarbageCollectedFinalized<DragCaretController>, private CaretBase {
+class DragCaretController final : public GarbageCollectedFinalized<DragCaretController> {
     WTF_MAKE_NONCOPYABLE(DragCaretController);
 public:
     static DragCaretController* create();
@@ -56,6 +56,7 @@
     DragCaretController();
 
     VisiblePosition m_position;
+    const std::unique_ptr<CaretBase> m_caretBase;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/Position.h b/third_party/WebKit/Source/core/editing/Position.h
index 84dd327..3ea6c90 100644
--- a/third_party/WebKit/Source/core/editing/Position.h
+++ b/third_party/WebKit/Source/core/editing/Position.h
@@ -170,7 +170,6 @@
     static PositionTemplate<Strategy> firstPositionInNode(Node* anchorNode);
     static PositionTemplate<Strategy> lastPositionInNode(Node* anchorNode);
     static int minOffsetForNode(Node* anchorNode, int offset);
-    static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode);
     static PositionTemplate<Strategy> firstPositionInOrBeforeNode(Node* anchorNode);
     static PositionTemplate<Strategy> lastPositionInOrAfterNode(Node* anchorNode);
 
@@ -341,24 +340,6 @@
 }
 
 template <typename Strategy>
-bool PositionTemplate<Strategy>::offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode)
-{
-    if (anchorNode->offsetInCharacters())
-        return offset < anchorNode->maxCharacterOffset();
-
-    int currentOffset = 0;
-    for (Node* node = Strategy::firstChild(*anchorNode); node && currentOffset < offset; node = Strategy::nextSibling(*node))
-        currentOffset++;
-
-    return offset < currentOffset;
-}
-
-inline bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode)
-{
-    return Position::offsetIsBeforeLastNodeOffset(offset, anchorNode);
-}
-
-template <typename Strategy>
 PositionTemplate<Strategy> PositionTemplate<Strategy>::firstPositionInOrBeforeNode(Node* node)
 {
     if (!node)
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
index 279533b..be0c9c6 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -112,6 +112,16 @@
     return hasNoAttributeOrOnlyStyleAttribute(toHTMLFontElement(element), shouldStyleAttributeBeEmpty);
 }
 
+static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode)
+{
+    if (anchorNode->offsetInCharacters())
+        return offset < anchorNode->maxCharacterOffset();
+    int currentOffset = 0;
+    for (Node* node = NodeTraversal::firstChild(*anchorNode); node && currentOffset < offset; node = NodeTraversal::nextSibling(*node))
+        currentOffset++;
+    return offset < currentOffset;
+}
+
 ApplyStyleCommand::ApplyStyleCommand(Document& document, const EditingStyle* style, EditAction editingAction, EPropertyLevel propertyLevel)
     : CompositeEditCommand(document)
     , m_style(style->copy())
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 5fc1f26b..c45021a9d 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -996,6 +996,7 @@
 
 void ContentSecurityPolicy::logToConsole(ConsoleMessage* consoleMessage, LocalFrame* frame)
 {
+    consoleMessage->collectCallStack();
     if (frame)
         frame->document()->addConsoleMessage(consoleMessage);
     else if (m_executionContext)
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
index 85c3487..01136649 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
@@ -118,10 +118,10 @@
         }
         // We post the below task to check if the above idle task isn't late.
         // There's no risk of concurrency as both tasks are on main thread.
-        this->postDelayedTaskToMainThread(BLINK_FROM_HERE, new SameThreadTask(bind(&CanvasAsyncBlobCreator::idleTaskStartTimeoutEvent, this, quality)), IdleTaskStartTimeoutDelay);
+        this->postDelayedTaskToMainThread(BLINK_FROM_HERE, bind(&CanvasAsyncBlobCreator::idleTaskStartTimeoutEvent, this, quality), IdleTaskStartTimeoutDelay);
     } else if (m_mimeType == MimeTypeWebp) {
         BackgroundTaskRunner::TaskSize taskSize = (m_size.height() * m_size.width() >= LongTaskImageSizeThreshold) ? BackgroundTaskRunner::TaskSizeLongRunningTask : BackgroundTaskRunner::TaskSizeShortRunningTask;
-        BackgroundTaskRunner::postOnBackgroundThread(BLINK_FROM_HERE, threadSafeBind(&CanvasAsyncBlobCreator::encodeImageOnEncoderThread, AllowCrossThreadAccess(this), quality), taskSize);
+        BackgroundTaskRunner::postOnBackgroundThread(BLINK_FROM_HERE, threadSafeBind(&CanvasAsyncBlobCreator::encodeImageOnEncoderThread, wrapCrossThreadPersistent(this), quality), taskSize);
     }
 }
 
@@ -282,7 +282,7 @@
         return;
     }
 
-    Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&CanvasAsyncBlobCreator::createBlobAndInvokeCallback, AllowCrossThreadAccess(this)));
+    Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&CanvasAsyncBlobCreator::createBlobAndInvokeCallback, wrapCrossThreadPersistent(this)));
 }
 
 bool CanvasAsyncBlobCreator::initializePngStruct()
@@ -309,7 +309,7 @@
 {
     if (m_idleTaskStatus == IdleTaskStarted) {
         // Even if the task started quickly, we still want to ensure completion
-        this->postDelayedTaskToMainThread(BLINK_FROM_HERE, new SameThreadTask(bind(&CanvasAsyncBlobCreator::idleTaskCompleteTimeoutEvent, this)), IdleTaskCompleteTimeoutDelay);
+        this->postDelayedTaskToMainThread(BLINK_FROM_HERE, bind(&CanvasAsyncBlobCreator::idleTaskCompleteTimeoutEvent, this), IdleTaskCompleteTimeoutDelay);
     } else if (m_idleTaskStatus == IdleTaskNotStarted) {
         // If the idle task does not start after a delay threshold, we will
         // force it to happen on main thread (even though it may cause more
@@ -361,9 +361,10 @@
     }
 }
 
-void CanvasAsyncBlobCreator::postDelayedTaskToMainThread(const WebTraceLocation& location, SameThreadTask* task, double delayMs)
+void CanvasAsyncBlobCreator::postDelayedTaskToMainThread(const WebTraceLocation& location, std::unique_ptr<SameThreadClosure> task, double delayMs)
 {
-    Platform::current()->mainThread()->getWebTaskRunner()->postDelayedTask(location, task, delayMs);
+    DCHECK(isMainThread());
+    Platform::current()->mainThread()->getWebTaskRunner()->postDelayedTask(location, std::move(task), delayMs);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
index f82b7e6..64152fb 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
@@ -5,7 +5,6 @@
 #include "core/CoreExport.h"
 #include "core/dom/DOMTypedArray.h"
 #include "core/fileapi/BlobCallback.h"
-#include "platform/Task.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/heap/Handle.h"
 #include "wtf/OwnPtr.h"
@@ -52,7 +51,7 @@
     virtual void scheduleInitiateJpegEncoding(const double&);
     virtual void idleEncodeRowsPng(double deadlineSeconds);
     virtual void idleEncodeRowsJpeg(double deadlineSeconds);
-    virtual void postDelayedTaskToMainThread(const WebTraceLocation&, SameThreadTask*, double delayMs);
+    virtual void postDelayedTaskToMainThread(const WebTraceLocation&, std::unique_ptr<SameThreadClosure>, double delayMs);
     virtual void signalAlternativeCodePathFinishedForTesting() { }
     virtual void createBlobAndInvokeCallback();
     virtual void createNullAndInvokeCallback();
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp
index 9fa0156..423c670 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp
@@ -5,7 +5,6 @@
 #include "core/html/canvas/CanvasAsyncBlobCreator.h"
 
 #include "core/html/ImageData.h"
-#include "platform/Task.h"
 #include "platform/testing/UnitTestHelpers.h"
 #include "public/platform/Platform.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -35,7 +34,7 @@
     void createBlobAndInvokeCallback() override { };
     void createNullAndInvokeCallback() override { };
     void signalAlternativeCodePathFinishedForTesting() override;
-    void postDelayedTaskToMainThread(const WebTraceLocation&, SameThreadTask*, double delayMs) override;
+    void postDelayedTaskToMainThread(const WebTraceLocation&, std::unique_ptr<SameThreadClosure>, double delayMs) override;
 };
 
 void MockCanvasAsyncBlobCreator::signalAlternativeCodePathFinishedForTesting()
@@ -43,9 +42,10 @@
     testing::exitRunLoop();
 }
 
-void MockCanvasAsyncBlobCreator::postDelayedTaskToMainThread(const WebTraceLocation& location, SameThreadTask* task, double delayMs)
+void MockCanvasAsyncBlobCreator::postDelayedTaskToMainThread(const WebTraceLocation& location, std::unique_ptr<SameThreadClosure> task, double delayMs)
 {
-    Platform::current()->mainThread()->getWebTaskRunner()->postTask(location, task);
+    DCHECK(isMainThread());
+    Platform::current()->mainThread()->getWebTaskRunner()->postTask(location, std::move(task));
 }
 
 //==============================================================================
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
index 9c29fa20..86b14a70 100644
--- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
+++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
@@ -220,7 +220,7 @@
     if (arrayBuffer->byteLength() >= longTaskByteLengthThreshold)
         taskSize = BackgroundTaskRunner::TaskSizeLongRunningTask;
     WebTaskRunner* taskRunner = Platform::current()->currentThread()->getWebTaskRunner();
-    BackgroundTaskRunner::postOnBackgroundThread(BLINK_FROM_HERE, threadSafeBind(&ImageBitmapFactories::ImageBitmapLoader::decodeImageOnDecoderThread, AllowCrossThreadAccess(this), AllowCrossThreadAccess(taskRunner), AllowCrossThreadAccess(arrayBuffer)), taskSize);
+    BackgroundTaskRunner::postOnBackgroundThread(BLINK_FROM_HERE, threadSafeBind(&ImageBitmapFactories::ImageBitmapLoader::decodeImageOnDecoderThread, wrapCrossThreadPersistent(this), AllowCrossThreadAccess(taskRunner), wrapCrossThreadPersistent(arrayBuffer)), taskSize);
 }
 
 void ImageBitmapFactories::ImageBitmapLoader::decodeImageOnDecoderThread(WebTaskRunner* taskRunner, DOMArrayBuffer* arrayBuffer)
@@ -240,7 +240,7 @@
         decoder->setData(sharedBuffer.get(), true);
         frame = ImageBitmap::getSkImageFromDecoder(std::move(decoder));
     }
-    taskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&ImageBitmapFactories::ImageBitmapLoader::resolvePromiseOnOriginalThread, AllowCrossThreadAccess(this), frame.release()));
+    taskRunner->postTask(BLINK_FROM_HERE, threadSafeBind(&ImageBitmapFactories::ImageBitmapLoader::resolvePromiseOnOriginalThread, wrapCrossThreadPersistent(this), frame.release()));
 }
 
 void ImageBitmapFactories::ImageBitmapLoader::resolvePromiseOnOriginalThread(PassRefPtr<SkImage> frame)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
index c501fa3c..52c53a5 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -121,7 +121,7 @@
         .setFill(computedTiming.fill())
         .setBackendNodeId(DOMNodeIds::idForNode(effect->target()))
         .setEasing(easing).build();
-    return animationObject.release();
+    return animationObject;
 }
 
 static PassOwnPtr<protocol::Animation::KeyframeStyle> buildObjectForStringKeyframe(const StringKeyframe* keyframe)
@@ -133,7 +133,7 @@
     OwnPtr<protocol::Animation::KeyframeStyle> keyframeObject = protocol::Animation::KeyframeStyle::create()
         .setOffset(offset)
         .setEasing(keyframe->easing().toString()).build();
-    return keyframeObject.release();
+    return keyframeObject;
 }
 
 static PassOwnPtr<protocol::Animation::KeyframesRule> buildObjectForAnimationKeyframes(const KeyframeEffect* effect)
@@ -151,7 +151,7 @@
         const StringKeyframe* stringKeyframe = toStringKeyframe(keyframe.get());
         keyframes->addItem(buildObjectForStringKeyframe(stringKeyframe));
     }
-    return protocol::Animation::KeyframesRule::create().setKeyframes(keyframes.release()).build();
+    return protocol::Animation::KeyframesRule::create().setKeyframes(std::move(keyframes)).build();
 }
 
 PassOwnPtr<protocol::Animation::Animation> InspectorAnimationAgent::buildObjectForAnimation(blink::Animation& animation)
@@ -175,7 +175,7 @@
     m_idToAnimationType.set(id, animationType);
 
     OwnPtr<protocol::Animation::AnimationEffect> animationEffectObject = buildObjectForAnimationEffect(toKeyframeEffect(animation.effect()), animationType == AnimationType::CSSTransition);
-    animationEffectObject->setKeyframesRule(keyframeRule.release());
+    animationEffectObject->setKeyframesRule(std::move(keyframeRule));
 
     OwnPtr<protocol::Animation::Animation> animationObject = protocol::Animation::Animation::create()
         .setId(id)
@@ -185,11 +185,11 @@
         .setPlaybackRate(animation.playbackRate())
         .setStartTime(normalizedStartTime(animation))
         .setCurrentTime(animation.currentTime())
-        .setSource(animationEffectObject.release())
+        .setSource(std::move(animationEffectObject))
         .setType(animationType).build();
     if (animationType != AnimationType::WebAnimation)
         animationObject->setCssId(createCSSId(animation));
-    return animationObject.release();
+    return animationObject;
 }
 
 void InspectorAnimationAgent::getPlaybackRate(ErrorString*, double* playbackRate)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
index af08d78..4e5a54f 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
@@ -104,7 +104,7 @@
                 .setFrameId(IdentifiersFactory::frameId(frame))
                 .setManifestURL(manifestURL)
                 .setStatus(static_cast<int>(host->getStatus())).build();
-            (*result)->addItem(value.release());
+            (*result)->addItem(std::move(value));
         }
     }
 }
@@ -168,7 +168,7 @@
     for (int i = 0; it != end; ++it, i++)
         resources->addItem(buildObjectForApplicationCacheResource(*it));
 
-    return resources.release();
+    return resources;
 }
 
 PassOwnPtr<protocol::ApplicationCache::ApplicationCacheResource> InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
@@ -193,7 +193,7 @@
         .setUrl(resourceInfo.m_resource.getString())
         .setSize(static_cast<int>(resourceInfo.m_size))
         .setType(builder.toString()).build();
-    return value.release();
+    return value;
 }
 
 DEFINE_TRACE(InspectorApplicationCacheAgent)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h
index bad291f16..73ab0f8 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h
@@ -78,7 +78,7 @@
         if (!m_state) {
             OwnPtr<protocol::DictionaryValue> newState = protocol::DictionaryValue::create();
             m_state = newState.get();
-            state->setObject(m_name, newState.release());
+            state->setObject(m_name, std::move(newState));
         }
     }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index 7a48e0e..c5ca1706 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -896,7 +896,7 @@
                 entry->setInlineStyle(styleSheet->buildObjectForStyle(styleSheet->inlineStyle()));
         }
 
-        inheritedEntries->fromJust()->addItem(entry.release());
+        inheritedEntries->fromJust()->addItem(std::move(entry));
         parentElement = parentElement->parentOrShadowHostElement();
     }
 
@@ -931,7 +931,7 @@
     StyleResolver& styleResolver = ownerDocument->ensureStyleResolver();
     RefPtr<ComputedStyle> style = styleResolver.styleForElement(element);
     if (!style)
-        return cssKeyframesRules.release();
+        return cssKeyframesRules;
     const CSSAnimationData* animationData = style->animations();
     for (size_t i = 0; animationData && i < animationData->nameList().size(); ++i) {
         AtomicString animationName(animationData->nameList()[i]);
@@ -963,10 +963,10 @@
         if (sourceData)
             name->setRange(inspectorStyleSheet->buildSourceRangeObject(sourceData->ruleHeaderRange));
         cssKeyframesRules->addItem(protocol::CSS::CSSKeyframesRule::create()
-            .setAnimationName(name.release())
-            .setKeyframes(keyframes.release()).build());
+            .setAnimationName(std::move(name))
+            .setKeyframes(std::move(keyframes)).build());
     }
-    return cssKeyframesRules.release();
+    return cssKeyframesRules;
 }
 
 void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nodeId, Maybe<protocol::CSS::CSSStyle>* inlineStyle, Maybe<protocol::CSS::CSSStyle>* attributesStyle)
@@ -1244,7 +1244,7 @@
         Member<StyleSheetAction> action = actions.at(i);
         m_domAgent->history()->appendPerformedAction(action);
     }
-    *result = serializedStyles.release();
+    *result = std::move(serializedStyles);
 }
 
 CSSStyleDeclaration* InspectorCSSAgent::setStyleText(ErrorString* errorString, InspectorStyleSheetBase* inspectorStyleSheet, const SourceRange& range, const String& text)
@@ -1418,15 +1418,15 @@
             if (mediaValues->computeLength(expValue.value, expValue.unit, computedLength))
                 mediaQueryExpression->setComputedLength(computedLength);
 
-            expressionArray->addItem(mediaQueryExpression.release());
+            expressionArray->addItem(std::move(mediaQueryExpression));
             hasExpressionItems = true;
         }
         if (!hasExpressionItems)
             continue;
         OwnPtr<protocol::CSS::MediaQuery> mediaQuery = protocol::CSS::MediaQuery::create()
             .setActive(mediaEvaluator->eval(query, nullptr))
-            .setExpressions(expressionArray.release()).build();
-        mediaListArray->addItem(mediaQuery.release());
+            .setExpressions(std::move(expressionArray)).build();
+        mediaListArray->addItem(std::move(mediaQuery));
         hasMediaQueryItems = true;
     }
 
@@ -1434,7 +1434,7 @@
         .setText(media->mediaText())
         .setSource(source).build();
     if (hasMediaQueryItems)
-        mediaObject->setMediaList(mediaListArray.release());
+        mediaObject->setMediaList(std::move(mediaListArray));
 
     if (inspectorStyleSheet && mediaListSource != MediaListSourceLinkedSheet)
         mediaObject->setStyleSheetId(inspectorStyleSheet->id());
@@ -1444,11 +1444,11 @@
 
         CSSRule* parentRule = media->parentRule();
         if (!parentRule)
-            return mediaObject.release();
+            return mediaObject;
         InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(parentRule->parentStyleSheet());
         mediaObject->setRange(inspectorStyleSheet->ruleHeaderSourceRange(parentRule));
     }
-    return mediaObject.release();
+    return mediaObject;
 }
 
 void InspectorCSSAgent::collectMediaQueriesFromStyleSheet(CSSStyleSheet* styleSheet, protocol::Array<protocol::CSS::CSSMedia>* mediaArray)
@@ -1519,7 +1519,7 @@
             }
         }
     }
-    return mediaArray.release();
+    return mediaArray;
 }
 
 InspectorStyleSheetForInlineStyle* InspectorCSSAgent::asInspectorStyleSheet(Element* element)
@@ -1711,7 +1711,7 @@
 
     OwnPtr<protocol::CSS::CSSRule> result = inspectorStyleSheet->buildObjectForRuleWithoutMedia(rule);
     result->setMedia(buildMediaListChain(rule));
-    return result.release();
+    return result;
 }
 
 static inline bool matchesPseudoElement(const CSSSelector* selector, PseudoId elementPseudoId)
@@ -1730,7 +1730,7 @@
 {
     OwnPtr<protocol::Array<protocol::CSS::RuleMatch>> result = protocol::Array<protocol::CSS::RuleMatch>::create();
     if (!ruleList)
-        return result.release();
+        return result;
 
     HeapVector<Member<CSSStyleRule>> uniqRules = filterDuplicateRules(ruleList);
     for (unsigned i = 0; i < uniqRules.size(); ++i) {
@@ -1754,12 +1754,12 @@
             ++index;
         }
         result->addItem(protocol::CSS::RuleMatch::create()
-            .setRule(ruleObject.release())
-            .setMatchingSelectors(matchingSelectors.release())
+            .setRule(std::move(ruleObject))
+            .setMatchingSelectors(std::move(matchingSelectors))
             .build());
     }
 
-    return result.release();
+    return result;
 }
 
 PassOwnPtr<protocol::CSS::CSSStyle> InspectorCSSAgent::buildObjectForAttributesStyle(Element* element)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
index b7098339..f7af8db 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
@@ -186,7 +186,7 @@
             v8::Local<v8::Value> columns = arguments->argumentCount() > 1 ? arguments->argumentAt(1).v8Value() : v8::Local<v8::Value>();
             OwnPtr<protocol::Runtime::RemoteObject> inspectorValue = m_v8Session->wrapTable(context, table, columns);
             if (inspectorValue)
-                jsonArgs->addItem(inspectorValue.release());
+                jsonArgs->addItem(std::move(inspectorValue));
             else
                 jsonArgs = nullptr;
         } else {
@@ -196,11 +196,11 @@
                     jsonArgs = nullptr;
                     break;
                 }
-                jsonArgs->addItem(inspectorValue.release());
+                jsonArgs->addItem(std::move(inspectorValue));
             }
         }
         if (jsonArgs)
-            jsonObj->setParameters(jsonArgs.release());
+            jsonObj->setParameters(std::move(jsonArgs));
     }
     if (consoleMessage->callStack())
         jsonObj->setStack(consoleMessage->callStack()->buildInspectorObject());
@@ -208,7 +208,7 @@
         jsonObj->setMessageId(consoleMessage->messageId());
     if (consoleMessage->relatedMessageId())
         jsonObj->setRelatedMessageId(consoleMessage->relatedMessageId());
-    frontend()->messageAdded(jsonObj.release());
+    frontend()->messageAdded(std::move(jsonObj));
     frontend()->flush();
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
index e9ac236..bc655b6 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -554,7 +554,7 @@
     }
 
     OwnPtr<protocol::Array<protocol::DOM::Node>> children = buildArrayForContainerChildren(node, depth, nodeMap);
-    frontend()->setChildNodes(nodeId, children.release());
+    frontend()->setChildNodes(nodeId, std::move(children));
 }
 
 void InspectorDOMAgent::discardFrontendBindings()
@@ -687,7 +687,7 @@
     m_danglingNodeToIdMaps.append(newMap);
     OwnPtr<protocol::Array<protocol::DOM::Node>> children = protocol::Array<protocol::DOM::Node>::create();
     children->addItem(buildObjectForNode(node, 0, danglingMap));
-    frontend()->setChildNodes(0, children.release());
+    frontend()->setChildNodes(0, std::move(children));
 
     return pushNodePathToFrontend(nodeToPush, danglingMap);
 }
@@ -1112,7 +1112,7 @@
     highlightConfig->shapeMargin = parseColor(config->getShapeMarginColor(nullptr));
     highlightConfig->selectorList = config->getSelectorList("");
 
-    return highlightConfig.release();
+    return highlightConfig;
 }
 
 void InspectorDOMAgent::setInspectMode(ErrorString* errorString, const String& mode, const Maybe<protocol::DOM::HighlightConfig>& highlightConfig)
@@ -1140,7 +1140,7 @@
 void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlineColor)
 {
     OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad(FloatRect(x, y, width, height)));
-    innerHighlightQuad(quad.release(), color, outlineColor);
+    innerHighlightQuad(std::move(quad), color, outlineColor);
 }
 
 void InspectorDOMAgent::highlightQuad(ErrorString* errorString, PassOwnPtr<protocol::Array<double>> quadArray, const Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlineColor)
@@ -1150,7 +1150,7 @@
         *errorString = "Invalid Quad format";
         return;
     }
-    innerHighlightQuad(quad.release(), color, outlineColor);
+    innerHighlightQuad(std::move(quad), color, outlineColor);
 }
 
 void InspectorDOMAgent::innerHighlightQuad(PassOwnPtr<FloatQuad> quad, const Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlineColor)
@@ -1479,7 +1479,7 @@
             OwnPtr<protocol::Array<protocol::DOM::Node>> shadowRoots = protocol::Array<protocol::DOM::Node>::create();
             for (ShadowRoot* root = &shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
                 shadowRoots->addItem(buildObjectForNode(root, 0, nodesMap));
-            value->setShadowRoots(shadowRoots.release());
+            value->setShadowRoots(std::move(shadowRoots));
             forcePushChildren = true;
         }
 
@@ -1502,7 +1502,7 @@
         } else {
             OwnPtr<protocol::Array<protocol::DOM::Node>> pseudoElements = buildArrayForPseudoElements(element, nodesMap);
             if (pseudoElements) {
-                value->setPseudoElements(pseudoElements.release());
+                value->setPseudoElements(std::move(pseudoElements));
                 forcePushChildren = true;
             }
             if (!element->ownerDocument()->xmlVersion().isEmpty())
@@ -1539,10 +1539,10 @@
             depth = 1;
         OwnPtr<protocol::Array<protocol::DOM::Node>> children = buildArrayForContainerChildren(node, depth, nodesMap);
         if (children->length() > 0 || depth) // Push children along with shadow in any case.
-            value->setChildren(children.release());
+            value->setChildren(std::move(children));
     }
 
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<protocol::Array<String>> InspectorDOMAgent::buildArrayForElementAttributes(Element* element)
@@ -1555,7 +1555,7 @@
         attributesValue->addItem(attribute.name().toString());
         attributesValue->addItem(attribute.value());
     }
-    return attributesValue.release();
+    return attributesValue;
 }
 
 PassOwnPtr<protocol::Array<protocol::DOM::Node>> InspectorDOMAgent::buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap)
@@ -1568,7 +1568,7 @@
             children->addItem(buildObjectForNode(firstChild, 0, nodesMap));
             m_childrenRequested.add(bind(container, nodesMap));
         }
-        return children.release();
+        return children;
     }
 
     Node* child = innerFirstChild(container);
@@ -1579,7 +1579,7 @@
         children->addItem(buildObjectForNode(child, depth, nodesMap));
         child = innerNextSibling(child);
     }
-    return children.release();
+    return children;
 }
 
 PassOwnPtr<protocol::Array<protocol::DOM::Node>> InspectorDOMAgent::buildArrayForPseudoElements(Element* element, NodeToIdMap* nodesMap)
@@ -1592,7 +1592,7 @@
         pseudoElements->addItem(buildObjectForNode(element->pseudoElement(PseudoIdBefore), 0, nodesMap));
     if (element->pseudoElement(PseudoIdAfter))
         pseudoElements->addItem(buildObjectForNode(element->pseudoElement(PseudoIdAfter), 0, nodesMap));
-    return pseudoElements.release();
+    return pseudoElements;
 }
 
 PassOwnPtr<protocol::Array<protocol::DOM::BackendNode>> InspectorDOMAgent::buildArrayForDistributedNodes(InsertionPoint* insertionPoint)
@@ -1607,9 +1607,9 @@
             .setNodeType(distributedNode->getNodeType())
             .setNodeName(distributedNode->nodeName())
             .setBackendNodeId(DOMNodeIds::idForNode(distributedNode)).build();
-        distributedNodes->addItem(backendNode.release());
+        distributedNodes->addItem(std::move(backendNode));
     }
-    return distributedNodes.release();
+    return distributedNodes;
 }
 
 Node* InspectorDOMAgent::innerFirstChild(Node* node)
@@ -1693,7 +1693,7 @@
     OwnPtr<protocol::DOM::Node> value = buildObjectForNode(frameOwner, 0, m_documentNodeToIdMap.get());
     Node* previousSibling = innerPreviousSibling(frameOwner);
     int prevId = previousSibling ? m_documentNodeToIdMap->get(previousSibling) : 0;
-    frontend()->childNodeInserted(parentId, prevId, value.release());
+    frontend()->childNodeInserted(parentId, prevId, std::move(value));
 }
 
 void InspectorDOMAgent::didCommitLoad(LocalFrame*, DocumentLoader* loader)
@@ -1733,7 +1733,7 @@
         Node* prevSibling = innerPreviousSibling(node);
         int prevId = prevSibling ? m_documentNodeToIdMap->get(prevSibling) : 0;
         OwnPtr<protocol::DOM::Node> value = buildObjectForNode(node, 0, m_documentNodeToIdMap.get());
-        frontend()->childNodeInserted(parentId, prevId, value.release());
+        frontend()->childNodeInserted(parentId, prevId, std::move(value));
     }
 }
 
@@ -1811,7 +1811,7 @@
             m_domListener->didModifyDOMAttr(element);
         nodeIds->addItem(id);
     }
-    frontend()->inlineStyleInvalidated(nodeIds.release());
+    frontend()->inlineStyleInvalidated(std::move(nodeIds));
 }
 
 void InspectorDOMAgent::characterDataModified(CharacterData* characterData)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index 1b99710..dfcd08bb 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -163,7 +163,7 @@
 
     OwnPtr<protocol::DictionaryValue> newResult = protocol::DictionaryValue::create();
     protocol::DictionaryValue* result = newResult.get();
-    object->setObject(propertyName, newResult.release());
+    object->setObject(propertyName, std::move(newResult));
     return result;
 }
 
@@ -173,7 +173,7 @@
     if (!breakpoints) {
         OwnPtr<protocol::DictionaryValue> newBreakpoints = protocol::DictionaryValue::create();
         breakpoints = newBreakpoints.get();
-        m_state->setObject(DOMDebuggerAgentState::eventListenerBreakpoints, newBreakpoints.release());
+        m_state->setObject(DOMDebuggerAgentState::eventListenerBreakpoints, std::move(newBreakpoints));
     }
     return breakpoints;
 }
@@ -184,7 +184,7 @@
     if (!breakpoints) {
         OwnPtr<protocol::DictionaryValue> newBreakpoints = protocol::DictionaryValue::create();
         breakpoints = newBreakpoints.get();
-        m_state->setObject(DOMDebuggerAgentState::xhrBreakpoints, newBreakpoints.release());
+        m_state->setObject(DOMDebuggerAgentState::xhrBreakpoints, std::move(newBreakpoints));
     }
     return breakpoints;
 }
@@ -234,7 +234,7 @@
     if (hasBreakpoint(node, AttributeModified)) {
         OwnPtr<protocol::DictionaryValue> eventData = protocol::DictionaryValue::create();
         descriptionForDOMEvent(node, AttributeModified, false, eventData.get());
-        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, eventData.release());
+        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, std::move(eventData));
     }
 }
 
@@ -354,14 +354,14 @@
             continue;
         OwnPtr<protocol::DOMDebugger::EventListener> listenerObject = buildObjectForEventListener(context, info, objectGroup);
         if (listenerObject)
-            listenersArray->addItem(listenerObject.release());
+            listenersArray->addItem(std::move(listenerObject));
     }
     for (const auto& info : eventInformation) {
         if (info.useCapture)
             continue;
         OwnPtr<protocol::DOMDebugger::EventListener> listenerObject = buildObjectForEventListener(context, info, objectGroup);
         if (listenerObject)
-            listenersArray->addItem(listenerObject.release());
+            listenersArray->addItem(std::move(listenerObject));
     }
 }
 
@@ -388,12 +388,12 @@
         .setType(info.eventType)
         .setUseCapture(info.useCapture)
         .setPassive(info.passive)
-        .setLocation(location.release()).build();
+        .setLocation(std::move(location)).build();
     if (!objectGroupId.isEmpty()) {
         value->setHandler(m_v8Session->wrapObject(context, function, objectGroupId));
         value->setOriginalHandler(m_v8Session->wrapObject(context, info.handler, objectGroupId));
     }
-    return value.release();
+    return value;
 }
 
 void InspectorDOMDebuggerAgent::allowNativeBreakpoint(const String& breakpointName, const String* targetName, bool sync)
@@ -406,7 +406,7 @@
     if (hasBreakpoint(parent, SubtreeModified)) {
         OwnPtr<protocol::DictionaryValue> eventData = protocol::DictionaryValue::create();
         descriptionForDOMEvent(parent, SubtreeModified, true, eventData.get());
-        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, eventData.release());
+        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, std::move(eventData));
     }
 }
 
@@ -416,11 +416,11 @@
     if (hasBreakpoint(node, NodeRemoved)) {
         OwnPtr<protocol::DictionaryValue> eventData = protocol::DictionaryValue::create();
         descriptionForDOMEvent(node, NodeRemoved, false, eventData.get());
-        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, eventData.release());
+        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, std::move(eventData));
     } else if (parentNode && hasBreakpoint(parentNode, SubtreeModified)) {
         OwnPtr<protocol::DictionaryValue> eventData = protocol::DictionaryValue::create();
         descriptionForDOMEvent(node, SubtreeModified, false, eventData.get());
-        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, eventData.release());
+        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, std::move(eventData));
     }
     didRemoveDOMNode(node);
 }
@@ -430,7 +430,7 @@
     if (hasBreakpoint(element, AttributeModified)) {
         OwnPtr<protocol::DictionaryValue> eventData = protocol::DictionaryValue::create();
         descriptionForDOMEvent(element, AttributeModified, false, eventData.get());
-        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, eventData.release());
+        m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::DOM, std::move(eventData));
     }
 }
 
@@ -522,7 +522,7 @@
     eventData->setString("eventName", fullEventName);
     if (targetName)
         eventData->setString("targetName", *targetName);
-    return eventData.release();
+    return eventData;
 }
 
 void InspectorDOMDebuggerAgent::didFireWebGLError(const String& errorName)
@@ -532,7 +532,7 @@
         return;
     if (!errorName.isEmpty())
         eventData->setString(webglErrorNameProperty, errorName);
-    pauseOnNativeEventIfNeeded(eventData.release(), false);
+    pauseOnNativeEventIfNeeded(std::move(eventData), false);
 }
 
 void InspectorDOMDebuggerAgent::didFireWebGLWarning()
@@ -593,7 +593,7 @@
     OwnPtr<protocol::DictionaryValue> eventData = protocol::DictionaryValue::create();
     eventData->setString("breakpointURL", breakpointURL);
     eventData->setString("url", url);
-    m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::XHR, eventData.release());
+    m_v8Session->breakProgram(protocol::Debugger::Paused::ReasonEnum::XHR, std::move(eventData));
 }
 
 void InspectorDOMDebuggerAgent::didAddBreakpoint()
diff --git a/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp b/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
index 69873df..f6cdc58 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
@@ -25,7 +25,7 @@
     PathBuilder() : m_path(protocol::ListValue::create()) { }
     virtual ~PathBuilder() { }
 
-    PassOwnPtr<protocol::ListValue> release() { return m_path.release(); }
+    PassOwnPtr<protocol::ListValue> release() { return std::move(m_path); }
 
     void appendPath(const Path& path)
     {
@@ -122,7 +122,7 @@
     array->addItem(quad.p3().y());
     array->addItem(quad.p4().x());
     array->addItem(quad.p4().y());
-    return array.release();
+    return array;
 }
 
 Path quadToPath(const FloatQuad& quad)
@@ -200,7 +200,7 @@
     LayoutObject* layoutObject = element->layoutObject();
     FrameView* containingView = element->document().view();
     if (!layoutObject || !containingView)
-        return elementInfo.release();
+        return elementInfo;
 
     // layoutObject the getBoundingClientRect() data in the tooltip
     // to be consistent with the rulers (see http://crbug.com/262338).
@@ -208,7 +208,7 @@
     elementInfo->setString("nodeWidth", String::number(boundingBox->width()));
     elementInfo->setString("nodeHeight", String::number(boundingBox->height()));
 
-    return elementInfo.release();
+    return elementInfo;
 }
 
 } // namespace
@@ -262,7 +262,7 @@
         object->setString("outlineColor", outlineColor.serialized());
     if (!name.isEmpty())
         object->setString("name", name);
-    m_highlightPaths->pushValue(object.release());
+    m_highlightPaths->pushValue(std::move(object));
 }
 
 void InspectorHighlight::appendEventTargetQuads(Node* eventTargetNode, const InspectorHighlightConfig& highlightConfig)
@@ -330,7 +330,7 @@
     if (m_elementInfo)
         object->setValue("elementInfo", m_elementInfo->clone());
     object->setBoolean("displayAsMaterial", m_displayAsMaterial);
-    return object.release();
+    return object;
 }
 
 // static
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
index ae8ba59..83d48af 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -76,9 +76,9 @@
         .setHeight(rect.height)
         .setWidth(rect.width).build();
     OwnPtr<protocol::LayerTree::ScrollRect> scrollRectObject = protocol::LayerTree::ScrollRect::create()
-        .setRect(rectObject.release())
+        .setRect(std::move(rectObject))
         .setType(type).build();
-    return scrollRectObject.release();
+    return scrollRectObject;
 }
 
 static PassOwnPtr<Array<protocol::LayerTree::ScrollRect>> buildScrollRectsForLayer(GraphicsLayer* graphicsLayer, bool reportWheelScrollers)
@@ -95,7 +95,7 @@
         WebRect webRect(webLayer->position().x, webLayer->position().y, webLayer->bounds().width, webLayer->bounds().height);
         scrollRects->addItem(buildScrollRect(webRect, protocol::LayerTree::ScrollRect::TypeEnum::WheelEventHandler));
     }
-    return scrollRects->length() ? scrollRects.release() : nullptr;
+    return scrollRects->length() ? std::move(scrollRects) : nullptr;
 }
 
 static PassOwnPtr<protocol::LayerTree::Layer> buildObjectForLayer(GraphicsLayer* graphicsLayer, int nodeId, bool reportWheelEventListeners)
@@ -127,7 +127,7 @@
         OwnPtr<Array<double>> transformArray = Array<double>::create();
         for (size_t i = 0; i < WTF_ARRAY_LENGTH(flattenedMatrix); ++i)
             transformArray->addItem(flattenedMatrix[i]);
-        layerObject->setTransform(transformArray.release());
+        layerObject->setTransform(std::move(transformArray));
         const FloatPoint3D& transformOrigin = graphicsLayer->transformOrigin();
         // FIXME: rename these to setTransformOrigin*
         if (webLayer->bounds().width > 0)
@@ -142,8 +142,8 @@
     }
     OwnPtr<Array<protocol::LayerTree::ScrollRect>> scrollRects = buildScrollRectsForLayer(graphicsLayer, reportWheelEventListeners);
     if (scrollRects)
-        layerObject->setScrollRects(scrollRects.release());
-    return layerObject.release();
+        layerObject->setScrollRects(std::move(scrollRects));
+    return layerObject;
 }
 
 InspectorLayerTreeAgent::InspectorLayerTreeAgent(InspectedFrames* inspectedFrames)
@@ -200,7 +200,7 @@
         .setY(rect.y())
         .setWidth(rect.width())
         .setHeight(rect.height()).build();
-    frontend()->layerPainted(idForLayer(graphicsLayer), domRect.release());
+    frontend()->layerPainted(idForLayer(graphicsLayer), std::move(domRect));
 }
 
 PassOwnPtr<Array<protocol::LayerTree::Layer>> InspectorLayerTreeAgent::buildLayerTree()
@@ -216,7 +216,7 @@
     bool haveBlockingWheelEventHandlers = m_inspectedFrames->root()->chromeClient().eventListenerProperties(WebEventListenerClass::MouseWheel) == WebEventListenerProperties::Blocking;
 
     gatherGraphicsLayers(rootGraphicsLayer(), layerIdToNodeIdMap, layers, haveBlockingWheelEventHandlers, scrollingLayerId);
-    return layers.release();
+    return layers;
 }
 
 void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(PaintLayer* root, LayerIdToNodeIdMap& layerIdToNodeIdMap)
@@ -430,7 +430,7 @@
         OwnPtr<Array<double>> outRow = Array<double>::create();
         for (size_t j = 0; j < row.size(); ++j)
             outRow->addItem(row[j]);
-        (*outTimings)->addItem(outRow.release());
+        (*outTimings)->addItem(std::move(outRow));
     }
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index 91f8de6..ca889d4 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -167,7 +167,7 @@
     if (DOMImplementation::isXMLMIMEType(mimeType)) {
         OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
         decoder->useLenientXMLDecoding();
-        return decoder.release();
+        return decoder;
     }
     if (equalIgnoringCase(mimeType, "text/html"))
         return TextResourceDecoder::create("text/html", "UTF-8");
@@ -397,7 +397,7 @@
     if (!scripts) {
         OwnPtr<protocol::DictionaryValue> newScripts = protocol::DictionaryValue::create();
         scripts = newScripts.get();
-        m_state->setObject(PageAgentState::pageAgentScriptsToEvaluateOnLoad, newScripts.release());
+        m_state->setObject(PageAgentState::pageAgentScriptsToEvaluateOnLoad, std::move(newScripts));
     }
     // Assure we don't override existing ids -- m_lastScriptIdentifier could get out of sync WRT actual
     // scripts once we restored the scripts from the cookie during navigation.
@@ -540,7 +540,7 @@
 
     OwnPtr<protocol::Array<protocol::Debugger::SearchMatch>> results;
     results = V8ContentSearchUtil::searchInTextByLines(m_v8Session, content, query, caseSensitive, isRegex);
-    callback->sendSuccess(results.release());
+    callback->sendSuccess(std::move(results));
 }
 
 void InspectorPageAgent::searchInResource(ErrorString*, const String& frameId, const String& url, const String& query, const Maybe<bool>& optionalCaseSensitive, const Maybe<bool>& optionalIsRegex, PassOwnPtr<SearchInResourceCallback> callback)
@@ -706,7 +706,7 @@
         frameObject->setName(name);
     }
 
-    return frameObject.release();
+    return frameObject;
 }
 
 PassOwnPtr<protocol::Page::FrameResourceTree> InspectorPageAgent::buildObjectForFrameTree(LocalFrame* frame)
@@ -724,7 +724,7 @@
             resourceObject->setCanceled(true);
         else if (cachedResource->getStatus() == Resource::LoadError)
             resourceObject->setFailed(true);
-        subresources->addItem(resourceObject.release());
+        subresources->addItem(std::move(resourceObject));
     }
 
     HeapVector<Member<Document>> allImports = InspectorPageAgent::importsForFrame(frame);
@@ -733,12 +733,12 @@
             .setUrl(urlWithoutFragment(import->url()).getString())
             .setType(resourceTypeJson(InspectorPageAgent::DocumentResource))
             .setMimeType(import->suggestedMIMEType()).build();
-        subresources->addItem(resourceObject.release());
+        subresources->addItem(std::move(resourceObject));
     }
 
     OwnPtr<protocol::Page::FrameResourceTree> result = protocol::Page::FrameResourceTree::create()
-        .setFrame(frameObject.release())
-        .setResources(subresources.release()).build();
+        .setFrame(std::move(frameObject))
+        .setResources(std::move(subresources)).build();
 
     OwnPtr<protocol::Array<protocol::Page::FrameResourceTree>> childrenArray;
     for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
@@ -748,8 +748,8 @@
             childrenArray = protocol::Array<protocol::Page::FrameResourceTree>::create();
         childrenArray->addItem(buildObjectForFrameTree(toLocalFrame(child)));
     }
-    result->setChildFrames(childrenArray.release());
-    return result.release();
+    result->setChildFrames(std::move(childrenArray));
+    return result;
 }
 
 void InspectorPageAgent::startScreencast(ErrorString*, const Maybe<String>& format, const Maybe<int>& quality, const Maybe<int>& maxWidth, const Maybe<int>& maxHeight, const Maybe<int>& everyNthFrame)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
index 2c17fd9a..7a9344d 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
@@ -296,7 +296,7 @@
         request.httpBody()->flatten(bytes);
         requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data(), bytes.size()));
     }
-    return requestObject.release();
+    return requestObject;
 }
 
 static PassOwnPtr<protocol::Network::Response> buildObjectForResourceResponse(const ResourceResponse& response, Resource* cachedResource = nullptr, bool* isEmpty = nullptr)
@@ -418,14 +418,14 @@
             .setKeyExchange(responseSecurityDetails->keyExchange)
             .setCipher(responseSecurityDetails->cipher)
             .setCertificateId(responseSecurityDetails->certID).build();
-        securityDetails->setCertificateValidationDetails(certificateValidationDetails.release());
+        securityDetails->setCertificateValidationDetails(std::move(certificateValidationDetails));
         if (responseSecurityDetails->mac.length() > 0)
             securityDetails->setMac(responseSecurityDetails->mac);
 
-        responseObject->setSecurityDetails(securityDetails.release());
+        responseObject->setSecurityDetails(std::move(securityDetails));
     }
 
-    return responseObject.release();
+    return responseObject;
 }
 
 InspectorResourceAgent::~InspectorResourceAgent()
@@ -501,7 +501,7 @@
     requestInfo->setMixedContentType(mixedContentTypeForContextType(MixedContentChecker::contextTypeForInspector(frame, request)));
 
     String resourceType = InspectorPageAgent::resourceTypeJson(type);
-    frontend()->requestWillBeSent(requestId, frameId, loaderId, urlWithoutFragment(loader->url()).getString(), requestInfo.release(), monotonicallyIncreasingTime(), currentTime(), initiatorObject.release(), buildObjectForResourceResponse(redirectResponse), resourceType);
+    frontend()->requestWillBeSent(requestId, frameId, loaderId, urlWithoutFragment(loader->url()).getString(), std::move(requestInfo), monotonicallyIncreasingTime(), currentTime(), std::move(initiatorObject), buildObjectForResourceResponse(redirectResponse), resourceType);
     if (m_pendingXHRReplayData && !m_pendingXHRReplayData->async())
         frontend()->flush();
 }
@@ -575,7 +575,7 @@
     m_resourcesData->setResourceType(requestId, type);
 
     if (resourceResponse && !resourceIsEmpty)
-        frontend()->responseReceived(requestId, frameId, loaderId, monotonicallyIncreasingTime(), InspectorPageAgent::resourceTypeJson(type), resourceResponse.release());
+        frontend()->responseReceived(requestId, frameId, loaderId, monotonicallyIncreasingTime(), InspectorPageAgent::resourceTypeJson(type), std::move(resourceResponse));
     // If we revalidated the resource and got Not modified, send content length following didReceiveResponse
     // as there will be no calls to didReceiveData from the network stack.
     if (isNotModified && cachedResource && cachedResource->encodedSize())
@@ -823,7 +823,7 @@
         OwnPtr<protocol::Network::Initiator> initiatorObject = protocol::Network::Initiator::create()
             .setType(protocol::Network::Initiator::TypeEnum::Script).build();
         initiatorObject->setStack(stackTrace->buildInspectorObject());
-        return initiatorObject.release();
+        return initiatorObject;
     }
 
     while (document && !document->scriptableDocumentParser())
@@ -836,7 +836,7 @@
             initiatorObject->setLineNumber(initiatorInfo.position.m_line.oneBasedInt());
         else
             initiatorObject->setLineNumber(document->scriptableDocumentParser()->lineNumber().oneBasedInt());
-        return initiatorObject.release();
+        return initiatorObject;
     }
 
     if (m_isRecalculatingStyle && m_styleRecalculationInitiator)
@@ -856,7 +856,7 @@
     ASSERT(request);
     OwnPtr<protocol::Network::WebSocketRequest> requestObject = protocol::Network::WebSocketRequest::create()
         .setHeaders(buildObjectForHeaders(request->headerFields())).build();
-    frontend()->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), currentTime(), requestObject.release());
+    frontend()->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), currentTime(), std::move(requestObject));
 }
 
 void InspectorResourceAgent::didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const WebSocketHandshakeRequest* request, const WebSocketHandshakeResponse* response)
@@ -874,7 +874,7 @@
         if (!request->headersText().isEmpty())
             responseObject->setRequestHeadersText(request->headersText());
     }
-    frontend()->webSocketHandshakeResponseReceived(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), responseObject.release());
+    frontend()->webSocketHandshakeResponseReceived(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), std::move(responseObject));
 }
 
 void InspectorResourceAgent::didCloseWebSocket(Document*, unsigned long identifier)
@@ -888,7 +888,7 @@
         .setOpcode(opCode)
         .setMask(masked)
         .setPayloadData(String::fromUTF8WithLatin1Fallback(payload, payloadLength)).build();
-    frontend()->webSocketFrameReceived(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), frameObject.release());
+    frontend()->webSocketFrameReceived(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), std::move(frameObject));
 }
 
 void InspectorResourceAgent::didSendWebSocketFrame(unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength)
@@ -897,7 +897,7 @@
         .setOpcode(opCode)
         .setMask(masked)
         .setPayloadData(String::fromUTF8WithLatin1Fallback(payload, payloadLength)).build();
-    frontend()->webSocketFrameSent(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), frameObject.release());
+    frontend()->webSocketFrameSent(IdentifiersFactory::requestId(identifier), monotonicallyIncreasingTime(), std::move(frameObject));
 }
 
 void InspectorResourceAgent::didReceiveWebSocketFrameError(unsigned long identifier, const String& errorMessage)
@@ -972,7 +972,7 @@
 
     // XHR with ResponseTypeBlob should be returned as blob.
     if (resourceData->xhrReplayData() && canGetResponseBodyBlob(requestId)) {
-        getResponseBodyBlob(requestId, callback.release());
+        getResponseBodyBlob(requestId, std::move(callback));
         return;
     }
 
@@ -1004,7 +1004,7 @@
     }
 
     if (canGetResponseBodyBlob(requestId)) {
-        getResponseBodyBlob(requestId, callback.release());
+        getResponseBodyBlob(requestId, std::move(callback));
         return;
     }
 
@@ -1017,7 +1017,7 @@
     if (!blockedURLs) {
         OwnPtr<protocol::DictionaryValue> newList = protocol::DictionaryValue::create();
         blockedURLs = newList.get();
-        m_state->setObject(ResourceAgentState::blockedURLs, newList.release());
+        m_state->setObject(ResourceAgentState::blockedURLs, std::move(newList));
     }
     blockedURLs->setBoolean(url, true);
 }
@@ -1107,7 +1107,7 @@
 void InspectorResourceAgent::frameScheduledNavigation(LocalFrame* frame, double)
 {
     OwnPtr<protocol::Network::Initiator> initiator = buildInitiatorObject(frame->document(), FetchInitiatorInfo());
-    m_frameNavigationInitiatorMap.set(IdentifiersFactory::frameId(frame), initiator.release());
+    m_frameNavigationInitiatorMap.set(IdentifiersFactory::frameId(frame), std::move(initiator));
 }
 
 void InspectorResourceAgent::frameClearedScheduledNavigation(LocalFrame* frame)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorSession.cpp b/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
index bfde487..ab98657 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
@@ -50,7 +50,7 @@
     if (restore) {
         OwnPtr<protocol::Value> state = protocol::parseJSON(*savedState);
         if (state)
-            m_state = protocol::DictionaryValue::cast(state.release());
+            m_state = protocol::DictionaryValue::cast(std::move(state));
         if (!m_state)
             m_state = protocol::DictionaryValue::create();
     } else {
@@ -138,7 +138,7 @@
     ASSERT(isInstrumenting());
     OwnPtr<protocol::DictionaryValue> directive = protocol::DictionaryValue::create();
     directive->setString("directiveText", directiveText);
-    m_v8Session->breakProgramOnException(protocol::Debugger::Paused::ReasonEnum::CSPViolation, directive.release());
+    m_v8Session->breakProgramOnException(protocol::Debugger::Paused::ReasonEnum::CSPViolation, std::move(directive));
 }
 
 void InspectorSession::asyncTaskScheduled(const String& taskName, void* task)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
index c307f18..593ff3e 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
@@ -687,7 +687,7 @@
         .setStartColumn(start.m_column.zeroBasedInt())
         .setEndLine(end.m_line.zeroBasedInt())
         .setEndColumn(end.m_column.zeroBasedInt()).build();
-    return result.release();
+    return result;
 }
 
 InspectorStyle* InspectorStyle::create(CSSStyleDeclaration* style, CSSRuleSourceData* sourceData, InspectorStyleSheetBase* parentStyleSheet)
@@ -718,7 +718,7 @@
         }
     }
 
-    return result.release();
+    return result;
 }
 
 PassOwnPtr<protocol::Array<protocol::CSS::CSSComputedStyleProperty>> InspectorStyle::buildArrayForComputedStyle()
@@ -731,10 +731,10 @@
         OwnPtr<protocol::CSS::CSSComputedStyleProperty> entry = protocol::CSS::CSSComputedStyleProperty::create()
             .setName(property.name)
             .setValue(property.value).build();
-        result->addItem(entry.release());
+        result->addItem(std::move(entry));
     }
 
-    return result.release();
+    return result;
 }
 
 bool InspectorStyle::styleText(String* result)
@@ -828,17 +828,17 @@
                         .setValue(shorthandValue(shorthand)).build();
                     if (!m_style->getPropertyPriority(name).isEmpty())
                         entry->setImportant(true);
-                    shorthandEntries->addItem(entry.release());
+                    shorthandEntries->addItem(std::move(entry));
                 }
             }
         }
-        propertiesObject->addItem(property.release());
+        propertiesObject->addItem(std::move(property));
     }
 
     OwnPtr<protocol::CSS::CSSStyle> result = protocol::CSS::CSSStyle::create()
-        .setCssProperties(propertiesObject.release())
-        .setShorthandEntries(shorthandEntries.release()).build();
-    return result.release();
+        .setCssProperties(std::move(propertiesObject))
+        .setShorthandEntries(std::move(shorthandEntries)).build();
+    return result;
 }
 
 String InspectorStyle::shorthandValue(const String& shorthandProperty)
@@ -1339,7 +1339,7 @@
     String sourceMapURLValue = sourceMapURL();
     if (!sourceMapURLValue.isEmpty())
         result->setSourceMapURL(sourceMapURLValue);
-    return result.release();
+    return result;
 }
 
 PassOwnPtr<protocol::Array<protocol::CSS::Value>> InspectorStyleSheet::selectorsFromSource(CSSRuleSourceData* sourceData, const String& sheetText)
@@ -1360,9 +1360,9 @@
         OwnPtr<protocol::CSS::Value> simpleSelector = protocol::CSS::Value::create()
             .setText(selector.stripWhiteSpace()).build();
         simpleSelector->setRange(buildSourceRangeObject(range));
-        result->addItem(simpleSelector.release());
+        result->addItem(std::move(simpleSelector));
     }
-    return result.release();
+    return result;
 }
 
 PassOwnPtr<protocol::CSS::SelectorList> InspectorStyleSheet::buildObjectForSelectorList(CSSStyleRule* rule)
@@ -1382,7 +1382,7 @@
             selectors->addItem(protocol::CSS::Value::create().setText(selector->selectorText()).build());
     }
     return protocol::CSS::SelectorList::create()
-        .setSelectors(selectors.release())
+        .setSelectors(std::move(selectors))
         .setText(selectorText).build();
 }
 
@@ -1407,7 +1407,7 @@
             result->setStyleSheetId(id());
     }
 
-    return result.release();
+    return result;
 }
 
 PassOwnPtr<protocol::CSS::CSSKeyframeRule> InspectorStyleSheet::buildObjectForKeyframeRule(CSSKeyframeRule* keyframeRule)
@@ -1422,12 +1422,12 @@
         keyText->setRange(buildSourceRangeObject(sourceData->ruleHeaderRange));
     OwnPtr<protocol::CSS::CSSKeyframeRule> result = protocol::CSS::CSSKeyframeRule::create()
         // TODO(samli): keyText() normalises 'from' and 'to' keyword values.
-        .setKeyText(keyText.release())
+        .setKeyText(std::move(keyText))
         .setOrigin(m_origin)
         .setStyle(buildObjectForStyle(keyframeRule->style())).build();
     if (canBind(m_origin) && !id().isEmpty())
         result->setStyleSheetId(id());
-    return result.release();
+    return result;
 }
 
 bool InspectorStyleSheet::getText(String* result)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
index 295c993..1bb3cd0 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -176,7 +176,7 @@
     value->setString("invalidatedSelectorId", invalidatedSelector);
     if (RefPtr<ScriptCallStack> stackTrace = ScriptCallStack::capture(1))
         stackTrace->toTracedValue(value.get(), "stackTrace");
-    return value.release();
+    return value;
 }
 } // namespace InspectorScheduleStyleInvalidationTrackingEvent
 
@@ -203,28 +203,28 @@
 {
     OwnPtr<TracedValue> value = fillCommonPart(element, invalidationSet, Id);
     value->setString("changedId", id);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorScheduleStyleInvalidationTrackingEvent::classChange(Element& element, const InvalidationSet& invalidationSet, const AtomicString& className)
 {
     OwnPtr<TracedValue> value = fillCommonPart(element, invalidationSet, Class);
     value->setString("changedClass", className);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorScheduleStyleInvalidationTrackingEvent::attributeChange(Element& element, const InvalidationSet& invalidationSet, const QualifiedName& attributeName)
 {
     OwnPtr<TracedValue> value = fillCommonPart(element, invalidationSet, Attribute);
     value->setString("changedAttribute", attributeName.toString());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorScheduleStyleInvalidationTrackingEvent::pseudoChange(Element& element, const InvalidationSet& invalidationSet, CSSSelector::PseudoType pseudoType)
 {
     OwnPtr<TracedValue> value = fillCommonPart(element, invalidationSet, Attribute);
     value->setString("changedPseudo", pseudoTypeToString(pseudoType));
-    return value.release();
+    return value;
 }
 
 String descendantInvalidationSetToIdString(const InvalidationSet& set)
@@ -247,7 +247,7 @@
     value->setString("frame", toHexString(element.document().frame()));
     setNodeInfo(value.get(), &element, "nodeId", "nodeName");
     value->setString("reason", reason);
-    return value.release();
+    return value;
 }
 } // namespace InspectorStyleInvalidatorInvalidateEvent
 
@@ -263,7 +263,7 @@
     invalidationSet.toTracedValue(value.get());
     value->endArray();
     value->setString("selectorPart", selectorPart);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorStyleInvalidatorInvalidateEvent::invalidationList(Element& element, const Vector<RefPtr<InvalidationSet>>& invalidationList)
@@ -273,7 +273,7 @@
     for (const auto& invalidationSet : invalidationList)
         invalidationSet->toTracedValue(value.get());
     value->endArray();
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorStyleRecalcInvalidationTrackingEvent::data(Node* node, const StyleChangeReasonForTracing& reason)
@@ -287,7 +287,7 @@
     value->setString("extraData", reason.getExtraData());
     if (RefPtr<ScriptCallStack> stackTrace = ScriptCallStack::capture(1))
         stackTrace->toTracedValue(value.get(), "stackTrace");
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorLayoutEvent::beginData(FrameView* frameView)
@@ -304,7 +304,7 @@
     value->setBoolean("partialLayout", isPartial);
     value->setString("frame", toHexString(&frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 static void createQuad(TracedValue* value, const char* name, const FloatQuad& quad)
@@ -344,7 +344,7 @@
     } else {
         ASSERT_NOT_REACHED();
     }
-    return value.release();
+    return value;
 }
 
 namespace LayoutInvalidationReason {
@@ -391,7 +391,7 @@
     value->setString("reason", reason);
     if (RefPtr<ScriptCallStack> stackTrace = ScriptCallStack::capture(1))
         stackTrace->toTracedValue(value.get(), "stackTrace");
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorPaintInvalidationTrackingEvent::data(const LayoutObject* layoutObject, const LayoutObject& paintContainer)
@@ -401,7 +401,7 @@
     value->setString("frame", toHexString(layoutObject->frame()));
     setGeneratingNodeInfo(value.get(), &paintContainer, "paintId");
     setGeneratingNodeInfo(value.get(), layoutObject, "nodeId", "nodeName");
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorScrollInvalidationTrackingEvent::data(const LayoutObject& layoutObject)
@@ -414,7 +414,7 @@
     setGeneratingNodeInfo(value.get(), &layoutObject, "nodeId", "nodeName");
     if (RefPtr<ScriptCallStack> stackTrace = ScriptCallStack::capture(1))
         stackTrace->toTracedValue(value.get(), "stackTrace");
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorChangeResourcePriorityEvent::data(unsigned long identifier, const ResourceLoadPriority& loadPriority)
@@ -424,7 +424,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("requestId", requestId);
     value->setString("priority", resourcePriorityString(loadPriority));
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorSendRequestEvent::data(unsigned long identifier, LocalFrame* frame, const ResourceRequest& request)
@@ -440,7 +440,7 @@
     if (priority)
         value->setString("priority", priority);
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorReceiveResponseEvent::data(unsigned long identifier, LocalFrame* frame, const ResourceResponse& response)
@@ -452,7 +452,7 @@
     value->setString("frame", toHexString(frame));
     value->setInteger("statusCode", response.httpStatusCode());
     value->setString("mimeType", response.mimeType().getString().isolatedCopy());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorReceiveDataEvent::data(unsigned long identifier, LocalFrame* frame, int encodedDataLength)
@@ -463,7 +463,7 @@
     value->setString("requestId", requestId);
     value->setString("frame", toHexString(frame));
     value->setInteger("encodedDataLength", encodedDataLength);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorResourceFinishEvent::data(unsigned long identifier, double finishTime, bool didFail)
@@ -475,7 +475,7 @@
     value->setBoolean("didFail", didFail);
     if (finishTime)
         value->setDouble("networkTime", finishTime);
-    return value.release();
+    return value;
 }
 
 static LocalFrame* frameForExecutionContext(ExecutionContext* context)
@@ -492,8 +492,7 @@
     value->setInteger("timerId", timerId);
     if (LocalFrame* frame = frameForExecutionContext(context))
         value->setString("frame", toHexString(frame));
-    setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorTimerInstallEvent::data(ExecutionContext* context, int timerId, int timeout, bool singleShot)
@@ -501,12 +500,15 @@
     OwnPtr<TracedValue> value = genericTimerData(context, timerId);
     value->setInteger("timeout", timeout);
     value->setBoolean("singleShot", singleShot);
-    return value.release();
+    setCallStack(value.get());
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorTimerRemoveEvent::data(ExecutionContext* context, int timerId)
 {
-    return genericTimerData(context, timerId);
+    OwnPtr<TracedValue> value = genericTimerData(context, timerId);
+    setCallStack(value.get());
+    return value.release();
 }
 
 PassOwnPtr<TracedValue> InspectorTimerFireEvent::data(ExecutionContext* context, int timerId)
@@ -523,7 +525,7 @@
     else if (context->isWorkerGlobalScope())
         value->setString("worker", toHexString(toWorkerGlobalScope(context)));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> genericIdleCallbackEvent(ExecutionContext* context, int id)
@@ -533,14 +535,14 @@
     if (LocalFrame* frame = frameForExecutionContext(context))
         value->setString("frame", toHexString(frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorIdleCallbackRequestEvent::data(ExecutionContext* context, int id, double timeout)
 {
     OwnPtr<TracedValue> value = genericIdleCallbackEvent(context, id);
     value->setInteger("timeout", timeout);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorIdleCallbackCancelEvent::data(ExecutionContext* context, int id)
@@ -553,7 +555,7 @@
     OwnPtr<TracedValue> value = genericIdleCallbackEvent(context, id);
     value->setDouble("allottedMilliseconds", allottedMilliseconds);
     value->setBoolean("timedOut", timedOut);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorParseHtmlEvent::beginData(Document* document, unsigned startLine)
@@ -563,21 +565,21 @@
     value->setString("frame", toHexString(document->frame()));
     value->setString("url", document->url().getString());
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorParseHtmlEvent::endData(unsigned endLine)
 {
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setInteger("endLine", endLine);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorParseAuthorStyleSheetEvent::data(const CSSStyleSheetResource* cachedStyleSheet)
 {
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("styleSheetUrl", cachedStyleSheet->url().getString());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorXhrReadyStateChangeEvent::data(ExecutionContext* context, XMLHttpRequest* request)
@@ -588,7 +590,7 @@
     if (LocalFrame* frame = frameForExecutionContext(context))
         value->setString("frame", toHexString(frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorXhrLoadEvent::data(ExecutionContext* context, XMLHttpRequest* request)
@@ -598,7 +600,7 @@
     if (LocalFrame* frame = frameForExecutionContext(context))
         value->setString("frame", toHexString(frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 static void localToPageQuad(const LayoutObject& layoutObject, const LayoutRect& rect, FloatQuad* quad)
@@ -626,7 +628,7 @@
     value->setString("frame", toHexString(paintInvalidationContainer.frame()));
     setGeneratingNodeInfo(value.get(), &paintInvalidationContainer, "paintId");
     value->setString("reason", reason);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorPaintEvent::data(LayoutObject* layoutObject, const LayoutRect& clipRect, const GraphicsLayer* graphicsLayer)
@@ -640,7 +642,7 @@
     int graphicsLayerId = graphicsLayer ? graphicsLayer->platformLayer()->id() : 0;
     value->setInteger("layerId", graphicsLayerId);
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> frameEventData(LocalFrame* frame)
@@ -650,7 +652,7 @@
     bool isMainFrame = frame && frame->isMainFrame();
     value->setBoolean("isMainFrame", isMainFrame);
     value->setString("page", toHexString(frame));
-    return value.release();
+    return value;
 }
 
 
@@ -669,14 +671,14 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("frame", toHexString(layoutObject->frame()));
     setGeneratingNodeInfo(value.get(), layoutObject, "nodeId");
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorUpdateLayerTreeEvent::data(LocalFrame* frame)
 {
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("frame", toHexString(frame));
-    return value.release();
+    return value;
 }
 
 namespace {
@@ -686,7 +688,7 @@
     value->setString("url", url);
     value->setInteger("lineNumber", textPosition.m_line.oneBasedInt());
     value->setInteger("columnNumber", textPosition.m_column.oneBasedInt());
-    return value.release();
+    return value;
 }
 }
 
@@ -695,7 +697,7 @@
     OwnPtr<TracedValue> value = fillLocation(url, textPosition);
     value->setString("frame", toHexString(frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorParseScriptEvent::data(unsigned long identifier, const String& url)
@@ -704,7 +706,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("requestId", requestId);
     value->setString("url", url);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorCompileScriptEvent::data(const String& url, const TextPosition& textPosition)
@@ -719,7 +721,7 @@
         value->setString("frame", toHexString(frame));
 
     if (function.IsEmpty())
-        return value.release();
+        return value;
 
     v8::Local<v8::Function> originalFunction = getBoundFunction(function);
     v8::ScriptOrigin origin = originalFunction->GetScriptOrigin();
@@ -739,7 +741,7 @@
     value->setString("scriptId", String::number(scriptId));
     value->setString("scriptName", scriptName);
     value->setInteger("scriptLine", lineNumber);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorPaintImageEvent::data(const LayoutImage& layoutImage)
@@ -748,7 +750,7 @@
     setGeneratingNodeInfo(value.get(), &layoutImage, "nodeId");
     if (const ImageResource* resource = layoutImage.cachedImage())
         value->setString("url", resource->url().getString());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorPaintImageEvent::data(const LayoutObject& owningLayoutObject, const StyleImage& styleImage)
@@ -757,7 +759,7 @@
     setGeneratingNodeInfo(value.get(), &owningLayoutObject, "nodeId");
     if (const ImageResource* resource = styleImage.cachedImage())
         value->setString("url", resource->url().getString());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorPaintImageEvent::data(const LayoutObject* owningLayoutObject, const ImageResource& imageResource)
@@ -765,7 +767,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     setGeneratingNodeInfo(value.get(), owningLayoutObject, "nodeId");
     value->setString("url", imageResource.url().getString());
-    return value.release();
+    return value;
 }
 
 static size_t usedHeapSize()
@@ -784,7 +786,7 @@
         value->setInteger("jsEventListeners", InstanceCounters::counterValue(InstanceCounters::JSEventListenerCounter));
     }
     value->setDouble("jsHeapSizeUsed", static_cast<double>(usedHeapSize()));
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorInvalidateLayoutEvent::data(LocalFrame* frame)
@@ -792,7 +794,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("frame", toHexString(frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorRecalculateStylesEvent::data(LocalFrame* frame)
@@ -800,7 +802,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("frame", toHexString(frame));
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorEventDispatchEvent::data(const Event& event)
@@ -808,7 +810,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("type", event.type());
     setCallStack(value.get());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorTimeStampEvent::data(ExecutionContext* context, const String& message)
@@ -817,7 +819,7 @@
     value->setString("message", message);
     if (LocalFrame* frame = frameForExecutionContext(context))
         value->setString("frame", toHexString(frame));
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorTracingSessionIdForWorkerEvent::data(const String& sessionId, const String& workerId, WorkerThread* workerThread)
@@ -826,7 +828,7 @@
     value->setString("sessionId", sessionId);
     value->setString("workerId", workerId);
     value->setDouble("workerThreadId", workerThread->platformThreadId());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorTracingStartedInFrame::data(const String& sessionId, LocalFrame* frame)
@@ -834,7 +836,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("sessionId", sessionId);
     value->setString("page", toHexString(frame));
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorSetLayerTreeId::data(const String& sessionId, int layerTreeId)
@@ -842,7 +844,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("sessionId", sessionId);
     value->setInteger("layerTreeId", layerTreeId);
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorAnimationEvent::data(const Animation& animation)
@@ -857,14 +859,14 @@
                 setNodeInfo(value.get(), target, "nodeId", "nodeName");
         }
     }
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorAnimationStateEvent::data(const Animation& animation)
 {
     OwnPtr<TracedValue> value = TracedValue::create();
     value->setString("state", animation.playState());
-    return value.release();
+    return value;
 }
 
 PassOwnPtr<TracedValue> InspectorHitTestEvent::endData(const HitTestRequest& request, const HitTestLocation& location, const HitTestResult& result)
@@ -884,7 +886,7 @@
         value->setBoolean("listBased", true);
     else if (Node* node = result.innerNode())
         setNodeInfo(value.get(), node, "nodeId", "nodeName");
-    return value.release();
+    return value;
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/inspector/LayoutEditor.cpp b/third_party/WebKit/Source/core/inspector/LayoutEditor.cpp
index 3b1a748b..1fa6881 100644
--- a/third_party/WebKit/Source/core/inspector/LayoutEditor.cpp
+++ b/third_party/WebKit/Source/core/inspector/LayoutEditor.cpp
@@ -33,7 +33,7 @@
     object->setString("type", type);
     object->setString("propertyName", propertyName);
     object->setObject("propertyValue", std::move(valueDescription));
-    return object.release();
+    return object;
 }
 
 PassOwnPtr<protocol::DictionaryValue> pointToJSON(FloatPoint point)
@@ -41,7 +41,7 @@
     OwnPtr<protocol::DictionaryValue> object = protocol::DictionaryValue::create();
     object->setNumber("x", point.x());
     object->setNumber("y", point.y());
-    return object.release();
+    return object;
 }
 
 PassOwnPtr<protocol::DictionaryValue> quadToJSON(FloatQuad& quad)
@@ -51,7 +51,7 @@
     object->setObject("p2", pointToJSON(quad.p2()));
     object->setObject("p3", pointToJSON(quad.p3()));
     object->setObject("p4", pointToJSON(quad.p4()));
-    return object.release();
+    return object;
 }
 
 bool isMutableUnitType(CSSPrimitiveValue::UnitType unitType)
@@ -178,7 +178,7 @@
     appendAnchorFor(anchors.get(), "margin", "margin-bottom");
     appendAnchorFor(anchors.get(), "margin", "margin-left");
 
-    object->setArray("anchors", anchors.release());
+    object->setArray("anchors", std::move(anchors));
 
     FloatQuad content, padding, border, margin;
     InspectorHighlight::buildNodeQuads(m_element.get(), &content, &padding, &border, &margin);
@@ -186,7 +186,7 @@
     object->setObject("paddingQuad", quadToJSON(padding));
     object->setObject("marginQuad", quadToJSON(margin));
     object->setObject("borderQuad", quadToJSON(border));
-    evaluateInOverlay("showLayoutEditor", object.release());
+    evaluateInOverlay("showLayoutEditor", std::move(object));
     editableSelectorUpdated(false);
 }
 
@@ -271,14 +271,14 @@
         m_growsInside.set(propertyName, growInside(propertyName, cssValue));
 
     object->setBoolean("growInside", m_growsInside.get(propertyName));
-    return object.release();
+    return object;
 }
 
 void LayoutEditor::appendAnchorFor(protocol::ListValue* anchors, const String& type, const String& propertyName)
 {
     OwnPtr<protocol::DictionaryValue> description = createValueDescription(propertyName);
     if (description)
-        anchors->pushValue(createAnchor(type, propertyName, description.release()));
+        anchors->pushValue(createAnchor(type, propertyName, std::move(description)));
 }
 
 void LayoutEditor::overlayStartedPropertyChange(const String& anchorName)
@@ -375,7 +375,7 @@
 
     Document* ownerDocument = m_element->ownerDocument();
     if (!ownerDocument->isActive() || !rule)
-        return object.release();
+        return object;
 
     Vector<String> medias;
     buildMediaListChain(rule, medias);
@@ -383,13 +383,13 @@
     for (size_t i = 0; i < medias.size(); ++i)
         mediaListValue->pushValue(protocol::StringValue::create(medias[i]));
 
-    object->setArray("medias", mediaListValue.release());
+    object->setArray("medias", std::move(mediaListValue));
 
     TrackExceptionState exceptionState;
     StaticElementList* elements = ownerDocument->querySelectorAll(AtomicString(currentSelectorText), exceptionState);
 
     if (!elements || exceptionState.hadException())
-        return object.release();
+        return object;
 
     OwnPtr<protocol::ListValue> highlights = protocol::ListValue::create();
     InspectorHighlightConfig config = affectedNodesHighlightConfig();
@@ -402,8 +402,8 @@
         highlights->pushValue(highlight.asProtocolValue());
     }
 
-    object->setArray("nodes", highlights.release());
-    return object.release();
+    object->setArray("nodes", std::move(highlights));
+    return object;
 }
 
 bool LayoutEditor::setCSSPropertyValueInCurrentRule(const String& value)
diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
index 9c474c97..b564caa1 100644
--- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
+++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
@@ -190,7 +190,7 @@
         if (mimeType.isEmpty())
             mimeType = AtomicString("text/plain");
         blobData->setContentType(mimeType);
-        resourceData->setDownloadedFileBlob(BlobDataHandle::create(blobData.release(), -1));
+        resourceData->setDownloadedFileBlob(BlobDataHandle::create(std::move(blobData), -1));
     }
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
index 18e0d52e..41f05e6 100644
--- a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
@@ -162,7 +162,7 @@
 
     OwnPtr<Timer<ThreadDebugger>> timer = adoptPtr(new Timer<ThreadDebugger>(this, &ThreadDebugger::onTimer));
     Timer<ThreadDebugger>* timerPtr = timer.get();
-    m_timers.append(timer.release());
+    m_timers.append(std::move(timer));
     timerPtr->startRepeating(interval, BLINK_FROM_HERE);
 }
 
diff --git a/third_party/WebKit/Source/core/layout/FloatingObjects.cpp b/third_party/WebKit/Source/core/layout/FloatingObjects.cpp
index 85a93e7..fe47a39e 100644
--- a/third_party/WebKit/Source/core/layout/FloatingObjects.cpp
+++ b/third_party/WebKit/Source/core/layout/FloatingObjects.cpp
@@ -82,7 +82,7 @@
     newObj->setShouldPaint(!layoutObject->hasSelfPaintingLayer()); // If a layer exists, the float will paint itself. Otherwise someone else will.
     newObj->setIsDescendant(true);
 
-    return newObj.release();
+    return newObj;
 }
 
 PassOwnPtr<FloatingObject> FloatingObject::copyToNewContainer(LayoutSize offset, bool shouldPaint, bool isDescendant) const
@@ -94,7 +94,7 @@
 {
     OwnPtr<FloatingObject> cloneObject = adoptPtr(new FloatingObject(layoutObject(), getType(), m_frameRect, m_shouldPaint, m_isDescendant, false));
     cloneObject->m_isPlaced = m_isPlaced;
-    return cloneObject.release();
+    return cloneObject;
 }
 
 template <FloatingObject::Type FloatTypeValue>
@@ -388,7 +388,7 @@
     while (!m_set.isEmpty()) {
         OwnPtr<FloatingObject> floatingObject = m_set.takeFirst();
         LayoutBox* layoutObject = floatingObject->layoutObject();
-        map.add(layoutObject, floatingObject.release());
+        map.add(layoutObject, std::move(floatingObject));
     }
     clear();
 }
diff --git a/third_party/WebKit/Source/core/layout/LayoutAnalyzer.cpp b/third_party/WebKit/Source/core/layout/LayoutAnalyzer.cpp
index 93eea65..1f5b741 100644
--- a/third_party/WebKit/Source/core/layout/LayoutAnalyzer.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutAnalyzer.cpp
@@ -111,7 +111,7 @@
         if (m_counters[i] > 0)
             tracedValue->setInteger(nameForCounter(static_cast<Counter>(i)), m_counters[i]);
     }
-    return tracedValue.release();
+    return tracedValue;
 }
 
 const char* LayoutAnalyzer::nameForCounter(Counter counter) const
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 905857e..a5553e4 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -3026,7 +3026,7 @@
 
     setLogicalWidthForFloat(*newObj, logicalWidthForChild(floatBox) + marginStartForChild(floatBox) + marginEndForChild(floatBox));
 
-    return m_floatingObjects->add(newObj.release());
+    return m_floatingObjects->add(std::move(newObj));
 }
 
 void LayoutBlockFlow::removeFloatingObject(LayoutBox* floatBox)
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index efda388..b8997ea 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -212,7 +212,7 @@
                 OwnPtr<GridArea> result = adoptPtr(new GridArea(GridSpan::translatedDefiniteGridSpan(m_rowIndex, m_rowIndex + rowSpan), GridSpan::translatedDefiniteGridSpan(m_columnIndex, m_columnIndex + columnSpan)));
                 // Advance the iterator to avoid an infinite loop where we would return the same grid area over and over.
                 ++varyingTrackIndex;
-                return result.release();
+                return result;
             }
         }
         return nullptr;
@@ -640,7 +640,7 @@
         }
     }
     if (!validFlexFactorUnit)
-        return computeFlexFactorUnitSize(tracks, direction, flexFactorSum, leftOverSpace, flexibleTracksIndexes, additionalTracksToTreatAsInflexible.release());
+        return computeFlexFactorUnitSize(tracks, direction, flexFactorSum, leftOverSpace, flexibleTracksIndexes, std::move(additionalTracksToTreatAsInflexible));
     return hypotheticalFactorUnitSize;
 }
 
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index d9fa5977..d7a5137 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1187,7 +1187,7 @@
     OwnPtr<TracedValue> value = TracedValue::create();
     addJsonObjectForRect(value.get(), "rect", rect);
     value->setString("invalidation_reason", invalidationReason);
-    return value.release();
+    return value;
 }
 
 static void invalidatePaintRectangleOnWindow(const LayoutBoxModelObject& paintInvalidationContainer, const IntRect& dirtyRect)
@@ -1338,7 +1338,7 @@
     addJsonObjectForPoint(value.get(), "oldLocation", oldLocation);
     addJsonObjectForRect(value.get(), "newRect", newRect);
     addJsonObjectForPoint(value.get(), "newLocation", newLocation);
-    return value.release();
+    return value;
 }
 
 LayoutRect LayoutObject::selectionRectInViewCoordinates() const
diff --git a/third_party/WebKit/Source/core/layout/TracedLayoutObject.cpp b/third_party/WebKit/Source/core/layout/TracedLayoutObject.cpp
index 5a1b2b9..fddb6c4 100644
--- a/third_party/WebKit/Source/core/layout/TracedLayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/TracedLayoutObject.cpp
@@ -103,7 +103,7 @@
 {
     OwnPtr<TracedValue> tracedValue = TracedValue::create();
     dumpToTracedValue(view, traceGeometry, tracedValue.get());
-    return tracedValue.release();
+    return tracedValue;
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index fb6cc54..57eeda9 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -219,7 +219,7 @@
     if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode())
         graphicsLayer->setOwnerNodeId(DOMNodeIds::idForNode(owningNode));
 
-    return graphicsLayer.release();
+    return graphicsLayer;
 }
 
 void CompositedLayerMapping::createPrimaryGraphicsLayer()
diff --git a/third_party/WebKit/Source/core/layout/shapes/RasterShape.cpp b/third_party/WebKit/Source/core/layout/shapes/RasterShape.cpp
index 483c5c8..a1c420632 100644
--- a/third_party/WebKit/Source/core/layout/shapes/RasterShape.cpp
+++ b/third_party/WebKit/Source/core/layout/shapes/RasterShape.cpp
@@ -103,7 +103,7 @@
     }
 
     result->initializeBounds();
-    return result.release();
+    return result;
 }
 
 void RasterShapeIntervals::initializeBounds()
diff --git a/third_party/WebKit/Source/core/layout/shapes/Shape.cpp b/third_party/WebKit/Source/core/layout/shapes/Shape.cpp
index 176bd3e..76e973ce 100644
--- a/third_party/WebKit/Source/core/layout/shapes/Shape.cpp
+++ b/third_party/WebKit/Source/core/layout/shapes/Shape.cpp
@@ -142,7 +142,7 @@
                 floatValueForLength(values.at(i + 1), boxHeight));
             (*vertices)[i / 2] = physicalPointToLogical(vertex, logicalBoxSize.height().toFloat(), writingMode);
         }
-        shape = createPolygonShape(vertices.release(), polygon->getWindRule());
+        shape = createPolygonShape(std::move(vertices), polygon->getWindRule());
         break;
     }
 
@@ -176,16 +176,16 @@
     shape->m_writingMode = writingMode;
     shape->m_margin = margin;
 
-    return shape.release();
+    return shape;
 }
 
 PassOwnPtr<Shape> Shape::createEmptyRasterShape(WritingMode writingMode, float margin)
 {
     OwnPtr<RasterShapeIntervals> intervals = adoptPtr(new RasterShapeIntervals(0, 0));
-    OwnPtr<RasterShape> rasterShape = adoptPtr(new RasterShape(intervals.release(), IntSize()));
+    OwnPtr<RasterShape> rasterShape = adoptPtr(new RasterShape(std::move(intervals), IntSize()));
     rasterShape->m_writingMode = writingMode;
     rasterShape->m_margin = margin;
-    return rasterShape.release();
+    return std::move(rasterShape);
 }
 
 PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const LayoutRect& imageR, const LayoutRect& marginR, WritingMode writingMode, float margin)
@@ -234,10 +234,10 @@
         }
     }
 
-    OwnPtr<RasterShape> rasterShape = adoptPtr(new RasterShape(intervals.release(), marginRect.size()));
+    OwnPtr<RasterShape> rasterShape = adoptPtr(new RasterShape(std::move(intervals), marginRect.size()));
     rasterShape->m_writingMode = writingMode;
     rasterShape->m_margin = margin;
-    return rasterShape.release();
+    return std::move(rasterShape);
 }
 
 PassOwnPtr<Shape> Shape::createLayoutBoxShape(const FloatRoundedRect& roundedRect, WritingMode writingMode, float margin)
@@ -248,7 +248,7 @@
     shape->m_writingMode = writingMode;
     shape->m_margin = margin;
 
-    return shape.release();
+    return shape;
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
index 026daa4..6ce62cab 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
@@ -114,7 +114,7 @@
     patternData->transform.translate(tileBounds.x(), tileBounds.y());
     patternData->transform.preMultiply(attributes.patternTransform());
 
-    return patternData.release();
+    return patternData;
 }
 
 SVGPaintServer LayoutSVGResourcePattern::preparePaintServer(const LayoutObject& object)
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
index 309b5131..fe15b73 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
@@ -279,7 +279,7 @@
             registerPendingResource(extensions, id, element);
     }
 
-    return (!resources || !resources->hasResourceData()) ? nullptr : resources.release();
+    return (!resources || !resources->hasResourceData()) ? nullptr : std::move(resources);
 }
 
 void SVGResources::layoutIfNeeded()
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp
index 608d6484..1e120bf 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp
@@ -48,7 +48,7 @@
         return;
 
     // Put object in cache.
-    SVGResources* resources = m_cache.set(object, newResources.release()).storedValue->value.get();
+    SVGResources* resources = m_cache.set(object, std::move(newResources)).storedValue->value.get();
 
     // Run cycle-detection _afterwards_, so self-references can be caught as well.
     SVGResourcesCycleSolver solver(object, resources);
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl
index 1fe2730..a66c738 100644
--- a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl
@@ -35,5 +35,8 @@
     Exposed=DedicatedWorker,
 ] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
     [PostMessage, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
+
+    void close();
+
     attribute EventHandler onmessage;
 };
diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
index abc4aaf..f8c2a51 100644
--- a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
@@ -36,5 +36,8 @@
 ] interface SharedWorkerGlobalScope : WorkerGlobalScope {
     readonly attribute DOMString name;
     // TODO(philipj): readonly attribute ApplicationCache applicationCache;
+
+    void close();
+
     attribute EventHandler onconnect;
 };
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
index 0befce6..b711451 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -159,7 +159,8 @@
 
 void WorkerGlobalScope::close()
 {
-    // Let current script run to completion, but tell the worker micro task runner to tear down the thread after this task.
+    // Let current script run to completion, but tell the worker micro task
+    // runner to tear down the thread after this task.
     m_closing = true;
 }
 
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
index 6bf6468..6dd5e43 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
@@ -125,7 +125,11 @@
 
     WorkerInspectorController* workerInspectorController() { return m_workerInspectorController.get(); }
 
-    bool isClosing() { return m_closing; }
+    // Returns true when the WorkerGlobalScope is closing (e.g. via close()
+    // method). If this returns true, the worker is going to be shutdown after
+    // the current task execution. Workers that don't support close operation
+    // should always return false.
+    bool isClosing() const { return m_closing; }
 
     double timeOrigin() const { return m_timeOrigin; }
 
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
index 1081d5d..4554a14 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
@@ -32,7 +32,6 @@
     readonly attribute WorkerGlobalScope self;
     readonly attribute WorkerLocation location;
 
-    void close();
     // TODO(philipj): onerror should be an OnErrorEventHandler.
     attribute EventHandler onerror;
     // attribute EventHandler onlanguagechange;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesPopoverHelper.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesPopoverHelper.js
index e8839a06..18178b1 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesPopoverHelper.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesPopoverHelper.js
@@ -197,6 +197,9 @@
 
         this._originalPropertyText = this._treeElement.property.propertyText;
         this._treeElement.parentPane().setEditingStyle(true);
+        var uiLocation = WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
+        if (uiLocation)
+            WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */);
     },
 
     /**
@@ -307,6 +310,9 @@
 
         this._originalPropertyText = this._treeElement.property.propertyText;
         this._treeElement.parentPane().setEditingStyle(true);
+        var uiLocation = WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
+        if (uiLocation)
+            WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */);
     },
 
     /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
index ba06fc9e..221c2e6 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
@@ -77,8 +77,6 @@
     wasShown: function()
     {
         WebInspector.SourceFrame.prototype.wasShown.call(this);
-        if (this._diff)
-            this._diff.updateImmediately();
         this._boundWindowFocused = this._windowFocused.bind(this);
         this.element.ownerDocument.defaultView.addEventListener("focus", this._boundWindowFocused, false);
         this._checkContentUpdated();
@@ -204,6 +202,8 @@
     {
         this._isSettingContent = true;
         this.setContent(content);
+        if (this._diff)
+            this._diff.updateImmediately();
         delete this._isSettingContent;
     },
 
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
index bc35483..6656be8 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
@@ -123,7 +123,7 @@
 
 WebInspector.FlameChart.DividersBarHeight = 18;
 
-WebInspector.FlameChart.MinimalTimeWindowMs = 0.01;
+WebInspector.FlameChart.MinimalTimeWindowMs = 0.5;
 
 /**
  * @interface
diff --git a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
index 264b5c3..f56dd20 100644
--- a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
+++ b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
@@ -53,7 +53,7 @@
             // The bridge has already disappeared.
             return;
         }
-        m_bridge->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&Bridge::runTask, AllowCrossThreadAccess(m_bridge.get()), passed(std::move(task))));
+        m_bridge->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&Bridge::runTask, wrapCrossThreadPersistent(m_bridge.get()), passed(std::move(task))));
     }
 
     ~CrossThreadHolder()
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
index 8fa8758a..64930dae 100644
--- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
@@ -161,7 +161,7 @@
     FileWriter* fileWriter = FileWriter::create(getExecutionContext());
     FileWriterBaseCallback* conversionCallback = ConvertToFileWriterCallback::create(successCallback);
     OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback, errorCallback, m_context);
-    fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, callbacks.release());
+    fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, std::move(callbacks));
 }
 
 void DOMFileSystem::createFile(const FileEntry* fileEntry, BlobCallback* successCallback, ErrorCallback* errorCallback)
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
index e6dcaa4..28d6a21 100644
--- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
@@ -224,7 +224,7 @@
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(MetadataCallbacks::create(successCallback, errorCallback, m_context, this));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
-    fileSystem()->readMetadata(createFileSystemURL(entry), callbacks.release());
+    fileSystem()->readMetadata(createFileSystemURL(entry), std::move(callbacks));
 }
 
 static bool verifyAndGetDestinationPathForCopyOrMove(const EntryBase* source, EntryBase* parent, const String& newName, String& destinationPath)
@@ -272,7 +272,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, m_context, parent->filesystem(), destinationPath, source->isDirectory()));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
-    fileSystem()->move(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), callbacks.release());
+    fileSystem()->move(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), std::move(callbacks));
 }
 
 void DOMFileSystemBase::copy(const EntryBase* source, EntryBase* parent, const String& newName, EntryCallback* successCallback, ErrorCallback* errorCallback, SynchronousType synchronousType)
@@ -291,7 +291,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, m_context, parent->filesystem(), destinationPath, source->isDirectory()));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
-    fileSystem()->copy(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), callbacks.release());
+    fileSystem()->copy(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), std::move(callbacks));
 }
 
 void DOMFileSystemBase::remove(const EntryBase* entry, VoidCallback* successCallback, ErrorCallback* errorCallback, SynchronousType synchronousType)
@@ -311,7 +311,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks(VoidCallbacks::create(successCallback, errorCallback, m_context, this));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
-    fileSystem()->remove(createFileSystemURL(entry), callbacks.release());
+    fileSystem()->remove(createFileSystemURL(entry), std::move(callbacks));
 }
 
 void DOMFileSystemBase::removeRecursively(const EntryBase* entry, VoidCallback* successCallback, ErrorCallback* errorCallback, SynchronousType synchronousType)
@@ -331,7 +331,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks(VoidCallbacks::create(successCallback, errorCallback, m_context, this));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
-    fileSystem()->removeRecursively(createFileSystemURL(entry), callbacks.release());
+    fileSystem()->removeRecursively(createFileSystemURL(entry), std::move(callbacks));
 }
 
 void DOMFileSystemBase::getParent(const EntryBase* entry, EntryCallback* successCallback, ErrorCallback* errorCallback)
@@ -364,9 +364,9 @@
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
     if (flags.createFlag())
-        fileSystem()->createFile(createFileSystemURL(absolutePath), flags.exclusive(), callbacks.release());
+        fileSystem()->createFile(createFileSystemURL(absolutePath), flags.exclusive(), std::move(callbacks));
     else
-        fileSystem()->fileExists(createFileSystemURL(absolutePath), callbacks.release());
+        fileSystem()->fileExists(createFileSystemURL(absolutePath), std::move(callbacks));
 }
 
 void DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, const FileSystemFlags& flags, EntryCallback* successCallback, ErrorCallback* errorCallback, SynchronousType synchronousType)
@@ -386,9 +386,9 @@
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
     if (flags.createFlag())
-        fileSystem()->createDirectory(createFileSystemURL(absolutePath), flags.exclusive(), callbacks.release());
+        fileSystem()->createDirectory(createFileSystemURL(absolutePath), flags.exclusive(), std::move(callbacks));
     else
-        fileSystem()->directoryExists(createFileSystemURL(absolutePath), callbacks.release());
+        fileSystem()->directoryExists(createFileSystemURL(absolutePath), std::move(callbacks));
 }
 
 int DOMFileSystemBase::readDirectory(DirectoryReaderBase* reader, const String& path, EntriesCallback* successCallback, ErrorCallback* errorCallback, SynchronousType synchronousType)
@@ -403,7 +403,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntriesCallbacks::create(successCallback, errorCallback, m_context, reader, path));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
-    return fileSystem()->readDirectory(createFileSystemURL(path), callbacks.release());
+    return fileSystem()->readDirectory(createFileSystemURL(path), std::move(callbacks));
 }
 
 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId)
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp
index 5157851..c5f2012 100644
--- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp
@@ -215,7 +215,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, successCallback, errorCallback, m_context);
     callbacks->setShouldBlockUntilCompletion(true);
 
-    fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, callbacks.release());
+    fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, std::move(callbacks));
     if (errorCode != FileError::OK) {
         FileError::throwDOMException(exceptionState, errorCode);
         return 0;
diff --git a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp
index faf5dbe6..acc185d1 100644
--- a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp
@@ -63,7 +63,7 @@
     virtual ~CallbackWrapper() { }
     PassOwnPtr<AsyncFileSystemCallbacks> release()
     {
-        return m_callbacks.release();
+        return std::move(m_callbacks);
     }
 
     DEFINE_INLINE_TRACE() { }
diff --git a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
index 50fcd54..7a0841c0 100644
--- a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
@@ -79,7 +79,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(helper->getSuccessCallback(), helper->getErrorCallback(), &worker, fileSystemType);
     callbacks->setShouldBlockUntilCompletion(true);
 
-    LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, size, callbacks.release());
+    LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, size, std::move(callbacks));
     return helper->getResult(exceptionState);
 }
 
@@ -118,7 +118,7 @@
     OwnPtr<AsyncFileSystemCallbacks> callbacks = ResolveURICallbacks::create(resolveURLHelper->getSuccessCallback(), resolveURLHelper->getErrorCallback(), &worker);
     callbacks->setShouldBlockUntilCompletion(true);
 
-    LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, callbacks.release());
+    LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, std::move(callbacks));
 
     return resolveURLHelper->getResult(exceptionState);
 }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
index 3958588d..0607e46 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
@@ -131,7 +131,7 @@
         EXPECT_EQ(request->readyState(), "pending");
 
         getExecutionContext()->stopActiveDOMObjects();
-        request->onUpgradeNeeded(oldVersion, backend.release(), metadata, WebIDBDataLossNone, String());
+        request->onUpgradeNeeded(oldVersion, std::move(backend), metadata, WebIDBDataLossNone, String());
     }
 
     {
@@ -142,7 +142,7 @@
         EXPECT_EQ(request->readyState(), "pending");
 
         getExecutionContext()->stopActiveDOMObjects();
-        request->onSuccess(backend.release(), metadata);
+        request->onSuccess(std::move(backend), metadata);
     }
 }
 
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp
index 2695044..d27a3c60 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp
@@ -93,7 +93,7 @@
     OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create();
     EXPECT_CALL(*backend, close())
         .Times(1);
-    Persistent<IDBDatabase> db = IDBDatabase::create(getExecutionContext(), backend.release(), FakeIDBDatabaseCallbacks::create());
+    Persistent<IDBDatabase> db = IDBDatabase::create(getExecutionContext(), std::move(backend), FakeIDBDatabaseCallbacks::create());
 
     const int64_t transactionId = 1234;
     const HashSet<String> transactionScope = HashSet<String>();
@@ -129,7 +129,7 @@
         .Times(1);
     EXPECT_CALL(*backend, close())
         .Times(1);
-    Persistent<IDBDatabase> db = IDBDatabase::create(getExecutionContext(), backend.release(), FakeIDBDatabaseCallbacks::create());
+    Persistent<IDBDatabase> db = IDBDatabase::create(getExecutionContext(), std::move(backend), FakeIDBDatabaseCallbacks::create());
 
     const HashSet<String> transactionScope = HashSet<String>();
     Persistent<IDBTransaction> transaction = IDBTransaction::create(getScriptState(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get());
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
index f74dd647..7523d66 100644
--- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -118,7 +118,7 @@
         OwnPtr<protocol::Array<String>> databaseNames = protocol::Array<String>::create();
         for (size_t i = 0; i < databaseNamesList->length(); ++i)
             databaseNames->addItem(databaseNamesList->anonymousIndexedGetter(i));
-        m_requestCallback->sendSuccess(databaseNames.release());
+        m_requestCallback->sendSuccess(std::move(databaseNames));
     }
 
     DEFINE_INLINE_VIRTUAL_TRACE()
@@ -286,14 +286,14 @@
         const Vector<String>& stringArray = idbKeyPath.array();
         for (size_t i = 0; i < stringArray.size(); ++i)
             array->addItem(stringArray[i]);
-        keyPath->setArray(array.release());
+        keyPath->setArray(std::move(array));
         break;
     }
     default:
         ASSERT_NOT_REACHED();
     }
 
-    return keyPath.release();
+    return keyPath;
 }
 
 class DatabaseLoader final : public ExecutableWithDatabase {
@@ -324,22 +324,22 @@
                     .setKeyPath(keyPathFromIDBKeyPath(indexMetadata.keyPath))
                     .setUnique(indexMetadata.unique)
                     .setMultiEntry(indexMetadata.multiEntry).build();
-                indexes->addItem(objectStoreIndex.release());
+                indexes->addItem(std::move(objectStoreIndex));
             }
 
             OwnPtr<ObjectStore> objectStore = ObjectStore::create()
                 .setName(objectStoreMetadata.name)
                 .setKeyPath(keyPathFromIDBKeyPath(objectStoreMetadata.keyPath))
                 .setAutoIncrement(objectStoreMetadata.autoIncrement)
-                .setIndexes(indexes.release()).build();
-            objectStores->addItem(objectStore.release());
+                .setIndexes(std::move(indexes)).build();
+            objectStores->addItem(std::move(objectStore));
         }
         OwnPtr<DatabaseWithObjectStores> result = DatabaseWithObjectStores::create()
             .setName(databaseMetadata.name)
             .setVersion(databaseMetadata.version)
-            .setObjectStores(objectStores.release()).build();
+            .setObjectStores(std::move(objectStores)).build();
 
-        m_requestCallback->sendSuccess(result.release());
+        m_requestCallback->sendSuccess(std::move(result));
     }
 
     RequestCallback* getRequestCallback() override { return m_requestCallback.get(); }
@@ -479,12 +479,12 @@
             .setKey(key)
             .setPrimaryKey(primaryKey)
             .setValue(value).build();
-        m_result->addItem(dataEntry.release());
+        m_result->addItem(std::move(dataEntry));
     }
 
     void end(bool hasMore)
     {
-        m_requestCallback->sendSuccess(m_result.release(), hasMore);
+        m_requestCallback->sendSuccess(std::move(m_result), hasMore);
     }
 
     DEFINE_INLINE_VIRTUAL_TRACE()
@@ -544,7 +544,7 @@
         } else {
             idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRange.get(), WebIDBCursorDirectionNext);
         }
-        OpenCursorCallback* openCursorCallback = OpenCursorCallback::create(getScriptState(), m_requestCallback.release(), m_skipCount, m_pageSize);
+        OpenCursorCallback* openCursorCallback = OpenCursorCallback::create(getScriptState(), std::move(m_requestCallback), m_skipCount, m_pageSize);
         idbRequest->addEventListener(EventTypeNames::success, openCursorCallback, false);
     }
 
@@ -778,7 +778,7 @@
             m_requestCallback->sendFailure(String::format("Could not clear object store '%s': %d", m_objectStoreName.utf8().data(), ec));
             return;
         }
-        idbTransaction->addEventListener(EventTypeNames::complete, ClearObjectStoreListener::create(m_requestCallback.release()), false);
+        idbTransaction->addEventListener(EventTypeNames::complete, ClearObjectStoreListener::create(std::move(m_requestCallback)), false);
     }
 
     RequestCallback* getRequestCallback() override { return m_requestCallback.get(); }
diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp
index 17c81e4c..cdf1317e 100644
--- a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp
+++ b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp
@@ -56,9 +56,9 @@
 
     CanvasCaptureMediaStreamTrack* canvasTrack;
     if (givenFrameRate)
-        canvasTrack = CanvasCaptureMediaStreamTrack::create(track, &element, handler.release(), frameRate);
+        canvasTrack = CanvasCaptureMediaStreamTrack::create(track, &element, std::move(handler), frameRate);
     else
-        canvasTrack = CanvasCaptureMediaStreamTrack::create(track, &element, handler.release());
+        canvasTrack = CanvasCaptureMediaStreamTrack::create(track, &element, std::move(handler));
     // We want to capture a frame in the beginning.
     canvasTrack->requestFrame();
 
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
index 51c383c..36e56a3 100644
--- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
+++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -306,7 +306,7 @@
 
     // Cache |m_blobData->length()| before release()ng it.
     const long long blobDataLength = m_blobData->length();
-    createBlobEvent(Blob::create(BlobDataHandle::create(m_blobData.release(), blobDataLength)));
+    createBlobEvent(Blob::create(BlobDataHandle::create(std::move(m_blobData), blobDataLength)));
 }
 
 void MediaRecorder::onError(const WebString& message)
diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp b/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
index 89c16783..dec7b3c 100644
--- a/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
+++ b/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
@@ -33,7 +33,7 @@
         exceptionState.throwDOMException(NotSupportedError, "Missing platform implementation.");
         return nullptr;
     }
-    return new MediaSession(webMediaSession.release());
+    return new MediaSession(std::move(webMediaSession));
 }
 
 ScriptPromise MediaSession::activate(ScriptState* scriptState)
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
index 1b346c56..07c5d04 100644
--- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -155,7 +155,7 @@
         return 0;
     }
 
-    SourceBuffer* buffer = SourceBuffer::create(webSourceBuffer.release(), this, m_asyncEventQueue.get());
+    SourceBuffer* buffer = SourceBuffer::create(std::move(webSourceBuffer), this, m_asyncEventQueue.get());
     // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that object.
     m_sourceBuffers->add(buffer);
 
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp
index b2da5579..f16f517 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp
@@ -62,7 +62,7 @@
 
     for (size_t i = 0; i < webSourceInfos.size(); ++i)
         m_sourceInfos.append(SourceInfo::create(webSourceInfos[i]));
-    m_executionContext->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MediaStreamTrackSourcesRequestImpl::performCallback, AllowCrossThreadAccess(this)));
+    m_executionContext->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MediaStreamTrackSourcesRequestImpl::performCallback, wrapCrossThreadPersistent(this)));
 }
 
 void MediaStreamTrackSourcesRequestImpl::performCallback()
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
index feb241c..df073bc 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
@@ -51,7 +51,7 @@
         return nullptr;
     }
 
-    RTCDTMFSender* dtmfSender = new RTCDTMFSender(context, track, handler.release());
+    RTCDTMFSender* dtmfSender = new RTCDTMFSender(context, track, std::move(handler));
     dtmfSender->suspendIfNeeded();
     return dtmfSender;
 }
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
index c9f5345..208fd69 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
@@ -67,7 +67,7 @@
         exceptionState.throwDOMException(NotSupportedError, "RTCDataChannel is not supported");
         return nullptr;
     }
-    RTCDataChannel* channel = new RTCDataChannel(context, handler.release());
+    RTCDataChannel* channel = new RTCDataChannel(context, std::move(handler));
     channel->suspendIfNeeded();
 
     return channel;
diff --git a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
index 56e6720a..c2aafb1a 100644
--- a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
+++ b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
@@ -75,7 +75,7 @@
     ScriptPromise promise = resolver->promise();
 
     OwnPtr<WebNotificationShowCallbacks> callbacks = adoptPtr(new CallbackPromiseAdapter<void, void>(resolver));
-    ServiceWorkerRegistrationNotifications::from(executionContext, registration).prepareShow(data, callbacks.release());
+    ServiceWorkerRegistrationNotifications::from(executionContext, registration).prepareShow(data, std::move(callbacks));
 
     return promise;
 }
diff --git a/third_party/WebKit/Source/modules/permissions/Permissions.cpp b/third_party/WebKit/Source/modules/permissions/Permissions.cpp
index c7113590..64f5741a 100644
--- a/third_party/WebKit/Source/modules/permissions/Permissions.cpp
+++ b/third_party/WebKit/Source/modules/permissions/Permissions.cpp
@@ -194,7 +194,7 @@
 
     WebVector<WebPermissionType> internalWebPermissions = *internalPermissions;
     client->requestPermissions(internalWebPermissions, KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()),
-        new PermissionsCallback(resolver, internalPermissions.release(), callerIndexToInternalIndex.release()));
+        new PermissionsCallback(resolver, std::move(internalPermissions), std::move(callerIndexToInternalIndex)));
     return promise;
 }
 
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
index 44f81298..70c9c53 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
@@ -357,7 +357,7 @@
     case BinaryTypeBlob: {
         OwnPtr<BlobData> blobData = BlobData::create();
         blobData->appendBytes(data, length);
-        Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), length));
+        Blob* blob = Blob::create(BlobDataHandle::create(std::move(blobData), length));
         dispatchEvent(MessageEvent::create(blob));
         return;
     }
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp
index ea1d2b9..a9d211b 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp
@@ -27,7 +27,7 @@
 
     if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped())
         return;
-    m_resolver->resolve(PresentationConnection::take(m_resolver.get(), result.release(), m_request));
+    m_resolver->resolve(PresentationConnection::take(m_resolver.get(), std::move(result), m_request));
 }
 
 void PresentationConnectionCallbacks::onError(const WebPresentationError& error)
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
index 389c00e9..348e665 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
@@ -68,7 +68,7 @@
     // provided, following the specification.
 
     const long long byteLength = blobData->length();
-    return Blob::create(BlobDataHandle::create(blobData.release(), byteLength));
+    return Blob::create(BlobDataHandle::create(std::move(blobData), byteLength));
 }
 
 ScriptValue PushMessageData::json(ScriptState* scriptState, ExceptionState& exceptionState) const
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
index 91ea315..a75d8b8 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -124,11 +124,6 @@
     return m_registration;
 }
 
-void ServiceWorkerGlobalScope::close(ExceptionState& exceptionState)
-{
-    exceptionState.throwDOMException(InvalidAccessError, "Not supported.");
-}
-
 ScriptPromise ServiceWorkerGlobalScope::skipWaiting(ScriptState* scriptState)
 {
     ExecutionContext* executionContext = scriptState->getExecutionContext();
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h
index ef976a2..ac72d691 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h
@@ -69,8 +69,6 @@
 
     ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, ExceptionState&);
 
-    void close(ExceptionState&);
-
     ScriptPromise skipWaiting(ScriptState*);
 
     void setRegistration(std::unique_ptr<WebServiceWorkerRegistration::Handle>);
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
index df412a7..71ea34e 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
@@ -40,8 +40,6 @@
 
   [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
 
-  [RaisesException] void close();
-
   [CallWith=ScriptState] Promise<void> skipWaiting();
 
   attribute EventHandler onactivate;
diff --git a/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp b/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp
index db20887..0bc7237 100644
--- a/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp
@@ -53,7 +53,7 @@
         return;
 
     // The leak references to successCallback and errorCallback are picked up on notifyComplete.
-    m_thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&AsyncAudioDecoder::decode, AllowCrossThreadAccess(audioData), sampleRate, wrapCrossThreadPersistent(successCallback), wrapCrossThreadPersistent(errorCallback), wrapCrossThreadPersistent(resolver), wrapCrossThreadPersistent(context)));
+    m_thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&AsyncAudioDecoder::decode, wrapCrossThreadPersistent(audioData), sampleRate, wrapCrossThreadPersistent(successCallback), wrapCrossThreadPersistent(errorCallback), wrapCrossThreadPersistent(resolver), wrapCrossThreadPersistent(context)));
 }
 
 void AsyncAudioDecoder::decode(DOMArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResolver* resolver, AbstractAudioContext* context)
@@ -62,7 +62,7 @@
 
     // Decoding is finished, but we need to do the callbacks on the main thread.
     // The leaked reference to audioBuffer is picked up in notifyComplete.
-    Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&AsyncAudioDecoder::notifyComplete, AllowCrossThreadAccess(audioData), wrapCrossThreadPersistent(successCallback), wrapCrossThreadPersistent(errorCallback), bus.release().leakRef(), wrapCrossThreadPersistent(resolver), wrapCrossThreadPersistent(context)));
+    Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&AsyncAudioDecoder::notifyComplete, wrapCrossThreadPersistent(audioData), wrapCrossThreadPersistent(successCallback), wrapCrossThreadPersistent(errorCallback), bus.release().leakRef(), wrapCrossThreadPersistent(resolver), wrapCrossThreadPersistent(context)));
 }
 
 void AsyncAudioDecoder::notifyComplete(DOMArrayBuffer*, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback, AudioBus* audioBus, ScriptPromiseResolver* resolver, AbstractAudioContext* context)
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
index d09f4da..845c9d2a 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -177,9 +177,7 @@
                 m_maybePrintCORSMessage = false;
                 if (context()->getExecutionContext()) {
                     context()->getExecutionContext()->postTask(BLINK_FROM_HERE,
-                        createCrossThreadTask(&MediaElementAudioSourceHandler::printCORSMessage,
-                            AllowCrossThreadAccess(this),
-                            m_currentSrcString));
+                        createCrossThreadTask(&MediaElementAudioSourceHandler::printCORSMessage, PassRefPtr<MediaElementAudioSourceHandler>(this), m_currentSrcString));
                 }
             }
             outputBus->zero();
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index 29a9bce..04edef24 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -203,10 +203,7 @@
     if (context()->getExecutionContext()) {
         context()->getExecutionContext()->postTask(
             BLINK_FROM_HERE,
-            createCrossThreadTask(
-                &OfflineAudioDestinationHandler::notifySuspend,
-                this,
-                context()->currentSampleFrame()));
+            createCrossThreadTask(&OfflineAudioDestinationHandler::notifySuspend, PassRefPtr<OfflineAudioDestinationHandler>(this), context()->currentSampleFrame()));
     }
 }
 
@@ -217,7 +214,7 @@
     // The actual rendering has been completed. Notify the context.
     if (context()->getExecutionContext()) {
         context()->getExecutionContext()->postTask(BLINK_FROM_HERE,
-            createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplete, AllowCrossThreadAccess(this)));
+            createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplete, PassRefPtr<OfflineAudioDestinationHandler>(this)));
     }
 }
 
diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
index 4a1c49d..45ec9f6 100644
--- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
@@ -165,7 +165,7 @@
             // Fire the event on the main thread with the appropriate buffer
             // index.
             context()->getExecutionContext()->postTask(BLINK_FROM_HERE,
-                createCrossThreadTask(&ScriptProcessorHandler::fireProcessEvent, AllowCrossThreadAccess(this), m_doubleBufferIndex));
+                createCrossThreadTask(&ScriptProcessorHandler::fireProcessEvent, PassRefPtr<ScriptProcessorHandler>(this), m_doubleBufferIndex));
         }
 
         swapBuffers();
diff --git a/third_party/WebKit/Source/modules/webdatabase/Database.cpp b/third_party/WebKit/Source/modules/webdatabase/Database.cpp
index 395f746..61377d3 100644
--- a/third_party/WebKit/Source/modules/webdatabase/Database.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/Database.cpp
@@ -845,7 +845,7 @@
 {
     // The task is constructed in a database thread, and destructed in the
     // context thread.
-    getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLTransaction::performPendingCallback, AllowCrossThreadAccess(transaction)));
+    getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLTransaction::performPendingCallback, wrapCrossThreadPersistent(transaction)));
 }
 
 Vector<String> Database::performGetTableNames()
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp
index f4d01e5e..0401fe7 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp
@@ -422,7 +422,7 @@
     return GL_NONE;
 }
 
-V8CopyablePersistent<v8::Array>* WebGLFramebuffer::getPersistentCache()
+ScopedPersistent<v8::Array>* WebGLFramebuffer::getPersistentCache()
 {
     return &m_attachmentWrappers;
 }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h
index b8ed8cc..b068f87 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h
@@ -26,6 +26,7 @@
 #ifndef WebGLFramebuffer_h
 #define WebGLFramebuffer_h
 
+#include "bindings/core/v8/ScopedPersistent.h"
 #include "modules/webgl/WebGLContextObject.h"
 #include "modules/webgl/WebGLSharedObject.h"
 
@@ -94,7 +95,7 @@
 
     GLenum getReadBuffer() const { return m_readBuffer; }
 
-    V8CopyablePersistent<v8::Array>* getPersistentCache();
+    ScopedPersistent<v8::Array>* getPersistentCache();
 
     DECLARE_VIRTUAL_TRACE();
 
@@ -130,7 +131,7 @@
 
     GLenum m_readBuffer;
 
-    V8CopyablePersistent<v8::Array> m_attachmentWrappers;
+    ScopedPersistent<v8::Array> m_attachmentWrappers;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLObject.h b/third_party/WebKit/Source/modules/webgl/WebGLObject.h
index 2a80113..6fe0442 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLObject.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLObject.h
@@ -56,18 +56,6 @@
     return result;
 }
 
-// TODO(kbr): v8::Persistent doesn't auto-reset in its destructor,
-// which wreaks havoc when they're embedded in Oilpan objects even if
-// they use GarbageCollectedFinalized. The first V8 GC after the
-// Oilpan object is reclaimed will reset the cell in the
-// v8::Persistent, scribbling over the Oilpan heap. If v8::Persistents
-// are ever embedded in Oilpan objects, they must use
-// CopyablePersistentTraits to pick up the kResetInDestructor = true
-// setting. This alias template ensures correct usage, but ideally,
-// these persistent caches would not be necessary. crbug.com/611864
-template <typename T>
-using V8CopyablePersistent = v8::Persistent<T, v8::CopyablePersistentTraits<T>>;
-
 class WebGLObject : public GarbageCollectedFinalized<WebGLObject>, public ScriptWrappable {
 public:
     virtual ~WebGLObject();
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp b/third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp
index a33e2b5..d113ab0 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp
@@ -147,7 +147,7 @@
     }
 }
 
-V8CopyablePersistent<v8::Array>* WebGLProgram::getPersistentCache()
+ScopedPersistent<v8::Array>* WebGLProgram::getPersistentCache()
 {
     return &m_shaderWrappers;
 }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLProgram.h b/third_party/WebKit/Source/modules/webgl/WebGLProgram.h
index d18a922..db01e93 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLProgram.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLProgram.h
@@ -26,6 +26,7 @@
 #ifndef WebGLProgram_h
 #define WebGLProgram_h
 
+#include "bindings/core/v8/ScopedPersistent.h"
 #include "modules/webgl/WebGLShader.h"
 #include "modules/webgl/WebGLSharedPlatform3DObject.h"
 #include "wtf/PassRefPtr.h"
@@ -58,7 +59,7 @@
     bool attachShader(WebGLShader*);
     bool detachShader(WebGLShader*);
 
-    V8CopyablePersistent<v8::Array>* getPersistentCache();
+    ScopedPersistent<v8::Array>* getPersistentCache();
 
     DECLARE_VIRTUAL_TRACE();
 
@@ -87,7 +88,7 @@
 
     bool m_infoValid;
 
-    V8CopyablePersistent<v8::Array> m_shaderWrappers;
+    ScopedPersistent<v8::Array> m_shaderWrappers;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index fa3c89ad..4f64e96 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1545,7 +1545,7 @@
     // during restoration of texture unit bindings. Skip the
     // preserveObjectWrapper work in this case.
     v8::Local<v8::String> hiddenValueName;
-    V8CopyablePersistent<v8::Array>* persistentCache = nullptr;
+    ScopedPersistent<v8::Array>* persistentCache = nullptr;
     if (target == GL_TEXTURE_2D) {
         m_textureUnits[m_activeTextureUnit].m_texture2DBinding = texture;
 
@@ -6284,27 +6284,27 @@
     m_onePlusMaxNonDefaultTextureUnit = 0;
 }
 
-void WebGLRenderingContextBase::preserveObjectWrapper(ScriptState* scriptState, ScriptWrappable* sourceObject, v8::Local<v8::String> hiddenValueName, V8CopyablePersistent<v8::Array>* persistentCache, uint32_t index, ScriptWrappable* targetObject)
+void WebGLRenderingContextBase::preserveObjectWrapper(ScriptState* scriptState, ScriptWrappable* sourceObject, v8::Local<v8::String> hiddenValueName, ScopedPersistent<v8::Array>* persistentCache, uint32_t index, ScriptWrappable* targetObject)
 {
     v8::Isolate* isolate = scriptState->isolate();
-    if (persistentCache->IsEmpty()) {
+    if (persistentCache->isEmpty()) {
         // TODO(kbr): eliminate the persistent caches and just use
         // V8HiddenValue::getHiddenValue. Unfortunately, it's
         // currently too slow to use. crbug.com/611864
-        persistentCache->Reset(isolate, v8::Array::New(isolate));
+        persistentCache->set(isolate, v8::Array::New(isolate));
         V8HiddenValue::setHiddenValue(
             scriptState,
             sourceObject->newLocalWrapper(isolate),
             hiddenValueName,
-            persistentCache->Get(isolate));
+            persistentCache->newLocal(isolate));
         // It is important to mark the persistent cache as weak
         // (phantom, actually). Otherwise there will be a reference
         // cycle between it and its JavaScript wrapper, and currently
         // there are problems collecting such cycles.
-        persistentCache->SetWeak();
+        persistentCache->setPhantom();
     }
 
-    v8::Local<v8::Array> localCache = persistentCache->Get(isolate);
+    v8::Local<v8::Array> localCache = persistentCache->newLocal(isolate);
     if (targetObject) {
         v8CallOrCrash(localCache->Set(scriptState->context(), index, targetObject->newLocalWrapper(isolate)));
     } else {
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
index 9a6c5ac..29bcc61 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -27,6 +27,7 @@
 #define WebGLRenderingContextBase_h
 
 #include "bindings/core/v8/Nullable.h"
+#include "bindings/core/v8/ScopedPersistent.h"
 #include "bindings/core/v8/ScriptState.h"
 #include "bindings/core/v8/ScriptValue.h"
 #include "bindings/core/v8/ScriptWrappable.h"
@@ -37,7 +38,6 @@
 #include "core/layout/LayoutBoxModelObject.h"
 #include "modules/webgl/WebGLContextAttributes.h"
 #include "modules/webgl/WebGLExtensionName.h"
-#include "modules/webgl/WebGLObject.h"
 #include "modules/webgl/WebGLTexture.h"
 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
 #include "platform/Timer.h"
@@ -1040,11 +1040,11 @@
     // latched into the context's state, or which are implicitly
     // linked together (like programs and their attached shaders), are
     // not garbage collected before they should be.
-    V8CopyablePersistent<v8::Array> m_2DTextureWrappers;
-    V8CopyablePersistent<v8::Array> m_2DArrayTextureWrappers;
-    V8CopyablePersistent<v8::Array> m_3DTextureWrappers;
-    V8CopyablePersistent<v8::Array> m_cubeMapTextureWrappers;
-    V8CopyablePersistent<v8::Array> m_extensionWrappers;
+    ScopedPersistent<v8::Array> m_2DTextureWrappers;
+    ScopedPersistent<v8::Array> m_2DArrayTextureWrappers;
+    ScopedPersistent<v8::Array> m_3DTextureWrappers;
+    ScopedPersistent<v8::Array> m_cubeMapTextureWrappers;
+    ScopedPersistent<v8::Array> m_extensionWrappers;
 
     // The "catch-all" array for the rest of the preserved object
     // wrappers. The enum below defines how the indices in this array
@@ -1058,9 +1058,9 @@
         PreservedDefaultVAO,
         PreservedVAO,
     };
-    V8CopyablePersistent<v8::Array> m_miscWrappers;
+    ScopedPersistent<v8::Array> m_miscWrappers;
 
-    static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObject, v8::Local<v8::String> hiddenValueName, V8CopyablePersistent<v8::Array>* persistentCache, uint32_t index, ScriptWrappable* targetObject);
+    static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObject, v8::Local<v8::String> hiddenValueName, ScopedPersistent<v8::Array>* persistentCache, uint32_t index, ScriptWrappable* targetObject);
 
     // Called to lazily instantiate the wrapper for the default VAO
     // during calls to bindBuffer and vertexAttribPointer (from
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp
index 7f91e45..8425467 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp
@@ -109,7 +109,7 @@
     }
 }
 
-V8CopyablePersistent<v8::Array>* WebGLVertexArrayObjectBase::getPersistentCache()
+ScopedPersistent<v8::Array>* WebGLVertexArrayObjectBase::getPersistentCache()
 {
     return &m_arrayBufferWrappers;
 }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h b/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h
index f2abff9..bcf2d1b2 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h
@@ -5,6 +5,7 @@
 #ifndef WebGLVertexArrayObjectBase_h
 #define WebGLVertexArrayObjectBase_h
 
+#include "bindings/core/v8/ScopedPersistent.h"
 #include "modules/webgl/WebGLBuffer.h"
 #include "modules/webgl/WebGLContextObject.h"
 #include "platform/heap/Handle.h"
@@ -34,7 +35,7 @@
     void setArrayBufferForAttrib(GLuint, WebGLBuffer*);
     void unbindBuffer(WebGLBuffer*);
 
-    V8CopyablePersistent<v8::Array>* getPersistentCache();
+    ScopedPersistent<v8::Array>* getPersistentCache();
 
     DECLARE_VIRTUAL_TRACE();
 
@@ -56,7 +57,7 @@
 
     // For preserving the wrappers of WebGLBuffer objects latched in
     // via vertexAttribPointer calls.
-    V8CopyablePersistent<v8::Array> m_arrayBufferWrappers;
+    ScopedPersistent<v8::Array> m_arrayBufferWrappers;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
index 86114bc5..80ef3fb 100644
--- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
@@ -384,7 +384,7 @@
 
 void Bridge::initialize(const String& sourceURL, unsigned lineNumber)
 {
-    if (!waitForMethodCompletion(createCrossThreadTask(&Peer::initialize, AllowCrossThreadAccess(m_peer.get()), sourceURL, lineNumber))) {
+    if (!waitForMethodCompletion(createCrossThreadTask(&Peer::initialize, wrapCrossThreadPersistent(m_peer.get()), sourceURL, lineNumber))) {
         // The worker thread has been signalled to shutdown before method completion.
         disconnect();
     }
@@ -395,7 +395,7 @@
     if (!m_peer)
         return false;
 
-    if (!waitForMethodCompletion(createCrossThreadTask(&Peer::connect, AllowCrossThreadAccess(m_peer.get()), url, protocol)))
+    if (!waitForMethodCompletion(createCrossThreadTask(&Peer::connect, wrapCrossThreadPersistent(m_peer.get()), url, protocol)))
         return false;
 
     return m_syncHelper->connectRequestResult();
@@ -408,7 +408,7 @@
     if (message.length())
         memcpy(data->data(), static_cast<const char*>(message.data()), message.length());
 
-    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::sendTextAsCharVector, AllowCrossThreadAccess(m_peer.get()), passed(std::move(data))));
+    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::sendTextAsCharVector, wrapCrossThreadPersistent(m_peer.get()), passed(std::move(data))));
 }
 
 void Bridge::send(const DOMArrayBuffer& binaryData, unsigned byteOffset, unsigned byteLength)
@@ -419,25 +419,25 @@
     if (binaryData.byteLength())
         memcpy(data->data(), static_cast<const char*>(binaryData.data()) + byteOffset, byteLength);
 
-    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::sendBinaryAsCharVector, AllowCrossThreadAccess(m_peer.get()), passed(std::move(data))));
+    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::sendBinaryAsCharVector, wrapCrossThreadPersistent(m_peer.get()), passed(std::move(data))));
 }
 
 void Bridge::send(PassRefPtr<BlobDataHandle> data)
 {
     ASSERT(m_peer);
-    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::sendBlob, AllowCrossThreadAccess(m_peer.get()), data));
+    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::sendBlob, wrapCrossThreadPersistent(m_peer.get()), data));
 }
 
 void Bridge::close(int code, const String& reason)
 {
     ASSERT(m_peer);
-    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::close, AllowCrossThreadAccess(m_peer.get()), code, reason));
+    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::close, wrapCrossThreadPersistent(m_peer.get()), code, reason));
 }
 
 void Bridge::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
 {
     ASSERT(m_peer);
-    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::fail, AllowCrossThreadAccess(m_peer.get()), reason, level, sourceURL, lineNumber));
+    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::fail, wrapCrossThreadPersistent(m_peer.get()), reason, level, sourceURL, lineNumber));
 }
 
 void Bridge::disconnect()
@@ -445,7 +445,7 @@
     if (!m_peer)
         return;
 
-    waitForMethodCompletion(createCrossThreadTask(&Peer::disconnect, AllowCrossThreadAccess(m_peer.get())));
+    waitForMethodCompletion(createCrossThreadTask(&Peer::disconnect, wrapCrossThreadPersistent(m_peer.get())));
     // Here |m_peer| is detached from the main thread and we can delete it.
 
     m_client = nullptr;
diff --git a/third_party/WebKit/Source/platform/CrossThreadCopier.h b/third_party/WebKit/Source/platform/CrossThreadCopier.h
index ea57c88..aa1aa85 100644
--- a/third_party/WebKit/Source/platform/CrossThreadCopier.h
+++ b/third_party/WebKit/Source/platform/CrossThreadCopier.h
@@ -250,6 +250,8 @@
 template <typename T>
 AllowCrossThreadAccessWrapper<T*> AllowCrossThreadAccess(T* value)
 {
+    static_assert(!blink::IsGarbageCollectedType<T>::value, "Use wrapCrossThreadPersistent() instead for garbage-collected pointers");
+    static_assert(!WTF::IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value, "Use PassRefPtr<T> instead for ThreadSafeRefCounted");
     return AllowCrossThreadAccessWrapper<T*>(value);
 }
 
diff --git a/third_party/WebKit/Source/platform/Task.h b/third_party/WebKit/Source/platform/Task.h
deleted file mode 100644
index 5ddf4de..0000000
--- a/third_party/WebKit/Source/platform/Task.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Task_h
-#define Task_h
-
-#include "public/platform/WebTaskRunner.h"
-#include "wtf/Allocator.h"
-#include "wtf/Functional.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace blink {
-
-// Please use WTF::SameThreadClosure or WTF::CrossThreadClosure directly,
-// instead of wrapping them by blink::SameThreadTask/CrossThreadTask here.
-
-// TODO(hiroshige): Make these classes internal to
-// Source/platform/WebTaskRunner.cpp.
-class SameThreadTask : public WebTaskRunner::Task {
-    USING_FAST_MALLOC(SameThreadTask);
-    WTF_MAKE_NONCOPYABLE(SameThreadTask);
-public:
-    explicit SameThreadTask(std::unique_ptr<SameThreadClosure> closure)
-        : m_closure(std::move(closure))
-    {
-    }
-
-    void run() override
-    {
-        (*m_closure)();
-    }
-
-private:
-    std::unique_ptr<SameThreadClosure> m_closure;
-};
-
-class CrossThreadTask : public WebTaskRunner::Task {
-    USING_FAST_MALLOC(CrossThreadTask);
-    WTF_MAKE_NONCOPYABLE(CrossThreadTask);
-public:
-    explicit CrossThreadTask(std::unique_ptr<CrossThreadClosure> closure)
-        : m_closure(std::move(closure))
-    {
-    }
-
-    void run() override
-    {
-        (*m_closure)();
-    }
-
-private:
-    std::unique_ptr<CrossThreadClosure> m_closure;
-};
-
-} // namespace blink
-
-#endif // Task_h
diff --git a/third_party/WebKit/Source/platform/TracedValueTest.cpp b/third_party/WebKit/Source/platform/TracedValueTest.cpp
index 22e6d7c7..b2357545 100644
--- a/third_party/WebKit/Source/platform/TracedValueTest.cpp
+++ b/third_party/WebKit/Source/platform/TracedValueTest.cpp
@@ -25,7 +25,7 @@
     value->setBoolean("bool", true);
     value->setString("string", "string");
 
-    std::unique_ptr<base::Value> parsed = parseTracedValue(value.release());
+    std::unique_ptr<base::Value> parsed = parseTracedValue(std::move(value));
     base::DictionaryValue* dictionary;
     ASSERT_TRUE(parsed->GetAsDictionary(&dictionary));
     int intValue;
@@ -61,7 +61,7 @@
     value->endArray();
     value->setString("s0", "foo");
 
-    std::unique_ptr<base::Value> parsed = parseTracedValue(value.release());
+    std::unique_ptr<base::Value> parsed = parseTracedValue(std::move(value));
     base::DictionaryValue* dictionary;
     ASSERT_TRUE(parsed->GetAsDictionary(&dictionary));
     int i0;
@@ -109,7 +109,7 @@
     value->setString("s3\\", "value3");
     value->setString("\"s4\"", "value4");
 
-    std::unique_ptr<base::Value> parsed = parseTracedValue(value.release());
+    std::unique_ptr<base::Value> parsed = parseTracedValue(std::move(value));
     base::DictionaryValue* dictionary;
     ASSERT_TRUE(parsed->GetAsDictionary(&dictionary));
     std::string s0;
diff --git a/third_party/WebKit/Source/platform/WebTaskRunner.cpp b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
index 439963d..67a38be 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunner.cpp
+++ b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
@@ -4,10 +4,44 @@
 
 #include "public/platform/WebTaskRunner.h"
 
-#include "platform/Task.h"
-
 namespace blink {
 
+class SameThreadTask : public WebTaskRunner::Task {
+    USING_FAST_MALLOC(SameThreadTask);
+    WTF_MAKE_NONCOPYABLE(SameThreadTask);
+public:
+    explicit SameThreadTask(std::unique_ptr<SameThreadClosure> closure)
+        : m_closure(std::move(closure))
+    {
+    }
+
+    void run() override
+    {
+        (*m_closure)();
+    }
+
+private:
+    std::unique_ptr<SameThreadClosure> m_closure;
+};
+
+class CrossThreadTask : public WebTaskRunner::Task {
+    USING_FAST_MALLOC(CrossThreadTask);
+    WTF_MAKE_NONCOPYABLE(CrossThreadTask);
+public:
+    explicit CrossThreadTask(std::unique_ptr<CrossThreadClosure> closure)
+        : m_closure(std::move(closure))
+    {
+    }
+
+    void run() override
+    {
+        (*m_closure)();
+    }
+
+private:
+    std::unique_ptr<CrossThreadClosure> m_closure;
+};
+
 void WebTaskRunner::postTask(const WebTraceLocation& location, std::unique_ptr<CrossThreadClosure> task)
 {
     postTask(location, new CrossThreadTask(std::move(task)));
diff --git a/third_party/WebKit/Source/platform/audio/FFTFrame.cpp b/third_party/WebKit/Source/platform/audio/FFTFrame.cpp
index 5abb2e3..9d70364c 100644
--- a/third_party/WebKit/Source/platform/audio/FFTFrame.cpp
+++ b/third_party/WebKit/Source/platform/audio/FFTFrame.cpp
@@ -64,7 +64,7 @@
     // Put back into frequency domain.
     newFrame->doFFT(buffer.data());
 
-    return newFrame.release();
+    return newFrame;
 }
 
 void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTFrame& frame2, double interp)
diff --git a/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp b/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
index a45f1941b..7b88489 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp
@@ -41,8 +41,7 @@
 
 PassOwnPtr<HRTFDatabase> HRTFDatabase::create(float sampleRate)
 {
-    OwnPtr<HRTFDatabase> hrtfDatabase = adoptPtr(new HRTFDatabase(sampleRate));
-    return hrtfDatabase.release();
+    return adoptPtr(new HRTFDatabase(sampleRate));
 }
 
 HRTFDatabase::HRTFDatabase(float sampleRate)
@@ -56,7 +55,7 @@
         if (!hrtfElevation.get())
             return;
 
-        m_elevations[elevationIndex] = hrtfElevation.release();
+        m_elevations[elevationIndex] = std::move(hrtfElevation);
         elevationIndex += InterpolationFactor;
     }
 
diff --git a/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp b/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp
index 3792288..aa8ca147 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFElevation.cpp
@@ -256,8 +256,8 @@
         }
     }
 
-    OwnPtr<HRTFElevation> hrtfElevation = adoptPtr(new HRTFElevation(kernelListL.release(), kernelListR.release(), elevation, sampleRate));
-    return hrtfElevation.release();
+    OwnPtr<HRTFElevation> hrtfElevation = adoptPtr(new HRTFElevation(std::move(kernelListL), std::move(kernelListR), elevation, sampleRate));
+    return hrtfElevation;
 }
 
 PassOwnPtr<HRTFElevation> HRTFElevation::createByInterpolatingSlices(HRTFElevation* hrtfElevation1, HRTFElevation* hrtfElevation2, float x, float sampleRate)
@@ -285,8 +285,8 @@
     // Interpolate elevation angle.
     double angle = (1.0 - x) * hrtfElevation1->elevationAngle() + x * hrtfElevation2->elevationAngle();
 
-    OwnPtr<HRTFElevation> hrtfElevation = adoptPtr(new HRTFElevation(kernelListL.release(), kernelListR.release(), static_cast<int>(angle), sampleRate));
-    return hrtfElevation.release();
+    OwnPtr<HRTFElevation> hrtfElevation = adoptPtr(new HRTFElevation(std::move(kernelListL), std::move(kernelListR), static_cast<int>(angle), sampleRate));
+    return hrtfElevation;
 }
 
 void HRTFElevation::getKernelsFromAzimuth(double azimuthBlend, unsigned azimuthIndex, HRTFKernel* &kernelL, HRTFKernel* &kernelR, double& frameDelayL, double& frameDelayR)
diff --git a/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp b/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp
index 722fb665..6ef5208b 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp
@@ -99,7 +99,7 @@
     fftFrame.addConstantGroupDelay(m_frameDelay);
     fftFrame.doInverseFFT(channel->mutableData());
 
-    return channel.release();
+    return channel;
 }
 
 // Interpolates two kernels with x: 0 -> 1 and returns the result.
@@ -121,7 +121,7 @@
     float frameDelay = (1 - x) * kernel1->frameDelay() + x * kernel2->frameDelay();
 
     OwnPtr<FFTFrame> interpolatedFrame = FFTFrame::createInterpolatedFrame(*kernel1->fftFrame(), *kernel2->fftFrame(), x);
-    return HRTFKernel::create(interpolatedFrame.release(), frameDelay, sampleRate1);
+    return HRTFKernel::create(std::move(interpolatedFrame), frameDelay, sampleRate1);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/audio/Reverb.cpp b/third_party/WebKit/Source/platform/audio/Reverb.cpp
index f920f04..dc7e9ea 100644
--- a/third_party/WebKit/Source/platform/audio/Reverb.cpp
+++ b/third_party/WebKit/Source/platform/audio/Reverb.cpp
@@ -117,7 +117,7 @@
         AudioChannel* channel = impulseResponseBuffer->channel(i);
 
         OwnPtr<ReverbConvolver> convolver = adoptPtr(new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads));
-        m_convolvers.append(convolver.release());
+        m_convolvers.append(std::move(convolver));
 
         convolverRenderPhase += renderSliceSize;
     }
diff --git a/third_party/WebKit/Source/platform/audio/ReverbConvolver.cpp b/third_party/WebKit/Source/platform/audio/ReverbConvolver.cpp
index 7113080..e204727 100644
--- a/third_party/WebKit/Source/platform/audio/ReverbConvolver.cpp
+++ b/third_party/WebKit/Source/platform/audio/ReverbConvolver.cpp
@@ -93,10 +93,11 @@
         bool isBackgroundStage = false;
 
         if (useBackgroundThreads && stageOffset > RealtimeFrameLimit) {
-            m_backgroundStages.append(stage.release());
+            m_backgroundStages.append(std::move(stage));
             isBackgroundStage = true;
-        } else
-            m_stages.append(stage.release());
+        } else {
+            m_stages.append(std::move(stage));
+        }
 
         stageOffset += stageSize;
         ++i;
diff --git a/third_party/WebKit/Source/platform/blink_platform.gypi b/third_party/WebKit/Source/platform/blink_platform.gypi
index 53a4bca..29486e5 100644
--- a/third_party/WebKit/Source/platform/blink_platform.gypi
+++ b/third_party/WebKit/Source/platform/blink_platform.gypi
@@ -113,7 +113,6 @@
       'StorageQuotaCallbacks.h',
       'Supplementable.cpp',
       'Supplementable.h',
-      'Task.h',
       'TaskSynchronizer.cpp',
       'TaskSynchronizer.h',
       'Theme.cpp',
diff --git a/third_party/WebKit/Source/platform/exported/Platform.cpp b/third_party/WebKit/Source/platform/exported/Platform.cpp
index 77b9c7d..96da43fb 100644
--- a/third_party/WebKit/Source/platform/exported/Platform.cpp
+++ b/third_party/WebKit/Source/platform/exported/Platform.cpp
@@ -34,6 +34,7 @@
 #include "platform/PartitionAllocMemoryDumpProvider.h"
 #include "platform/fonts/FontCacheMemoryDumpProvider.h"
 #include "platform/graphics/CompositorFactory.h"
+#include "platform/heap/BlinkGCMemoryDumpProvider.h"
 #include "platform/heap/GCTaskRunner.h"
 #include "platform/web_memory_dump_provider_adapter.h"
 #include "public/platform/Platform.h"
@@ -92,6 +93,8 @@
     WTF::initialize(callOnMainThreadFunction);
 
     ProcessHeap::init();
+    if (base::ThreadTaskRunnerHandle::IsSet())
+        base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(BlinkGCMemoryDumpProvider::instance(), "BlinkGC", base::ThreadTaskRunnerHandle::Get());
 
     ThreadState::attachMainThread();
 
@@ -114,6 +117,8 @@
     if (s_platform->m_mainThread) {
         s_platform->unregisterMemoryDumpProvider(FontCacheMemoryDumpProvider::instance());
         base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(PartitionAllocMemoryDumpProvider::instance());
+        base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(BlinkGCMemoryDumpProvider::instance());
+
         ASSERT(s_gcTaskRunner);
         delete s_gcTaskRunner;
         s_gcTaskRunner = nullptr;
diff --git a/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp b/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp
index 1a6053e..410ccbc 100644
--- a/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp
@@ -98,7 +98,7 @@
     // to return from this method so the underlying file will not be deleted.
     OwnPtr<BlobData> blobData = BlobData::create();
     blobData->appendFile(webFileInfo.platformPath, 0, webFileInfo.length, invalidFileTime());
-    RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.release(), webFileInfo.length);
+    RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(std::move(blobData), webFileInfo.length);
 
     FileMetadata fileMetadata;
     fileMetadata.modificationTime = webFileInfo.modificationTime;
diff --git a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
index b7e838ca..9ac701c9 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
@@ -29,6 +29,7 @@
 
 #include "platform/fonts/FontDescription.h"
 
+#include "platform/Language.h"
 #include "platform/RuntimeEnabledFeatures.h"
 #include "wtf/StringHasher.h"
 #include "wtf/text/AtomicStringHash.h"
@@ -125,8 +126,13 @@
 static const AtomicString& defaultLocale()
 {
     DEFINE_STATIC_LOCAL(AtomicString, locale, ());
-    if (locale.isNull())
-        locale = AtomicString("en");
+    if (locale.isNull()) {
+        AtomicString defaultLocale = defaultLanguage();
+        if (!defaultLocale.isEmpty())
+            locale = defaultLocale;
+        else
+            locale = AtomicString("en");
+    }
     return locale;
 }
 
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
index fcd7bde..0999e94 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
@@ -700,7 +700,7 @@
     result->m_numGlyphs = count;
     ASSERT(result->m_numGlyphs == count); // no overflow
     result->m_hasVerticalOffsets = fontData->platformData().isVerticalAnyUpright();
-    result->m_runs.append(run.release());
+    result->m_runs.append(std::move(run));
     return result.release();
 }
 
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
index 786924d0..42bf7adb 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
@@ -337,21 +337,21 @@
     if (HB_DIRECTION_IS_FORWARD(run->m_direction)) {
         for (size_t pos = 0; pos < m_runs.size(); ++pos) {
             if (m_runs.at(pos)->m_startIndex > run->m_startIndex) {
-                m_runs.insert(pos, run.release());
+                m_runs.insert(pos, std::move(run));
                 break;
             }
         }
     } else {
         for (size_t pos = 0; pos < m_runs.size(); ++pos) {
             if (m_runs.at(pos)->m_startIndex < run->m_startIndex) {
-                m_runs.insert(pos, run.release());
+                m_runs.insert(pos, std::move(run));
                 break;
             }
         }
     }
     // If we didn't find an existing slot to place it, append.
     if (run)
-        m_runs.append(run.release());
+        m_runs.append(std::move(run));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/geometry/FloatPolygonTest.cpp b/third_party/WebKit/Source/platform/geometry/FloatPolygonTest.cpp
index e1cb108..a8a1ff91 100644
--- a/third_party/WebKit/Source/platform/geometry/FloatPolygonTest.cpp
+++ b/third_party/WebKit/Source/platform/geometry/FloatPolygonTest.cpp
@@ -41,7 +41,7 @@
         OwnPtr<Vector<FloatPoint>> vertices = adoptPtr(new Vector<FloatPoint>(coordinatesLength / 2));
         for (unsigned i = 0; i < coordinatesLength; i += 2)
             (*vertices)[i / 2] = FloatPoint(coordinates[i], coordinates[i + 1]);
-        m_polygon = adoptPtr(new FloatPolygon(vertices.release(), fillRule));
+        m_polygon = adoptPtr(new FloatPolygon(std::move(vertices), fillRule));
     }
 
     const FloatPolygon& polygon() const { return *m_polygon; }
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index 5f750f02e..f566abe8 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -92,7 +92,7 @@
     if (!contextProvider)
         return nullptr;
     RefPtr<Canvas2DLayerBridge> layerBridge;
-    layerBridge = adoptRef(new Canvas2DLayerBridge(contextProvider.release(), size, msaaSampleCount, opacityMode, accelerationMode));
+    layerBridge = adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), size, msaaSampleCount, opacityMode, accelerationMode));
     return layerBridge.release();
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
index 3be2822..7bb092d 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
@@ -27,7 +27,6 @@
 #include "SkSurface.h"
 #include "gpu/command_buffer/client/gles2_interface.h"
 #include "gpu/command_buffer/common/capabilities.h"
-#include "platform/Task.h"
 #include "platform/ThreadSafeFunctional.h"
 #include "platform/WaitableEvent.h"
 #include "platform/graphics/ImageBuffer.h"
@@ -161,7 +160,7 @@
         FakeGLES2Interface gl;
         OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
 
-        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::DisableAcceleration)));
+        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::DisableAcceleration)));
 
         const GrGLTextureInfo* textureInfo = skia::GrBackendObjectToGrGLTextureInfo(bridge->newImageSnapshot(PreferAcceleration, SnapshotReasonUnknown)->getTextureHandle(true));
         EXPECT_EQ(textureInfo, nullptr);
@@ -174,7 +173,7 @@
         OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
 
         gl.setIsContextLost(true);
-        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
+        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
         EXPECT_TRUE(bridge->checkSurfaceValid());
         EXPECT_FALSE(bridge->isAccelerated());
     }
@@ -185,7 +184,7 @@
             // No fallback case.
             FakeGLES2Interface gl;
             OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
-            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
+            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
             EXPECT_TRUE(bridge->checkSurfaceValid());
             EXPECT_TRUE(bridge->isAccelerated());
             RefPtr<SkImage> snapshot = bridge->newImageSnapshot(PreferAcceleration, SnapshotReasonUnknown);
@@ -198,7 +197,7 @@
             FakeGLES2Interface gl;
             OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
             GrContext* gr = contextProvider->grContext();
-            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
+            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
             EXPECT_TRUE(bridge->checkSurfaceValid());
             EXPECT_TRUE(bridge->isAccelerated()); // We don't yet know that allocation will fail
             // This will cause SkSurface_Gpu creation to fail without
@@ -215,7 +214,7 @@
         FakeGLES2Interface gl;
         OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
 
-        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
+        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
         EXPECT_TRUE(bridge->checkSurfaceValid());
         SkPaint paint;
         uint32_t genID = bridge->getOrCreateSurface()->generationID();
@@ -237,7 +236,7 @@
     {
         FakeGLES2Interface gl;
         OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
-        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
+        Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
         bridge->m_lastImageId = 1;
 
         NullWebExternalBitmap bitmap;
@@ -254,7 +253,7 @@
         {
             FakeGLES2Interface gl;
             OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
-            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
+            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
             WebExternalTextureMailbox mailbox;
             bridge->prepareMailbox(&mailbox, 0);
             bridge->mailboxReleased(mailbox, lostResource);
@@ -267,7 +266,7 @@
             WebExternalTextureMailbox mailbox;
             Canvas2DLayerBridge* rawBridge;
             {
-                Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
+                Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
                 bridge->prepareMailbox(&mailbox, 0);
                 rawBridge = bridge.get();
             } // bridge goes out of scope, but object is kept alive by self references.
@@ -282,7 +281,7 @@
         {
             FakeGLES2Interface gl;
             OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
-            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 300), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
+            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 300), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
             SkPaint paint;
             bridge->canvas()->drawRect(SkRect::MakeXYWH(0, 0, 1, 1), paint);
             RefPtr<SkImage> image = bridge->newImageSnapshot(PreferAcceleration, SnapshotReasonUnknown);
@@ -293,7 +292,7 @@
         {
             FakeGLES2Interface gl;
             OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(&gl));
-            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextProvider.release(), IntSize(300, 300), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
+            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 300), 0, NonOpaque, Canvas2DLayerBridge::EnableAcceleration)));
             SkPaint paint;
             bridge->canvas()->drawRect(SkRect::MakeXYWH(0, 0, 1, 1), paint);
             RefPtr<SkImage> image = bridge->newImageSnapshot(PreferNoAcceleration, SnapshotReasonUnknown);
@@ -348,7 +347,7 @@
 void runCreateBridgeTask(Canvas2DLayerBridgePtr* bridgePtr, gpu::gles2::GLES2Interface* gl, Canvas2DLayerBridgeTest* testHost, WaitableEvent* doneEvent)
 {
     OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new FakeWebGraphicsContext3DProvider(gl));
-    *bridgePtr = testHost->makeBridge(contextProvider.release(), IntSize(300, 300), Canvas2DLayerBridge::EnableAcceleration);
+    *bridgePtr = testHost->makeBridge(std::move(contextProvider), IntSize(300, 300), Canvas2DLayerBridge::EnableAcceleration);
     // draw+flush to trigger the creation of a GPU surface
     (*bridgePtr)->didDraw(FloatRect(0, 0, 1, 1));
     (*bridgePtr)->finalizeFrame(FloatRect(0, 0, 1, 1));
@@ -447,7 +446,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -491,7 +490,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -544,7 +543,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -610,7 +609,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -665,7 +664,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -725,7 +724,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -782,7 +781,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -835,7 +834,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationScheduledEvent = adoptPtr(new WaitableEvent());
@@ -875,7 +874,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationAbortedEvent = adoptPtr(new WaitableEvent());
@@ -909,7 +908,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationAbortedEvent = adoptPtr(new WaitableEvent());
@@ -946,7 +945,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     gl.setIsContextLost(true);
     // Test entering hibernation
@@ -981,7 +980,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
@@ -1020,7 +1019,7 @@
     // Register an alternate Logger for tracking hibernation events
     OwnPtr<MockLogger> mockLogger = adoptPtr(new MockLogger);
     MockLogger* mockLoggerPtr = mockLogger.get();
-    bridge->setLoggerForTesting(mockLogger.release());
+    bridge->setLoggerForTesting(std::move(mockLogger));
 
     // Test entering hibernation
     OwnPtr<WaitableEvent> hibernationStartedEvent = adoptPtr(new WaitableEvent());
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp
index e44c998..d072e0b 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp
@@ -32,7 +32,7 @@
 
     return base::Bind(&CompositorMutationsTarget::applyMutations,
         base::Unretained(m_mutationsTarget),
-        base::Owned(m_mutations.release().leakPtr()));
+        base::Owned(m_mutations.leakPtr()));
 }
 
 void CompositorMutatorClient::setMutationsForTesting(PassOwnPtr<CompositorMutations> mutations)
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
index ca0f1f7..239bdbd 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp
@@ -27,7 +27,7 @@
 
     CompositorMutatorClient client(&target);
     OwnPtr<CompositorMutations> mutations = adoptPtr(new CompositorMutations());
-    client.setMutationsForTesting(mutations.release());
+    client.setMutationsForTesting(std::move(mutations));
 
     EXPECT_CALL(target, applyMutations(_));
     client.TakeMutations().Run();
diff --git a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
index cdf81df..7b8980d 100644
--- a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
@@ -176,7 +176,7 @@
     ASSERT(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1);
     OwnPtr<Buffer> newBuffer = adoptPtr(new Buffer(bufferSize, typeName));
     Buffer* bufferToReturn = newBuffer.get();
-    m_buffers.append(newBuffer.release());
+    m_buffers.append(std::move(newBuffer));
     m_endIndex = m_buffers.size() - 1;
     return bufferToReturn;
 }
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index 9ea87b7..ad4312a1 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -46,7 +46,7 @@
     if (!actualDecoder)
         return nullptr;
 
-    return adoptPtr(new DeferredImageDecoder(actualDecoder.release()));
+    return adoptPtr(new DeferredImageDecoder(std::move(actualDecoder)));
 }
 
 PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> actualDecoder)
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
index bf6e341..71ed10c3 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -103,7 +103,7 @@
         OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(this);
         m_actualDecoder = decoder.get();
         m_actualDecoder->setSize(1, 1);
-        m_lazyDecoder = DeferredImageDecoder::createForTesting(decoder.release());
+        m_lazyDecoder = DeferredImageDecoder::createForTesting(std::move(decoder));
         m_surface = SkSurface::MakeRasterN32Premul(100, 100);
         ASSERT_TRUE(m_surface.get());
         m_decodeRequestCount = 0;
@@ -361,7 +361,7 @@
 {
     OwnPtr<ImageDecoder> actualDecoder = ImageDecoder::create(*m_data,
         ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
-    OwnPtr<DeferredImageDecoder> decoder = DeferredImageDecoder::createForTesting(actualDecoder.release());
+    OwnPtr<DeferredImageDecoder> decoder = DeferredImageDecoder::createForTesting(std::move(actualDecoder));
     decoder->setData(*m_data, true);
 
     SkImageInfo pixInfo = SkImageInfo::MakeN32Premul(1, 1);
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index e8c05b67..1d30391 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -209,7 +209,7 @@
         if (shadowMode != DrawShadowOnly)
             drawLooperBuilder.clear();
 
-        setDrawLooper(drawLooperBuilder.release());
+        setDrawLooper(std::move(drawLooperBuilder));
         return;
     }
 
@@ -217,7 +217,7 @@
     if (shadowMode == DrawShadowAndForeground) {
         drawLooperBuilder->addUnmodifiedContent();
     }
-    setDrawLooper(drawLooperBuilder.release());
+    setDrawLooper(std::move(drawLooperBuilder));
 }
 
 void GraphicsContext::setDrawLooper(PassOwnPtr<DrawLooperBuilder> drawLooperBuilder)
@@ -480,7 +480,7 @@
     OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
     drawLooperBuilder->addShadow(FloatSize(shadowOffset), shadowBlur, shadowColor,
         DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIgnoresAlpha);
-    setDrawLooper(drawLooperBuilder.release());
+    setDrawLooper(std::move(drawLooperBuilder));
     fillRectWithRoundedHole(outerRect, roundedHole, fillColor);
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index d685919..945e8f9 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -89,8 +89,7 @@
 
 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
 {
-    OwnPtr<GraphicsLayer> layer = adoptPtr(new GraphicsLayer(client));
-    return layer.release();
+    return adoptPtr(new GraphicsLayer(client));
 }
 
 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
index 4942162..ccc1972 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
@@ -73,7 +73,7 @@
     OwnPtr<ImageBufferSurface> surface(adoptPtr(new UnacceleratedImageBufferSurface(size, opacityMode, initializationMode)));
     if (!surface->isValid())
         return nullptr;
-    return adoptPtr(new ImageBuffer(surface.release()));
+    return adoptPtr(new ImageBuffer(std::move(surface)));
 }
 
 ImageBuffer::ImageBuffer(PassOwnPtr<ImageBufferSurface> surface)
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp b/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp
index 57db466..ce886997 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp
@@ -99,7 +99,7 @@
 
     MutexLocker lock(m_mutex);
     ASSERT(!m_decoderCacheMap.contains(newCacheEntry->cacheKey()));
-    insertCacheInternal(newCacheEntry.release(), &m_decoderCacheMap, &m_decoderCacheKeyMap);
+    insertCacheInternal(std::move(newCacheEntry), &m_decoderCacheMap, &m_decoderCacheKeyMap);
 }
 
 void ImageDecodingStore::removeDecoder(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp
index 1fa2cce..809174a 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp
@@ -85,7 +85,7 @@
     OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
     decoder->setSize(1, 1);
     const ImageDecoder* refDecoder = decoder.get();
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder.release());
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder));
     EXPECT_EQ(1, ImageDecodingStore::instance().cacheEntries());
     EXPECT_EQ(4u, ImageDecodingStore::instance().memoryUsageInBytes());
 
@@ -105,9 +105,9 @@
     decoder1->setSize(1, 1);
     decoder2->setSize(2, 2);
     decoder3->setSize(3, 3);
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder1.release());
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder2.release());
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder3.release());
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder1));
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder2));
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder3));
     EXPECT_EQ(3, ImageDecodingStore::instance().cacheEntries());
     EXPECT_EQ(56u, ImageDecodingStore::instance().memoryUsageInBytes());
 
@@ -132,9 +132,9 @@
     decoder1->setSize(1, 1);
     decoder2->setSize(2, 2);
     decoder3->setSize(3, 3);
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder1.release());
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder2.release());
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder3.release());
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder1));
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder2));
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder3));
     EXPECT_EQ(3, ImageDecodingStore::instance().cacheEntries());
 
     ImageDecoder* testDecoder;
@@ -158,7 +158,7 @@
     OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
     decoder->setSize(1, 1);
     const ImageDecoder* refDecoder = decoder.get();
-    ImageDecodingStore::instance().insertDecoder(m_generator.get(), decoder.release());
+    ImageDecodingStore::instance().insertDecoder(m_generator.get(), std::move(decoder));
     EXPECT_EQ(1, ImageDecodingStore::instance().cacheEntries());
     EXPECT_EQ(4u, ImageDecodingStore::instance().memoryUsageInBytes());
 
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
index 3efd86e2..faf1444 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -165,7 +165,7 @@
     decoder->setData(data, true);
 
     OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes(planes, rowBytes));
-    decoder->setImagePlanes(imagePlanes.release());
+    decoder->setImagePlanes(std::move(imagePlanes));
 
     ASSERT(decoder->canDecodeToYUV());
 
@@ -234,7 +234,7 @@
         else
             ImageDecodingStore::instance().unlockDecoder(this, decoder);
     } else if (!removeDecoder) {
-        ImageDecodingStore::instance().insertDecoder(this, decoderContainer.release());
+        ImageDecodingStore::instance().insertDecoder(this, std::move(decoderContainer));
     }
     return fullSizeImage;
 }
@@ -332,7 +332,7 @@
     // Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding.
     decoder->setData(data, true);
     OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes);
-    decoder->setImagePlanes(dummyImagePlanes.release());
+    decoder->setImagePlanes(std::move(dummyImagePlanes));
 
     return updateYUVComponentSizes(decoder.get(), sizeInfo->fSizes, sizeInfo->fWidthBytes);
 }
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp
index 4b9d1b7..2d75f18 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp
@@ -185,7 +185,7 @@
     setFrameStatus(ImageFrame::FrameComplete);
     addNewData();
     OwnPtr<WebThread> thread = adoptPtr(Platform::current()->createThread("DecodeThread"));
-    thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&decodeThreadMain, AllowCrossThreadAccess(m_generator.get()), AllowCrossThreadAccess(m_segmentReader.get())));
+    thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&decodeThreadMain, m_generator, m_segmentReader));
     thread.clear();
     EXPECT_EQ(2, m_decodeRequestCount);
     EXPECT_EQ(1, m_decodersDestroyed);
diff --git a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
index fbe78704..9676b2d 100644
--- a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
@@ -141,7 +141,7 @@
         return nullptr;
 
     base64Encode(encodedImage, *base64Data);
-    return base64Data.release();
+    return base64Data;
 }
 
 PassOwnPtr<PictureSnapshot::Timings> PictureSnapshot::profile(unsigned minRepeatCount, double minDuration, const FloatRect* clipRect) const
@@ -169,7 +169,7 @@
         m_picture->playback(&canvas);
         now = WTF::monotonicallyIncreasingTime();
     }
-    return timings.release();
+    return timings;
 }
 
 PassRefPtr<JSONArray> PictureSnapshot::snapshotCommandLog() const
diff --git a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
index 9f26973..7e9b5702 100644
--- a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
@@ -98,11 +98,11 @@
     {
         OwnPtr<MockSurfaceFactory> surfaceFactory = adoptPtr(new MockSurfaceFactory());
         m_surfaceFactory = surfaceFactory.get();
-        OwnPtr<RecordingImageBufferSurface> testSurface = adoptPtr(new RecordingImageBufferSurface(IntSize(10, 10), surfaceFactory.release()));
+        OwnPtr<RecordingImageBufferSurface> testSurface = adoptPtr(new RecordingImageBufferSurface(IntSize(10, 10), std::move(surfaceFactory)));
         m_testSurface = testSurface.get();
         // We create an ImageBuffer in order for the testSurface to be
         // properly initialized with a GraphicsContext
-        m_imageBuffer = ImageBuffer::create(testSurface.release());
+        m_imageBuffer = ImageBuffer::create(std::move(testSurface));
         EXPECT_FALSE(!m_imageBuffer);
         m_fakeImageBufferClient = adoptPtr(new FakeImageBufferClient(m_imageBuffer.get()));
         m_imageBuffer->setClient(m_fakeImageBufferClient.get());
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
index 5f9c4d5..b78dff3 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -423,7 +423,7 @@
     layer->SetDoubleSided(!paintChunk.properties.backfaceHidden);
     if (paintChunk.knownToBeOpaque)
         layer->SetContentsOpaque(true);
-    m_contentLayerClients.append(contentLayerClient.release());
+    m_contentLayerClients.append(std::move(contentLayerClient));
     return layer;
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 8431581..73ed04b0 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -110,7 +110,7 @@
     if (discardFramebufferSupported)
         extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer");
 
-    RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(std::move(contextProvider), extensionsUtil.release(), discardFramebufferSupported, wantAlphaChannel, premultipliedAlpha, preserve, wantDepthBuffer, wantStencilBuffer));
+    RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(std::move(contextProvider), std::move(extensionsUtil), discardFramebufferSupported, wantAlphaChannel, premultipliedAlpha, preserve, wantDepthBuffer, wantStencilBuffer));
     if (!drawingBuffer->initialize(size, multisampleSupported)) {
         drawingBuffer->beginDestruction();
         return PassRefPtr<DrawingBuffer>();
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
index df68644..affb56f3 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -208,7 +208,7 @@
     static PassRefPtr<DrawingBufferForTests> create(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, const IntSize& size, PreserveDrawingBuffer preserve)
     {
         OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->contextGL());
-        RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBufferForTests(std::move(contextProvider), extensionsUtil.release(), preserve));
+        RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBufferForTests(std::move(contextProvider), std::move(extensionsUtil), preserve));
         bool multisampleExtensionSupported = false;
         if (!drawingBuffer->initialize(size, multisampleExtensionSupported)) {
             drawingBuffer->beginDestruction();
@@ -259,8 +259,8 @@
     {
         OwnPtr<GLES2InterfaceForTests> gl = adoptPtr(new GLES2InterfaceForTests);
         m_gl = gl.get();
-        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(gl.release()));
-        m_drawingBuffer = DrawingBufferForTests::create(provider.release(), IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve);
+        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(std::move(gl)));
+        m_drawingBuffer = DrawingBufferForTests::create(std::move(provider), IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve);
         CHECK(m_drawingBuffer);
     }
 
@@ -481,11 +481,11 @@
     {
         OwnPtr<GLES2InterfaceForTests> gl = adoptPtr(new GLES2InterfaceForTests);
         m_gl = gl.get();
-        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(gl.release()));
+        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(std::move(gl)));
         RuntimeEnabledFeatures::setWebGLImageChromiumEnabled(true);
         m_imageId0 = m_gl->nextImageIdToBeCreated();
         EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId0)).Times(1);
-        m_drawingBuffer = DrawingBufferForTests::create(provider.release(),
+        m_drawingBuffer = DrawingBufferForTests::create(std::move(provider),
             IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve);
         CHECK(m_drawingBuffer);
         testing::Mock::VerifyAndClearExpectations(m_gl);
@@ -661,7 +661,7 @@
         SCOPED_TRACE(cases[i].testCaseName);
         OwnPtr<DepthStencilTrackingGLES2Interface> gl = adoptPtr(new DepthStencilTrackingGLES2Interface);
         DepthStencilTrackingGLES2Interface* trackingGL = gl.get();
-        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(gl.release()));
+        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(std::move(gl)));
         DrawingBuffer::PreserveDrawingBuffer preserve = DrawingBuffer::Preserve;
 
         bool premultipliedAlpha = false;
@@ -670,7 +670,7 @@
         bool wantStencilBuffer = cases[i].requestStencil;
         bool wantAntialiasing = false;
         RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create(
-            provider.release(),
+            std::move(provider),
             IntSize(10, 10),
             premultipliedAlpha,
             wantAlphaChannel,
@@ -739,9 +739,9 @@
         OwnPtr<GLES2InterfaceForTests> gl = adoptPtr(new GLES2InterfaceForTests);
         gl->setAllowImageChromium(false);
         m_gl = gl.get();
-        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(gl.release()));
+        OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(std::move(gl)));
         RuntimeEnabledFeatures::setWebGLImageChromiumEnabled(true);
-        m_drawingBuffer = DrawingBufferForTests::create(provider.release(),
+        m_drawingBuffer = DrawingBufferForTests::create(std::move(provider),
             IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve);
     }
 
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
index e68bc797..58cd5d2 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
@@ -28,7 +28,7 @@
 {
     OwnPtr<Extensions3DUtil> out = adoptPtr(new Extensions3DUtil(gl));
     out->initializeExtensions();
-    return out.release();
+    return out;
 }
 
 Extensions3DUtil::Extensions3DUtil(gpu::gles2::GLES2Interface* gl)
diff --git a/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h b/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
index 05fff2ec..a109d96 100644
--- a/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
+++ b/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
@@ -151,7 +151,7 @@
     {
         OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(m_client);
         decoder->setSize(m_decodedSize.width(), m_decodedSize.height());
-        return decoder.release();
+        return std::move(decoder);
     }
 
 private:
diff --git a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
index a0f7556..4fede90 100644
--- a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
+++ b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
@@ -6,6 +6,8 @@
 
 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
 #include "base/trace_event/heap_profiler_allocation_register.h"
+#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/process_memory_dump.h"
 #include "base/trace_event/trace_event_memory_overhead.h"
 #include "platform/heap/Handle.h"
 #include "platform/web_process_memory_dump_impl.h"
@@ -17,18 +19,16 @@
 namespace blink {
 namespace {
 
-void dumpMemoryTotals(blink::WebProcessMemoryDump* memoryDump)
+void dumpMemoryTotals(base::trace_event::ProcessMemoryDump* memoryDump)
 {
-    String dumpName = String::format("blink_gc");
-    WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDump(dumpName);
-    allocatorDump->addScalar("size", "bytes", ProcessHeap::totalAllocatedSpace());
+    base::trace_event::MemoryAllocatorDump* allocatorDump = memoryDump->CreateAllocatorDump("blink_gc");
+    allocatorDump->AddScalar("size", "bytes", ProcessHeap::totalAllocatedSpace());
 
-    dumpName.append("/allocated_objects");
-    WebMemoryAllocatorDump* objectsDump = memoryDump->createMemoryAllocatorDump(dumpName);
+    base::trace_event::MemoryAllocatorDump* objectsDump = memoryDump->CreateAllocatorDump("blink_gc/allocated_objects");
 
     // ThreadHeap::markedObjectSize() can be underestimated if we're still in the
     // process of lazy sweeping.
-    objectsDump->addScalar("size", "bytes", ProcessHeap::totalAllocatedObjectSize() + ProcessHeap::totalMarkedObjectSize());
+    objectsDump->AddScalar("size", "bytes", ProcessHeap::totalAllocatedObjectSize() + ProcessHeap::totalMarkedObjectSize());
 }
 
 void reportAllocation(Address address, size_t size, const char* typeName)
@@ -53,11 +53,13 @@
 {
 }
 
-bool BlinkGCMemoryDumpProvider::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, blink::WebProcessMemoryDump* memoryDump)
+bool BlinkGCMemoryDumpProvider::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, base::trace_event::ProcessMemoryDump* memoryDump)
 {
+    using base::trace_event::MemoryDumpLevelOfDetail;
+    MemoryDumpLevelOfDetail levelOfDetail = args.level_of_detail;
     // In the case of a detailed dump perform a mark-only GC pass to collect
     // more detailed stats.
-    if (levelOfDetail == WebMemoryDumpLevelOfDetail::Detailed)
+    if (levelOfDetail == MemoryDumpLevelOfDetail::DETAILED)
         ThreadHeap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::TakeSnapshot, BlinkGC::ForcedGC);
     dumpMemoryTotals(memoryDump);
 
@@ -67,7 +69,7 @@
         base::hash_map<base::trace_event::AllocationContext, base::trace_event::AllocationMetrics> metricsByContext;
         {
             MutexLocker locker(m_allocationRegisterMutex);
-            if (levelOfDetail == WebMemoryDumpLevelOfDetail::Detailed) {
+            if (levelOfDetail == MemoryDumpLevelOfDetail::DETAILED) {
                 for (const auto& allocSize : *m_allocationRegister) {
                     base::trace_event::AllocationMetrics& metrics = metricsByContext[allocSize.context];
                     metrics.size += allocSize.size;
@@ -76,22 +78,22 @@
             }
             m_allocationRegister->EstimateTraceMemoryOverhead(&overhead);
         }
-        memoryDump->dumpHeapUsage(metricsByContext, overhead, "blink_gc");
+        memoryDump->DumpHeapUsage(metricsByContext, overhead, "blink_gc");
     }
 
     // Merge all dumps collected by ThreadHeap::collectGarbage.
-    if (levelOfDetail == WebMemoryDumpLevelOfDetail::Detailed)
-        memoryDump->takeAllDumpsFrom(m_currentProcessMemoryDump.get());
+    if (levelOfDetail == MemoryDumpLevelOfDetail::DETAILED)
+        memoryDump->TakeAllDumpsFrom(m_currentProcessMemoryDump.get());
     return true;
 }
 
-void BlinkGCMemoryDumpProvider::onHeapProfilingEnabled(bool enabled)
+void BlinkGCMemoryDumpProvider::OnHeapProfilingEnabled(bool enabled)
 {
     if (enabled) {
         {
             MutexLocker locker(m_allocationRegisterMutex);
             if (!m_allocationRegister)
-                m_allocationRegister = adoptPtr(new base::trace_event::AllocationRegister());
+                m_allocationRegister.reset(new base::trace_event::AllocationRegister());
         }
         HeapAllocHooks::setAllocationHook(reportAllocation);
         HeapAllocHooks::setFreeHook(reportFree);
@@ -102,18 +104,19 @@
     m_isHeapProfilingEnabled = enabled;
 }
 
-WebMemoryAllocatorDump* BlinkGCMemoryDumpProvider::createMemoryAllocatorDumpForCurrentGC(const String& absoluteName)
+base::trace_event::MemoryAllocatorDump* BlinkGCMemoryDumpProvider::createMemoryAllocatorDumpForCurrentGC(const String& absoluteName)
 {
-    return m_currentProcessMemoryDump->createMemoryAllocatorDump(absoluteName);
+    // TODO(bashi): Change type name of |absoluteName|.
+    return m_currentProcessMemoryDump->CreateAllocatorDump(absoluteName.utf8().data());
 }
 
 void BlinkGCMemoryDumpProvider::clearProcessDumpForCurrentGC()
 {
-    m_currentProcessMemoryDump->clear();
+    m_currentProcessMemoryDump->Clear();
 }
 
 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider()
-    : m_currentProcessMemoryDump(adoptPtr(new WebProcessMemoryDumpImpl()))
+    : m_currentProcessMemoryDump(new base::trace_event::ProcessMemoryDump(nullptr))
     , m_isHeapProfilingEnabled(false)
 {
 }
diff --git a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.h b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.h
index e6de7a33..b829c59 100644
--- a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.h
+++ b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.h
@@ -5,11 +5,11 @@
 #ifndef BlinkGCMemoryDumpProvider_h
 #define BlinkGCMemoryDumpProvider_h
 
+#include "base/trace_event/memory_dump_provider.h"
 #include "platform/PlatformExport.h"
 #include "platform/heap/BlinkGC.h"
 #include "public/platform/WebMemoryDumpProvider.h"
 #include "wtf/Allocator.h"
-#include "wtf/OwnPtr.h"
 #include "wtf/ThreadingPrimitives.h"
 #include "wtf/text/WTFString.h"
 
@@ -17,6 +17,7 @@
 namespace trace_event {
 
 class AllocationRegister;
+class MemoryAllocatorDump;
 
 } // namespace trace_event
 } // namespace base
@@ -24,27 +25,26 @@
 namespace blink {
 class WebMemoryAllocatorDump;
 
-class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final : public WebMemoryDumpProvider {
+class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final : public base::trace_event::MemoryDumpProvider {
     USING_FAST_MALLOC(BlinkGCMemoryDumpProvider);
 public:
     static BlinkGCMemoryDumpProvider* instance();
     ~BlinkGCMemoryDumpProvider() override;
 
-    // WebMemoryDumpProvider implementation.
-    bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) override;
-    bool supportsHeapProfiling() override { return true; }
-    void onHeapProfilingEnabled(bool) override;
+    // MemoryDumpProvider implementation.
+    bool OnMemoryDump(const base::trace_event::MemoryDumpArgs&, base::trace_event::ProcessMemoryDump*) override;
+    void OnHeapProfilingEnabled(bool) override;
 
     // The returned WebMemoryAllocatorDump is owned by
     // BlinkGCMemoryDumpProvider, and should not be retained (just used to
     // dump in the current call stack).
-    WebMemoryAllocatorDump* createMemoryAllocatorDumpForCurrentGC(const String& absoluteName);
+    base::trace_event::MemoryAllocatorDump* createMemoryAllocatorDumpForCurrentGC(const String& absoluteName);
 
     // This must be called before taking a new process-wide GC snapshot, to
     // clear the previous dumps.
     void clearProcessDumpForCurrentGC();
 
-    WebProcessMemoryDump* currentProcessMemoryDump() { return m_currentProcessMemoryDump.get(); }
+    base::trace_event::ProcessMemoryDump* currentProcessMemoryDump() { return m_currentProcessMemoryDump.get(); }
 
     void insert(Address, size_t, const char*);
     void remove(Address);
@@ -53,8 +53,8 @@
     BlinkGCMemoryDumpProvider();
 
     Mutex m_allocationRegisterMutex;
-    OwnPtr<base::trace_event::AllocationRegister> m_allocationRegister;
-    OwnPtr<WebProcessMemoryDump> m_currentProcessMemoryDump;
+    std::unique_ptr<base::trace_event::AllocationRegister> m_allocationRegister;
+    std::unique_ptr<base::trace_event::ProcessMemoryDump> m_currentProcessMemoryDump;
     bool m_isHeapProfilingEnabled;
 };
 
diff --git a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProviderTest.cpp b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProviderTest.cpp
index 12369461..bd8841a 100644
--- a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProviderTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProviderTest.cpp
@@ -4,7 +4,7 @@
 
 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
 
-#include "platform/web_process_memory_dump_impl.h"
+#include "base/trace_event/process_memory_dump.h"
 #include "public/platform/Platform.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "wtf/Threading.h"
@@ -13,11 +13,11 @@
 
 TEST(BlinkGCDumpProviderTest, MemoryDump)
 {
-    OwnPtr<WebProcessMemoryDump> dump = adoptPtr(new WebProcessMemoryDumpImpl());
-    ASSERT(dump);
-    BlinkGCMemoryDumpProvider::instance()->onMemoryDump(WebMemoryDumpLevelOfDetail::Detailed, dump.get());
-    ASSERT(dump->getMemoryAllocatorDump(String::format("blink_gc")));
-    ASSERT(dump->getMemoryAllocatorDump(String::format("blink_gc/allocated_objects")));
+    base::trace_event::MemoryDumpArgs args = { base::trace_event::MemoryDumpLevelOfDetail::DETAILED };
+    std::unique_ptr<base::trace_event::ProcessMemoryDump> dump(new base::trace_event::ProcessMemoryDump(nullptr));
+    BlinkGCMemoryDumpProvider::instance()->OnMemoryDump(args, dump.get());
+    DCHECK(dump->GetAllocatorDump("blink_gc"));
+    DCHECK(dump->GetAllocatorDump("blink_gc/allocated_objects"));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 4714e24..346f332 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -114,9 +114,6 @@
     s_isLowEndDevice = base::SysInfo::IsLowEndDevice();
 
     GCInfoTable::init();
-
-    if (Platform::current() && Platform::current()->currentThread())
-        Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvider::instance(), "BlinkGC");
 }
 
 void ProcessHeap::resetHeapCounters()
@@ -129,9 +126,6 @@
 {
     ASSERT(!s_shutdownComplete);
 
-    if (Platform::current() && Platform::current()->currentThread())
-        Platform::current()->unregisterMemoryDumpProvider(BlinkGCMemoryDumpProvider::instance());
-
     {
         // The main thread must be the last thread that gets detached.
         MutexLocker locker(ThreadHeap::allHeapsMutex());
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.cpp b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
index 2dda0b095..852ee3c 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
@@ -30,6 +30,7 @@
 
 #include "platform/heap/HeapPage.h"
 
+#include "base/trace_event/process_memory_dump.h"
 #include "platform/ScriptForbiddenScope.h"
 #include "platform/TraceEvent.h"
 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
@@ -135,23 +136,23 @@
 void BaseArena::takeSnapshot(const String& dumpBaseName, ThreadState::GCSnapshotInfo& info)
 {
     // |dumpBaseName| at this point is "blink_gc/thread_X/heaps/HeapName"
-    WebMemoryAllocatorDump* allocatorDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpBaseName);
+    base::trace_event::MemoryAllocatorDump* allocatorDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpBaseName);
     size_t pageCount = 0;
     BasePage::HeapSnapshotInfo heapInfo;
     for (BasePage* page = m_firstUnsweptPage; page; page = page->next()) {
         String dumpName = dumpBaseName + String::format("/pages/page_%lu", static_cast<unsigned long>(pageCount++));
-        WebMemoryAllocatorDump* pageDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName);
+        base::trace_event::MemoryAllocatorDump* pageDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName);
 
         page->takeSnapshot(pageDump, info, heapInfo);
     }
-    allocatorDump->addScalar("blink_page_count", "objects", pageCount);
+    allocatorDump->AddScalar("blink_page_count", "objects", pageCount);
 
     // When taking a full dump (w/ freelist), both the /buckets and /pages
     // report their free size but they are not meant to be added together.
     // Therefore, here we override the free_size of the parent heap to be
     // equal to the free_size of the sum of its heap pages.
-    allocatorDump->addScalar("free_size", "bytes", heapInfo.freeSize);
-    allocatorDump->addScalar("free_count", "objects", heapInfo.freeCount);
+    allocatorDump->AddScalar("free_size", "bytes", heapInfo.freeSize);
+    allocatorDump->AddScalar("free_count", "objects", heapInfo.freeCount);
 }
 
 #if ENABLE(ASSERT)
@@ -389,9 +390,9 @@
 void NormalPageArena::takeFreelistSnapshot(const String& dumpName)
 {
     if (m_freeList.takeSnapshot(dumpName)) {
-        WebMemoryAllocatorDump* bucketsDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName + "/buckets");
-        WebMemoryAllocatorDump* pagesDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName + "/pages");
-        BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwnershipEdge(pagesDump->guid(), bucketsDump->guid());
+        base::trace_event::MemoryAllocatorDump* bucketsDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName + "/buckets");
+        base::trace_event::MemoryAllocatorDump* pagesDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName + "/pages");
+        BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwnershipEdge(pagesDump->guid(), bucketsDump->guid());
     }
 }
 
@@ -1019,9 +1020,9 @@
         }
 
         String dumpName = dumpBaseName + String::format("/buckets/bucket_%lu", static_cast<unsigned long>(1 << i));
-        WebMemoryAllocatorDump* bucketDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName);
-        bucketDump->addScalar("free_count", "objects", entryCount);
-        bucketDump->addScalar("free_size", "bytes", freeSize);
+        base::trace_event::MemoryAllocatorDump* bucketDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName);
+        bucketDump->AddScalar("free_count", "objects", entryCount);
+        bucketDump->AddScalar("free_size", "bytes", freeSize);
         didDumpBucketStats = true;
     }
     return didDumpBucketStats;
@@ -1360,7 +1361,7 @@
     BasePage::markOrphaned();
 }
 
-void NormalPage::takeSnapshot(WebMemoryAllocatorDump* pageDump, ThreadState::GCSnapshotInfo& info, HeapSnapshotInfo& heapInfo)
+void NormalPage::takeSnapshot(base::trace_event::MemoryAllocatorDump* pageDump, ThreadState::GCSnapshotInfo& info, HeapSnapshotInfo& heapInfo)
 {
     HeapObjectHeader* header = nullptr;
     size_t liveCount = 0;
@@ -1391,12 +1392,12 @@
         }
     }
 
-    pageDump->addScalar("live_count", "objects", liveCount);
-    pageDump->addScalar("dead_count", "objects", deadCount);
-    pageDump->addScalar("free_count", "objects", freeCount);
-    pageDump->addScalar("live_size", "bytes", liveSize);
-    pageDump->addScalar("dead_size", "bytes", deadSize);
-    pageDump->addScalar("free_size", "bytes", freeSize);
+    pageDump->AddScalar("live_count", "objects", liveCount);
+    pageDump->AddScalar("dead_count", "objects", deadCount);
+    pageDump->AddScalar("free_count", "objects", freeCount);
+    pageDump->AddScalar("live_size", "bytes", liveSize);
+    pageDump->AddScalar("dead_size", "bytes", deadSize);
+    pageDump->AddScalar("free_size", "bytes", freeSize);
     heapInfo.freeSize += freeSize;
     heapInfo.freeCount += freeCount;
 }
@@ -1489,7 +1490,7 @@
     BasePage::markOrphaned();
 }
 
-void LargeObjectPage::takeSnapshot(WebMemoryAllocatorDump* pageDump, ThreadState::GCSnapshotInfo& info, HeapSnapshotInfo&)
+void LargeObjectPage::takeSnapshot(base::trace_event::MemoryAllocatorDump* pageDump, ThreadState::GCSnapshotInfo& info, HeapSnapshotInfo&)
 {
     size_t liveSize = 0;
     size_t deadSize = 0;
@@ -1510,10 +1511,10 @@
         info.deadSize[gcInfoIndex] += payloadSize;
     }
 
-    pageDump->addScalar("live_count", "objects", liveCount);
-    pageDump->addScalar("dead_count", "objects", deadCount);
-    pageDump->addScalar("live_size", "bytes", liveSize);
-    pageDump->addScalar("dead_size", "bytes", deadSize);
+    pageDump->AddScalar("live_count", "objects", liveCount);
+    pageDump->AddScalar("dead_count", "objects", deadCount);
+    pageDump->AddScalar("live_size", "bytes", liveSize);
+    pageDump->AddScalar("dead_size", "bytes", deadSize);
 }
 
 #if ENABLE(ASSERT)
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h
index 1bcfc82..7eed9b64 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -31,6 +31,7 @@
 #ifndef HeapPage_h
 #define HeapPage_h
 
+#include "base/trace_event/memory_allocator_dump.h"
 #include "platform/PlatformExport.h"
 #include "platform/heap/BlinkGC.h"
 #include "platform/heap/GCInfo.h"
@@ -401,7 +402,7 @@
         size_t freeSize = 0;
     };
 
-    virtual void takeSnapshot(WebMemoryAllocatorDump*, ThreadState::GCSnapshotInfo&, HeapSnapshotInfo&) = 0;
+    virtual void takeSnapshot(base::trace_event::MemoryAllocatorDump*, ThreadState::GCSnapshotInfo&, HeapSnapshotInfo&) = 0;
 #if ENABLE(ASSERT)
     virtual bool contains(Address) = 0;
 #endif
@@ -477,7 +478,7 @@
     void checkAndMarkPointer(Visitor*, Address) override;
     void markOrphaned() override;
 
-    void takeSnapshot(WebMemoryAllocatorDump*, ThreadState::GCSnapshotInfo&, HeapSnapshotInfo&) override;
+    void takeSnapshot(base::trace_event::MemoryAllocatorDump*, ThreadState::GCSnapshotInfo&, HeapSnapshotInfo&) override;
 #if ENABLE(ASSERT)
     // Returns true for the whole blinkPageSize page that the page is on, even
     // for the header, and the unmapped guard page at the start. That ensures
@@ -534,7 +535,7 @@
     void checkAndMarkPointer(Visitor*, Address) override;
     void markOrphaned() override;
 
-    void takeSnapshot(WebMemoryAllocatorDump*, ThreadState::GCSnapshotInfo&, HeapSnapshotInfo&) override;
+    void takeSnapshot(base::trace_event::MemoryAllocatorDump*, ThreadState::GCSnapshotInfo&, HeapSnapshotInfo&) override;
 #if ENABLE(ASSERT)
     // Returns true for any address that is on one of the pages that this
     // large object uses. That ensures that we can use a negative result to
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index e8910cb..8524836 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -30,6 +30,7 @@
 
 #include "platform/heap/ThreadState.h"
 
+#include "base/trace_event/process_memory_dump.h"
 #include "platform/Histogram.h"
 #include "platform/ScriptForbiddenScope.h"
 #include "platform/TraceEvent.h"
@@ -1525,15 +1526,15 @@
         totalDeadSize += info.deadSize[gcInfoIndex];
     }
 
-    WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(threadDumpName);
-    threadDump->addScalar("live_count", "objects", totalLiveCount);
-    threadDump->addScalar("dead_count", "objects", totalDeadCount);
-    threadDump->addScalar("live_size", "bytes", totalLiveSize);
-    threadDump->addScalar("dead_size", "bytes", totalDeadSize);
+    base::trace_event::MemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(threadDumpName);
+    threadDump->AddScalar("live_count", "objects", totalLiveCount);
+    threadDump->AddScalar("dead_count", "objects", totalDeadCount);
+    threadDump->AddScalar("live_size", "bytes", totalLiveSize);
+    threadDump->AddScalar("dead_size", "bytes", totalDeadSize);
 
-    WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName);
-    WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName);
-    BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwnershipEdge(classesDump->guid(), heapsDump->guid());
+    base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName);
+    base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName);
+    BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwnershipEdge(classesDump->guid(), heapsDump->guid());
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
index 6386c22c..4de383f 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
@@ -83,7 +83,7 @@
 
     // Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding.
     OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes());
-    decoder->setImagePlanes(dummyImagePlanes.release());
+    decoder->setImagePlanes(std::move(dummyImagePlanes));
 
     bool sizeIsAvailable = decoder->isSizeAvailable();
     ASSERT_TRUE(sizeIsAvailable);
@@ -115,7 +115,7 @@
     planes[2] = ((char*) planes[1]) + rowBytes[1] * uSize.height();
 
     OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes(planes, rowBytes));
-    decoder->setImagePlanes(imagePlanes.release());
+    decoder->setImagePlanes(std::move(imagePlanes));
 
     ASSERT_TRUE(decoder->decodeToYUV());
 }
@@ -251,7 +251,7 @@
     decoder->setData(data.get(), true);
 
     OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes());
-    decoder->setImagePlanes(imagePlanes.release());
+    decoder->setImagePlanes(std::move(imagePlanes));
     ASSERT_TRUE(decoder->isSizeAvailable());
     ASSERT_FALSE(decoder->canDecodeToYUV());
 }
diff --git a/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoder.cpp b/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoder.cpp
index bc1488f..93353ff 100644
--- a/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoder.cpp
+++ b/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoder.cpp
@@ -169,7 +169,7 @@
     jpeg_start_compress(cinfo, TRUE);
 
     cinfo->client_data = 0;
-    return encoderState.release();
+    return std::move(encoderState);
 }
 
 int JPEGImageEncoder::computeCompressionQuality(const double& quality)
@@ -236,7 +236,7 @@
     if (!encoderState)
         return false;
 
-    return JPEGImageEncoder::encodeWithPreInitializedState(encoderState.release(), imageData.pixels());
+    return JPEGImageEncoder::encodeWithPreInitializedState(std::move(encoderState), imageData.pixels());
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/network/HTTPHeaderMap.cpp b/third_party/WebKit/Source/platform/network/HTTPHeaderMap.cpp
index 12e38e4..c1c37dc 100644
--- a/third_party/WebKit/Source/platform/network/HTTPHeaderMap.cpp
+++ b/third_party/WebKit/Source/platform/network/HTTPHeaderMap.cpp
@@ -49,7 +49,7 @@
     for (HTTPHeaderMap::const_iterator it = begin(); it != endIt; ++it)
         data->uncheckedAppend(std::make_pair(it->key.getString().isolatedCopy(), it->value.getString().isolatedCopy()));
 
-    return data.release();
+    return data;
 }
 
 void HTTPHeaderMap::adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData> data)
diff --git a/third_party/WebKit/Source/platform/network/ResourceRequest.cpp b/third_party/WebKit/Source/platform/network/ResourceRequest.cpp
index d91fadb..003096b3 100644
--- a/third_party/WebKit/Source/platform/network/ResourceRequest.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceRequest.cpp
@@ -49,7 +49,7 @@
     setHTTPMethod(AtomicString(data->m_httpMethod));
     setPriority(data->m_priority, data->m_intraPriorityValue);
 
-    m_httpHeaderFields.adopt(data->m_httpHeaders.release());
+    m_httpHeaderFields.adopt(std::move(data->m_httpHeaders));
 
     setHTTPBody(data->m_httpBody);
     setAttachedCredential(data->m_attachedCredential);
@@ -118,7 +118,7 @@
     data->m_isExternalRequest = m_isExternalRequest;
     data->m_inputPerfMetricReportPolicy = m_inputPerfMetricReportPolicy;
     data->m_followedRedirect = m_followedRedirect;
-    return data.release();
+    return data;
 }
 
 bool ResourceRequest::isEmpty() const
diff --git a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
index dfb0076d..06fa838 100644
--- a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
@@ -111,7 +111,7 @@
     setHTTPStatusCode(data->m_httpStatusCode);
     setHTTPStatusText(AtomicString(data->m_httpStatusText));
 
-    m_httpHeaderFields.adopt(data->m_httpHeaders.release());
+    m_httpHeaderFields.adopt(std::move(data->m_httpHeaders));
     setLastModifiedDate(data->m_lastModifiedDate);
     setResourceLoadTiming(data->m_resourceLoadTiming.release());
     m_securityInfo = data->m_securityInfo;
@@ -195,7 +195,7 @@
     // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support
     // whatever values may be present in the opaque m_extraData structure.
 
-    return data.release();
+    return data;
 }
 
 bool ResourceResponse::isHTTP() const
@@ -545,7 +545,7 @@
     OwnPtr<BlobData> blobData = BlobData::create();
     blobData->appendFile(m_downloadedFilePath);
     blobData->detachFromCurrentThread();
-    m_downloadedFileHandle = BlobDataHandle::create(blobData.release(), -1);
+    m_downloadedFileHandle = BlobDataHandle::create(std::move(blobData), -1);
 }
 
 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse& b)
diff --git a/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp b/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp
index 47e3432..03d0297 100644
--- a/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp
@@ -17,7 +17,7 @@
     info->m_finalResponse = ResourceResponse(data->m_finalResponse.get());
     for (auto& responseData : data->m_redirectChain)
         info->m_redirectChain.append(ResourceResponse(responseData.get()));
-    return info.release();
+    return info;
 }
 
 PassOwnPtr<CrossThreadResourceTimingInfoData> ResourceTimingInfo::copyData() const
@@ -32,7 +32,7 @@
     for (const auto& response : m_redirectChain)
         data->m_redirectChain.append(response.copyData());
     data->m_isMainResource = m_isMainResource;
-    return data.release();
+    return data;
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
index 5b4323c8..f7a8f0f 100644
--- a/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
@@ -127,7 +127,7 @@
             int animationId = animation->id();
             int animationGroupId = animation->group();
 
-            if (addAnimation(animation.release())) {
+            if (addAnimation(std::move(animation))) {
                 sentToCompositor = true;
                 m_runState = RunState::RunningOnCompositor;
                 m_compositorAnimationId = animationId;
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
index 61742d3..6a05438 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
@@ -255,7 +255,7 @@
     int animationId = animation->id();
     int animationGroupId = animation->group();
 
-    bool sentToCompositor = addAnimation(animation.release());
+    bool sentToCompositor = addAnimation(std::move(animation));
     if (sentToCompositor) {
         m_runState = RunState::RunningOnCompositor;
         m_compositorAnimationId = animationId;
diff --git a/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp b/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp
index e431145..d0accb94 100644
--- a/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp
+++ b/third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp
@@ -76,7 +76,7 @@
     OwnPtr<DummyRectClient> client = adoptPtr(new DummyRectClient(bounds, color));
     m_displayItemList.allocateAndConstruct<DrawingDisplayItem>(
         *client, DisplayItem::DrawingFirst, client->makePicture());
-    m_dummyClients.append(client.release());
+    m_dummyClients.append(std::move(client));
     return *this;
 }
 
@@ -86,7 +86,7 @@
     OwnPtr<DummyRectClient> client = adoptPtr(new DummyRectClient(floatBounds, Color::transparent));
     m_displayItemList.allocateAndConstruct<ForeignLayerDisplayItem>(
         *client, DisplayItem::ForeignLayerFirst, std::move(layer), location, size);
-    m_dummyClients.append(client.release());
+    m_dummyClients.append(std::move(client));
     return *this;
 }
 
diff --git a/third_party/WebKit/Source/platform/text/LocaleICU.cpp b/third_party/WebKit/Source/platform/text/LocaleICU.cpp
index 2939d52..7bed850a 100644
--- a/third_party/WebKit/Source/platform/text/LocaleICU.cpp
+++ b/third_party/WebKit/Source/platform/text/LocaleICU.cpp
@@ -213,7 +213,7 @@
             return PassOwnPtr<Vector<String>>();
         labels->append(String::adopt(buffer));
     }
-    return labels.release();
+    return labels;
 }
 
 static PassOwnPtr<Vector<String>> createFallbackWeekDayShortLabels()
@@ -227,7 +227,7 @@
     labels->append("Thu");
     labels->append("Fri");
     labels->append("Sat");
-    return labels.release();
+    return labels;
 }
 
 void LocaleICU::initializeCalendar()
@@ -253,7 +253,7 @@
     labels->reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthFullName));
     for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthFullName); ++i)
         labels->append(WTF::monthFullName[i]);
-    return labels.release();
+    return labels;
 }
 
 const Vector<String>& LocaleICU::monthLabels()
@@ -293,7 +293,7 @@
     labels->reserveCapacity(2);
     labels->append("AM");
     labels->append("PM");
-    return labels.release();
+    return labels;
 }
 
 void LocaleICU::initializeDateTimeFormat()
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
index ff85b344..e7012fd 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
@@ -565,7 +565,7 @@
     privilegeData->m_universalAccess = m_universalAccess;
     privilegeData->m_canLoadLocalResources = m_canLoadLocalResources;
     privilegeData->m_blockLocalAccessFromLocalOrigin = m_blockLocalAccessFromLocalOrigin;
-    return privilegeData.release();
+    return privilegeData;
 }
 
 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeData)
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp
index 8514db7..20bda20 100644
--- a/third_party/WebKit/Source/web/InspectorOverlay.cpp
+++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -402,7 +402,7 @@
     OwnPtr<protocol::DictionaryValue> result = protocol::DictionaryValue::create();
     result->setNumber("width", size.width());
     result->setNumber("height", size.height());
-    return result.release();
+    return result;
 }
 
 void InspectorOverlay::drawNodeHighlight()
@@ -423,7 +423,7 @@
             Element* element = elements->item(i);
             InspectorHighlight highlight(element, m_nodeHighlightConfig, false);
             OwnPtr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
-            evaluateInOverlay("drawHighlight", highlightJSON.release());
+            evaluateInOverlay("drawHighlight", std::move(highlightJSON));
         }
     }
 
@@ -433,7 +433,7 @@
         highlight.appendEventTargetQuads(m_eventTargetNode.get(), m_nodeHighlightConfig);
 
     OwnPtr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
-    evaluateInOverlay("drawHighlight", highlightJSON.release());
+    evaluateInOverlay("drawHighlight", std::move(highlightJSON));
 }
 
 void InspectorOverlay::drawQuadHighlight()
@@ -536,7 +536,7 @@
     resetData->setNumber("pageZoomFactor", m_webViewImpl->mainFrameImpl()->frame()->pageZoomFactor());
     resetData->setNumber("scrollX", documentScrollOffset.x());
     resetData->setNumber("scrollY", documentScrollOffset.y());
-    evaluateInOverlay("reset", resetData.release());
+    evaluateInOverlay("reset", std::move(resetData));
 }
 
 void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument)
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 471de234..baca0da 100644
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -244,8 +244,9 @@
 
 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed()
 {
-    DCHECK(m_embeddedWorker);
-    document().postTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl::terminateWorkerContext, AllowCrossThreadAccess(m_embeddedWorker)));
+    // This should never be called because close() is not defined in
+    // ServiceWorkerGlobalScope.
+    NOTREACHED();
 }
 
 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope()
diff --git a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
index f87ad10c..42e7c9e 100644
--- a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
+++ b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
@@ -149,7 +149,7 @@
 
     // The connector object manages its own lifecycle (and the lifecycles of the two worker objects).
     // It will free itself once connecting is completed.
-    SharedWorkerConnector* connector = new SharedWorkerConnector(worker, url, name, std::move(port), webWorkerConnector.release());
+    SharedWorkerConnector* connector = new SharedWorkerConnector(worker, url, name, std::move(port), std::move(webWorkerConnector));
     connector->connect();
 }
 
diff --git a/third_party/WebKit/Source/web/WebBlob.cpp b/third_party/WebKit/Source/web/WebBlob.cpp
index 70fa3b6..370a6b10 100644
--- a/third_party/WebKit/Source/web/WebBlob.cpp
+++ b/third_party/WebKit/Source/web/WebBlob.cpp
@@ -48,7 +48,7 @@
 {
     OwnPtr<BlobData> blobData = BlobData::create();
     blobData->appendFile(path, 0, size, invalidFileTime());
-    return Blob::create(BlobDataHandle::create(blobData.release(), size));
+    return Blob::create(BlobDataHandle::create(std::move(blobData), size));
 }
 
 WebBlob WebBlob::fromV8Value(v8::Local<v8::Value> value)
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
index 773a97bb..92d6413 100644
--- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
+++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
@@ -124,7 +124,7 @@
             return;
         OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLoopAdapter(adoptPtr(client->createClientMessageLoop())));
         s_instance = instance.get();
-        MainThreadDebugger::instance()->setClientMessageLoop(instance.release());
+        MainThreadDebugger::instance()->setClientMessageLoop(std::move(instance));
     }
 
     static void webViewImplClosed(WebViewImpl* view)
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index 8b20a10..3207d37f 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -397,7 +397,7 @@
     SecurityOrigin* starterOrigin = document->getSecurityOrigin();
 
     WorkerClients* workerClients = WorkerClients::create();
-    provideContentSettingsClientToWorker(workerClients, m_contentSettingsClient.release());
+    provideContentSettingsClientToWorker(workerClients, std::move(m_contentSettingsClient));
     provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create());
     provideServiceWorkerGlobalScopeClientToWorker(workerClients, ServiceWorkerGlobalScopeClientImpl::create(*m_workerContextClient));
     provideServiceWorkerContainerClientToWorker(workerClients, adoptPtr(m_workerContextClient->createServiceWorkerProvider()));
@@ -426,7 +426,7 @@
     m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *document, *m_workerContextClient);
     m_loaderProxy = WorkerLoaderProxy::create(this);
     m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy);
-    m_workerThread->start(startupData.release());
+    m_workerThread->start(std::move(startupData));
     m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL);
 }
 
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index d58381f..972d7208 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -346,7 +346,7 @@
     InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScriptLoader->identifier(), m_mainScriptLoader->script());
     m_mainScriptLoader.clear();
 
-    workerThread()->start(startupData.release());
+    workerThread()->start(std::move(startupData));
     m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get()), workerThread(), m_url);
     m_client->workerScriptLoaded();
 }
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 7076785..fd23e7d8 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -736,7 +736,7 @@
         DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized);
         OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->createFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY), WebSize()));
         DCHECK(flingCurve);
-        m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(flingCurve.release(), this);
+        m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(std::move(flingCurve), this);
         scheduleAnimation();
         eventResult = WebInputEventResult::HandledSystem;
 
@@ -958,7 +958,7 @@
     m_flingModifier = parameters.modifiers;
     OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters.cumulativeScroll));
     DCHECK(curve);
-    m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.release(), this, parameters.startTime);
+    m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(std::move(curve), this, parameters.startTime);
     DCHECK_NE(parameters.sourceDevice, WebGestureDeviceUninitialized);
     m_flingSourceDevice = parameters.sourceDevice;
     scheduleAnimation();
diff --git a/third_party/WebKit/Source/wtf/DequeTest.cpp b/third_party/WebKit/Source/wtf/DequeTest.cpp
index 83c00e47..99b2662 100644
--- a/third_party/WebKit/Source/wtf/DequeTest.cpp
+++ b/third_party/WebKit/Source/wtf/DequeTest.cpp
@@ -212,7 +212,7 @@
     EXPECT_EQ(1u, deque.size());
     EXPECT_EQ(1, destructNumber);
 
-    OwnPtr<DestructCounter> ownCounter1 = deque.first().release();
+    OwnPtr<DestructCounter> ownCounter1 = std::move(deque.first());
     deque.removeFirst();
     EXPECT_EQ(counter1, ownCounter1->get());
     EXPECT_EQ(0u, deque.size());
diff --git a/third_party/WebKit/Source/wtf/HashMap.h b/third_party/WebKit/Source/wtf/HashMap.h
index c9f6796..776ccba 100644
--- a/third_party/WebKit/Source/wtf/HashMap.h
+++ b/third_party/WebKit/Source/wtf/HashMap.h
@@ -58,7 +58,6 @@
     typedef typename ValueTraits::TraitType ValueType;
 
 private:
-    typedef typename MappedTraits::PassInType MappedPassInType;
     typedef typename MappedTraits::PeekOutType MappedPeekType;
 
     typedef HashArg HashFunctions;
@@ -142,7 +141,8 @@
     //   static unsigned hash(const T&);
     //   static bool equal(const ValueType&, const T&);
     //   static translate(ValueType&, const T&, unsigned hashCode);
-    template <typename HashTranslator, typename T> AddResult add(const T&, MappedPassInType);
+    template <typename HashTranslator, typename IncomingKeyType, typename IncomingMappedType>
+    AddResult add(IncomingKeyType&&, IncomingMappedType&&);
 
     static bool isValidKey(KeyPeekInType);
 
@@ -377,11 +377,11 @@
 }
 
 template <typename T, typename U, typename V, typename W, typename X, typename Y>
-template <typename HashTranslator, typename TYPE>
-typename HashMap<T, U, V, W, X, Y>::AddResult
-HashMap<T, U, V, W, X, Y>::add(const TYPE& key, MappedPassInType value)
+template <typename HashTranslator, typename IncomingKeyType, typename IncomingMappedType>
+auto HashMap<T, U, V, W, X, Y>::add(IncomingKeyType&& key, IncomingMappedType&& mapped) -> AddResult
 {
-    return m_impl.template addPassingHashCode<HashMapTranslatorAdapter<ValueTraits, HashTranslator>>(key, value);
+    return m_impl.template addPassingHashCode<HashMapTranslatorAdapter<ValueTraits, HashTranslator>>(
+        std::forward<IncomingKeyType>(key), std::forward<IncomingMappedType>(mapped));
 }
 
 template <typename T, typename U, typename V, typename W, typename X, typename Y>
diff --git a/third_party/WebKit/Source/wtf/HashSet.h b/third_party/WebKit/Source/wtf/HashSet.h
index c2d6813..afd943b 100644
--- a/third_party/WebKit/Source/wtf/HashSet.h
+++ b/third_party/WebKit/Source/wtf/HashSet.h
@@ -42,7 +42,6 @@
     typedef HashArg HashFunctions;
     typedef TraitsArg ValueTraits;
     typedef typename ValueTraits::PeekInType ValuePeekInType;
-    typedef typename ValueTraits::PassInType ValuePassInType;
 
 public:
     typedef typename ValueTraits::TraitType ValueType;
diff --git a/third_party/WebKit/Source/wtf/HashTable.h b/third_party/WebKit/Source/wtf/HashTable.h
index a1b96bc..1930eb0 100644
--- a/third_party/WebKit/Source/wtf/HashTable.h
+++ b/third_party/WebKit/Source/wtf/HashTable.h
@@ -353,11 +353,9 @@
     typedef Traits ValueTraits;
     typedef Key KeyType;
     typedef typename KeyTraits::PeekInType KeyPeekInType;
-    typedef typename KeyTraits::PassInType KeyPassInType;
     typedef Value ValueType;
     typedef Extractor ExtractorType;
     typedef KeyTraits KeyTraitsType;
-    typedef typename Traits::PassInType ValuePassInType;
     typedef IdentityHashTranslator<HashFunctions> IdentityTranslatorType;
     typedef HashTableAddResult<HashTable, ValueType> AddResult;
 
diff --git a/third_party/WebKit/Source/wtf/HashTraits.h b/third_party/WebKit/Source/wtf/HashTraits.h
index b5154b38..113ebac0 100644
--- a/third_party/WebKit/Source/wtf/HashTraits.h
+++ b/third_party/WebKit/Source/wtf/HashTraits.h
@@ -102,10 +102,7 @@
     typedef const T& IteratorConstReferenceType;
     static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; }
     static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return *x; }
-    // Type for functions that take ownership, such as add.
-    // The store function either not be called or called once to store something
-    // passed in.  The value passed to the store function will be PassInType.
-    typedef const T& PassInType;
+
     template <typename IncomingValueType>
     static void store(IncomingValueType&& value, T& storage) { storage = std::forward<IncomingValueType>(value); }
 
@@ -164,7 +161,6 @@
 
     typedef typename OwnPtr<P>::PtrType PeekInType;
 
-    typedef PassOwnPtr<P> PassInType;
     static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = std::move(value); }
 
     typedef typename OwnPtr<P>::PtrType PeekOutType;
@@ -187,7 +183,6 @@
     static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; }
     static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return *x; }
 
-    typedef PassRefPtr<P> PassInType;
     static void store(PassRefPtr<P> value, RefPtr<P>& storage) { storage = value; }
 
     typedef P* PeekOutType;
@@ -205,7 +200,6 @@
 
     using PeekInType = T*;
 
-    using PassInType = std::unique_ptr<T>;
     static void store(std::unique_ptr<T>&& value, std::unique_ptr<T>& storage) { storage = std::move(value); }
 
     using PeekOutType = T*;
diff --git a/third_party/WebKit/Source/wtf/VectorTest.cpp b/third_party/WebKit/Source/wtf/VectorTest.cpp
index 6f047688..7203ea4 100644
--- a/third_party/WebKit/Source/wtf/VectorTest.cpp
+++ b/third_party/WebKit/Source/wtf/VectorTest.cpp
@@ -200,7 +200,7 @@
     EXPECT_EQ(1u, vector.size());
     EXPECT_EQ(1, destructNumber);
 
-    OwnPtr<DestructCounter> ownCounter1 = vector[0].release();
+    OwnPtr<DestructCounter> ownCounter1 = std::move(vector[0]);
     vector.remove(0);
     ASSERT_EQ(counter1, ownCounter1->get());
     ASSERT_EQ(0u, vector.size());
diff --git a/third_party/WebKit/Source/wtf/text/TextPosition.cpp b/third_party/WebKit/Source/wtf/text/TextPosition.cpp
index 27e79f8..32a0314f 100644
--- a/third_party/WebKit/Source/wtf/text/TextPosition.cpp
+++ b/third_party/WebKit/Source/wtf/text/TextPosition.cpp
@@ -45,7 +45,7 @@
     }
     result->append(text.length());
 
-    return result.release();
+    return result;
 }
 
 OrdinalNumber TextPosition::toOffset(const Vector<unsigned>& lineEndings)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
deleted file mode 100644
index baab81f..0000000
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.tool.commands.stepsequence import StepSequence
-from webkitpy.tool.commands.command import Command
-
-_log = logging.getLogger(__name__)
-
-
-class AbstractSequencedCommand(Command):
-    steps = None
-
-    def __init__(self):
-        self._sequence = StepSequence(self.steps)
-        super(AbstractSequencedCommand, self).__init__(self._sequence.options())
-
-    def _prepare_state(self, options, args, tool):
-        return None
-
-    def execute(self, options, args, tool):
-        try:
-            state = self._prepare_state(options, args, tool)
-        except ScriptError, e:
-            _log.error(e.message_with_output())
-            self._exit(e.exit_code or 2)
-
-        self._sequence.run_and_handle_errors(tool, options, state)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/prettydiff.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/prettydiff.py
index 4d41282..84d6b16 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/prettydiff.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/prettydiff.py
@@ -26,14 +26,67 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
-from webkitpy.tool.steps.confirmdiff import ConfirmDiff
+import logging
+import optparse
+import sys
+import urllib
+
+from webkitpy.common.prettypatch import PrettyPatch
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.commands.command import Command
 
 
-class PrettyDiff(AbstractSequencedCommand):
+_log = logging.getLogger(__name__)
+
+
+class PrettyDiff(Command):
     name = "pretty-diff"
     help_text = "Shows the pretty diff in the default browser"
     show_in_main_help = True
-    steps = [
-        ConfirmDiff,
-    ]
+
+    def __init__(self):
+        options = [
+            optparse.make_option("-g", "--git-commit", action="store", dest="git_commit",
+                                 help=("Operate on a local commit. If a range, the commits are squashed into one. <ref>.... "
+                                       "includes the working copy changes. UPSTREAM can be used for the upstream/tracking branch."))
+        ]
+        super(PrettyDiff, self).__init__(options)
+
+    def execute(self, options, args, tool):
+        pretty_diff_file = self._show_pretty_diff(options)
+        if pretty_diff_file:
+            diff_correct = tool.user.confirm("Was that diff correct?")
+            pretty_diff_file.close()
+            if not diff_correct:
+                sys.exit(1)
+
+    def _show_pretty_diff(self, options):
+        if not self._tool.user.can_open_url():
+            return None
+        try:
+            pretty_patch = PrettyPatch(self._tool.executive)
+            patch = self._diff(options)
+            pretty_diff_file = pretty_patch.pretty_diff_file(patch)
+            self._open_pretty_diff(pretty_diff_file.name)
+            # We return the pretty_diff_file here because we need to keep the
+            # file alive until the user has had a chance to confirm the diff.
+            return pretty_diff_file
+        except ScriptError as e:
+            _log.warning("PrettyPatch failed.  :(")
+            _log.error(e.message_with_output())
+            self._exit(e.exit_code or 2)
+        except OSError:
+            _log.warning("PrettyPatch unavailable.")
+
+    def _diff(self, options):
+        changed_files = self._tool.scm().changed_files(options.git_commit)
+        return self._tool.scm().create_patch(options.git_commit,
+                                             changed_files=changed_files)
+
+    def _open_pretty_diff(self, file_path):
+        if self._tool.platform.is_cygwin():
+            assert file_path.endswith('.html')
+            self._tool.executive.run_command(['cygstart', file_path])
+            return
+        url = "file://%s" % urllib.quote(file_path)
+        self._tool.user.open_url(url)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/stepsequence.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/stepsequence.py
deleted file mode 100644
index 2816307e..0000000
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/stepsequence.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import sys
-
-from webkitpy.tool.steps.options import Options
-
-from webkitpy.common.system.executive import ScriptError
-
-_log = logging.getLogger(__name__)
-
-
-class StepSequenceErrorHandler():
-
-    @classmethod
-    def handle_script_error(cls, tool, patch, script_error):
-        raise NotImplementedError, "subclasses must implement"
-
-    @classmethod
-    def handle_checkout_needs_update(cls, tool, state, options, error):
-        raise NotImplementedError, "subclasses must implement"
-
-
-class StepSequence(object):
-
-    def __init__(self, steps):
-        self._steps = steps or []
-
-    def options(self):
-        collected_options = [
-            Options.parent_command,
-            Options.quiet,
-        ]
-        for step in self._steps:
-            collected_options = collected_options + step.options()
-        # Remove duplicates.
-        collected_options = sorted(set(collected_options))
-        return collected_options
-
-    def _run(self, tool, options, state):
-        for step in self._steps:
-            step(tool, options).run(state)
-
-    # Child processes exit with a special code to the parent queue process can detect the error was handled.
-    handled_error_code = 2
-
-    @classmethod
-    def exit_after_handled_error(cls, error):
-        _log.error(error)
-        sys.exit(cls.handled_error_code)
-
-    def run_and_handle_errors(self, tool, options, state=None):
-        if not state:
-            state = {}
-        try:
-            self._run(tool, options, state)
-        except ScriptError, e:
-            if not options.quiet:
-                _log.error(e.message_with_output())
-            if options.parent_command:
-                command = tool.command_by_name(options.parent_command)
-                command.handle_script_error(tool, state, e)
-            self.exit_after_handled_error(e)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/__init__.py
deleted file mode 100644
index ef65bee5..0000000
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# Required for Python to search this directory for module files
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/abstractstep.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/abstractstep.py
deleted file mode 100644
index 45a44472..0000000
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/abstractstep.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import sys
-
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.tool.steps.options import Options
-
-
-class AbstractStep(object):
-
-    def __init__(self, tool, options):
-        self._tool = tool
-        self._options = options
-
-    def _exit(self, code):
-        sys.exit(code)
-
-    @classmethod
-    def options(cls):
-        return [
-            # We need this option here because cached_lookup uses it.  :(
-            Options.git_commit,
-        ]
-
-    def run(self, state):
-        raise NotImplementedError, "subclasses must implement"
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/confirmdiff.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/confirmdiff.py
deleted file mode 100644
index 6f785b44..0000000
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/confirmdiff.py
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import urllib
-
-from webkitpy.tool.steps.abstractstep import AbstractStep
-from webkitpy.tool.steps.options import Options
-from webkitpy.common.prettypatch import PrettyPatch
-from webkitpy.common.system import logutils
-from webkitpy.common.system.executive import ScriptError
-
-
-_log = logutils.get_logger(__file__)
-
-
-class ConfirmDiff(AbstractStep):
-
-    @classmethod
-    def options(cls):
-        return AbstractStep.options() + [
-            Options.confirm,
-        ]
-
-    def _show_pretty_diff(self):
-        if not self._tool.user.can_open_url():
-            return None
-
-        try:
-            pretty_patch = PrettyPatch(self._tool.executive)
-            pretty_diff_file = pretty_patch.pretty_diff_file(self.diff())
-            self._open_pretty_diff(pretty_diff_file.name)
-
-            # We return the pretty_diff_file here because we need to keep the
-            # file alive until the user has had a chance to confirm the diff.
-            return pretty_diff_file
-        except ScriptError, e:
-            _log.warning("PrettyPatch failed.  :(")
-        except OSError, e:
-            _log.warning("PrettyPatch unavailable.")
-
-    def _open_pretty_diff(self, file_path):
-        if self._tool.platform.is_cygwin():
-            assert file_path.endswith('.html')
-            self._tool.executive.run_command(['cygstart', file_path])
-            return
-        url = "file://%s" % urllib.quote(file_path)
-        self._tool.user.open_url(url)
-
-    def diff(self):
-        changed_files = self._tool.scm().changed_files(self._options.git_commit)
-        return self._tool.scm().create_patch(self._options.git_commit,
-                                             changed_files=changed_files)
-
-    def run(self, state):
-        if not self._options.confirm:
-            return
-        pretty_diff_file = self._show_pretty_diff()
-        if pretty_diff_file:
-            diff_correct = self._tool.user.confirm("Was that diff correct?")
-            pretty_diff_file.close()
-            if not diff_correct:
-                self._exit(1)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/options.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/options.py
deleted file mode 100644
index 80ebb1b..0000000
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/options.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from optparse import make_option
-
-
-class Options(object):
-    confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
-    git_commit = make_option("-g", "--git-commit", action="store", dest="git_commit",
-                             help="Operate on a local commit. If a range, the commits are squashed into one. <ref>.... includes the working copy changes. UPSTREAM can be used for the upstream/tracking branch.")
-    parent_command = make_option("--parent-command", action="store", dest="parent_command",
-                                 default=None, help="(Internal) The command that spawned this instance.")
-    quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
index a588c90..9566830 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
@@ -28,12 +28,12 @@
     def main(self, argv=None):
         self.parse_args(argv)
 
-        self.cd('')
         if not self.checkout_is_okay():
             return 1
 
         self.print_('## noting the current Chromium commitish')
-        chromium_commitish = self.run(['git', 'show-ref', 'HEAD'])[1].split()[0]
+        _, show_ref_output = self.run(['git', 'show-ref', 'HEAD'])
+        chromium_commitish = show_ref_output.split()[0]
 
         if self.target == 'wpt':
             import_commitish = self.update(
@@ -76,7 +76,8 @@
         self.target = args.target
 
     def checkout_is_okay(self):
-        if self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_failure=False)[0]:
+        git_diff_retcode, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_failure=False)
+        if git_diff_retcode:
             self.print_('## checkout is dirty, aborting')
             return False
 
@@ -95,58 +96,56 @@
 
         return True
 
-    def update(self, dest, url):
+    def update(self, dest_dir_name, url):
         """Updates an imported repository.
 
         Args:
-            dest: The destination directory name.
+            dest_dir_name: The destination directory name.
             url: URL of the git repository.
 
         Returns:
             A string for the commit description "<destination>@<commitish>".
         """
-        self.print_('## cloning %s into %s' % (url, dest))
-        self.cd('')
-        self.run(['git', 'clone', url, dest])
+        temp_repo_path = self.path_from_webkit_base(dest_dir_name)
+        self.print_('## cloning %s into %s' % (url, temp_repo_path))
+        self.run(['git', 'clone', url, temp_repo_path])
 
-        self.cd(dest)
-        self.run(['git', 'submodule', 'update', '--init', '--recursive'])
+        self.run(['git', 'submodule', 'update', '--init', '--recursive'], cwd=temp_repo_path)
 
         self.print_('## noting the revision we are importing')
-        master_commitish = self.run(['git', 'show-ref', 'origin/master'])[1].split()[0]
+        _, show_ref_output = self.run(['git', 'show-ref', 'origin/master'], cwd=temp_repo_path)
+        master_commitish = show_ref_output.split()[0]
 
-        self.print_('## cleaning out tests from LayoutTests/imported/%s' % dest)
-        dest_repo = self.path_from_webkit_base('LayoutTests', 'imported', dest)
-        files_to_delete = self.fs.files_under(dest_repo, file_filter=self.is_not_baseline)
+        self.print_('## cleaning out tests from LayoutTests/imported/%s' % dest_dir_name)
+        dest_path = self.path_from_webkit_base('LayoutTests', 'imported', dest_dir_name)
+        files_to_delete = self.fs.files_under(dest_path, file_filter=self.is_not_baseline)
         for subpath in files_to_delete:
             self.remove('LayoutTests', 'imported', subpath)
 
         self.print_('## importing the tests')
-        src_repo = self.path_from_webkit_base(dest)
+        src_repo = self.path_from_webkit_base(dest_dir_name)
         import_path = self.path_from_webkit_base('Tools', 'Scripts', 'import-w3c-tests')
         self.run([self.host.executable, import_path, '-d', 'imported', src_repo])
 
-        self.cd('')
-        self.run(['git', 'add', '--all', 'LayoutTests/imported/%s' % dest])
+        self.run(['git', 'add', '--all', 'LayoutTests/imported/%s' % dest_dir_name])
 
         self.print_('## deleting manual tests')
-        files_to_delete = self.fs.files_under(dest_repo, file_filter=self.is_manual_test)
+        files_to_delete = self.fs.files_under(dest_path, file_filter=self.is_manual_test)
         for subpath in files_to_delete:
             self.remove('LayoutTests', 'imported', subpath)
 
         self.print_('## deleting any orphaned baselines')
-        previous_baselines = self.fs.files_under(dest_repo, file_filter=self.is_baseline)
+        previous_baselines = self.fs.files_under(dest_path, file_filter=self.is_baseline)
         for subpath in previous_baselines:
-            full_path = self.fs.join(dest_repo, subpath)
+            full_path = self.fs.join(dest_path, subpath)
             if self.fs.glob(full_path.replace('-expected.txt', '*')) == [full_path]:
                 self.fs.remove(full_path)
 
         if not self.keep_w3c_repos_around:
-            self.print_('## deleting %s repo directory' % dest)
-            self.cd('')
-            self.rmtree(repo)
+            self.print_('## deleting %s repo directory' % temp_repo_path)
+            self.rmtree(temp_repo_path)
 
-        return '%s@%s' % (dest, master_commitish)
+        return '%s@%s' % (dest_dir_name, master_commitish)
 
     def commit_changes_if_needed(self, chromium_commitish, import_commitish):
         if self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_failure=False)[0]:
@@ -176,11 +175,12 @@
     def is_not_baseline(self, fs, dirname, basename):
         return not self.is_baseline(fs, dirname, basename)
 
-    def run(self, cmd, exit_on_failure=True):
+    def run(self, cmd, exit_on_failure=True, cwd=None):
         if self.verbose:
             self.print_(' '.join(cmd))
 
-        proc = self.executive.popen(cmd, stdout=self.executive.PIPE, stderr=self.executive.PIPE)
+        cwd = cwd or self.finder.webkit_base()
+        proc = self.executive.popen(cmd, stdout=self.executive.PIPE, stderr=self.executive.PIPE, cwd=cwd)
         out, err = proc.communicate()
         if proc.returncode or self.verbose:
             self.print_('# ret> %d' % proc.returncode)
@@ -194,12 +194,6 @@
             self.host.exit(proc.returncode)
         return proc.returncode, out
 
-    def cd(self, *comps):
-        dest = self.path_from_webkit_base(*comps)
-        if self.verbose:
-            self.print_('cd %s' % dest)
-        self.fs.chdir(dest)
-
     def copyfile(self, source, destination):
         if self.verbose:
             self.print_('cp %s %s' % (source, destination))
diff --git a/third_party/closure_compiler/externs/autofill_private.js b/third_party/closure_compiler/externs/autofill_private.js
index bb34658..dc2f693 100644
--- a/third_party/closure_compiler/externs/autofill_private.js
+++ b/third_party/closure_compiler/externs/autofill_private.js
@@ -1,7 +1,14 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+// This file was generated by:
+//   tools/json_schema_compiler/compiler.py.
+// NOTE: The format of types has changed. 'FooType' is now
+//   'chrome.autofillPrivate.FooType'.
+// Please run the closure compiler before committing changes.
+// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
+
 /** @fileoverview Externs generated from namespace: autofillPrivate */
 
 /**
@@ -34,7 +41,7 @@
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-AutofillMetadata
  */
-var AutofillMetadata;
+chrome.autofillPrivate.AutofillMetadata;
 
 /**
  * @typedef {{
@@ -51,11 +58,11 @@
  *   phoneNumbers: (!Array<string>|undefined),
  *   emailAddresses: (!Array<string>|undefined),
  *   languageCode: (string|undefined),
- *   metadata: (AutofillMetadata|undefined)
+ *   metadata: (!chrome.autofillPrivate.AutofillMetadata|undefined)
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressEntry
  */
-var AddressEntry;
+chrome.autofillPrivate.AddressEntry;
 
 /**
  * @typedef {{
@@ -66,24 +73,24 @@
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponent
  */
-var AddressComponent;
+chrome.autofillPrivate.AddressComponent;
 
 /**
  * @typedef {{
- *   row: !Array<AddressComponent>
+ *   row: !Array<!chrome.autofillPrivate.AddressComponent>
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponentRow
  */
-var AddressComponentRow;
+chrome.autofillPrivate.AddressComponentRow;
 
 /**
  * @typedef {{
- *   components: !Array<AddressComponentRow>,
+ *   components: !Array<!chrome.autofillPrivate.AddressComponentRow>,
  *   languageCode: string
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponents
  */
-var AddressComponents;
+chrome.autofillPrivate.AddressComponents;
 
 /**
  * @typedef {{
@@ -92,11 +99,11 @@
  *   cardNumber: (string|undefined),
  *   expirationMonth: (string|undefined),
  *   expirationYear: (string|undefined),
- *   metadata: (AutofillMetadata|undefined)
+ *   metadata: (!chrome.autofillPrivate.AutofillMetadata|undefined)
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-CreditCardEntry
  */
-var CreditCardEntry;
+chrome.autofillPrivate.CreditCardEntry;
 
 /**
  * @typedef {{
@@ -106,12 +113,13 @@
  * }}
  * @see https://developer.chrome.com/extensions/autofillPrivate#type-ValidatePhoneParams
  */
-var ValidatePhoneParams;
+chrome.autofillPrivate.ValidatePhoneParams;
 
 /**
  * Saves the given address. If |address| has an empty string as its ID, it will
  * be assigned a new one and added as a new entry.
- * @param {AddressEntry} address The address entry to save.
+ * @param {!chrome.autofillPrivate.AddressEntry} address The address entry to
+ *     save.
  * @see https://developer.chrome.com/extensions/autofillPrivate#method-saveAddress
  */
 chrome.autofillPrivate.saveAddress = function(address) {};
@@ -121,8 +129,8 @@
  * @param {string} countryCode A two-character string representing the address'
  *     country     whose components should be returned. See autofill_country.cc
  *     for a     list of valid codes.
- * @param {function(AddressComponents):void} callback Callback which will be
- *     called with components.
+ * @param {function(!chrome.autofillPrivate.AddressComponents):void} callback
+ *     Callback which will be called with components.
  * @see https://developer.chrome.com/extensions/autofillPrivate#method-getAddressComponents
  */
 chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {};
@@ -130,7 +138,7 @@
 /**
  * Saves the given credit card. If |card| has an empty string as its ID, it will
  * be assigned a new one and added as a new entry.
- * @param {CreditCardEntry} card The card entry to save.
+ * @param {!chrome.autofillPrivate.CreditCardEntry} card The card entry to save.
  * @see https://developer.chrome.com/extensions/autofillPrivate#method-saveCreditCard
  */
 chrome.autofillPrivate.saveCreditCard = function(card) {};
@@ -146,7 +154,8 @@
  * Validates a newly-added phone number and invokes the callback with a list of
  * validated numbers. Note that if the newly-added number was invalid, it will
  * not be returned in the list of valid numbers.
- * @param {ValidatePhoneParams} params The parameters to this function.
+ * @param {!chrome.autofillPrivate.ValidatePhoneParams} params The parameters to
+ *     this function.
  * @param {function(!Array<string>):void} callback Callback which will be called
  *     with validated phone numbers.
  * @see https://developer.chrome.com/extensions/autofillPrivate#method-validatePhoneNumbers
@@ -176,5 +185,3 @@
  * @see https://developer.chrome.com/extensions/autofillPrivate#event-onCreditCardListChanged
  */
 chrome.autofillPrivate.onCreditCardListChanged;
-
-
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium
index 616b5c3..157f470 100644
--- a/third_party/libxml/README.chromium
+++ b/third_party/libxml/README.chromium
@@ -1,6 +1,6 @@
 Name: libxml
 URL: http://xmlsoft.org
-Version: 2.9.3
+Version: 8effcb578e0590cc01bbcab0f9dccefc6bdbcdbd
 License: MIT
 License File: src/Copyright
 Security Critical: yes
@@ -10,10 +10,8 @@
 libxml2 from libxml.org.
 
 Modifications:
-- Import https://git.gnome.org/browse/libxml2/commit/?id=a7a94612aa3b16779e2c74e1fa353b5d9786c602 from upstream
 - Add helper classes in chromium/libxml_utils.cc and
   chromium/include/libxml/libxml_utils.h.
-- Include fix for runtime blowups on larger xpath expressions, https://bugzilla.gnome.org/show_bug.cgi?id=760325
 - Fix printf format specifiers, https://chromium.googlesource.com/chromium/src/+/d31995076e55f1aac2f935c53b585a90ece27a11
 - Add second workaround for VS 2015 Update 2 code-gen bug - crbug.com/599427
 - Add patch from https://bugzilla.gnome.org/show_bug.cgi?id=758588 for
@@ -22,38 +20,48 @@
 
 To import a new snapshot:
 
-On Linux, get the latest tar, untar, and replace src/ with libxml2-X.Y.Z/.
+1. git clone git://git.gnome.org/libxml2
 
-Generate config.h, include/libxml/xmlversion.h, and xml2-config:
+2. Note the commit and export the repository to third_party/libxml/src
 
-cd linux
-../src/configure --without-iconv --with-icu --without-ftp --without-http \
-    --without-lzma
-cd ..
-Patch config.h to not define HAVE_RAND_R since we use this file on Android
-and it does not have it.
+3. Update README.chromium with the commit
 
-On a Mac, do the same in the mac/ subdir for config.h and
-include/libxml/xmlversion.h and copy those to the Linux box in mac/
+4. Apply the patches mentioned above; for fixes that have flowed in
+   from upstream updates, remove them from README.chromium.
 
-On a Windows box:
-cd libxml2-2.9.2\win32
-cscript //E:jscript configure.js compiler=msvc iconv=no icu=yes ftp=no http=no
-Then copy VC10/config.h and include/libxml/xmlversion.h to win32/ on Linux.
-Patch win32/config.h to wrap the #define snprintf with:
-  #if _MSC_VER < 1900
-  #endif
+5. Generate config.h, include/libxml/xmlversion.h, and xml2-config:
 
-Remove:
-  src/doc/
-  src/example/
-  src/macos/libxml2.mcp.xml.sit.hqx
-  src/os400/
-  src/python/
-  src/result/
-  src/test/
-  src/vms/
-  src/win32/wince
-  src/VxWorks/
+   cd linux
+   ../src/configure --without-iconv --with-icu --without-ftp \
+       --without-http --without-lzma
 
-Update BUILD.gn and libxml.gyp as necessary to add/remove files, etc.
+6. Patch config.h to not define HAVE_RAND_R since we use this file on
+   Android which does not have it.
+
+7. On a Mac, do the same in the mac/ subdir for config.h and
+   include/libxml/xmlversion.h and copy those to the Linux box in mac/
+
+8. On a Windows box:
+
+   cd win32
+   cscript //E:jscript configure.js compiler=msvc iconv=no icu=yes \
+       ftp=no http=no
+
+   Then copy VC10/config.h and include/libxml/xmlversion.h to win32/
+   on Linux.
+
+9. Remove the following, and any other new unneeded files:
+
+   src/doc/
+   src/example/
+   src/macos/libxml2.mcp.xml.sit.hqx
+   src/os400/
+   src/python/
+   src/result/
+   src/test/
+   src/vms/
+   src/win32/wince
+   src/VxWorks/
+
+10. Update BUILD.gn and libxml.gyp as necessary to add/remove files,
+    etc.
diff --git a/third_party/libxml/linux/config.h b/third_party/libxml/linux/config.h
index 5c6121b782..f3d4f75 100644
--- a/third_party/libxml/linux/config.h
+++ b/third_party/libxml/linux/config.h
@@ -158,7 +158,6 @@
 
 /* Define to 1 if you have the `rand_r' function. */
 
-
 /* Define to 1 if you have the <resolv.h> header file. */
 #define HAVE_RESOLV_H 1
 
@@ -275,7 +274,8 @@
 /* Define as const if the declaration of iconv() needs const. */
 /* #undef ICONV_CONST */
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
 #define LT_OBJDIR ".libs/"
 
 /* Name of package */
@@ -312,7 +312,7 @@
 #define VA_LIST_IS_ARRAY 1
 
 /* Version number of package */
-#define VERSION "2.9.3"
+#define VERSION "2.9.4"
 
 /* Determine what socket length (socklen_t) data type is */
 #define XML_SOCKLEN_T socklen_t
diff --git a/third_party/libxml/linux/include/libxml/xmlversion.h b/third_party/libxml/linux/include/libxml/xmlversion.h
index bc7b4c4..ebf1374c 100644
--- a/third_party/libxml/linux/include/libxml/xmlversion.h
+++ b/third_party/libxml/linux/include/libxml/xmlversion.h
@@ -29,21 +29,21 @@
  *
  * the version string like "1.2.3"
  */
-#define LIBXML_DOTTED_VERSION "2.9.3"
+#define LIBXML_DOTTED_VERSION "2.9.4"
 
 /**
  * LIBXML_VERSION:
  *
  * the version number: 1.2.3 value is 10203
  */
-#define LIBXML_VERSION 20903
+#define LIBXML_VERSION 20904
 
 /**
  * LIBXML_VERSION_STRING:
  *
  * the version number string, 1.2.3 value is "10203"
  */
-#define LIBXML_VERSION_STRING "20903"
+#define LIBXML_VERSION_STRING "20904"
 
 /**
  * LIBXML_VERSION_EXTRA:
@@ -58,7 +58,7 @@
  * Macro to check that the libxml version in use is compatible with
  * the version the software has been compiled against
  */
-#define LIBXML_TEST_VERSION xmlCheckVersion(20903);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20904);
 
 #ifndef VMS
 #if 0
diff --git a/third_party/libxml/linux/xml2-config b/third_party/libxml/linux/xml2-config
index 59cf2d5..2efbfd7 100755
--- a/third_party/libxml/linux/xml2-config
+++ b/third_party/libxml/linux/xml2-config
@@ -58,7 +58,7 @@
       ;;
 
     --version)
-	echo 2.9.3
+	echo 2.9.4
 	exit 0
 	;;
 
@@ -86,12 +86,12 @@
 	then
 	    if [ "-L${libdir}" = "-L/usr/lib" -o "-L${libdir}" = "-L/usr/lib64" ]
 	    then
-		echo -lxml2 -lz   -lm  -ldl
+		echo -lxml2 -lz      -licui18n -licuuc -licudata   -lm  -ldl
 	    else
-		echo -L${libdir} -lxml2 -lz   -lm  -ldl
+		echo -L${libdir} -lxml2 -lz      -licui18n -licuuc -licudata   -lm  -ldl
 	    fi
 	else
-	    echo -L${libdir} -lxml2 -lz   -lm  -ldl 
+	    echo -L${libdir} -lxml2 -lz      -licui18n -licuuc -licudata   -lm  -ldl 
 	fi
        	;;
 
diff --git a/third_party/libxml/mac/config.h b/third_party/libxml/mac/config.h
index 9a1e7bf4..d17857b 100644
--- a/third_party/libxml/mac/config.h
+++ b/third_party/libxml/mac/config.h
@@ -312,7 +312,7 @@
 #define VA_LIST_IS_ARRAY 1
 
 /* Version number of package */
-#define VERSION "2.9.3"
+#define VERSION "2.9.4"
 
 /* Determine what socket length (socklen_t) data type is */
 #define XML_SOCKLEN_T socklen_t
diff --git a/third_party/libxml/mac/include/libxml/xmlversion.h b/third_party/libxml/mac/include/libxml/xmlversion.h
index bc7b4c4..ebf1374c 100644
--- a/third_party/libxml/mac/include/libxml/xmlversion.h
+++ b/third_party/libxml/mac/include/libxml/xmlversion.h
@@ -29,21 +29,21 @@
  *
  * the version string like "1.2.3"
  */
-#define LIBXML_DOTTED_VERSION "2.9.3"
+#define LIBXML_DOTTED_VERSION "2.9.4"
 
 /**
  * LIBXML_VERSION:
  *
  * the version number: 1.2.3 value is 10203
  */
-#define LIBXML_VERSION 20903
+#define LIBXML_VERSION 20904
 
 /**
  * LIBXML_VERSION_STRING:
  *
  * the version number string, 1.2.3 value is "10203"
  */
-#define LIBXML_VERSION_STRING "20903"
+#define LIBXML_VERSION_STRING "20904"
 
 /**
  * LIBXML_VERSION_EXTRA:
@@ -58,7 +58,7 @@
  * Macro to check that the libxml version in use is compatible with
  * the version the software has been compiled against
  */
-#define LIBXML_TEST_VERSION xmlCheckVersion(20903);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20904);
 
 #ifndef VMS
 #if 0
diff --git a/third_party/libxml/src/COPYING b/third_party/libxml/src/COPYING
index d61318502..94a9ed0 100644
--- a/third_party/libxml/src/COPYING
+++ b/third_party/libxml/src/COPYING
@@ -1,23 +1,674 @@
-Except where otherwise noted in the source code (e.g. the files hash.c,
-list.c and the trio files, which are covered by a similar licence but
-with different Copyright notices) all the files are:
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
 
- Copyright (C) 1998-2012 Daniel Veillard.  All Rights Reserved.
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
 
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is fur-
-nished to do so, subject to the following conditions:
+                            Preamble
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/third_party/libxml/src/ChangeLog b/third_party/libxml/src/ChangeLog
index 08725dd..ef6cb8e 100644
--- a/third_party/libxml/src/ChangeLog
+++ b/third_party/libxml/src/ChangeLog
@@ -593,7 +593,7 @@
 
 Tue Apr 22 10:27:17 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
-	* dict.c: improvement on the hashing of the dictionnary, with visible
+	* dict.c: improvement on the hashing of the dictionary, with visible
 	  speed up as the number of strings in the hash increases, work from
 	  Stefan Behnel
 
@@ -5017,7 +5017,7 @@
 Sun Jan 23 23:54:39 CET 2005 Daniel Veillard <daniel@veillard.com>
 
 	* hash.c include/libxml/hash.h: added xmlHashCreateDict where
-	  the hash reuses the dictionnary for internal strings
+	  the hash reuses the dictionary for internal strings
 	* entities.c valid.c parser.c: reuse that new API, leads to a decent
 	  speedup when parsing for example DocBook documents.
 
@@ -5371,7 +5371,7 @@
 Wed Nov 24 13:41:52 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 	* dict.c include/libxml/dict.h: added xmlDictExists() to the 
-	  dictionnary interface.
+	  dictionary interface.
 	* xmlreader.c: applying xmlTextReaderHasAttributes fix for namespaces
 	  from Rob Richards
 
@@ -5697,7 +5697,7 @@
 Tue Oct 26 18:09:59 CEST 2004 Daniel Veillard <daniel@veillard.com>
 
 	* debugXML.c include/libxml/xmlerror.h: added checking for names
-	  values and dictionnaries generates a tons of errors
+	  values and dictionaries generates a tons of errors
 	* SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c
 	  include/libxml/tree.h: fixing the errors in the regression tests
 
@@ -7746,14 +7746,14 @@
 	  make tests
 	* xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to
 	  compile an XPath expression within a context, currently the goal
-	  is to be able to reuse the XSLT stylesheet dictionnary, but this
+	  is to be able to reuse the XSLT stylesheet dictionary, but this
 	  opens the door to others possible optimizations.
 	* dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows
-	  to build a new dictionnary based on another read-only dictionnary.
-	  This is needed for XSLT to keep the stylesheet dictionnary read-only
+	  to build a new dictionary based on another read-only dictionary.
+	  This is needed for XSLT to keep the stylesheet dictionary read-only
 	  while being able to reuse the strings for the transformation
-	  dictionnary.
-	* xinclude.c: fixed a dictionnar reference counting problem occuring
+	  dictionary.
+	* xinclude.c: fixed a dictionary reference counting problem occuring
 	  when document parsing failed.
 	* testSAX.c: adding option --repeat for timing 100times the parsing
 	* doc/* : rebuilt all the docs
@@ -7806,7 +7806,7 @@
 Thu Jan  8 17:57:50 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 	* xmlschemas.c: removed a memory leak remaining from the switch
-	  to a dictionnary for string allocations c.f. #130891
+	  to a dictionary for string allocations c.f. #130891
 
 Thu Jan  8 17:48:46 CET 2004 Daniel Veillard <daniel@veillard.com>
 
@@ -7928,7 +7928,7 @@
 Fri Jan  2 11:40:06 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 	* SAX2.c: found and fixed a bug misallocating some non
-	  blank text node strings from the dictionnary.
+	  blank text node strings from the dictionary.
 	* xmlmemory.c: fixed a problem with the memory debug mutex
 	  release.
 
@@ -9386,7 +9386,7 @@
 
 	* parser.c: William's change allowed to spot a nasty bug in xmlDoRead
 	  if the result is not well formed that ctxt->myDoc is not NULL
-	  and uses the context dictionnary.
+	  and uses the context dictionary.
 
 Fri Sep 26 21:09:34 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
diff --git a/third_party/libxml/src/HTMLparser.c b/third_party/libxml/src/HTMLparser.c
index b7291972..69eed2b 100644
--- a/third_party/libxml/src/HTMLparser.c
+++ b/third_party/libxml/src/HTMLparser.c
@@ -6537,7 +6537,7 @@
  * DICT_FREE:
  * @str:  a string
  *
- * Free a string if it is not owned by the "dict" dictionnary in the
+ * Free a string if it is not owned by the "dict" dictionary in the
  * current scope
  */
 #define DICT_FREE(str)						\
diff --git a/third_party/libxml/src/Makefile.am b/third_party/libxml/src/Makefile.am
index 70720f3..9f988b0 100644
--- a/third_party/libxml/src/Makefile.am
+++ b/third_party/libxml/src/Makefile.am
@@ -216,6 +216,10 @@
 	@echo '## Go get a cup of coffee it is gonna take a while ...'
 	$(MAKE) CHECKER='valgrind -q' runtests
 
+asan:
+	@echo '## rebuilding for ASAN'
+	./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff  ; $(MAKE) clean ; $(MAKE)
+
 testall : tests SVGtests SAXtests
 
 tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES)
@@ -1207,7 +1211,7 @@
 	     check-xsddata-test-suite.py check-xinclude-test-suite.py \
              example/Makefile.am example/gjobread.c example/gjobs.xml \
 	     $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
-	     libxml2-config.cmake.in \
+	     libxml2-config.cmake.in autogen.sh \
 	     trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
 	     triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \
 	     enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
diff --git a/third_party/libxml/src/Makefile.in b/third_party/libxml/src/Makefile.in
index edf924b5..b59cdddd 100644
--- a/third_party/libxml/src/Makefile.in
+++ b/third_party/libxml/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -18,17 +18,7 @@
 
 
 VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -100,6 +90,15 @@
 	runxmlconf$(EXEEXT) testrecurse$(EXEEXT) testlimits$(EXEEXT)
 bin_PROGRAMS = xmllint$(EXEEXT) xmlcatalog$(EXEEXT)
 subdir = .
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/config.h.in $(srcdir)/libxml.spec.in \
+	$(srcdir)/libxml-2.0.pc.in \
+	$(srcdir)/libxml-2.0-uninstalled.pc.in \
+	$(srcdir)/libxml2-config.cmake.in $(srcdir)/xml2-config.in \
+	depcomp COPYING TODO compile config.guess config.sub \
+	install-sh missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -107,8 +106,6 @@
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
-	$(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -409,12 +406,6 @@
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
-	$(srcdir)/libxml-2.0-uninstalled.pc.in \
-	$(srcdir)/libxml-2.0.pc.in $(srcdir)/libxml.spec.in \
-	$(srcdir)/libxml2-config.cmake.in $(srcdir)/xml2-config.in \
-	AUTHORS COPYING ChangeLog INSTALL NEWS README TODO compile \
-	config.guess config.sub depcomp install-sh ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -497,6 +488,7 @@
 HTML_OBJ = @HTML_OBJ@
 HTTP_OBJ = @HTTP_OBJ@
 ICONV_LIBS = @ICONV_LIBS@
+ICU_CFLAGS = @ICU_CFLAGS@
 ICU_LIBS = @ICU_LIBS@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -518,9 +510,9 @@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 LZMA_CFLAGS = @LZMA_CFLAGS@
 LZMA_LIBS = @LZMA_LIBS@
+MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -827,7 +819,7 @@
 	     check-xsddata-test-suite.py check-xinclude-test-suite.py \
              example/Makefile.am example/gjobread.c example/gjobs.xml \
 	     $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
-	     libxml2-config.cmake.in \
+	     libxml2-config.cmake.in autogen.sh \
 	     trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
 	     triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \
 	     enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
@@ -860,7 +852,7 @@
 .SUFFIXES: .c .lo .o .obj
 am--refresh: Makefile
 	@:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -873,6 +865,7 @@
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -886,9 +879,9 @@
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
 
-$(top_srcdir)/configure:  $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	$(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 $(am__aclocal_m4_deps):
 
@@ -899,7 +892,7 @@
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in:  $(am__configure_deps) 
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
 	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
 	rm -f stamp-h1
 	touch $@
@@ -1618,15 +1611,15 @@
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
@@ -1662,17 +1655,17 @@
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build/sub \
-	  && ../../configure \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=../.. --prefix="$$dc_install_base" \
+	    --srcdir=.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1883,8 +1876,6 @@
 	uninstall-man uninstall-man1 uninstall-man3 \
 	uninstall-pkgconfigDATA
 
-.PRECIOUS: Makefile
-
 
 # that one forces the rebuild when "make rebuild" is run on doc/
 rebuild_testapi:
@@ -1916,6 +1907,10 @@
 	@echo '## Go get a cup of coffee it is gonna take a while ...'
 	$(MAKE) CHECKER='valgrind -q' runtests
 
+asan:
+	@echo '## rebuilding for ASAN'
+	./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff  ; $(MAKE) clean ; $(MAKE)
+
 testall : tests SVGtests SAXtests
 
 tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES)
diff --git a/third_party/libxml/src/NEWS b/third_party/libxml/src/NEWS
index 8027d55c..d248c69 100644
--- a/third_party/libxml/src/NEWS
+++ b/third_party/libxml/src/NEWS
@@ -845,7 +845,7 @@
    - Improvement: switch parser to XML-1.0 5th edition, add parsing flags
       for old versions, switch URI parsing to RFC 3986,
       add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
-      new hashing functions for dictionnaries (based on Stefan Behnel work),
+      new hashing functions for dictionaries (based on Stefan Behnel work),
       improve handling of misplaced html/head/body in HTML parser, better
       regression test tools and code coverage display, better algorithms
       to detect various versions of the billion laughts attacks, make
@@ -1231,7 +1231,7 @@
     Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
     some gcc4 fixes, HP-UX portability fixes (Rick Jones).
    - bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
-    xmlreader stopping on non-fatal errors, thread support for dictionnaries
+    xmlreader stopping on non-fatal errors, thread support for dictionaries
     reference counting (Gary Coady), internal subset and push problem, URL
     saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
     fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
@@ -1244,7 +1244,7 @@
     Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug
     (Rob Richards), Schemas decimal type fixes (William Brack),
     xmlByteConsumed static buffer (Ben Maurer).
-   - improvement: speedup parsing comments and DTDs, dictionnary support for
+   - improvement: speedup parsing comments and DTDs, dictionary support for
     hash tables, Schemas Identity constraints (Kasimier), streaming XPath
     subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical
     values handling (Kasimier), add xmlTextReaderByteConsumed (Aron
@@ -1454,7 +1454,7 @@
     URI on SYSTEM lookup failure, XInclude parse flags inheritance (William),
     XInclude and XPointer fixes for entities (William), XML parser bug
     reported by Holger Rauch, nanohttp fd leak (William),  regexps char
-    groups '-' handling (William), dictionnary reference counting problems,
+    groups '-' handling (William), dictionary reference counting problems,
     do not close stderr.
    - performance patches from Petr Pajas
    - Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey)
@@ -1482,7 +1482,7 @@
     William) reported by Yuuichi Teranishi
    - bugfixes: make test and path issues, xmlWriter attribute serialization
     (William Brack), xmlWriter indentation (William), schemas validation
-    (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg
+    (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
     Paraschenko), XInclude empty fallback (William), HTML warnings (William),
     XPointer in XInclude (William), Python namespace serialization,
     isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
@@ -1503,7 +1503,7 @@
 
 
 2.6.5: Jan 25 2004:
-   - Bugfixes: dictionnaries for schemas (William Brack), regexp segfault
+   - Bugfixes: dictionaries for schemas (William Brack), regexp segfault
     (William), xs:all problem (William), a number of XPointer bugfixes
     (William), xmllint error go to stderr, DTD validation problem with
     namespace, memory leak (William), SAX1 cleanup and minimal options fixes
@@ -1515,14 +1515,14 @@
     Fleck), doc (Sven Zimmerman), I/O example.
    - Python bindings: fixes (William), enum support (Stéphane Bidoul),
     structured error reporting (Stéphane Bidoul)
-   - XInclude: various fixes for conformance, problem related to dictionnary
+   - XInclude: various fixes for conformance, problem related to dictionary
     references (William & me), recursion (William)
    - xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred
     Mickautsch),
    - xmlSchemas: normalizedString datatype (John Belmonte)
    - code cleanup for strings functions (William)
    - Windows: compiler patches (Mark Vakoc)
-   - Parser optimizations, a few new XPath and dictionnary APIs for future
+   - Parser optimizations, a few new XPath and dictionary APIs for future
     XSLT optimizations.
 
 
@@ -1617,8 +1617,8 @@
     of change
    - Increased the library modularity, far more options can be stripped out,
     a --with-minimum configuration will weight around 160KBytes
-   - Use per parser and per document dictionnary, allocate names and small
-    text nodes from the dictionnary
+   - Use per parser and per document dictionary, allocate names and small
+    text nodes from the dictionary
    - Switch to a SAX2 like parser rewrote most of the XML parser core,
     provides namespace resolution and defaulted attributes, minimize memory
     allocations and copies, namespace checking and specific error handling,
@@ -1665,7 +1665,7 @@
     (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
     error handling.
    - xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
-    testing,  --nodict for building without tree dictionnary, --nocdata to
+    testing,  --nodict for building without tree dictionary, --nocdata to
     replace CDATA by text, --nsclean to remove surperfluous  namespace
     declarations
    - added xml2-config --libtool-libs option from Kevin P. Fleming
diff --git a/third_party/libxml/src/aclocal.m4 b/third_party/libxml/src/aclocal.m4
index 11ea66b4..7f2a607 100644
--- a/third_party/libxml/src/aclocal.m4
+++ b/third_party/libxml/src/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -180,62 +180,7 @@
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
-AC_DEFUN([PKG_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
-m4_pushdef([pkg_description],
-    [pkg-config installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([pkgconfigdir],
-    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
-    [with_pkgconfigdir=]pkg_default)
-AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
-m4_popdef([pkg_default])
-m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
-
-
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
-AC_DEFUN([PKG_NOARCH_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
-m4_pushdef([pkg_description],
-    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([noarch-pkgconfigdir],
-    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
-    [with_noarch_pkgconfigdir=]pkg_default)
-AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
-m4_popdef([pkg_default])
-m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
-
-
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
-AC_DEFUN([PKG_CHECK_VAR],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
-
-_PKG_CONFIG([$1], [variable="][$3]["], [$2])
-AS_VAR_COPY([$1], [pkg_cv_][$1])
-
-AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
-
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -247,10 +192,10 @@
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -266,14 +211,14 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -318,14 +263,15 @@
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -356,7 +302,7 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -547,7 +493,7 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -623,7 +569,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -713,8 +659,8 @@
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target (and possibly the TAP driver).  The
-# system "awk" is bad on some platforms.
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -787,11 +733,7 @@
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi
-dnl The trailing newline in this macro's definition is deliberate, for
-dnl backward compatibility and to allow trailing 'dnl'-style comments
-dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
-])
+fi])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -820,7 +762,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -831,7 +773,7 @@
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh+set}" != xset; then
+if test x"${install_sh}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -841,7 +783,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -860,9 +802,45 @@
 rmdir .tst 2>/dev/null
 AC_SUBST([am__leading_dot])])
 
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -912,7 +890,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -951,7 +929,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -980,7 +958,7 @@
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1027,7 +1005,7 @@
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1046,7 +1024,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1127,7 +1105,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1187,7 +1165,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1215,7 +1193,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1234,7 +1212,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/third_party/libxml/src/catalog.c b/third_party/libxml/src/catalog.c
index 5773db3..ac6e9815 100644
--- a/third_party/libxml/src/catalog.c
+++ b/third_party/libxml/src/catalog.c
@@ -47,9 +47,9 @@
 #define MAX_CATAL_DEPTH	50
 
 #ifdef _WIN32
-# define PATH_SEAPARATOR ';'
+# define PATH_SEPARATOR ';'
 #else
-# define PATH_SEAPARATOR ':'
+# define PATH_SEPARATOR ':'
 #endif
 
 /**
@@ -3247,7 +3247,7 @@
 	while (xmlIsBlank_ch(*cur)) cur++;
 	if (*cur != 0) {
 	    paths = cur;
-	    while ((*cur != 0) && (*cur != PATH_SEAPARATOR) && (!xmlIsBlank_ch(*cur)))
+	    while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur)))
 		cur++;
 	    path = xmlStrndup((const xmlChar *)paths, cur - paths);
 #ifdef _WIN32
@@ -3263,7 +3263,7 @@
 		xmlFree(path);
 	    }
 	}
-	while (*cur == PATH_SEAPARATOR)
+	while (*cur == PATH_SEPARATOR)
 	    cur++;
     }
 }
diff --git a/third_party/libxml/src/compile b/third_party/libxml/src/compile
index a85b723..531136b 100755
--- a/third_party/libxml/src/compile
+++ b/third_party/libxml/src/compile
@@ -3,7 +3,7 @@
 
 scriptversion=2012-10-14.11; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/third_party/libxml/src/config.guess b/third_party/libxml/src/config.guess
index dbfb978..b79252d 100755
--- a/third_party/libxml/src/config.guess
+++ b/third_party/libxml/src/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2015 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2015-01-01'
+timestamp='2013-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 #
-# Please send patches to <config-patches@gnu.org>.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
 
 
 me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +50,7 @@
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2015 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -149,7 +149,7 @@
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
 	;;
 esac
 
@@ -579,9 +579,8 @@
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/lslpp ] ; then
-		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
-			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -827,7 +826,7 @@
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    *:MSYS*:*)
+    i*:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -970,10 +969,10 @@
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    openrisc*:Linux:*:*)
-	echo or1k-unknown-linux-${LIBC}
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
-    or32:Linux:*:* | or1k*:Linux:*:*)
+    or32:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
@@ -1261,26 +1260,16 @@
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
-	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		    grep IS_64BIT_ARCH >/dev/null
-		then
-		    case $UNAME_PROCESSOR in
-			i386) UNAME_PROCESSOR=x86_64 ;;
-			powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		    esac
-		fi
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
 	    fi
-	elif test "$UNAME_PROCESSOR" = i386 ; then
-	    # Avoid executing cc on OS X 10.9, as it ships with a stub
-	    # that puts up a graphical alert prompting to install
-	    # developer tools.  Any system running Mac OS X 10.7 or
-	    # later (Darwin 11 and later) is required to have a 64-bit
-	    # processor. This is not true of the ARM version of Darwin
-	    # that Apple uses in portable devices.
-	    UNAME_PROCESSOR=x86_64
 	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
@@ -1372,6 +1361,154 @@
 	exit ;;
 esac
 
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+	"4"
+#else
+	""
+#endif
+	); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
 cat >&2 <<EOF
 $0: unable to guess system type
 
diff --git a/third_party/libxml/src/config.h.in b/third_party/libxml/src/config.h.in
index 749b1d62..eaef4d4 100644
--- a/third_party/libxml/src/config.h.in
+++ b/third_party/libxml/src/config.h.in
@@ -274,7 +274,8 @@
 /* Define as const if the declaration of iconv() needs const. */
 #undef ICONV_CONST
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
 #undef LT_OBJDIR
 
 /* Name of package */
diff --git a/third_party/libxml/src/config.sub b/third_party/libxml/src/config.sub
index 6467c95..9633db7 100755
--- a/third_party/libxml/src/config.sub
+++ b/third_party/libxml/src/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2015 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2015-01-01'
+timestamp='2013-08-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 # of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -68,7 +68,7 @@
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2015 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -260,12 +260,11 @@
 	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| epiphany \
-	| fido | fr30 | frv | ft32 \
+	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -283,10 +282,8 @@
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipsr5900 | mipsr5900el \
@@ -298,11 +295,11 @@
 	| nds32 | nds32le | nds32be \
 	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 | or1k | or1knd | or32 \
+	| open8 \
+	| or1k | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -313,7 +310,6 @@
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -328,10 +324,7 @@
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	leon|leon[3-9])
-		basic_machine=sparc-$basic_machine
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -388,7 +381,6 @@
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
-	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
@@ -408,10 +400,8 @@
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipsr5900-* | mipsr5900el-* \
@@ -423,7 +413,6 @@
 	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
-	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -441,7 +430,6 @@
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
-	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -779,9 +767,6 @@
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
-	leon-*|leon[3-9]-*)
-		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
-		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -837,10 +822,6 @@
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
-	moxiebox)
-		basic_machine=moxie-unknown
-		os=-moxiebox
-		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -1025,7 +1006,7 @@
 		;;
 	ppc64)	basic_machine=powerpc64-unknown
 		;;
-	ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
 		basic_machine=powerpc64le-unknown
@@ -1386,14 +1367,14 @@
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1611,6 +1592,9 @@
 	mips*-*)
 		os=-elf
 		;;
+	or1k-*)
+		os=-elf
+		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/third_party/libxml/src/configure b/third_party/libxml/src/configure
index f32b775..d3f891af 100755
--- a/third_party/libxml/src/configure
+++ b/third_party/libxml/src/configure
@@ -663,8 +663,9 @@
 TEST_SCHEMAS
 WITH_SCHEMAS
 WITH_ISO8859X
-ICU_LIBS
 WITH_ICU
+ICU_LIBS
+ICU_CFLAGS
 WITH_ICONV
 WITH_OUTPUT
 TEST_XPATH
@@ -744,7 +745,6 @@
 USE_VERSION_SCRIPT_FALSE
 USE_VERSION_SCRIPT_TRUE
 VERSION_SCRIPT_FLAGS
-LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
 LIPO
@@ -835,6 +835,9 @@
 build_vendor
 build_cpu
 build
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
 target_alias
 host_alias
 build_alias
@@ -876,13 +879,13 @@
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_maintainer_mode
 enable_silent_rules
 enable_dependency_tracking
 enable_shared
 enable_static
 with_pic
 enable_fast_install
-with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
@@ -942,9 +945,12 @@
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
-LT_SYS_LIBRARY_PATH
+Z_CFLAGS
+Z_LIBS
 LZMA_CFLAGS
-LZMA_LIBS'
+LZMA_LIBS
+ICU_CFLAGS
+ICU_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1561,6 +1567,9 @@
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-maintainer-mode
+                          disable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
   --enable-silent-rules   less verbose build output (undo: "make V=1")
   --disable-silent-rules  verbose build output (undo: "make V=0")
   --enable-dependency-tracking
@@ -1580,12 +1589,9 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
-  --with-aix-soname=aix|svr4|both
-                          shared library versioning (aka "SONAME") variant to
-                          provide on AIX, [default=aix].
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
-                          compiler's sysroot if not specified).
+  --with-sysroot=DIR Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).
   --with-c14n             add the Canonicalization support (on)
   --with-catalog          add the Catalog support (on)
   --with-debug            add the debugging module (on)
@@ -1645,10 +1651,12 @@
               directories to add to pkg-config's search path
   PKG_CONFIG_LIBDIR
               path overriding pkg-config's built-in search path
-  LT_SYS_LIBRARY_PATH
-              User-defined run-time library search path.
+  Z_CFLAGS    C compiler flags for Z, overriding pkg-config
+  Z_LIBS      linker flags for Z, overriding pkg-config
   LZMA_CFLAGS C compiler flags for LZMA, overriding pkg-config
   LZMA_LIBS   linker flags for LZMA, overriding pkg-config
+  ICU_CFLAGS  C compiler flags for ICU, overriding pkg-config
+  ICU_LIBS    linker flags for ICU, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2487,6 +2495,29 @@
 ac_config_headers="$ac_config_headers config.h"
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=yes
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
@@ -2590,7 +2621,7 @@
 
 LIBXML_MAJOR_VERSION=2
 LIBXML_MINOR_VERSION=9
-LIBXML_MICRO_VERSION=3
+LIBXML_MICRO_VERSION=4
 LIBXML_MICRO_VERSION_SUFFIX=
 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -2631,7 +2662,7 @@
 
 VERSION=${LIBXML_VERSION}
 
-am__api_version='1.15'
+am__api_version='1.14'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2803,8 +2834,8 @@
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -2823,7 +2854,7 @@
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh+set}" != xset; then
+if test x"${install_sh}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3152,8 +3183,8 @@
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target (and possibly the TAP driver).  The
-# system "awk" is bad on some platforms.
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
@@ -3211,7 +3242,6 @@
   fi
 fi
 
-
 # Support silent build rules, requires at least automake-1.11. Disable
 # by either passing --disable-silent-rules to configure or passing V=1
 # to make
@@ -4819,8 +4849,8 @@
 
 
 
-macro_version='2.4.6'
-macro_revision='2.4.6'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -4834,7 +4864,7 @@
 
 
 
-ltmain=$ac_aux_dir/ltmain.sh
+ltmain="$ac_aux_dir/ltmain.sh"
 
 # Backslashify metacharacters that are still active within
 # double-quoted strings.
@@ -4883,7 +4913,7 @@
     $ECHO ""
 }
 
-case $ECHO in
+case "$ECHO" in
   printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
 $as_echo "printf" >&6; } ;;
   print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -5206,19 +5236,19 @@
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return, which upsets mingw
+    # gcc leaves a trailing carriage return which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -5232,7 +5262,7 @@
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD=$ac_prog
+      test -z "$LD" && LD="$ac_prog"
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -5243,7 +5273,7 @@
     with_gnu_ld=unknown
     ;;
   esac
-elif test yes = "$with_gnu_ld"; then
+elif test "$with_gnu_ld" = yes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -5254,32 +5284,32 @@
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD=$ac_dir/$ac_prog
+      lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test no != "$with_gnu_ld" && break
+	test "$with_gnu_ld" != no && break
 	;;
       *)
-	test yes != "$with_gnu_ld" && break
+	test "$with_gnu_ld" != yes && break
 	;;
       esac
     fi
   done
-  IFS=$lt_save_ifs
+  IFS="$lt_save_ifs"
 else
-  lt_cv_path_LD=$LD # Let the user override the test with a path.
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
 fi
 fi
 
-LD=$lt_cv_path_LD
+LD="$lt_cv_path_LD"
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -5322,38 +5352,33 @@
 else
   if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM=$NM
+  lt_cv_path_NM="$NM"
 else
-  lt_nm_to_check=${ac_tool_prefix}nm
+  lt_nm_to_check="${ac_tool_prefix}nm"
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm=$ac_dir/$lt_tmp_nm
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
-	case $build_os in
-	mingw*) lt_bad_file=conftest.nm/nofile ;;
-	*) lt_bad_file=/dev/null ;;
-	esac
-	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
-	*$lt_bad_file* | *'Invalid file or object type'*)
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break 2
+	  break
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break 2
+	    break
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -5364,15 +5389,15 @@
 	esac
       fi
     done
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
   done
   : ${lt_cv_path_NM=no}
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
-if test no != "$lt_cv_path_NM"; then
-  NM=$lt_cv_path_NM
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
@@ -5478,9 +5503,9 @@
   fi
 fi
 
-    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols -headers"
+      DUMPBIN="$DUMPBIN -symbols"
       ;;
     *)
       DUMPBIN=:
@@ -5488,8 +5513,8 @@
     esac
   fi
 
-  if test : != "$DUMPBIN"; then
-    NM=$DUMPBIN
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
   fi
 fi
 test -z "$NM" && NM=nm
@@ -5529,7 +5554,7 @@
   $as_echo_n "(cached) " >&6
 else
     i=0
-  teststring=ABCD
+  teststring="ABCD"
 
   case $build_os in
   msdosdjgpp*)
@@ -5569,7 +5594,7 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5620,22 +5645,22 @@
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-       test undefined != "$lt_cv_sys_max_cmd_len"; then
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8; do
+      for i in 1 2 3 4 5 6 7 8 ; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test 17 != "$i" # 1/2 MB should be enough
+	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -5653,7 +5678,7 @@
 
 fi
 
-if test -n "$lt_cv_sys_max_cmd_len"; then
+if test -n $lt_cv_sys_max_cmd_len ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
@@ -5671,6 +5696,30 @@
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -5793,13 +5842,13 @@
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test yes != "$GCC"; then
+    if test "$GCC" != yes; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test yes = "$GCC"; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -5927,13 +5976,13 @@
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
+# `unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[4-9]*)
@@ -5960,7 +6009,8 @@
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -6038,7 +6088,7 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -6056,8 +6106,8 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd* | bitrig*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -6110,9 +6160,6 @@
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
-os2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 esac
 
 fi
@@ -6270,8 +6317,8 @@
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh;
-  # decide which one to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -6283,7 +6330,7 @@
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd=$ECHO
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
   ;;
 esac
 
@@ -6438,7 +6485,7 @@
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-      if test 0 -eq "$ac_status"; then
+      if test "$ac_status" -eq 0; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -6446,7 +6493,7 @@
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-	if test 0 -ne "$ac_status"; then
+	if test "$ac_status" -ne 0; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -6459,7 +6506,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
 $as_echo "$lt_cv_ar_at_file" >&6; }
 
-if test no = "$lt_cv_ar_at_file"; then
+if test "x$lt_cv_ar_at_file" = xno; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -6676,7 +6723,7 @@
 
 if test -n "$RANLIB"; then
   case $host_os in
-  bitrig* | openbsd*)
+  openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -6766,7 +6813,7 @@
   symcode='[ABCDGISTW]'
   ;;
 hpux*)
-  if test ia64 = "$host_cpu"; then
+  if test "$host_cpu" = ia64; then
     symcode='[ABCDEGRST]'
   fi
   ;;
@@ -6799,44 +6846,14 @@
   symcode='[ABCDGIRSTW]' ;;
 esac
 
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  # Gets list of data symbols to import.
-  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
-  # Adjust the below global symbol transforms to fixup imported variables.
-  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
-  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
-  lt_c_name_lib_hook="\
-  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
-  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
-else
-  # Disable hooks by default.
-  lt_cv_sys_global_symbol_to_import=
-  lt_cdecl_hook=
-  lt_c_name_hook=
-  lt_c_name_lib_hook=
-fi
-
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -6854,24 +6871,21 @@
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function,
-    # D for any global variable and I for any imported variable.
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -6919,11 +6933,11 @@
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined __osf__
+#elif defined(__osf__)
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -6949,7 +6963,7 @@
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -6969,13 +6983,13 @@
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS=conftstm.$ac_objext
+	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -6996,7 +7010,7 @@
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test yes = "$pipe_works"; then
+  if test "$pipe_works" = yes; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -7049,16 +7063,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
 $as_echo_n "checking for sysroot... " >&6; }
 
@@ -7071,9 +7075,9 @@
 
 
 lt_sysroot=
-case $with_sysroot in #(
+case ${with_sysroot} in #(
  yes)
-   if test yes = "$GCC"; then
+   if test "$GCC" = yes; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -7083,8 +7087,8 @@
  no|'')
    ;; #(
  *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
-$as_echo "$with_sysroot" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
    as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
    ;;
 esac
@@ -7096,99 +7100,18 @@
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
-$as_echo_n "checking for a working dd... " >&6; }
-if ${ac_cv_path_lt_DD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-: ${lt_DD:=$DD}
-if test -z "$lt_DD"; then
-  ac_path_lt_DD_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in dd; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_lt_DD" || continue
-if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
-fi
-      $ac_path_lt_DD_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_lt_DD"; then
-    :
-  fi
-else
-  ac_cv_path_lt_DD=$lt_DD
-fi
-
-rm -f conftest.i conftest2.i conftest.out
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
-$as_echo "$ac_cv_path_lt_DD" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
-$as_echo_n "checking how to truncate binary pipes... " >&6; }
-if ${lt_cv_truncate_bin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-lt_cv_truncate_bin=
-if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
-fi
-rm -f conftest.i conftest2.i conftest.out
-test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
-$as_echo "$lt_cv_truncate_bin" >&6; }
-
-
-
-
-
-
-
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in $*""; do
-      case $cc_temp in
-        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
 fi
 
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out what ABI is being produced by ac_compile, and set mode
-  # options accordingly.
+  # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7197,25 +7120,24 @@
   test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE=32
+	HPUX_IA64_MODE="32"
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE=64
+	HPUX_IA64_MODE="64"
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
+  # Find out which ABI we are using.
   echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-    if test yes = "$lt_cv_prog_gnu_ld"; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -7244,50 +7166,9 @@
   rm -rf conftest*
   ;;
 
-mips64*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    emul=elf
-    case `/usr/bin/file conftest.$ac_objext` in
-      *32-bit*)
-	emul="${emul}32"
-	;;
-      *64-bit*)
-	emul="${emul}64"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *MSB*)
-	emul="${emul}btsmip"
-	;;
-      *LSB*)
-	emul="${emul}ltsmip"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *N32*)
-	emul="${emul}n32"
-	;;
-    esac
-    LD="${LD-ld} -m $emul"
-  fi
-  rm -rf conftest*
-  ;;
-
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.  Note that the listed cases only cover the
-  # situations where additional linker options are needed (such as when
-  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
-  # vice versa); the common cases where no linker options are needed do
-  # not appear in the list.
+  # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7310,10 +7191,10 @@
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*linux*)
+	  powerpc64le-*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*linux*)
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -7332,10 +7213,10 @@
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*linux*)
+	  powerpcle-*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*linux*)
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -7353,7 +7234,7 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS=$CFLAGS
+  SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -7393,14 +7274,13 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test yes != "$lt_cv_cc_needs_belf"; then
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS=$SAVE_CFLAGS
+    CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
 *-*solaris*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
+  # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7412,7 +7292,7 @@
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*|x86_64-*-solaris*)
+        i?86-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -7421,7 +7301,7 @@
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD=${LD-ld}_sol2
+          LD="${LD-ld}_sol2"
         fi
         ;;
       *)
@@ -7437,7 +7317,7 @@
   ;;
 esac
 
-need_locks=$enable_libtool_lock
+need_locks="$enable_libtool_lock"
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -7548,7 +7428,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
   MANIFEST_TOOL=:
 fi
 
@@ -8051,7 +7931,7 @@
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
-      if test -z "$LT_MULTI_MODULE"; then
+      if test -z "${LT_MULTI_MODULE}"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -8069,7 +7949,7 @@
 	  cat conftest.err >&5
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -8108,7 +7988,7 @@
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS=$save_LDFLAGS
+	LDFLAGS="$save_LDFLAGS"
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -8137,7 +8017,7 @@
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&5
-      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&5
@@ -8150,32 +8030,32 @@
 $as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-	10.[012][,.]*)
-	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test yes = "$lt_cv_apple_cc_single_mod"; then
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test yes = "$lt_cv_ld_exported_symbols_list"; then
-      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -8183,41 +8063,6 @@
     ;;
   esac
 
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x$2 in
-    x)
-        ;;
-    *:)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
-        ;;
-    x:*)
-        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
-        ;;
-    *)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
@@ -8384,14 +8229,14 @@
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac
 else
@@ -8415,14 +8260,14 @@
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac
 else
@@ -8446,14 +8291,14 @@
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for lt_pkg in $withval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac
 else
@@ -8461,6 +8306,8 @@
 fi
 
 
+test -z "$pic_mode" && pic_mode=default
+
 
 
 
@@ -8476,14 +8323,14 @@
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac
 else
@@ -8497,63 +8344,11 @@
 
 
 
-  shared_archive_member_spec=
-case $host,$enable_shared in
-power*-*-aix[5-9]*,yes)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
-$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
-
-# Check whether --with-aix-soname was given.
-if test "${with_aix_soname+set}" = set; then :
-  withval=$with_aix_soname; case $withval in
-    aix|svr4|both)
-      ;;
-    *)
-      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
-      ;;
-    esac
-    lt_cv_with_aix_soname=$with_aix_soname
-else
-  if ${lt_cv_with_aix_soname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_with_aix_soname=aix
-fi
-
-    with_aix_soname=$lt_cv_with_aix_soname
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
-$as_echo "$with_aix_soname" >&6; }
-  if test aix != "$with_aix_soname"; then
-    # For the AIX way of multilib, we name the shared archive member
-    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
-    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
-    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
-    # the AIX toolchain works better with OBJECT_MODE set (default 32).
-    if test 64 = "${OBJECT_MODE-32}"; then
-      shared_archive_member_spec=shr_64
-    else
-      shared_archive_member_spec=shr
-    fi
-  fi
-  ;;
-*)
-  with_aix_soname=aix
-  ;;
-esac
-
-
-
-
-
-
-
 
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
+LIBTOOL_DEPS="$ltmain"
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -8602,7 +8397,7 @@
 
 
 
-if test -n "${ZSH_VERSION+set}"; then
+if test -n "${ZSH_VERSION+set}" ; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -8641,7 +8436,7 @@
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test set != "${COLLECT_NAMES+set}"; then
+  if test "X${COLLECT_NAMES+set}" != Xset; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -8652,14 +8447,14 @@
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a '.a' archive for static linking (except MSVC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld=$lt_cv_prog_gnu_ld
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
-old_CC=$CC
-old_CFLAGS=$CFLAGS
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -8668,8 +8463,15 @@
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
-func_cc_basename $compiler
-cc_basename=$func_cc_basename_result
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
 
 # Only perform the check for file, if the check method requires it
@@ -8684,22 +8486,22 @@
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD=$MAGIC_CMD
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/${ac_tool_prefix}file"; then
-      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8722,13 +8524,13 @@
       break
     fi
   done
-  IFS=$lt_save_ifs
-  MAGIC_CMD=$lt_save_MAGIC_CMD
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
   ;;
 esac
 fi
 
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8750,22 +8552,22 @@
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD=$MAGIC_CMD
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/file"; then
-      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8788,13 +8590,13 @@
       break
     fi
   done
-  IFS=$lt_save_ifs
-  MAGIC_CMD=$lt_save_MAGIC_CMD
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
   ;;
 esac
 fi
 
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8815,7 +8617,7 @@
 
 # Use C for the default configuration in the libtool script
 
-lt_save_CC=$CC
+lt_save_CC="$CC"
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8877,7 +8679,7 @@
 
 lt_prog_compiler_no_builtin_flag=
 
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   case $cc_basename in
   nvcc*)
     lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -8893,7 +8695,7 @@
   lt_cv_prog_compiler_rtti_exceptions=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -8923,7 +8725,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
 else
     :
@@ -8941,18 +8743,17 @@
 lt_prog_compiler_static=
 
 
-  if test yes = "$GCC"; then
+  if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
     lt_prog_compiler_static='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       fi
-      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -8963,8 +8764,8 @@
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the '-m68020' flag to GCC prevents building anything better,
-            # like '-m68040'.
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
             lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -8980,11 +8781,6 @@
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic='-DDLL_EXPORT'
-      case $host_os in
-      os2*)
-	lt_prog_compiler_static='$wl-static'
-	;;
-      esac
       ;;
 
     darwin* | rhapsody*)
@@ -9055,7 +8851,7 @@
     case $host_os in
     aix*)
       lt_prog_compiler_wl='-Wl,'
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       else
@@ -9063,29 +8859,10 @@
       fi
       ;;
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      case $cc_basename in
-      nagfor*)
-        # NAG Fortran compiler
-        lt_prog_compiler_wl='-Wl,-Wl,,'
-        lt_prog_compiler_pic='-PIC'
-        lt_prog_compiler_static='-Bstatic'
-        ;;
-      esac
-      ;;
-
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
-      case $host_os in
-      os2*)
-	lt_prog_compiler_static='$wl-static'
-	;;
-      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -9101,7 +8878,7 @@
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='$wl-a ${wl}archive'
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -9112,7 +8889,7 @@
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64, which still supported -KPIC.
+      # old Intel for x86_64 which still supported -KPIC.
       ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
@@ -9137,12 +8914,6 @@
 	lt_prog_compiler_pic='-PIC'
 	lt_prog_compiler_static='-Bstatic'
 	;;
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fPIC'
-	lt_prog_compiler_static='-static'
-	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -9240,7 +9011,7 @@
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec; then
+      if test -d /usr/nec ;then
 	lt_prog_compiler_pic='-Kconform_pic'
 	lt_prog_compiler_static='-Bstatic'
       fi
@@ -9269,7 +9040,7 @@
   fi
 
 case $host_os in
-  # For platforms that do not support PIC, -DPIC is meaningless:
+  # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
     ;;
@@ -9301,7 +9072,7 @@
   lt_cv_prog_compiler_pic_works=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -9331,7 +9102,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-if test yes = "$lt_cv_prog_compiler_pic_works"; then
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
     case $lt_prog_compiler_pic in
      "" | " "*) ;;
      *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -9363,7 +9134,7 @@
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS=$LDFLAGS
+   save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9382,13 +9153,13 @@
      fi
    fi
    $RM -r conftest*
-   LDFLAGS=$save_LDFLAGS
+   LDFLAGS="$save_LDFLAGS"
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-if test yes = "$lt_cv_prog_compiler_static_works"; then
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
     :
 else
     lt_prog_compiler_static=
@@ -9508,8 +9279,8 @@
 
 
 
-hard_links=nottested
-if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -9521,9 +9292,9 @@
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test no = "$hard_links"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -9566,9 +9337,9 @@
   # included in the symbol list
   include_expsyms=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ' (' and ')$', so one must not match beginning or
-  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
-  # as well as any symbol that contains 'd'.
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
   exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -9583,7 +9354,7 @@
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test yes != "$GCC"; then
+    if test "$GCC" != yes; then
       with_gnu_ld=no
     fi
     ;;
@@ -9591,9 +9362,12 @@
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd* | bitrig*)
+  openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
   esac
 
   ld_shlibs=yes
@@ -9601,7 +9375,7 @@
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test yes = "$with_gnu_ld"; then
+  if test "$with_gnu_ld" = yes; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -9623,24 +9397,24 @@
     esac
   fi
 
-  if test yes = "$lt_use_gnu_ld_interface"; then
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='$wl'
+    wlarc='${wl}'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-    export_dynamic_flag_spec='$wl--export-dynamic'
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
     else
       whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+    case `$LD -v 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9653,7 +9427,7 @@
     case $host_os in
     aix[3-9]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test ia64 != "$host_cpu"; then
+      if test "$host_cpu" != ia64; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
@@ -9672,7 +9446,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9688,7 +9462,7 @@
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9698,7 +9472,7 @@
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='$wl--export-all-symbols'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
@@ -9706,89 +9480,61 @@
       exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file, use it as
-	# is; otherwise, prepend EXPORTS...
-	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
-          cp $export_symbols $output_objdir/$soname.def;
-        else
-          echo EXPORTS > $output_objdir/$soname.def;
-          cat $export_symbols >> $output_objdir/$soname.def;
-        fi~
-        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
     haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
       link_all_deplibs=yes
       ;;
 
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      shrext_cmds=.dll
-      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      enable_shared_with_static_runtimes=yes
-      ;;
-
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
-      export_dynamic_flag_spec='$wl-E'
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test linux-dietlibc = "$host_os"; then
+      if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test no = "$tmp_diet"
+	 && test "$tmp_diet" = no
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -9799,47 +9545,42 @@
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
-        nagfor*)                        # NAGFOR 5.3
-          tmp_sharedflag='-Wl,-shared' ;;
 	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  compiler_needs_object=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-        if test yes = "$supports_anon_versioning"; then
+        if test "x$supports_anon_versioning" = xyes; then
           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-            echo "local: *; };" >> $output_objdir/$libname.ver~
-            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
-	tcc*)
-	  export_dynamic_flag_spec='-rdynamic'
-	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
 	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test yes = "$supports_anon_versioning"; then
+	  if test "x$supports_anon_versioning" = xyes; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-              echo "local: *; };" >> $output_objdir/$libname.ver~
-              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -9848,13 +9589,13 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -9872,8 +9613,8 @@
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9885,7 +9626,7 @@
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -9900,9 +9641,9 @@
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -9919,15 +9660,15 @@
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
       ;;
     esac
 
-    if test no = "$ld_shlibs"; then
+    if test "$ld_shlibs" = no; then
       runpath_var=
       hardcode_libdir_flag_spec=
       export_dynamic_flag_spec=
@@ -9943,7 +9684,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -9951,57 +9692,34 @@
       ;;
 
     aix[4-9]*)
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=
+	no_entry_flag=""
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
-	# Without the "-l" option, or with the "-B" option, AIX nm treats
-	# weak defined symbols like other global defined symbols, whereas
-	# GNU nm marks them as "W".
-	# While the 'weak' keyword is ignored in the Export File, we need
-	# it in the Import File for the 'aix-soname' feature, so we have
-	# to replace the "-B" option with "-P" for AIX nm.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# have runtime linking enabled, and use it for executables.
-	# For shared libraries, we enable/disable runtime linking
-	# depending on the kind of the shared library created -
-	# when "with_aix_soname,aix_use_runtimelinking" is:
-	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "aix,yes"  lib.so          shared, rtl:yes, for executables
-	#            lib.a           static archive
-	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
-	#            lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a(lib.so.V) shared, rtl:no
-	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a           static archive
+	# need to do runtime linking.
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
-	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
-	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
-	    # so we don't have lib.a shared libs to link our executables.
-	    # We have to force runtime linking in this case.
-	    aix_use_runtimelinking=yes
-	    LDFLAGS="$LDFLAGS -Wl,-brtl"
-	  fi
 	  ;;
 	esac
 
@@ -10020,21 +9738,13 @@
       hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      file_list_spec='$wl-f,'
-      case $with_aix_soname,$aix_use_runtimelinking in
-      aix,*) ;; # traditional, no import file
-      svr4,* | *,yes) # use import file
-	# The Import File defines what to hardcode.
-	hardcode_direct=no
-	hardcode_direct_absolute=no
-	;;
-      esac
+      file_list_spec='${wl}-f,'
 
-      if test yes = "$GCC"; then
+      if test "$GCC" = yes; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`$CC -print-prog-name=collect2`
+	  collect2name=`${CC} -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -10053,42 +9763,36 @@
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test yes = "$aix_use_runtimelinking"; then
-	  shared_flag="$shared_flag "'$wl-G'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
 	fi
-	# Need to ensure runtime linking is disabled for the traditional
-	# shared library, or the linker may eventually find shared libraries
-	# /with/ Import File - we do not want to mix them.
-	shared_flag_aix='-shared'
-	shared_flag_svr4='-shared $wl-G'
+	link_all_deplibs=no
       else
 	# not using gcc
-	if test ia64 = "$host_cpu"; then
+	if test "$host_cpu" = ia64; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test yes = "$aix_use_runtimelinking"; then
-	    shared_flag='$wl-G'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
 	  else
-	    shared_flag='$wl-bM:SRE'
+	    shared_flag='${wl}-bM:SRE'
 	  fi
-	  shared_flag_aix='$wl-bM:SRE'
-	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      export_dynamic_flag_spec='$wl-bexpall'
+      export_dynamic_flag_spec='${wl}-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
-      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+      if test "$aix_use_runtimelinking" = yes; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        if test set = "${lt_cv_aix_libpath+set}"; then
+        if test "${lt_cv_aix_libpath+set}" = set; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -10123,7 +9827,7 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=/usr/lib:/lib
+    lt_cv_aix_libpath_="/usr/lib:/lib"
   fi
 
 fi
@@ -10131,17 +9835,17 @@
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
       else
-	if test ia64 = "$host_cpu"; then
-	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 if test set = "${lt_cv_aix_libpath+set}"; then
+	 if test "${lt_cv_aix_libpath+set}" = set; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -10176,7 +9880,7 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=/usr/lib:/lib
+    lt_cv_aix_libpath_="/usr/lib:/lib"
   fi
 
 fi
@@ -10184,33 +9888,21 @@
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' $wl-bernotok'
-	  allow_undefined_flag=' $wl-berok'
-	  if test yes = "$with_gnu_ld"; then
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    whole_archive_flag_spec='$convenience'
 	  fi
 	  archive_cmds_need_lc=yes
-	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
-	  # -brtl affects multiple linker settings, -berok does not and is overridden later
-	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
-	  if test svr4 != "$with_aix_soname"; then
-	    # This is similar to how AIX traditionally builds its shared libraries.
-	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
-	  fi
-	  if test aix != "$with_aix_soname"; then
-	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
-	  else
-	    # used by -dlpreopen to get the symbols
-	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
-	  fi
-	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -10219,7 +9911,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -10249,17 +9941,16 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
+	shrext_cmds=".dll"
 	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
-	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
-            cp "$export_symbols" "$output_objdir/$soname.def";
-            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
-          else
-            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
-          fi~
-          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-          linknames='
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
 	enable_shared_with_static_runtimes=yes
@@ -10268,18 +9959,18 @@
 	# Don't use ranlib
 	old_postinstall_cmds='chmod 644 $oldlib'
 	postlink_cmds='lt_outputfile="@OUTPUT@"~
-          lt_tool_outputfile="@TOOL_OUTPUT@"~
-          case $lt_outputfile in
-            *.exe|*.EXE) ;;
-            *)
-              lt_outputfile=$lt_outputfile.exe
-              lt_tool_outputfile=$lt_tool_outputfile.exe
-              ;;
-          esac~
-          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
-            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-            $RM "$lt_outputfile.manifest";
-          fi'
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -10288,7 +9979,7 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
+	shrext_cmds=".dll"
 	# FIXME: Setting linknames here is a bad hack.
 	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -10307,24 +9998,24 @@
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  if test yes = "$lt_cv_ld_force_load"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec=''
   fi
   link_all_deplibs=yes
-  allow_undefined_flag=$_lt_dar_allow_undefined
+  allow_undefined_flag="$_lt_dar_allow_undefined"
   case $cc_basename in
-     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     ifort*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test yes = "$_lt_dar_can_shared"; then
+  if test "$_lt_dar_can_shared" = "yes"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
-    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
-    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
 
   else
   ld_shlibs=no
@@ -10366,33 +10057,33 @@
       ;;
 
     hpux9*)
-      if test yes = "$GCC"; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      if test "$GCC" = yes; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
-      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       hardcode_minus_L=yes
-      export_dynamic_flag_spec='$wl-E'
+      export_dynamic_flag_spec='${wl}-E'
       ;;
 
     hpux10*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
-	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test no = "$with_gnu_ld"; then
-	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='$wl-E'
+	export_dynamic_flag_spec='${wl}-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -10400,25 +10091,25 @@
       ;;
 
     hpux11*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 
@@ -10430,7 +10121,7 @@
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler__b=no
-   save_LDFLAGS=$LDFLAGS
+   save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS -b"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -10449,14 +10140,14 @@
      fi
    fi
    $RM -r conftest*
-   LDFLAGS=$save_LDFLAGS
+   LDFLAGS="$save_LDFLAGS"
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test yes = "$lt_cv_prog_compiler__b"; then
-    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
     archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
@@ -10464,8 +10155,8 @@
 	  ;;
 	esac
       fi
-      if test no = "$with_gnu_ld"; then
-	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
 	hardcode_libdir_separator=:
 
 	case $host_cpu in
@@ -10476,7 +10167,7 @@
 	*)
 	  hardcode_direct=yes
 	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='$wl-E'
+	  export_dynamic_flag_spec='${wl}-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -10487,8 +10178,8 @@
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test yes = "$GCC"; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
@@ -10498,8 +10189,8 @@
 if ${lt_cv_irix_exported_symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS=$LDFLAGS
-	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
 	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int foo (void) { return 0; }
@@ -10511,35 +10202,25 @@
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS=$save_LDFLAGS
+           LDFLAGS="$save_LDFLAGS"
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test yes = "$lt_cv_irix_exported_symbol"; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
 	fi
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
-    linux*)
-      case $cc_basename in
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	ld_shlibs=yes
-	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      esac
-      ;;
-
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -10553,7 +10234,7 @@
     newsos6)
       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
-      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       hardcode_shlibpath_var=no
       ;;
@@ -10561,19 +10242,27 @@
     *nto* | *qnx*)
       ;;
 
-    openbsd* | bitrig*)
+    openbsd*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
 	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
-	  export_dynamic_flag_spec='$wl-E'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec='${wl}-E'
 	else
-	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	     ;;
+	  esac
 	fi
       else
 	ld_shlibs=no
@@ -10584,53 +10273,33 @@
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      shrext_cmds=.dll
-      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      enable_shared_with_static_runtimes=yes
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
-      if test yes = "$GCC"; then
-	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
-	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test yes = "$GCC"; then
-	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
-	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10641,24 +10310,24 @@
 
     solaris*)
       no_undefined_flag=' -z defs'
-      if test yes = "$GCC"; then
-	wlarc='$wl'
-	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='$wl'
-	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -10668,11 +10337,11 @@
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands '-z linker_flag'.  GCC discards it without '$wl',
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test yes = "$GCC"; then
-	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 	else
 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
 	fi
@@ -10682,10 +10351,10 @@
       ;;
 
     sunos4*)
-      if test sequent = "$host_vendor"; then
+      if test "x$host_vendor" = xsequent; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -10734,43 +10403,43 @@
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='$wl-z,text'
+      no_undefined_flag='${wl}-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
       runpath_var='LD_RUN_PATH'
 
-      if test yes = "$GCC"; then
-	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # Note: We can NOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      no_undefined_flag='$wl-z,text'
-      allow_undefined_flag='$wl-z,nodefs'
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='$wl-R,$libdir'
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      export_dynamic_flag_spec='$wl-Bexport'
+      export_dynamic_flag_spec='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test yes = "$GCC"; then
-	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -10785,10 +10454,10 @@
       ;;
     esac
 
-    if test sni = "$host_vendor"; then
+    if test x$host_vendor = xsni; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='$wl-Blargedynsym'
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
 	;;
       esac
     fi
@@ -10796,7 +10465,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
-test no = "$ld_shlibs" && can_build_shared=no
+test "$ld_shlibs" = no && can_build_shared=no
 
 with_gnu_ld=$with_gnu_ld
 
@@ -10822,7 +10491,7 @@
   # Assume -lc should be added
   archive_cmds_need_lc=yes
 
-  if test yes,yes = "$GCC,$enable_shared"; then
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
     case $archive_cmds in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -11037,14 +10706,14 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   case $host_os in
-    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
-    *) lt_awk_arg='/^libraries:/' ;;
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
-    *) lt_sed_strip_eq='s|=/|/|g' ;;
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -11060,35 +10729,28 @@
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary...
+  # and add multilib dir if necessary.
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  # ...but if some path component already ends with the multilib dir we assume
-  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
-  case "$lt_multi_os_dir; $lt_search_path_spec " in
-  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
-    lt_multi_os_dir=
-    ;;
-  esac
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
-    elif test -n "$lt_multi_os_dir"; then
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
-  lt_foo = "";
-  lt_count = 0;
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo = "/" $lt_i lt_foo;
+          lt_foo="/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -11102,7 +10764,7 @@
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -11111,7 +10773,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=.so
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -11128,16 +10790,14 @@
 # flags to be left without arguments
 need_version=unknown
 
-
-
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='$libname$release$shared_ext$major'
+  soname_spec='${libname}${release}${shared_ext}$major'
   ;;
 
 aix[4-9]*)
@@ -11145,91 +10805,41 @@
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test ia64 = "$host_cpu"; then
+  if test "$host_cpu" = ia64; then
     # AIX 5 supports IA64
-    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line '#! .'.  This would cause the generated library to
-    # depend on '.', always an invalid library.  This was fixed in
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # Using Import Files as archive members, it is possible to support
-    # filename-based versioning of shared library archives on AIX. While
-    # this would work for both with and without runtime linking, it will
-    # prevent static linking of such archives. So we do filename-based
-    # shared library versioning with .so extension only, which is used
-    # when both runtime linking and shared linking is enabled.
-    # Unfortunately, runtime linking may impact performance, so we do
-    # not want this to be the default eventually. Also, we use the
-    # versioned .so libs for executables only if there is the -brtl
-    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
-    # To allow for filename-based versioning support, we need to create
-    # libNAME.so.V as an archive file, containing:
-    # *) an Import File, referring to the versioned filename of the
-    #    archive as well as the shared archive member, telling the
-    #    bitwidth (32 or 64) of that shared object, and providing the
-    #    list of exported symbols of that shared object, eventually
-    #    decorated with the 'weak' keyword
-    # *) the shared object with the F_LOADONLY flag set, to really avoid
-    #    it being seen by the linker.
-    # At run time we better use the real file rather than another symlink,
-    # but for link time we create the symlink libNAME.so -> libNAME.so.V
-
-    case $with_aix_soname,$aix_use_runtimelinking in
-    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    aix,yes) # traditional libtool
-      dynamic_linker='AIX unversionable lib.so'
+    if test "$aix_use_runtimelinking" = yes; then
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      ;;
-    aix,no) # traditional AIX only
-      dynamic_linker='AIX lib.a(lib.so.V)'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      ;;
-    svr4,*) # full svr4 only
-      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,yes) # both, prefer svr4
-      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # unpreferred sharedlib libNAME.a needs extra handling
-      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
-      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,no) # both, prefer aix
-      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
-      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
-      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
-      ;;
-    esac
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -11239,18 +10849,18 @@
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='$libname$shared_ext'
+  library_names_spec='${libname}${shared_ext}'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -11258,8 +10868,8 @@
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -11271,7 +10881,7 @@
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=.dll
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -11280,8 +10890,8 @@
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -11297,17 +10907,17 @@
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
 
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -11316,8 +10926,8 @@
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-    library_names_spec='$libname.dll.lib'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
 
     case $build_os in
     mingw*)
@@ -11344,7 +10954,7 @@
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec=$LIB
+      sys_lib_search_path_spec="$LIB"
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -11357,8 +10967,8 @@
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -11371,7 +10981,7 @@
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -11384,8 +10994,8 @@
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$major$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -11398,8 +11008,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -11417,13 +11027,12 @@
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      soname_spec='$libname$release$shared_ext$major'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
       need_version=yes
       ;;
   esac
@@ -11453,10 +11062,10 @@
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=no
+  shlibpath_overrides_runpath=yes
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -11474,15 +11083,14 @@
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    if test 32 = "$HPUX_IA64_MODE"; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -11490,8 +11098,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -11500,8 +11108,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -11514,8 +11122,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11526,7 +11134,7 @@
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test yes = "$lt_cv_prog_gnu_ld"; then
+	if test "$lt_cv_prog_gnu_ld" = yes; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -11534,8 +11142,8 @@
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -11554,8 +11162,8 @@
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
-  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
   hardcode_into_libs=yes
   ;;
 
@@ -11564,33 +11172,13 @@
   dynamic_linker=no
   ;;
 
-linux*android*)
-  version_type=none # Android doesn't support versioned libraries.
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext'
-  soname_spec='$libname$release$shared_ext'
-  finish_cmds=
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  dynamic_linker='Android linker'
-  # Don't embed -rpath directories since the linker doesn't support them.
-  hardcode_libdir_flag_spec='-L$libdir'
-  ;;
-
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11634,18 +11222,10 @@
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
-  # Ideally, we could use ldconfig to report *all* directores which are
-  # searched for libraries, however this is still not possible.  Aside from not
-  # being certain /sbin/ldconfig is available, command
-  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
-  # even though it is searched at run-time.  Try to do the best guess by
-  # appending ld.so.conf contents (and includes) to the search path.
+  # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -11657,17 +11237,29 @@
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -11677,7 +11269,7 @@
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -11686,68 +11278,58 @@
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd* | bitrig*)
+openbsd*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec=/usr/lib
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-    need_version=no
-  else
-    need_version=yes
-  fi
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
   ;;
 
 os2*)
   libname_spec='$name'
-  version_type=windows
-  shrext_cmds=.dll
-  need_version=no
+  shrext_cmds=".dll"
   need_lib_prefix=no
-  # OS/2 can only load a DLL with a base name of 8 characters or less.
-  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
-    v=$($ECHO $release$versuffix | tr -d .-);
-    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
-    $ECHO $n$v`$shared_ext'
-  library_names_spec='${libname}_dll.$libext'
+  library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=BEGINLIBPATH
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-  postinstall_cmds='base_file=`basename \$file`~
-    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
-    dldir=$destdir/`dirname \$dlpath`~
-    test -d \$dldir || mkdir -p \$dldir~
-    $install_prog $dir/$dlname \$dldir/$dlname~
-    chmod a+x \$dldir/$dlname~
-    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-    fi'
-  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
-    dlpath=$dir/\$dldll~
-    $RM \$dlpath'
+  shlibpath_var=LIBPATH
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
 rdos*)
@@ -11758,8 +11340,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -11769,11 +11351,11 @@
 
 sunos4*)
   version_type=sunos
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test yes = "$with_gnu_ld"; then
+  if test "$with_gnu_ld" = yes; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -11781,8 +11363,8 @@
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -11803,24 +11385,24 @@
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec; then
+  if test -d /usr/nec ;then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
-    soname_spec='$libname$shared_ext.$major'
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=sco
+  version_type=freebsd-elf
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test yes = "$with_gnu_ld"; then
+  if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -11838,7 +11420,7 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -11846,8 +11428,8 @@
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -11857,35 +11439,20 @@
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test no = "$dynamic_linker" && can_build_shared=no
+test "$dynamic_linker" = no && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
-  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
 fi
-
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
-  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
 
-# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
-configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
-
-# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
-func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
-
-# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
-configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
-
-
-
-
-
-
 
 
 
@@ -11982,15 +11549,15 @@
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" ||
    test -n "$runpath_var" ||
-   test yes = "$hardcode_automatic"; then
+   test "X$hardcode_automatic" = "Xyes" ; then
 
   # We can hardcode non-existent directories.
-  if test no != "$hardcode_direct" &&
+  if test "$hardcode_direct" != no &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
-     test no != "$hardcode_minus_L"; then
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
   else
@@ -12005,12 +11572,12 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
-if test relink = "$hardcode_action" ||
-   test yes = "$inherit_rpath"; then
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
-     test no = "$enable_shared"; then
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -12020,7 +11587,7 @@
 
 
 
-  if test yes != "$enable_dlopen"; then
+  if test "x$enable_dlopen" != xyes; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -12030,23 +11597,23 @@
 
   case $host_os in
   beos*)
-    lt_cv_dlopen=load_add_on
+    lt_cv_dlopen="load_add_on"
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen=LoadLibrary
+    lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen=dlopen
+    lt_cv_dlopen="dlopen"
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-    # if libdl is installed we need to link against it
+  # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -12084,10 +11651,10 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
 
-    lt_cv_dlopen=dyld
+    lt_cv_dlopen="dyld"
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
 
@@ -12095,18 +11662,10 @@
 
     ;;
 
-  tpf*)
-    # Don't try to run any link tests for TPF.  We know it's impossible
-    # because TPF is a cross-compiler, and we know how we open DSOs.
-    lt_cv_dlopen=dlopen
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=no
-    ;;
-
   *)
     ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
 if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen=shl_load
+  lt_cv_dlopen="shl_load"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -12145,11 +11704,11 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
 if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen
+  lt_cv_dlopen="dlopen"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -12188,7 +11747,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -12227,7 +11786,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -12266,7 +11825,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
 fi
 
 
@@ -12287,21 +11846,21 @@
     ;;
   esac
 
-  if test no = "$lt_cv_dlopen"; then
-    enable_dlopen=no
-  else
+  if test "x$lt_cv_dlopen" != xno; then
     enable_dlopen=yes
+  else
+    enable_dlopen=no
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS=$CPPFLAGS
-    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS=$LDFLAGS
+    save_LDFLAGS="$LDFLAGS"
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS=$LIBS
+    save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -12309,7 +11868,7 @@
 if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test yes = "$cross_compiling"; then :
+  	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12356,9 +11915,9 @@
 #  endif
 #endif
 
-/* When -fvisibility=hidden is used, assume the code has been annotated
+/* When -fvisbility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -12388,7 +11947,7 @@
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -12408,14 +11967,14 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test yes = "$lt_cv_dlopen_self"; then
+    if test "x$lt_cv_dlopen_self" = xyes; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test yes = "$cross_compiling"; then :
+  	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12462,9 +12021,9 @@
 #  endif
 #endif
 
-/* When -fvisibility=hidden is used, assume the code has been annotated
+/* When -fvisbility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -12494,7 +12053,7 @@
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -12515,9 +12074,9 @@
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
-    CPPFLAGS=$save_CPPFLAGS
-    LDFLAGS=$save_LDFLAGS
-    LIBS=$save_LIBS
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
     ;;
   esac
 
@@ -12561,7 +12120,7 @@
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP"; then
+    if test -n "$STRIP" ; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -12589,7 +12148,7 @@
 
 
 
-  # Report what library types will actually be built
+  # Report which library types will actually be built
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -12597,13 +12156,13 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
-  test no = "$can_build_shared" && enable_shared=no
+  test "$can_build_shared" = "no" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test yes = "$enable_shared" && enable_static=no
+    test "$enable_shared" = yes && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -12611,12 +12170,8 @@
     ;;
 
   aix[4-9]*)
-    if test ia64 != "$host_cpu"; then
-      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-      yes,aix,yes) ;;			# shared object as lib.so file only
-      yes,svr4,*) ;;			# shared object as lib.so archive member only
-      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-      esac
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
     fi
     ;;
   esac
@@ -12626,7 +12181,7 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
-  test yes = "$enable_shared" || enable_static=yes
+  test "$enable_shared" = yes || enable_static=yes
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
@@ -12640,7 +12195,7 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC=$lt_save_CC
+CC="$lt_save_CC"
 
 
 
@@ -13144,7 +12699,82 @@
 if test "$with_zlib" = "no"; then
     echo "Disabling compression support"
 else
-    for ac_header in zlib.h
+    # Try pkg-config first so that static linking works.
+    # If this succeeeds, we ignore the WITH_ZLIB directory.
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Z" >&5
+$as_echo_n "checking for Z... " >&6; }
+
+if test -n "$Z_CFLAGS"; then
+    pkg_cv_Z_CFLAGS="$Z_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "zlib") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_Z_CFLAGS=`$PKG_CONFIG --cflags "zlib" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$Z_LIBS"; then
+    pkg_cv_Z_LIBS="$Z_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "zlib") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_Z_LIBS=`$PKG_CONFIG --libs "zlib" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        Z_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib" 2>&1`
+        else
+	        Z_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$Z_PKG_ERRORS" >&5
+
+	have_libz=no
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	have_libz=no
+else
+	Z_CFLAGS=$pkg_cv_Z_CFLAGS
+	Z_LIBS=$pkg_cv_Z_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	have_libz=yes
+fi
+
+     if test "x$have_libz" = "xno"; then
+        for ac_header in zlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_zlib_h" = xyes; then :
@@ -13152,8 +12782,8 @@
 #define HAVE_ZLIB_H 1
 _ACEOF
  SAVE_LDFLAGS="${LDFLAGS}"
-	 LDFLAGS="-L${Z_DIR}/lib"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5
+             LDFLAGS="-L${Z_DIR}/lib"
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5
 $as_echo_n "checking for gzread in -lz... " >&6; }
 if ${ac_cv_lib_z_gzread+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -13191,28 +12821,50 @@
 $as_echo "$ac_cv_lib_z_gzread" >&6; }
 if test "x$ac_cv_lib_z_gzread" = xyes; then :
 
-
-$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
-
-	    WITH_ZLIB=1
-	    if test "x${Z_DIR}" != "x"; then
-		Z_CFLAGS="-I${Z_DIR}/include"
-		Z_LIBS="-L${Z_DIR}/lib -lz"
-		case ${host} in
-		    *-*-solaris*)
-			Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
-			;;
-		esac
-	    else
-		Z_LIBS="-lz"
-	    fi
+                have_libz=yes
+                if test "x${Z_DIR}" != "x"; then
+                    Z_CFLAGS="-I${Z_DIR}/include"
+                    Z_LIBS="-L${Z_DIR}/lib -lz"
+                    case ${host} in
+                        *-*-solaris*)
+                            Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
+                            ;;
+                    esac
+                else
+                    Z_LIBS="-lz"
+                fi
+else
+  have_libz=no
 fi
 
-	 LDFLAGS="${SAVE_LDFLAGS}"
+             LDFLAGS="${SAVE_LDFLAGS}"
 fi
 
 done
 
+    else
+	# we still need to check for zlib.h header
+	for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+    fi
+
+    # Found the library via either method?
+    if test "x$have_libz" = "xyes"; then
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+        WITH_ZLIB=1
+    fi
 fi
 
 
@@ -14321,7 +13973,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_list is an array type" >&5
 $as_echo_n "checking whether va_list is an array type... " >&6; }
 cat > conftest.$ac_ext <<EOF
-#line 14324 "configure"
+#line 13976 "configure"
 #include "confdefs.h"
 
 #include <stdarg.h>
@@ -14331,7 +13983,7 @@
 va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1
 ; return 0; }
 EOF
-if { (eval echo configure:14334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:13986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
   rm -rf conftest*
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -14521,7 +14173,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket length (socklen_t)" >&5
 $as_echo_n "checking for type of socket length (socklen_t)... " >&6; }
 cat > conftest.$ac_ext <<EOF
-#line 14524 "configure"
+#line 14176 "configure"
 #include "confdefs.h"
 
 #include <stddef.h>
@@ -14532,7 +14184,7 @@
 (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)
 ; return 0; }
 EOF
-if { (eval echo configure:14535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:14187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
   rm -rf conftest*
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t *" >&5
@@ -14544,7 +14196,7 @@
   rm -rf conftest*
 
   cat > conftest.$ac_ext <<EOF
-#line 14547 "configure"
+#line 14199 "configure"
 #include "confdefs.h"
 
 #include <stddef.h>
@@ -14555,7 +14207,7 @@
 (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)
 ; return 0; }
 EOF
-if { (eval echo configure:14558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:14210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
   rm -rf conftest*
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t *" >&5
@@ -14567,7 +14219,7 @@
   rm -rf conftest*
 
     cat > conftest.$ac_ext <<EOF
-#line 14570 "configure"
+#line 14222 "configure"
 #include "confdefs.h"
 
 #include <stddef.h>
@@ -14578,7 +14230,7 @@
 (void)getsockopt (1, 1, 1, NULL, (int *)NULL)
 ; return 0; }
 EOF
-if { (eval echo configure:14581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:14233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
   rm -rf conftest*
 
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: int *" >&5
@@ -16102,8 +15754,6 @@
 	*) M_LIBS="-lm"
 	;;
 esac
-XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
-XML_LIBTOOLLIBS="libxml2.la"
 
 
 WITH_ICU=0
@@ -16111,19 +15761,177 @@
 if test "$with_icu" != "yes" ; then
     echo Disabling ICU support
 else
-    ICU_CONFIG=icu-config
-    if ${ICU_CONFIG} --cflags >/dev/null 2>&1
-    then
-        ICU_LIBS=`${ICU_CONFIG} --ldflags`
-        WITH_ICU=1
-        echo Enabling ICU support
-    else
-        as_fn_error $? "libicu config program icu-config not found" "$LINENO" 5
-    fi
+    # Try pkg-config first so that static linking works.
+    # If this succeeeds, we ignore the WITH_ICU directory.
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU" >&5
+$as_echo_n "checking for ICU... " >&6; }
+
+if test -n "$ICU_CFLAGS"; then
+    pkg_cv_ICU_CFLAGS="$ICU_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "icu-i18n") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$ICU_LIBS"; then
+    pkg_cv_ICU_LIBS="$ICU_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "icu-i18n") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-i18n" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
 
 
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-i18n" 2>&1`
+        else
+	        ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-i18n" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$ICU_PKG_ERRORS" >&5
+
+	have_libicu=no
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	have_libicu=no
+else
+	ICU_CFLAGS=$pkg_cv_ICU_CFLAGS
+	ICU_LIBS=$pkg_cv_ICU_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	have_libicu=yes
+fi
+
+    # If pkg-config failed, fall back to AC_CHECK_LIB. This
+    # will not pick up the necessary LIBS flags for liblzma's
+    # private dependencies, though, so static linking may fail.
+    if test "x$have_libicu" = "xno"; then
+        ICU_CONFIG=icu-config
+        if ${ICU_CONFIG} --cflags >/dev/null 2>&1
+        then
+            ICU_LIBS=`${ICU_CONFIG} --ldflags`
+            have_libicu=yes
+            echo Enabling ICU support
+        else
+            if test "$with_icu" != "yes" -a "$with_iconv" != "" ; then
+                CPPFLAGS="${CPPFLAGS} -I$with_icu"
+                # Export this since our headers include icu.h
+                XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_icu"
+            fi
+
+            ac_fn_c_check_header_mongrel "$LINENO" "unicode/ucnv.h" "ac_cv_header_unicode_ucnv_h" "$ac_includes_default"
+if test "x$ac_cv_header_unicode_ucnv_h" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu" >&5
+$as_echo_n "checking for icu... " >&6; }
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unicode/ucnv.h>
+int
+main ()
+{
+
+        UConverter *utf = ucnv_open("UTF-8", NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                have_libicu=yes
+else
+
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu in -licucore" >&5
+$as_echo_n "checking for icu in -licucore... " >&6; }
+
+                _ldflags="${LDFLAGS}"
+                _libs="${LIBS}"
+                LDFLAGS="${LDFLAGS} ${ICU_LIBS}"
+                LIBS="${LIBS} -licucore"
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unicode/ucnv.h>
+int
+main ()
+{
+
+        UConverter *utf = ucnv_open("UTF-8", NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                    have_libicu=yes
+                    ICU_LIBS="${ICU_LIBS} -licucore"
+                    LIBS="${_libs}"
+                    LDFLAGS="${_ldflags}"
+else
+
+                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                    LIBS="${_libs}"
+                LDFLAGS="${_ldflags}"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+        fi
+    fi
+
+    # Found the library via either method?
+    if test "x$have_libicu" = "xyes"; then
+        WITH_ICU=1
+    fi
+fi
+XML_LIBS="-lxml2 $Z_LIBS $LZMA_LIBS $THREAD_LIBS $ICONV_LIBS $ICU_LIBS $M_LIBS $LIBS"
+XML_LIBTOOLLIBS="libxml2.la"
+
+
 WITH_ISO8859X=1
 if test "$WITH_ICONV" != "1" ; then
 if test "$with_iso8859x" = "no" ; then
@@ -16272,6 +16080,7 @@
 
 
 
+
 RELDATE=`date +'%a %b %e %Y'`
 
 
@@ -16395,6 +16204,10 @@
 LTLIBOBJS=$ac_ltlibobjs
 
 
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
 $as_echo_n "checking that generated files are newer than configure... " >&6; }
    if test -n "$am_sleep_pid"; then
@@ -17041,7 +16854,6 @@
 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -17091,13 +16903,10 @@
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
@@ -17162,8 +16971,7 @@
 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
-configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -17214,12 +17022,9 @@
 compiler \
 lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_import \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-lt_cv_nm_interface \
 nm_file_list_spec \
-lt_cv_truncate_bin \
 lt_prog_compiler_no_builtin_flag \
 lt_prog_compiler_pic \
 lt_prog_compiler_wl \
@@ -17254,7 +17059,7 @@
 striplib; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -17281,11 +17086,10 @@
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-configure_time_dlsearch_path \
-configure_time_lt_sys_library_path; do
+sys_lib_dlsearch_path_spec; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -17294,16 +17098,19 @@
 done
 
 ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
 
-# See if we are running on zsh, and set the options that allow our
+# See if we are running on zsh, and set the options which allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
+if test -n "\${ZSH_VERSION+set}" ; then
    setopt NO_GLOB_SUBST
 fi
 
 
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'
 
@@ -18028,53 +17835,55 @@
  ;;
     "libtool":C)
 
-    # See if we are running on zsh, and set the options that allow our
+    # See if we are running on zsh, and set the options which allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}"; then
+    if test -n "${ZSH_VERSION+set}" ; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile=${ofile}T
+    cfgfile="${ofile}T"
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-# Generated automatically by $as_me ($PACKAGE) $VERSION
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
-
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit, 1996
-
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
-# (at your option) any later version.
 #
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that is built
-# using GNU Libtool, you may include this file under the  same
-# distribution terms that you use for the rest of that program.
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
 #
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
 # The names of the tagged configurations supported by this script.
-available_tags=''
-
-# Configured defaults for sys_lib_dlsearch_path munging.
-: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+available_tags=""
 
 # ### BEGIN LIBTOOL CONFIG
 
@@ -18094,9 +17903,6 @@
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
-# Shared archive member basename,for filename based shared library versioning on AIX.
-shared_archive_member_spec=$shared_archive_member_spec
-
 # Shell to use when invoking shell scripts.
 SHELL=$lt_SHELL
 
@@ -18214,27 +18020,18 @@
 # Transform the output of nm in a proper C declaration.
 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
-# Transform the output of nm into a list of symbols to manually relocate.
-global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
-
 # Transform the output of nm in a C name address pair.
 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
-# The name lister interface.
-nm_interface=$lt_lt_cv_nm_interface
-
 # Specify filename containing input files for \$NM.
 nm_file_list_spec=$lt_nm_file_list_spec
 
-# The root where to search for dependent libraries,and where our libraries should be installed.
+# The root where to search for dependent libraries,and in which our libraries should be installed.
 lt_sysroot=$lt_sysroot
 
-# Command to truncate a binary pipe.
-lt_truncate_bin=$lt_lt_cv_truncate_bin
-
 # The name of the directory that contains temporary libtool files.
 objdir=$objdir
 
@@ -18325,11 +18122,8 @@
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Detected run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
-
-# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
-configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Whether dlopen is supported.
 dlopen_support=$enable_dlopen
@@ -18422,13 +18216,13 @@
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct
 
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute
 
@@ -18480,72 +18274,13 @@
 
 _LT_EOF
 
-    cat <<'_LT_EOF' >> "$cfgfile"
-
-# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
-
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x$2 in
-    x)
-        ;;
-    *:)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
-        ;;
-    x:*)
-        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
-        ;;
-    *)
-        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-
-
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in $*""; do
-      case $cc_temp in
-        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
-
-# ### END FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_EOF
-
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
+if test "X${COLLECT_NAMES+set}" != Xset; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -18554,7 +18289,7 @@
   esac
 
 
-ltmain=$ac_aux_dir/ltmain.sh
+ltmain="$ac_aux_dir/ltmain.sh"
 
 
   # We use sed instead of cat because bash on DJGPP gets confused if
@@ -18564,6 +18299,165 @@
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
diff --git a/third_party/libxml/src/configure.ac b/third_party/libxml/src/configure.ac
index 02602814..6f012c9 100644
--- a/third_party/libxml/src/configure.ac
+++ b/third_party/libxml/src/configure.ac
@@ -3,12 +3,13 @@
 AC_INIT
 AC_CONFIG_SRCDIR([entities.c])
 AC_CONFIG_HEADERS([config.h])
+AM_MAINTAINER_MODE([enable])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
 
 LIBXML_MAJOR_VERSION=2
 LIBXML_MINOR_VERSION=9
-LIBXML_MICRO_VERSION=3
+LIBXML_MICRO_VERSION=4
 LIBXML_MICRO_VERSION_SUFFIX=
 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -390,24 +391,41 @@
 if test "$with_zlib" = "no"; then
     echo "Disabling compression support"
 else
-    AC_CHECK_HEADERS(zlib.h,
-        [SAVE_LDFLAGS="${LDFLAGS}"
-	 LDFLAGS="-L${Z_DIR}/lib"
-	AC_CHECK_LIB(z, gzread,[
-	    AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
-	    WITH_ZLIB=1
-	    if test "x${Z_DIR}" != "x"; then
-		Z_CFLAGS="-I${Z_DIR}/include"
-		Z_LIBS="-L${Z_DIR}/lib -lz"
-		[case ${host} in
-		    *-*-solaris*)
-			Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
-			;;
-		esac]
-	    else
-		Z_LIBS="-lz"
-	    fi])
-	 LDFLAGS="${SAVE_LDFLAGS}"])
+    # Try pkg-config first so that static linking works.
+    # If this succeeeds, we ignore the WITH_ZLIB directory.
+    PKG_CHECK_MODULES([Z],[zlib],
+        [have_libz=yes],
+        [have_libz=no])
+
+     if test "x$have_libz" = "xno"; then
+        AC_CHECK_HEADERS(zlib.h,
+            [SAVE_LDFLAGS="${LDFLAGS}"
+             LDFLAGS="-L${Z_DIR}/lib"
+            AC_CHECK_LIB(z, gzread,[
+                have_libz=yes
+                if test "x${Z_DIR}" != "x"; then
+                    Z_CFLAGS="-I${Z_DIR}/include"
+                    Z_LIBS="-L${Z_DIR}/lib -lz"
+                    [case ${host} in
+                        *-*-solaris*)
+                            Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
+                            ;;
+                    esac]
+                else
+                    Z_LIBS="-lz"
+                fi],
+                [have_libz=no])
+             LDFLAGS="${SAVE_LDFLAGS}"])
+    else
+	# we still need to check for zlib.h header
+	AC_CHECK_HEADERS([zlib.h])
+    fi
+
+    # Found the library via either method?
+    if test "x$have_libz" = "xyes"; then
+        AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
+        WITH_ZLIB=1
+    fi
 fi
 
 AC_SUBST(Z_CFLAGS)
@@ -1479,8 +1497,6 @@
 	*) M_LIBS="-lm"
 	;;
 esac
-XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
-XML_LIBTOOLLIBS="libxml2.la"
 AC_SUBST(WITH_ICONV)
 
 WITH_ICU=0
@@ -1488,18 +1504,64 @@
 if test "$with_icu" != "yes" ; then
     echo Disabling ICU support
 else
-    ICU_CONFIG=icu-config
-    if ${ICU_CONFIG} --cflags >/dev/null 2>&1
-    then
-        ICU_LIBS=`${ICU_CONFIG} --ldflags`
+    # Try pkg-config first so that static linking works.
+    # If this succeeeds, we ignore the WITH_ICU directory.
+    PKG_CHECK_MODULES([ICU],[icu-i18n],
+        [have_libicu=yes],
+        [have_libicu=no])
+
+    # If pkg-config failed, fall back to AC_CHECK_LIB. This
+    # will not pick up the necessary LIBS flags for liblzma's
+    # private dependencies, though, so static linking may fail.
+    if test "x$have_libicu" = "xno"; then
+        ICU_CONFIG=icu-config
+        if ${ICU_CONFIG} --cflags >/dev/null 2>&1
+        then
+            ICU_LIBS=`${ICU_CONFIG} --ldflags`
+            have_libicu=yes
+            echo Enabling ICU support
+        else
+            if test "$with_icu" != "yes" -a "$with_iconv" != "" ; then
+                CPPFLAGS="${CPPFLAGS} -I$with_icu"
+                # Export this since our headers include icu.h
+                XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_icu"
+            fi
+
+            AC_CHECK_HEADER(unicode/ucnv.h,
+            AC_MSG_CHECKING(for icu)
+            AC_TRY_LINK([#include <unicode/ucnv.h>],[
+        UConverter *utf = ucnv_open("UTF-8", NULL);],[
+                AC_MSG_RESULT(yes)
+                have_libicu=yes],[
+                AC_MSG_RESULT(no)
+                AC_MSG_CHECKING(for icu in -licucore)
+
+                _ldflags="${LDFLAGS}"
+                _libs="${LIBS}"
+                LDFLAGS="${LDFLAGS} ${ICU_LIBS}"
+                LIBS="${LIBS} -licucore"
+
+                AC_TRY_LINK([#include <unicode/ucnv.h>],[
+        UConverter *utf = ucnv_open("UTF-8", NULL);],[
+                    AC_MSG_RESULT(yes)
+                    have_libicu=yes
+                    ICU_LIBS="${ICU_LIBS} -licucore"
+                    LIBS="${_libs}"
+                    LDFLAGS="${_ldflags}"],[
+                    AC_MSG_RESULT(no)
+                    LIBS="${_libs}"
+                LDFLAGS="${_ldflags}"])]))
+        fi
+    fi
+
+    # Found the library via either method?
+    if test "x$have_libicu" = "xyes"; then
         WITH_ICU=1
-        echo Enabling ICU support
-    else
-        AC_MSG_ERROR([libicu config program icu-config not found])
     fi
 fi
+XML_LIBS="-lxml2 $Z_LIBS $LZMA_LIBS $THREAD_LIBS $ICONV_LIBS $ICU_LIBS $M_LIBS $LIBS"
+XML_LIBTOOLLIBS="libxml2.la"
 AC_SUBST(WITH_ICU)
-AC_SUBST(ICU_LIBS)
 
 WITH_ISO8859X=1
 if test "$WITH_ICONV" != "1" ; then
@@ -1638,6 +1700,7 @@
 AC_SUBST(XML_LIBS)
 AC_SUBST(XML_LIBTOOLLIBS)
 AC_SUBST(ICONV_LIBS)
+AC_SUBST(ICU_LIBS)
 AC_SUBST(XML_INCLUDEDIR)
 AC_SUBST(HTML_DIR)
 AC_SUBST(HAVE_ISNAN)
diff --git a/third_party/libxml/src/debugXML.c b/third_party/libxml/src/debugXML.c
index b05fdff5..e34b140 100644
--- a/third_party/libxml/src/debugXML.c
+++ b/third_party/libxml/src/debugXML.c
@@ -44,10 +44,10 @@
     int depth;                  /* current depth */
     xmlDocPtr doc;              /* current document */
     xmlNodePtr node;		/* current node */
-    xmlDictPtr dict;		/* the doc dictionnary */
+    xmlDictPtr dict;		/* the doc dictionary */
     int check;                  /* do just checkings */
     int errors;                 /* number of errors found */
-    int nodict;			/* if the document has no dictionnary */
+    int nodict;			/* if the document has no dictionary */
     int options;		/* options */
 };
 
@@ -243,7 +243,7 @@
  * @ctxt: the debug context
  * @name: the name
  *
- * Do debugging on the name, for example the dictionnary status and
+ * Do debugging on the name, for example the dictionary status and
  * conformance to the Name production.
  */
 static void
@@ -265,7 +265,7 @@
             ((ctxt->doc == NULL) ||
              ((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) {
 	    xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT,
-			 "Name is not from the document dictionnary '%s'",
+			 "Name is not from the document dictionary '%s'",
 			 (const char *) name);
 	}
     }
@@ -292,7 +292,7 @@
             /* desactivated right now as it raises too many errors */
 	    if (doc->type == XML_DOCUMENT_NODE)
 		xmlDebugErr(ctxt, XML_CHECK_NO_DICT,
-			    "Document has no dictionnary\n");
+			    "Document has no dictionary\n");
 #endif
 	    ctxt->nodict = 1;
 	}
diff --git a/third_party/libxml/src/depcomp b/third_party/libxml/src/depcomp
index fc98710e..4ebd5b3a 100755
--- a/third_party/libxml/src/depcomp
+++ b/third_party/libxml/src/depcomp
@@ -3,7 +3,7 @@
 
 scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/third_party/libxml/src/dict.c b/third_party/libxml/src/dict.c
index 8c8f9314..c0585fe 100644
--- a/third_party/libxml/src/dict.c
+++ b/third_party/libxml/src/dict.c
@@ -87,7 +87,7 @@
 #endif /* WITH_BIG_KEY */
 
 /*
- * An entry in the dictionnary
+ * An entry in the dictionary
  */
 typedef struct _xmlDictEntry xmlDictEntry;
 typedef xmlDictEntry *xmlDictEntryPtr;
@@ -110,7 +110,7 @@
     xmlChar array[1];
 };
 /*
- * The entire dictionnary
+ * The entire dictionary
  */
 struct _xmlDict {
     int ref_counter;
@@ -229,7 +229,7 @@
 
 /*
  * xmlDictAddString:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @name: the name of the userdata
  * @len: the length of the name
  *
@@ -291,7 +291,7 @@
 
 /*
  * xmlDictAddQString:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @prefix: the prefix of the userdata
  * @plen: the prefix length
  * @name: the name of the userdata
@@ -533,7 +533,7 @@
  *
  * Create a new dictionary
  *
- * Returns the newly created dictionnary, or NULL if an error occured.
+ * Returns the newly created dictionary, or NULL if an error occured.
  */
 xmlDictPtr
 xmlDictCreate(void) {
@@ -573,14 +573,14 @@
 
 /**
  * xmlDictCreateSub:
- * @sub: an existing dictionnary
+ * @sub: an existing dictionary
  *
  * Create a new dictionary, inheriting strings from the read-only
- * dictionnary @sub. On lookup, strings are first searched in the
- * new dictionnary, then in @sub, and if not found are created in the
- * new dictionnary.
+ * dictionary @sub. On lookup, strings are first searched in the
+ * new dictionary, then in @sub, and if not found are created in the
+ * new dictionary.
  *
- * Returns the newly created dictionnary, or NULL if an error occured.
+ * Returns the newly created dictionary, or NULL if an error occured.
  */
 xmlDictPtr
 xmlDictCreateSub(xmlDictPtr sub) {
@@ -599,7 +599,7 @@
 
 /**
  * xmlDictReference:
- * @dict: the dictionnary
+ * @dict: the dictionary
  *
  * Increment the reference counter of a dictionary
  *
@@ -620,10 +620,10 @@
 
 /**
  * xmlDictGrow:
- * @dict: the dictionnary
- * @size: the new size of the dictionnary
+ * @dict: the dictionary
+ * @size: the new size of the dictionary
  *
- * resize the dictionnary
+ * resize the dictionary
  *
  * Returns 0 in case of success, -1 in case of failure
  */
@@ -755,7 +755,7 @@
 
 /**
  * xmlDictFree:
- * @dict: the dictionnary
+ * @dict: the dictionary
  *
  * Free the hash @dict and its contents. The userdata is
  * deallocated with @f if provided.
@@ -817,11 +817,11 @@
 
 /**
  * xmlDictLookup:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @name: the name of the userdata
  * @len: the length of the name, if -1 it is recomputed
  *
- * Add the @name to the dictionnary @dict if not present.
+ * Add the @name to the dictionary @dict if not present.
  *
  * Returns the internal copy of the name or NULL in case of internal error
  */
@@ -957,11 +957,11 @@
 
 /**
  * xmlDictExists:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @name: the name of the userdata
  * @len: the length of the name, if -1 it is recomputed
  *
- * Check if the @name exists in the dictionnary @dict.
+ * Check if the @name exists in the dictionary @dict.
  *
  * Returns the internal copy of the name or NULL if not found.
  */
@@ -1065,7 +1065,7 @@
 
 /**
  * xmlDictQLookup:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @prefix: the prefix
  * @name: the name
  *
@@ -1170,7 +1170,7 @@
 
 /**
  * xmlDictOwns:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @str: the string
  *
  * check if a string is owned by the disctionary
@@ -1197,11 +1197,11 @@
 
 /**
  * xmlDictSize:
- * @dict: the dictionnary
+ * @dict: the dictionary
  *
  * Query the number of elements installed in the hash @dict.
  *
- * Returns the number of elements in the dictionnary or
+ * Returns the number of elements in the dictionary or
  * -1 in case of error
  */
 int
@@ -1215,7 +1215,7 @@
 
 /**
  * xmlDictSetLimit:
- * @dict: the dictionnary
+ * @dict: the dictionary
  * @limit: the limit in bytes
  *
  * Set a size limit for the dictionary
@@ -1236,7 +1236,7 @@
 
 /**
  * xmlDictGetUsage:
- * @dict: the dictionnary
+ * @dict: the dictionary
  *
  * Get how much memory is used by a dictionary for strings
  * Added in 2.9.0
diff --git a/third_party/libxml/src/error.c b/third_party/libxml/src/error.c
index 9c45040..4ca6838 100644
--- a/third_party/libxml/src/error.c
+++ b/third_party/libxml/src/error.c
@@ -177,8 +177,8 @@
     xmlChar  content[81]; /* space for 80 chars + line terminator */
     xmlChar *ctnt;
 
-    if ((input == NULL) || (input->cur == NULL) ||
-        (*input->cur == 0)) return;
+    if ((input == NULL) || (input->cur == NULL))
+        return;
 
     cur = input->cur;
     base = input->base;
diff --git a/third_party/libxml/src/include/Makefile.in b/third_party/libxml/src/include/Makefile.in
index ddc808f..e2fda3d8 100644
--- a/third_party/libxml/src/include/Makefile.in
+++ b/third_party/libxml/src/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,17 +14,7 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -88,6 +78,7 @@
 build_triplet = @build@
 host_triplet = @host@
 subdir = include
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -95,7 +86,6 @@
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -155,7 +145,6 @@
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -222,6 +211,7 @@
 HTML_OBJ = @HTML_OBJ@
 HTTP_OBJ = @HTTP_OBJ@
 ICONV_LIBS = @ICONV_LIBS@
+ICU_CFLAGS = @ICU_CFLAGS@
 ICU_LIBS = @ICU_LIBS@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -243,9 +233,9 @@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 LZMA_CFLAGS = @LZMA_CFLAGS@
 LZMA_LIBS = @LZMA_LIBS@
+MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -417,7 +407,7 @@
 all: all-recursive
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -429,6 +419,7 @@
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu include/Makefile
+.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -441,9 +432,9 @@
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
-$(top_srcdir)/configure:  $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
@@ -723,8 +714,6 @@
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
-.PRECIOUS: Makefile
-
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/third_party/libxml/src/include/libxml/Makefile.in b/third_party/libxml/src/include/libxml/Makefile.in
index 0cfbbe91..6ee34c9 100644
--- a/third_party/libxml/src/include/libxml/Makefile.in
+++ b/third_party/libxml/src/include/libxml/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,17 +15,7 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -89,6 +79,8 @@
 build_triplet = @build@
 host_triplet = @host@
 subdir = include/libxml
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/xmlversion.h.in $(xmlinc_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -96,8 +88,6 @@
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(xmlinc_HEADERS) \
-	$(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = xmlversion.h
@@ -169,7 +159,6 @@
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/xmlversion.h.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -211,6 +200,7 @@
 HTML_OBJ = @HTML_OBJ@
 HTTP_OBJ = @HTTP_OBJ@
 ICONV_LIBS = @ICONV_LIBS@
+ICU_CFLAGS = @ICU_CFLAGS@
 ICU_LIBS = @ICU_LIBS@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -232,9 +222,9 @@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 LZMA_CFLAGS = @LZMA_CFLAGS@
 LZMA_LIBS = @LZMA_LIBS@
+MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -455,7 +445,7 @@
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -467,6 +457,7 @@
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu include/libxml/Makefile
+.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -479,9 +470,9 @@
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
-$(top_srcdir)/configure:  $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in
@@ -714,8 +705,6 @@
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-xmlincHEADERS
 
-.PRECIOUS: Makefile
-
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/third_party/libxml/src/include/libxml/dict.h b/third_party/libxml/src/include/libxml/dict.h
index 7022ec8..b83db59a 100644
--- a/third_party/libxml/src/include/libxml/dict.h
+++ b/third_party/libxml/src/include/libxml/dict.h
@@ -1,5 +1,5 @@
 /*
- * Summary: string dictionnary
+ * Summary: string dictionary
  * Description: dictionary of reusable strings, just used to avoid allocation
  *         and freeing operations.
  *
@@ -11,6 +11,18 @@
 #ifndef __XML_DICT_H__
 #define __XML_DICT_H__
 
+#ifdef __cplusplus
+#define __XML_EXTERNC	extern "C"
+#else
+#define __XML_EXTERNC
+#endif
+
+/*
+ * The dictionary.
+ */
+__XML_EXTERNC typedef struct _xmlDict xmlDict;
+__XML_EXTERNC typedef xmlDict *xmlDictPtr;
+
 #include <limits.h>
 #include <libxml/xmlversion.h>
 #include <libxml/tree.h>
@@ -20,12 +32,6 @@
 #endif
 
 /*
- * The dictionnary.
- */
-typedef struct _xmlDict xmlDict;
-typedef xmlDict *xmlDictPtr;
-
-/*
  * Initializer
  */
 XMLPUBFUN int XMLCALL  xmlInitializeDict(void);
@@ -48,7 +54,7 @@
 			xmlDictFree	(xmlDictPtr dict);
 
 /*
- * Lookup of entry in the dictionnary.
+ * Lookup of entry in the dictionary.
  */
 XMLPUBFUN const xmlChar * XMLCALL
 			xmlDictLookup	(xmlDictPtr dict,
diff --git a/third_party/libxml/src/include/libxml/parser.h b/third_party/libxml/src/include/libxml/parser.h
index 3f5730d..47fbec0 100644
--- a/third_party/libxml/src/include/libxml/parser.h
+++ b/third_party/libxml/src/include/libxml/parser.h
@@ -260,7 +260,7 @@
     void              *catalogs;      /* document's own catalog */
     int                recovery;      /* run in recovery mode */
     int                progressive;   /* is this a progressive parsing */
-    xmlDictPtr         dict;          /* dictionnary for the parser */
+    xmlDictPtr         dict;          /* dictionary for the parser */
     const xmlChar *   *atts;          /* array for the attributes callbacks */
     int                maxatts;       /* the size of the array */
     int                docdict;       /* use strings from dict to build tree */
@@ -1099,7 +1099,7 @@
     XML_PARSE_SAX1	= 1<<9,	/* use the SAX1 interface internally */
     XML_PARSE_XINCLUDE	= 1<<10,/* Implement XInclude substitition  */
     XML_PARSE_NONET	= 1<<11,/* Forbid network access */
-    XML_PARSE_NODICT	= 1<<12,/* Do not reuse the context dictionnary */
+    XML_PARSE_NODICT	= 1<<12,/* Do not reuse the context dictionary */
     XML_PARSE_NSCLEAN	= 1<<13,/* remove redundant namespaces declarations */
     XML_PARSE_NOCDATA	= 1<<14,/* merge CDATA as text nodes */
     XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
diff --git a/third_party/libxml/src/include/libxml/schemasInternals.h b/third_party/libxml/src/include/libxml/schemasInternals.h
index 4f0ca9a1..c7cf552 100644
--- a/third_party/libxml/src/include/libxml/schemasInternals.h
+++ b/third_party/libxml/src/include/libxml/schemasInternals.h
@@ -28,52 +28,52 @@
 
 typedef enum {
     XML_SCHEMAS_UNKNOWN = 0,
-    XML_SCHEMAS_STRING,
-    XML_SCHEMAS_NORMSTRING,
-    XML_SCHEMAS_DECIMAL,
-    XML_SCHEMAS_TIME,
-    XML_SCHEMAS_GDAY,
-    XML_SCHEMAS_GMONTH,
-    XML_SCHEMAS_GMONTHDAY,
-    XML_SCHEMAS_GYEAR,
-    XML_SCHEMAS_GYEARMONTH,
-    XML_SCHEMAS_DATE,
-    XML_SCHEMAS_DATETIME,
-    XML_SCHEMAS_DURATION,
-    XML_SCHEMAS_FLOAT,
-    XML_SCHEMAS_DOUBLE,
-    XML_SCHEMAS_BOOLEAN,
-    XML_SCHEMAS_TOKEN,
-    XML_SCHEMAS_LANGUAGE,
-    XML_SCHEMAS_NMTOKEN,
-    XML_SCHEMAS_NMTOKENS,
-    XML_SCHEMAS_NAME,
-    XML_SCHEMAS_QNAME,
-    XML_SCHEMAS_NCNAME,
-    XML_SCHEMAS_ID,
-    XML_SCHEMAS_IDREF,
-    XML_SCHEMAS_IDREFS,
-    XML_SCHEMAS_ENTITY,
-    XML_SCHEMAS_ENTITIES,
-    XML_SCHEMAS_NOTATION,
-    XML_SCHEMAS_ANYURI,
-    XML_SCHEMAS_INTEGER,
-    XML_SCHEMAS_NPINTEGER,
-    XML_SCHEMAS_NINTEGER,
-    XML_SCHEMAS_NNINTEGER,
-    XML_SCHEMAS_PINTEGER,
-    XML_SCHEMAS_INT,
-    XML_SCHEMAS_UINT,
-    XML_SCHEMAS_LONG,
-    XML_SCHEMAS_ULONG,
-    XML_SCHEMAS_SHORT,
-    XML_SCHEMAS_USHORT,
-    XML_SCHEMAS_BYTE,
-    XML_SCHEMAS_UBYTE,
-    XML_SCHEMAS_HEXBINARY,
-    XML_SCHEMAS_BASE64BINARY,
-    XML_SCHEMAS_ANYTYPE,
-    XML_SCHEMAS_ANYSIMPLETYPE
+    XML_SCHEMAS_STRING = 1,
+    XML_SCHEMAS_NORMSTRING = 2,
+    XML_SCHEMAS_DECIMAL = 3,
+    XML_SCHEMAS_TIME = 4,
+    XML_SCHEMAS_GDAY = 5,
+    XML_SCHEMAS_GMONTH = 6,
+    XML_SCHEMAS_GMONTHDAY = 7,
+    XML_SCHEMAS_GYEAR = 8,
+    XML_SCHEMAS_GYEARMONTH = 9,
+    XML_SCHEMAS_DATE = 10,
+    XML_SCHEMAS_DATETIME = 11,
+    XML_SCHEMAS_DURATION = 12,
+    XML_SCHEMAS_FLOAT = 13,
+    XML_SCHEMAS_DOUBLE = 14,
+    XML_SCHEMAS_BOOLEAN = 15,
+    XML_SCHEMAS_TOKEN = 16,
+    XML_SCHEMAS_LANGUAGE = 17,
+    XML_SCHEMAS_NMTOKEN = 18,
+    XML_SCHEMAS_NMTOKENS = 19,
+    XML_SCHEMAS_NAME = 20,
+    XML_SCHEMAS_QNAME = 21,
+    XML_SCHEMAS_NCNAME = 22,
+    XML_SCHEMAS_ID = 23,
+    XML_SCHEMAS_IDREF = 24,
+    XML_SCHEMAS_IDREFS = 25,
+    XML_SCHEMAS_ENTITY = 26,
+    XML_SCHEMAS_ENTITIES = 27,
+    XML_SCHEMAS_NOTATION = 28,
+    XML_SCHEMAS_ANYURI = 29,
+    XML_SCHEMAS_INTEGER = 30,
+    XML_SCHEMAS_NPINTEGER = 31,
+    XML_SCHEMAS_NINTEGER = 32,
+    XML_SCHEMAS_NNINTEGER = 33,
+    XML_SCHEMAS_PINTEGER = 34,
+    XML_SCHEMAS_INT = 35,
+    XML_SCHEMAS_UINT = 36,
+    XML_SCHEMAS_LONG = 37,
+    XML_SCHEMAS_ULONG = 38,
+    XML_SCHEMAS_SHORT = 39,
+    XML_SCHEMAS_USHORT = 40,
+    XML_SCHEMAS_BYTE = 41,
+    XML_SCHEMAS_UBYTE = 42,
+    XML_SCHEMAS_HEXBINARY = 43,
+    XML_SCHEMAS_BASE64BINARY = 44,
+    XML_SCHEMAS_ANYTYPE = 45,
+    XML_SCHEMAS_ANYSIMPLETYPE = 46
 } xmlSchemaValType;
 
 /*
diff --git a/third_party/libxml/src/include/libxml/xpathInternals.h b/third_party/libxml/src/include/libxml/xpathInternals.h
index 70c9db9..76a6b481 100644
--- a/third_party/libxml/src/include/libxml/xpathInternals.h
+++ b/third_party/libxml/src/include/libxml/xpathInternals.h
@@ -229,7 +229,7 @@
  * Empties a node-set.
  */
 #define xmlXPathEmptyNodeSet(ns)					\
-    { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; }
+    { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
 
 /**
  * CHECK_ERROR:
diff --git a/third_party/libxml/src/install-sh b/third_party/libxml/src/install-sh
index 0b0fdcbb..377bb868 100755
--- a/third_party/libxml/src/install-sh
+++ b/third_party/libxml/src/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,15 +41,19 @@
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
-tab='	'
 nl='
 '
-IFS=" $tab$nl"
+IFS=" ""	$nl"
 
-# Set DOITPROG to "echo" to test this script.
+# set DOITPROG to echo to test this script
 
+# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
-doit_exec=${doit:-exec}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
@@ -64,6 +68,17 @@
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
 posix_mkdir=
 
 # Desired mode of installed file.
@@ -82,7 +97,7 @@
 dst_arg=
 
 copy_on_change=false
-is_target_a_directory=possibly
+no_target_directory=
 
 usage="\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -122,57 +137,46 @@
     -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift;;
+	shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-        case $mode in
-          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
-            echo "$0: invalid mode: $mode" >&2
-            exit 1;;
-        esac
-        shift;;
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift;;
+	shift;;
 
     -s) stripcmd=$stripprog;;
 
-    -t)
-        is_target_a_directory=always
-        dst_arg=$2
-        # Protect names problematic for 'test' and other utilities.
-        case $dst_arg in
-          -* | [=\(\)!]) dst_arg=./$dst_arg;;
-        esac
-        shift;;
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
 
-    -T) is_target_a_directory=never;;
+    -T) no_target_directory=true;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --) shift
-        break;;
+    --)	shift
+	break;;
 
-    -*) echo "$0: invalid option: $1" >&2
-        exit 1;;
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
 
     *)  break;;
   esac
   shift
 done
 
-# We allow the use of options -d and -T together, by making -d
-# take the precedence; this is for compatibility with GNU install.
-
-if test -n "$dir_arg"; then
-  if test -n "$dst_arg"; then
-    echo "$0: target directory not allowed when installing a directory." >&2
-    exit 1
-  fi
-fi
-
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
@@ -204,15 +208,6 @@
 fi
 
 if test -z "$dir_arg"; then
-  if test $# -gt 1 || test "$is_target_a_directory" = always; then
-    if test ! -d "$dst_arg"; then
-      echo "$0: $dst_arg: Is not a directory." >&2
-      exit 1
-    fi
-  fi
-fi
-
-if test -z "$dir_arg"; then
   do_exit='(exit $ret); exit $ret'
   trap "ret=129; $do_exit" 1
   trap "ret=130; $do_exit" 2
@@ -228,16 +223,16 @@
 
     *[0-7])
       if test -z "$stripcmd"; then
-        u_plus_rw=
+	u_plus_rw=
       else
-        u_plus_rw='% 200'
+	u_plus_rw='% 200'
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
       if test -z "$stripcmd"; then
-        u_plus_rw=
+	u_plus_rw=
       else
-        u_plus_rw=,u+rw
+	u_plus_rw=,u+rw
       fi
       cp_umask=$mode$u_plus_rw;;
   esac
@@ -274,15 +269,41 @@
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test "$is_target_a_directory" = never; then
-        echo "$0: $dst_arg: Is a directory" >&2
-        exit 1
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
       fi
       dstdir=$dst
       dst=$dstdir/`basename "$src"`
       dstdir_status=0
     else
-      dstdir=`dirname "$dst"`
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
       test -d "$dstdir"
       dstdir_status=$?
     fi
@@ -293,74 +314,74 @@
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-        # Create intermediate dirs using mode 755 as modified by the umask.
-        # This is like FreeBSD 'install' as of 1997-10-28.
-        umask=`umask`
-        case $stripcmd.$umask in
-          # Optimize common cases.
-          *[2367][2367]) mkdir_umask=$umask;;
-          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
 
-          *[0-7])
-            mkdir_umask=`expr $umask + 22 \
-              - $umask % 100 % 40 + $umask % 20 \
-              - $umask % 10 % 4 + $umask % 2
-            `;;
-          *) mkdir_umask=$umask,go-w;;
-        esac
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
 
-        # With -d, create the new directory with the user-specified mode.
-        # Otherwise, rely on $mkdir_umask.
-        if test -n "$dir_arg"; then
-          mkdir_mode=-m$mode
-        else
-          mkdir_mode=
-        fi
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
 
-        posix_mkdir=false
-        case $umask in
-          *[123567][0-7][0-7])
-            # POSIX mkdir -p sets u+wx bits regardless of umask, which
-            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-            ;;
-          *)
-            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
 
-            if (umask $mkdir_umask &&
-                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-            then
-              if test -z "$dir_arg" || {
-                   # Check for POSIX incompatibilities with -m.
-                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                   # other-writable bit of parent directory when it shouldn't.
-                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-                   case $ls_ld_tmpdir in
-                     d????-?r-*) different_mode=700;;
-                     d????-?--*) different_mode=755;;
-                     *) false;;
-                   esac &&
-                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-                   }
-                 }
-              then posix_mkdir=:
-              fi
-              rmdir "$tmpdir/d" "$tmpdir"
-            else
-              # Remove any dirs left behind by ancient mkdir implementations.
-              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-            fi
-            trap '' 0;;
-        esac;;
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
     esac
 
     if
       $posix_mkdir && (
-        umask $mkdir_umask &&
-        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
     then :
     else
@@ -370,51 +391,53 @@
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-        /*) prefix='/';;
-        [-=\(\)!]*) prefix='./';;
-        *)  prefix='';;
+	/*) prefix='/';;
+	[-=\(\)!]*) prefix='./';;
+	*)  prefix='';;
       esac
 
+      eval "$initialize_posix_glob"
+
       oIFS=$IFS
       IFS=/
-      set -f
+      $posix_glob set -f
       set fnord $dstdir
       shift
-      set +f
+      $posix_glob set +f
       IFS=$oIFS
 
       prefixes=
 
       for d
       do
-        test X"$d" = X && continue
+	test X"$d" = X && continue
 
-        prefix=$prefix$d
-        if test -d "$prefix"; then
-          prefixes=
-        else
-          if $posix_mkdir; then
-            (umask=$mkdir_umask &&
-             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-            # Don't fail if two instances are running concurrently.
-            test -d "$prefix" || exit 1
-          else
-            case $prefix in
-              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-              *) qprefix=$prefix;;
-            esac
-            prefixes="$prefixes '$qprefix'"
-          fi
-        fi
-        prefix=$prefix/
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
       done
 
       if test -n "$prefixes"; then
-        # Don't fail if two instances are running concurrently.
-        (umask $mkdir_umask &&
-         eval "\$doit_exec \$mkdirprog $prefixes") ||
-          test -d "$dstdir" || exit 1
-        obsolete_mkdir_used=true
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
       fi
     fi
   fi
@@ -449,12 +472,15 @@
 
     # If -C, don't bother to copy if it wouldn't change the file.
     if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
-       set -f &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
-       set +f &&
+       $posix_glob set +f &&
+
        test "$old" = "$new" &&
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     then
@@ -467,24 +493,24 @@
       # to itself, or perhaps because mv is so ancient that it does not
       # support -f.
       {
-        # Now remove or move aside any old file at destination location.
-        # We try this two ways since rm can't unlink itself on some
-        # systems and the destination file might be busy for other
-        # reasons.  In this case, the final cleanup might fail but the new
-        # file should still install successfully.
-        {
-          test ! -f "$dst" ||
-          $doit $rmcmd -f "$dst" 2>/dev/null ||
-          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-          } ||
-          { echo "$0: cannot unlink or rename $dst" >&2
-            (exit 1); exit 1
-          }
-        } &&
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
 
-        # Now rename the file to the real destination.
-        $doit $mvcmd "$dsttmp" "$dst"
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
       }
     fi || exit 1
 
diff --git a/third_party/libxml/src/libxml.spec.in b/third_party/libxml/src/libxml.spec.in
index 9029a180..6fe3c69a 100644
--- a/third_party/libxml/src/libxml.spec.in
+++ b/third_party/libxml/src/libxml.spec.in
@@ -3,10 +3,10 @@
 Summary: Library providing XML and HTML support
 Name: libxml2
 Version: @VERSION@
-Release: 1%{?dist}%{?extra_release}
+Release: 0rc2%{?dist}%{?extra_release}
 License: MIT
 Group: Development/Libraries
-Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
+Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}-rc2.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: python-devel
 %if 0%{?with_python3}
diff --git a/third_party/libxml/src/libxml2.spec b/third_party/libxml/src/libxml2.spec
deleted file mode 100644
index ccebbf4..0000000
--- a/third_party/libxml/src/libxml2.spec
+++ /dev/null
@@ -1,199 +0,0 @@
-%global with_python3 1
-
-Summary: Library providing XML and HTML support
-Name: libxml2
-Version: 2.9.3
-Release: 1%{?dist}%{?extra_release}
-License: MIT
-Group: Development/Libraries
-Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildRequires: python-devel
-%if 0%{?with_python3}
-BuildRequires: python3-devel
-%endif # with_python3
-BuildRequires: zlib-devel
-BuildRequires: pkgconfig
-BuildRequires: xz-devel
-URL: http://xmlsoft.org/
-
-%description
-This library allows to manipulate XML files. It includes support
-to read, modify and write XML and HTML files. There is DTDs support
-this includes parsing and validation even with complex DtDs, either
-at parse time or later once the document has been modified. The output
-can be a simple SAX stream or and in-memory DOM like representations.
-In this case one can use the built-in XPath and XPointer implementation
-to select sub nodes or ranges. A flexible Input/Output mechanism is
-available, with existing HTTP and FTP modules and combined to an
-URI library.
-
-%package devel
-Summary: Libraries, includes, etc. to develop XML and HTML applications
-Group: Development/Libraries
-Requires: libxml2 = %{version}-%{release}
-Requires: zlib-devel
-Requires: xz-devel
-Requires: pkgconfig
-
-%description devel
-Libraries, include files, etc you can use to develop XML applications.
-This library allows to manipulate XML files. It includes support
-to read, modify and write XML and HTML files. There is DTDs support
-this includes parsing and validation even with complex DtDs, either
-at parse time or later once the document has been modified. The output
-can be a simple SAX stream or and in-memory DOM like representations.
-In this case one can use the built-in XPath and XPointer implementation
-to select sub nodes or ranges. A flexible Input/Output mechanism is
-available, with existing HTTP and FTP modules and combined to an
-URI library.
-
-%package static
-Summary: Static library for libxml2
-Group: Development/Libraries
-Requires: libxml2 = %{version}-%{release}
-
-%description static
-Static library for libxml2 provided for specific uses or shaving a few
-microseconds when parsing, do not link to them for generic purpose packages.
-
-%package python
-Summary: Python bindings for the libxml2 library
-Group: Development/Libraries
-Requires: libxml2 = %{version}-%{release}
-
-%description python
-The libxml2-python package contains a Python 2 module that permits applications
-written in the Python programming language, version 2, to use the interface
-supplied by the libxml2 library to manipulate XML files.
-
-This library allows to manipulate XML files. It includes support
-to read, modify and write XML and HTML files. There is DTDs support
-this includes parsing and validation even with complex DTDs, either
-at parse time or later once the document has been modified.
-
-%if 0%{?with_python3}
-%package python3
-Summary: Python 3 bindings for the libxml2 library
-Group: Development/Libraries
-Requires: libxml2 = %{version}-%{release}
-
-%description python3
-The libxml2-python3 package contains a Python 3 module that permits
-applications written in the Python programming language, version 3, to use the
-interface supplied by the libxml2 library to manipulate XML files.
-
-This library allows to manipulate XML files. It includes support
-to read, modify and write XML and HTML files. There is DTDs support
-this includes parsing and validation even with complex DTDs, either
-at parse time or later once the document has been modified.
-%endif # with_python3
-
-%prep
-%setup -q
-
-%build
-%configure
-make %{_smp_mflags}
-
-%install
-rm -fr %{buildroot}
-
-make install DESTDIR=%{buildroot}
-
-%if 0%{?with_python3}
-make clean
-%configure --with-python=%{__python3}
-make install DESTDIR=%{buildroot}
-%endif # with_python3
-
-
-rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
-rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
-rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
-rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
-(cd doc/examples ; make clean ; rm -rf .deps Makefile)
-gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
-
-%check
-make runtests
-
-%clean
-rm -fr %{buildroot}
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%files
-%defattr(-, root, root)
-
-%doc AUTHORS NEWS README Copyright TODO
-%doc %{_mandir}/man1/xmllint.1*
-%doc %{_mandir}/man1/xmlcatalog.1*
-%doc %{_mandir}/man3/libxml.3*
-
-%{_libdir}/lib*.so.*
-%{_bindir}/xmllint
-%{_bindir}/xmlcatalog
-
-%files devel
-%defattr(-, root, root)
-
-%doc %{_mandir}/man1/xml2-config.1*
-%doc AUTHORS NEWS README Copyright
-%doc doc/*.html doc/html doc/*.gif doc/*.png
-%doc doc/tutorial doc/libxml2-api.xml.gz
-%doc doc/examples
-%doc %dir %{_datadir}/gtk-doc/html/libxml2
-%doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp
-%doc %{_datadir}/gtk-doc/html/libxml2/*.html
-%doc %{_datadir}/gtk-doc/html/libxml2/*.png
-%doc %{_datadir}/gtk-doc/html/libxml2/*.css
-
-%{_libdir}/lib*.so
-%{_libdir}/*.sh
-%{_includedir}/*
-%{_bindir}/xml2-config
-%{_datadir}/aclocal/libxml.m4
-%{_libdir}/pkgconfig/libxml-2.0.pc
-%{_libdir}/cmake/libxml2/libxml2-config.cmake
-
-%files static
-%defattr(-, root, root)
-
-%{_libdir}/*a
-
-%files python
-%defattr(-, root, root)
-
-%{_libdir}/python2*/site-packages/libxml2.py*
-%{_libdir}/python2*/site-packages/drv_libxml2.py*
-%{_libdir}/python2*/site-packages/libxml2mod*
-%doc python/TODO
-%doc python/libxml2class.txt
-%doc python/tests/*.py
-%doc doc/*.py
-%doc doc/python.html
-
-%if 0%{?with_python3}
-%files python3
-%defattr(-, root, root)
-
-%{_libdir}/python3*/site-packages/libxml2.py*
-%{_libdir}/python3*/site-packages/drv_libxml2.py*
-%{_libdir}/python3*/site-packages/__pycache__/libxml2.cpython-34.py*
-%{_libdir}/python3*/site-packages/__pycache__/drv_libxml2.cpython-34.py*
-%{_libdir}/python3*/site-packages/libxml2mod*
-%doc python/TODO
-%doc python/libxml2class.txt
-%doc python/tests/*.py
-%doc doc/*.py
-%doc doc/python.html
-%endif # with_python3
-
-%changelog
-* Fri Nov 20 2015 Daniel Veillard <veillard@redhat.com>
-- upstream release 2.9.3 see http://xmlsoft.org/news.html
-
diff --git a/third_party/libxml/src/ltmain.sh b/third_party/libxml/src/ltmain.sh
index 0f0a2da..a356aca 100644
--- a/third_party/libxml/src/ltmain.sh
+++ b/third_party/libxml/src/ltmain.sh
@@ -1,12 +1,9 @@
-#! /bin/sh
-## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-##               by inline-source v2014-01-03.01
 
-# libtool (GNU libtool) 2.4.6
-# Provide generalized library-building support services.
+# libtool (GNU libtool) 2.4.2
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -26,670 +23,166 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --no-warn            don't display warning messages
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:	$host
+#         shell:		$SHELL
+#         compiler:		$LTCC
+#         compiler flags:		$LTCFLAGS
+#         linker:		$LD (gnu? $with_gnu_ld)
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
+#         automake:	$automake_version
+#         autoconf:	$autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.6
-package_revision=2.4.6
+VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
+TIMESTAMP=""
+package_revision=1.3337
 
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Run './libtool --help' for help with using this script from the
-# command line.
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# After configure completes, it has a better idea of some of the
-# shell tools we need than the defaults used by the functions shared
-# with bootstrap, so set those here where they can still be over-
-# ridden by the user, but otherwise take precedence.
-
-: ${AUTOCONF="autoconf"}
-: ${AUTOMAKE="automake"}
-
-
-## -------------------------- ##
-## Source external libraries. ##
-## -------------------------- ##
-
-# Much of our low-level functionality needs to be sourced from external
-# libraries, which are installed to $pkgauxdir.
-
-# Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
-
-# General shell script boiler plate, and helper functions.
-# Written by Gary V. Vaughan, 2004
-
-# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary@gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Evaluate this file near the top of your script to gain access to
-# the functions and variables defined here:
-#
-#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
-#
-# If you need to override any of the default environment variable
-# settings, do that before evaluating this file.
-
-
-## -------------------- ##
-## Shell normalisation. ##
-## -------------------- ##
-
-# Some shells need a little help to be as Bourne compatible as possible.
-# Before doing anything else, make sure all that help has been provided!
-
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
 
-# NLS nuisances: We save the old values in case they are required later.
-_G_user_locale=
-_G_safe_locale=
-for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test set = \"\${$_G_var+set}\"; then
-          save_$_G_var=\$$_G_var
-          $_G_var=C
-	  export $_G_var
-	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
-	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 	fi"
 done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
 
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+$lt_unset CDPATH
 
-# Make sure IFS has a sensible default
-sp=' '
-nl='
-'
-IFS="$sp	$nl"
-
-# There are apparently some retarded systems that use ';' as a PATH separator!
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-
-## ------------------------- ##
-## Locate command utilities. ##
-## ------------------------- ##
-
-
-# func_executable_p FILE
-# ----------------------
-# Check that FILE is an executable regular file.
-func_executable_p ()
-{
-    test -f "$1" && test -x "$1"
-}
-
-
-# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
-# --------------------------------------------
-# Search for either a program that responds to --version with output
-# containing "GNU", or else returned by CHECK_FUNC otherwise, by
-# trying all the directories in PATH with each of the elements of
-# PROGS_LIST.
-#
-# CHECK_FUNC should accept the path to a candidate program, and
-# set $func_check_prog_result if it truncates its output less than
-# $_G_path_prog_max characters.
-func_path_progs ()
-{
-    _G_progs_list=$1
-    _G_check_func=$2
-    _G_PATH=${3-"$PATH"}
-
-    _G_path_prog_max=0
-    _G_path_prog_found=false
-    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
-    for _G_dir in $_G_PATH; do
-      IFS=$_G_save_IFS
-      test -z "$_G_dir" && _G_dir=.
-      for _G_prog_name in $_G_progs_list; do
-        for _exeext in '' .EXE; do
-          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
-          func_executable_p "$_G_path_prog" || continue
-          case `"$_G_path_prog" --version 2>&1` in
-            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
-            *)     $_G_check_func $_G_path_prog
-		   func_path_progs_result=$func_check_prog_result
-		   ;;
-          esac
-          $_G_path_prog_found && break 3
-        done
-      done
-    done
-    IFS=$_G_save_IFS
-    test -z "$func_path_progs_result" && {
-      echo "no acceptable sed could be found in \$PATH" >&2
-      exit 1
-    }
-}
-
-
-# We want to be able to use the functions in this file before configure
-# has figured out where the best binaries are kept, which means we have
-# to search for them ourselves - except when the results are already set
-# where we skip the searches.
-
-# Unless the user overrides by setting SED, search the path for either GNU
-# sed, or the sed that truncates its output the least.
-test -z "$SED" && {
-  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-  for _G_i in 1 2 3 4 5 6 7; do
-    _G_sed_script=$_G_sed_script$nl$_G_sed_script
-  done
-  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
-  _G_sed_script=
-
-  func_check_prog_sed ()
-  {
-    _G_path_prog=$1
-
-    _G_count=0
-    printf 0123456789 >conftest.in
-    while :
-    do
-      cat conftest.in conftest.in >conftest.tmp
-      mv conftest.tmp conftest.in
-      cp conftest.in conftest.nl
-      echo '' >> conftest.nl
-      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
-      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-      _G_count=`expr $_G_count + 1`
-      if test "$_G_count" -gt "$_G_path_prog_max"; then
-        # Best one so far, save it but keep looking for a better one
-        func_check_prog_result=$_G_path_prog
-        _G_path_prog_max=$_G_count
-      fi
-      # 10*(2^10) chars as input seems more than enough
-      test 10 -lt "$_G_count" && break
-    done
-    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-  }
-
-  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
-  rm -f conftest.sed
-  SED=$func_path_progs_result
-}
-
-
-# Unless the user overrides by setting GREP, search the path for either GNU
-# grep, or the grep that truncates its output the least.
-test -z "$GREP" && {
-  func_check_prog_grep ()
-  {
-    _G_path_prog=$1
-
-    _G_count=0
-    _G_path_prog_max=0
-    printf 0123456789 >conftest.in
-    while :
-    do
-      cat conftest.in conftest.in >conftest.tmp
-      mv conftest.tmp conftest.in
-      cp conftest.in conftest.nl
-      echo 'GREP' >> conftest.nl
-      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
-      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-      _G_count=`expr $_G_count + 1`
-      if test "$_G_count" -gt "$_G_path_prog_max"; then
-        # Best one so far, save it but keep looking for a better one
-        func_check_prog_result=$_G_path_prog
-        _G_path_prog_max=$_G_count
-      fi
-      # 10*(2^10) chars as input seems more than enough
-      test 10 -lt "$_G_count" && break
-    done
-    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-  }
-
-  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
-  GREP=$func_path_progs_result
-}
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# All uppercase variable names are used for environment variables.  These
-# variables can be overridden by the user before calling a script that
-# uses them if a suitable command of that name is not already available
-# in the command search PATH.
-
-: ${CP="cp -f"}
-: ${ECHO="printf %s\n"}
-: ${EGREP="$GREP -E"}
-: ${FGREP="$GREP -F"}
-: ${LN_S="ln -s"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-
-
-## -------------------- ##
-## Useful sed snippets. ##
-## -------------------- ##
-
-sed_dirname='s|/[^/]*$||'
-sed_basename='s|^.*/||'
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-
-# Same as above, but do not quote variable references.
-sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-
-# Sed substitution that converts a w32 file name or path
-# that contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-'\' parameter expansions in output of sed_double_quote_subst that
-# were '\'-ed in input to the same.  If an odd number of '\' preceded a
-# '$' in input to sed_double_quote_subst, that '$' was protected from
-# expansion.  Since each input '\' is now two '\'s, look for any number
-# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
-_G_bs='\\'
-_G_bs2='\\\\'
-_G_bs4='\\\\\\\\'
-_G_dollar='\$'
-sed_double_backslash="\
-  s/$_G_bs4/&\\
-/g
-  s/^$_G_bs2$_G_dollar/$_G_bs&/
-  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
-  s/\n//g"
-
-
-## ----------------- ##
-## Global variables. ##
-## ----------------- ##
-
-# Except for the global variables explicitly listed below, the following
-# functions in the '^func_' namespace, and the '^require_' namespace
-# variables initialised in the 'Resource management' section, sourcing
-# this file will not pollute your global namespace with anything
-# else. There's no portable way to scope variables in Bourne shell
-# though, so actually running these functions will sometimes place
-# results into a variable named after the function, and often use
-# temporary variables in the '^_G_' namespace. If you are careful to
-# avoid using those namespaces casually in your sourcing script, things
-# should continue to work as you expect. And, of course, you can freely
-# overwrite any of the functions or variables defined here before
-# calling anything to customize them.
-
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-# Allow overriding, eg assuming that you follow the convention of
-# putting '$debug_cmd' at the start of all your functions, you can get
-# bash to show function call trace with:
-#
-#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
-debug_cmd=${debug_cmd-":"}
-exit_cmd=:
-
-# By convention, finish your script with:
-#
-#    exit $exit_status
-#
-# so that you can set exit_status to non-zero if you want to indicate
-# something went wrong during execution without actually bailing out at
-# the point of failure.
-exit_status=$EXIT_SUCCESS
 
 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 # is ksh but when the shell is invoked as "sh" and the current value of
 # the _XPG environment variable is not equal to 1 (one), the special
 # positional parameter $0, within a function call, is the name of the
 # function.
-progpath=$0
-
-# The name of this program.
-progname=`$ECHO "$progpath" |$SED "$sed_basename"`
-
-# Make sure we have an absolute progpath for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
-     progdir=`cd "$progdir" && pwd`
-     progpath=$progdir/$progname
-     ;;
-  *)
-     _G_IFS=$IFS
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS=$_G_IFS
-       test -x "$progdir/$progname" && break
-     done
-     IFS=$_G_IFS
-     test -n "$progdir" || progdir=`pwd`
-     progpath=$progdir/$progname
-     ;;
-esac
+progpath="$0"
 
 
-## ----------------- ##
-## Standard options. ##
-## ----------------- ##
 
-# The following options affect the operation of the functions defined
-# below, and should be set appropriately depending on run-time para-
-# meters passed on the command line.
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
 
-opt_dry_run=false
-opt_quiet=false
-opt_verbose=false
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-# Categories 'all' and 'none' are always available.  Append any others
-# you will pass as the first argument to func_warning from your own
-# code.
-warning_categories=
+exit_status=$EXIT_SUCCESS
 
-# By default, display warnings according to 'opt_warning_types'.  Set
-# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
-# treat the next displayed warning as a fatal error.
-warning_func=func_warn_and_continue
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
 
-# Set to 'all' to display all warnings, 'none' to suppress all
-# warnings, or a space delimited list of some subset of
-# 'warning_categories' to display only the listed warnings.
-opt_warning_types=all
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
 
-
-## -------------------- ##
-## Resource management. ##
-## -------------------- ##
-
-# This section contains definitions for functions that each ensure a
-# particular resource (a file, or a non-empty configuration variable for
-# example) is available, and if appropriate to extract default values
-# from pertinent package files. Call them using their associated
-# 'require_*' variable to ensure that they are executed, at most, once.
-#
-# It's entirely deliberate that calling these functions can set
-# variables that don't obey the namespace limitations obeyed by the rest
-# of this file, in order that that they be as useful as possible to
-# callers.
-
-
-# require_term_colors
-# -------------------
-# Allow display of bold text on terminals that support it.
-require_term_colors=func_require_term_colors
-func_require_term_colors ()
-{
-    $debug_cmd
-
-    test -t 1 && {
-      # COLORTERM and USE_ANSI_COLORS environment variables take
-      # precedence, because most terminfo databases neglect to describe
-      # whether color sequences are supported.
-      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
-
-      if test 1 = "$USE_ANSI_COLORS"; then
-        # Standard ANSI escape sequences
-        tc_reset=''
-        tc_bold='';   tc_standout=''
-        tc_red='';   tc_green=''
-        tc_blue='';  tc_cyan=''
-      else
-        # Otherwise trust the terminfo database after all.
-        test -n "`tput sgr0 2>/dev/null`" && {
-          tc_reset=`tput sgr0`
-          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
-          tc_standout=$tc_bold
-          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
-          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
-          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
-          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
-          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
-        }
-      fi
-    }
-
-    require_term_colors=:
-}
-
-
-## ----------------- ##
-## Function library. ##
-## ----------------- ##
-
-# This section contains a variety of useful functions to call in your
-# scripts. Take note of the portable wrappers for features provided by
-# some modern shells, which will fall back to slower equivalents on
-# less featureful shells.
-
-
-# func_append VAR VALUE
-# ---------------------
-# Append VALUE onto the existing contents of VAR.
-
-  # We should try to minimise forks, especially on Windows where they are
-  # unreasonably slow, so skip the feature probes when bash or zsh are
-  # being used:
-  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
-    : ${_G_HAVE_ARITH_OP="yes"}
-    : ${_G_HAVE_XSI_OPS="yes"}
-    # The += operator was introduced in bash 3.1
-    case $BASH_VERSION in
-      [12].* | 3.0 | 3.0*) ;;
-      *)
-        : ${_G_HAVE_PLUSEQ_OP="yes"}
-        ;;
-    esac
-  fi
-
-  # _G_HAVE_PLUSEQ_OP
-  # Can be empty, in which case the shell is probed, "yes" if += is
-  # useable or anything else if it does not work.
-  test -z "$_G_HAVE_PLUSEQ_OP" \
-    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
-    && _G_HAVE_PLUSEQ_OP=yes
-
-if test yes = "$_G_HAVE_PLUSEQ_OP"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_append ()
-  {
-    $debug_cmd
-
-    eval "$1+=\$2"
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_append ()
-  {
-    $debug_cmd
-
-    eval "$1=\$$1\$2"
-  }
-fi
-
-
-# func_append_quoted VAR VALUE
-# ----------------------------
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-if test yes = "$_G_HAVE_PLUSEQ_OP"; then
-  eval 'func_append_quoted ()
-  {
-    $debug_cmd
-
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
-  }'
-else
-  func_append_quoted ()
-  {
-    $debug_cmd
-
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
-  }
-fi
-
-
-# func_append_uniq VAR VALUE
-# --------------------------
-# Append unique VALUE onto the existing contents of VAR, assuming
-# entries are delimited by the first character of VALUE.  For example:
-#
-#   func_append_uniq options " --another-option option-argument"
-#
-# will only append to $options if " --another-option option-argument "
-# is not already present somewhere in $options already (note spaces at
-# each end implied by leading space in second argument).
-func_append_uniq ()
-{
-    $debug_cmd
-
-    eval _G_current_value='`$ECHO $'$1'`'
-    _G_delim=`expr "$2" : '\(.\)'`
-
-    case $_G_delim$_G_current_value$_G_delim in
-      *"$2$_G_delim"*) ;;
-      *) func_append "$@" ;;
-    esac
-}
-
-
-# func_arith TERM...
-# ------------------
-# Set func_arith_result to the result of evaluating TERMs.
-  test -z "$_G_HAVE_ARITH_OP" \
-    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
-    && _G_HAVE_ARITH_OP=yes
-
-if test yes = "$_G_HAVE_ARITH_OP"; then
-  eval 'func_arith ()
-  {
-    $debug_cmd
-
-    func_arith_result=$(( $* ))
-  }'
-else
-  func_arith ()
-  {
-    $debug_cmd
-
-    func_arith_result=`expr "$@"`
-  }
-fi
-
-
-# func_basename FILE
-# ------------------
-# Set func_basename_result to FILE with everything up to and including
-# the last / stripped.
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  # If this shell supports suffix pattern removal, then use it to avoid
-  # forking. Hide the definitions single quotes in case the shell chokes
-  # on unsupported syntax...
-  _b='func_basename_result=${1##*/}'
-  _d='case $1 in
-        */*) func_dirname_result=${1%/*}$2 ;;
-        *  ) func_dirname_result=$3        ;;
-      esac'
-
-else
-  # ...otherwise fall back to using sed.
-  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
-  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
-      if test "X$func_dirname_result" = "X$1"; then
-        func_dirname_result=$3
-      else
-        func_append func_dirname_result "$2"
-      fi'
-fi
-
-eval 'func_basename ()
-{
-    $debug_cmd
-
-    '"$_b"'
-}'
-
-
-# func_dirname FILE APPEND NONDIR_REPLACEMENT
-# -------------------------------------------
+# func_dirname file append nondir_replacement
 # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 # otherwise set result to NONDIR_REPLACEMENT.
-eval 'func_dirname ()
+func_dirname ()
 {
-    $debug_cmd
-
-    '"$_d"'
-}'
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
 
 
-# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
-# --------------------------------------------------------
-# Perform func_basename and func_dirname in a single function
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
 # call:
 #   dirname:  Compute the dirname of FILE.  If nonempty,
 #             add APPEND to the result, otherwise set result
@@ -697,327 +190,263 @@
 #             value returned in "$func_dirname_result"
 #   basename: Compute filename of FILE.
 #             value retuned in "$func_basename_result"
-# For efficiency, we do not delegate to the functions above but instead
-# duplicate the functionality here.
-eval 'func_dirname_and_basename ()
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
 {
-    $debug_cmd
-
-    '"$_b"'
-    '"$_d"'
-}'
-
-
-# func_echo ARG...
-# ----------------
-# Echo program name prefixed message.
-func_echo ()
-{
-    $debug_cmd
-
-    _G_message=$*
-
-    func_echo_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_IFS
-      $ECHO "$progname: $_G_line"
-    done
-    IFS=$func_echo_IFS
-}
-
-
-# func_echo_all ARG...
-# --------------------
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
-
-
-# func_echo_infix_1 INFIX ARG...
-# ------------------------------
-# Echo program name, followed by INFIX on the first line, with any
-# additional lines not showing INFIX.
-func_echo_infix_1 ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    _G_infix=$1; shift
-    _G_indent=$_G_infix
-    _G_prefix="$progname: $_G_infix: "
-    _G_message=$*
-
-    # Strip color escape sequences before counting printable length
-    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
-    do
-      test -n "$_G_tc" && {
-        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
-        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
-      }
-    done
-    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
-
-    func_echo_infix_1_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_infix_1_IFS
-      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
-      _G_prefix=$_G_indent
-    done
-    IFS=$func_echo_infix_1_IFS
-}
-
-
-# func_error ARG...
-# -----------------
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
-}
-
-
-# func_fatal_error ARG...
-# -----------------------
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    $debug_cmd
-
-    func_error "$*"
-    exit $EXIT_FAILURE
-}
-
-
-# func_grep EXPRESSION FILENAME
-# -----------------------------
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $debug_cmd
-
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_len STRING
-# ---------------
-# Set func_len_result to the length of STRING. STRING may not
-# start with a hyphen.
-  test -z "$_G_HAVE_XSI_OPS" \
-    && (eval 'x=a/b/c;
-      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-    && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_len ()
-  {
-    $debug_cmd
-
-    func_len_result=${#1}
-  }'
-else
-  func_len ()
-  {
-    $debug_cmd
-
-    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-  }
-fi
-
-
-# func_mkdir_p DIRECTORY-PATH
-# ---------------------------
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    $debug_cmd
-
-    _G_directory_path=$1
-    _G_dir_list=
-
-    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
-
-      # Protect directory names starting with '-'
-      case $_G_directory_path in
-        -*) _G_directory_path=./$_G_directory_path ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$_G_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        _G_dir_list=$_G_directory_path:$_G_dir_list
-
-        # If the last portion added has no slash in it, the list is done
-        case $_G_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
-      done
-      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
-
-      func_mkdir_p_IFS=$IFS; IFS=:
-      for _G_dir in $_G_dir_list; do
-	IFS=$func_mkdir_p_IFS
-        # mkdir can fail with a 'File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$_G_dir" 2>/dev/null || :
-      done
-      IFS=$func_mkdir_p_IFS
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$_G_directory_path" || \
-        func_fatal_error "Failed to create '$1'"
-    fi
-}
-
-
-# func_mktempdir [BASENAME]
-# -------------------------
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, BASENAME is the basename for that directory.
-func_mktempdir ()
-{
-    $debug_cmd
-
-    _G_template=${TMPDIR-/tmp}/${1-$progname}
-
-    if test : = "$opt_dry_run"; then
-      # Return a directory name, but don't create it in dry-run mode
-      _G_tmpdir=$_G_template-$$
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
     else
-
-      # If mktemp works, use that first and foremost
-      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$_G_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        _G_tmpdir=$_G_template-${RANDOM-0}$$
-
-        func_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$_G_tmpdir"
-        umask $func_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$_G_tmpdir" || \
-        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+      func_dirname_result="$func_dirname_result${2}"
     fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
 
-    $ECHO "$_G_tmpdir"
-}
 
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+		s@/\./@/@g
+		t dotsl
+		s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
 
 # func_normal_abspath PATH
-# ------------------------
 # Remove doubled-up and trailing slashes, "." path components,
 # and cancel out any ".." path components in PATH after making
 # it an absolute path.
+#             value returned in "$func_normal_abspath_result"
 func_normal_abspath ()
 {
-    $debug_cmd
-
-    # These SED scripts presuppose an absolute path with a trailing slash.
-    _G_pathcar='s|^/\([^/]*\).*$|\1|'
-    _G_pathcdr='s|^/[^/]*||'
-    _G_removedotparts=':dotsl
-		s|/\./|/|g
-		t dotsl
-		s|/\.$|/|'
-    _G_collapseslashes='s|/\{1,\}|/|g'
-    _G_finalslash='s|/*$|/|'
-
-    # Start from root dir and reassemble the path.
-    func_normal_abspath_result=
-    func_normal_abspath_tpath=$1
-    func_normal_abspath_altnamespace=
-    case $func_normal_abspath_tpath in
-      "")
-        # Empty path, that just means $cwd.
-        func_stripname '' '/' "`pwd`"
-        func_normal_abspath_result=$func_stripname_result
-        return
-        ;;
-      # The next three entries are used to spot a run of precisely
-      # two leading slashes without using negated character classes;
-      # we take advantage of case's first-match behaviour.
-      ///*)
-        # Unusual form of absolute path, do nothing.
-        ;;
-      //*)
-        # Not necessarily an ordinary path; POSIX reserves leading '//'
-        # and for example Cygwin uses it to access remote file shares
-        # over CIFS/SMB, so we conserve a leading double slash if found.
-        func_normal_abspath_altnamespace=/
-        ;;
-      /*)
-        # Absolute path, do nothing.
-        ;;
-      *)
-        # Relative path, prepend $cwd.
-        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-        ;;
-    esac
-
-    # Cancel out all the simple stuff to save iterations.  We also want
-    # the path to end with a slash for ease of parsing, so make sure
-    # there is one (and only one) here.
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
-    while :; do
-      # Processed it all yet?
-      if test / = "$func_normal_abspath_tpath"; then
-        # If we ascended to the root using ".." the result may be empty now.
-        if test -z "$func_normal_abspath_result"; then
-          func_normal_abspath_result=/
-        fi
-        break
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
       fi
-      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_pathcar"`
-      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-          -e "$_G_pathcdr"`
-      # Figure out what to do with it
-      case $func_normal_abspath_tcomponent in
-        "")
-          # Trailing empty path component, ignore it.
-          ;;
-        ..)
-          # Parent dir; strip last assembled component from result.
-          func_dirname "$func_normal_abspath_result"
-          func_normal_abspath_result=$func_dirname_result
-          ;;
-        *)
-          # Actual path component, append it.
-          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
-          ;;
-      esac
-    done
-    # Restore leading double-slash if one was found on entry.
-    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 }
 
-
-# func_notquiet ARG...
-# --------------------
-# Echo program name prefixed message only when not in quiet mode.
-func_notquiet ()
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
 {
-    $debug_cmd
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
 
-    $opt_quiet || func_echo ${1+"$@"}
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
 
     # A bug in bash halts the script if the last line of a function
     # fails when set -e is in force, so we need another command to
@@ -1025,1113 +454,450 @@
     :
 }
 
-
-# func_relative_path SRCDIR DSTDIR
-# --------------------------------
-# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
-func_relative_path ()
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
 {
-    $debug_cmd
+    $ECHO "$*"
+}
 
-    func_relative_path_result=
-    func_normal_abspath "$1"
-    func_relative_path_tlibdir=$func_normal_abspath_result
-    func_normal_abspath "$2"
-    func_relative_path_tbindir=$func_normal_abspath_result
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
 
-    # Ascend the tree starting from libdir
-    while :; do
-      # check if we have found a prefix of bindir
-      case $func_relative_path_tbindir in
-        $func_relative_path_tlibdir)
-          # found an exact match
-          func_relative_path_tcancelled=
-          break
-          ;;
-        $func_relative_path_tlibdir*)
-          # found a matching prefix
-          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-          func_relative_path_tcancelled=$func_stripname_result
-          if test -z "$func_relative_path_result"; then
-            func_relative_path_result=.
-          fi
-          break
-          ;;
-        *)
-          func_dirname $func_relative_path_tlibdir
-          func_relative_path_tlibdir=$func_dirname_result
-          if test -z "$func_relative_path_tlibdir"; then
-            # Have to descend all the way to the root!
-            func_relative_path_result=../$func_relative_path_result
-            func_relative_path_tcancelled=$func_relative_path_tbindir
-            break
-          fi
-          func_relative_path_result=../$func_relative_path_result
-          ;;
-      esac
-    done
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
 
-    # Now calculate path; take care to avoid doubling-up slashes.
-    func_stripname '' '/' "$func_relative_path_result"
-    func_relative_path_result=$func_stripname_result
-    func_stripname '/' '/' "$func_relative_path_tcancelled"
-    if test -n "$func_stripname_result"; then
-      func_append func_relative_path_result "/$func_stripname_result"
-    fi
-
-    # Normalisation. If bindir is libdir, return '.' else relative path.
-    if test -n "$func_relative_path_result"; then
-      func_stripname './' '' "$func_relative_path_result"
-      func_relative_path_result=$func_stripname_result
-    fi
-
-    test -n "$func_relative_path_result" || func_relative_path_result=.
-
+    # bash bug again:
     :
 }
 
-
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
 {
-    $debug_cmd
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
 
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
-      fi
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
 
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
-          ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-	  ;;
-      esac
 
-      if test -n "$func_quote_for_eval_result"; then
-	func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
-    done
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
 }
 
 
-# func_quote_for_expand ARG
-# -------------------------
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
 # Aesthetically quote ARG to be evaled later; same as above,
 # but do not quote variable references.
 func_quote_for_expand ()
 {
-    $debug_cmd
-
     case $1 in
       *[\\\`\"]*)
-	_G_arg=`$ECHO "$1" | $SED \
-	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+	my_arg=`$ECHO "$1" | $SED \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-        _G_arg=$1 ;;
+        my_arg="$1" ;;
     esac
 
-    case $_G_arg in
+    case $my_arg in
       # Double-quote args containing shell metacharacters to delay
       # word splitting and command substitution for a subsequent eval.
       # Many Bourne shells cannot handle close brackets correctly
       # in scan sets, so we specify it separately.
       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        _G_arg=\"$_G_arg\"
+        my_arg="\"$my_arg\""
         ;;
     esac
 
-    func_quote_for_expand_result=$_G_arg
+    func_quote_for_expand_result="$my_arg"
 }
 
 
-# func_stripname PREFIX SUFFIX NAME
-# ---------------------------------
-# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_stripname ()
-  {
-    $debug_cmd
-
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary variable first.
-    func_stripname_result=$3
-    func_stripname_result=${func_stripname_result#"$1"}
-    func_stripname_result=${func_stripname_result%"$2"}
-  }'
-else
-  func_stripname ()
-  {
-    $debug_cmd
-
-    case $2 in
-      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
-      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
-    esac
-  }
-fi
-
-
-# func_show_eval CMD [FAIL_EXP]
-# -----------------------------
-# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 # is given, then evaluate it.
 func_show_eval ()
 {
-    $debug_cmd
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    _G_cmd=$1
-    _G_fail_exp=${2-':'}
-
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
-
-    $opt_dry_run || {
-      eval "$_G_cmd"
-      _G_status=$?
-      if test 0 -ne "$_G_status"; then
-	eval "(exit $_G_status); $_G_fail_exp"
-      fi
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
     }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
 }
 
 
-# func_show_eval_locale CMD [FAIL_EXP]
-# ------------------------------------
-# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 # is given, then evaluate it.  Use the saved locale for evaluation.
 func_show_eval_locale ()
 {
-    $debug_cmd
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    _G_cmd=$1
-    _G_fail_exp=${2-':'}
-
-    $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
       eval "func_echo $func_quote_for_expand_result"
     }
 
-    $opt_dry_run || {
-      eval "$_G_user_locale
-	    $_G_cmd"
-      _G_status=$?
-      eval "$_G_safe_locale"
-      if test 0 -ne "$_G_status"; then
-	eval "(exit $_G_status); $_G_fail_exp"
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
       fi
-    }
+    fi
 }
 
-
 # func_tr_sh
-# ----------
 # Turn $1 into a string suitable for a shell variable name.
 # Result is stored in $func_tr_sh_result.  All characters
 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
 # if $1 begins with a digit, a '_' is prepended as well.
 func_tr_sh ()
 {
-    $debug_cmd
-
-    case $1 in
-    [0-9]* | *[!a-zA-Z0-9_]*)
-      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
-      ;;
-    * )
-      func_tr_sh_result=$1
-      ;;
-    esac
-}
-
-
-# func_verbose ARG...
-# -------------------
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $debug_cmd
-
-    $opt_verbose && func_echo "$*"
-
-    :
-}
-
-
-# func_warn_and_continue ARG...
-# -----------------------------
-# Echo program name prefixed warning message to standard error.
-func_warn_and_continue ()
-{
-    $debug_cmd
-
-    $require_term_colors
-
-    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
-}
-
-
-# func_warning CATEGORY ARG...
-# ----------------------------
-# Echo program name prefixed warning message to standard error. Warning
-# messages can be filtered according to CATEGORY, where this function
-# elides messages where CATEGORY is not listed in the global variable
-# 'opt_warning_types'.
-func_warning ()
-{
-    $debug_cmd
-
-    # CATEGORY must be in the warning_categories list!
-    case " $warning_categories " in
-      *" $1 "*) ;;
-      *) func_internal_error "invalid warning category '$1'" ;;
-    esac
-
-    _G_category=$1
-    shift
-
-    case " $opt_warning_types " in
-      *" $_G_category "*) $warning_func ${1+"$@"} ;;
-    esac
-}
-
-
-# func_sort_ver VER1 VER2
-# -----------------------
-# 'sort -V' is not generally available.
-# Note this deviates from the version comparison in automake
-# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
-# but this should suffice as we won't be specifying old
-# version formats or redundant trailing .0 in bootstrap.conf.
-# If we did want full compatibility then we should probably
-# use m4_version_compare from autoconf.
-func_sort_ver ()
-{
-    $debug_cmd
-
-    printf '%s\n%s\n' "$1" "$2" \
-      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
-}
-
-# func_lt_ver PREV CURR
-# ---------------------
-# Return true if PREV and CURR are in the correct order according to
-# func_sort_ver, otherwise false.  Use it like this:
-#
-#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
-func_lt_ver ()
-{
-    $debug_cmd
-
-    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-#! /bin/sh
-
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
-# A portable, pluggable option parser for Bourne shell.
-# Written by Gary V. Vaughan, 2010
-
-# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary@gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# This file is a library for parsing options in your shell scripts along
-# with assorted other useful supporting features that you can make use
-# of too.
-#
-# For the simplest scripts you might need only:
-#
-#   #!/bin/sh
-#   . relative/path/to/funclib.sh
-#   . relative/path/to/options-parser
-#   scriptversion=1.0
-#   func_options ${1+"$@"}
-#   eval set dummy "$func_options_result"; shift
-#   ...rest of your script...
-#
-# In order for the '--version' option to work, you will need to have a
-# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
-#
-# For '-h' and '--help' to work, you will also need a one line
-# description of your script's purpose in a comment directly above the
-# '# Written by ' line, like the one at the top of this file.
-#
-# The default options also support '--debug', which will turn on shell
-# execution tracing (see the comment above debug_cmd below for another
-# use), and '--verbose' and the func_verbose function to allow your script
-# to display verbose messages only when your user has specified
-# '--verbose'.
-#
-# After sourcing this file, you can plug processing for additional
-# options by amending the variables from the 'Configuration' section
-# below, and following the instructions in the 'Option parsing'
-# section further down.
-
-## -------------- ##
-## Configuration. ##
-## -------------- ##
-
-# You should override these variables in your script after sourcing this
-# file so that they reflect the customisations you have added to the
-# option parser.
-
-# The usage line for option parsing errors and the start of '-h' and
-# '--help' output messages. You can embed shell variables for delayed
-# expansion at the time the message is displayed, but you will need to
-# quote other shell meta-characters carefully to prevent them being
-# expanded when the contents are evaled.
-usage='$progpath [OPTION]...'
-
-# Short help message in response to '-h' and '--help'.  Add to this or
-# override it after sourcing this library to reflect the full set of
-# options your script accepts.
-usage_message="\
-       --debug        enable verbose shell tracing
-   -W, --warnings=CATEGORY
-                      report the warnings falling in CATEGORY [all]
-   -v, --verbose      verbosely report processing
-       --version      print version information and exit
-   -h, --help         print short or long help message and exit
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-long_help_message="
-Warning categories include:
-       'all'          show all warnings
-       'none'         turn off all the warnings
-       'error'        warnings are treated as fatal errors"
-
-# Help message printed before fatal option parsing errors.
-fatal_help="Try '\$progname --help' for more information."
-
-
-
-## ------------------------- ##
-## Hook function management. ##
-## ------------------------- ##
-
-# This section contains functions for adding, removing, and running hooks
-# to the main code.  A hook is just a named list of of function, that can
-# be run in order later on.
-
-# func_hookable FUNC_NAME
-# -----------------------
-# Declare that FUNC_NAME will run hooks added with
-# 'func_add_hook FUNC_NAME ...'.
-func_hookable ()
-{
-    $debug_cmd
-
-    func_append hookable_fns " $1"
-}
-
-
-# func_add_hook FUNC_NAME HOOK_FUNC
-# ---------------------------------
-# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
-# first have been declared "hookable" by a call to 'func_hookable'.
-func_add_hook ()
-{
-    $debug_cmd
-
-    case " $hookable_fns " in
-      *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not accept hook functions." ;;
-    esac
-
-    eval func_append ${1}_hooks '" $2"'
-}
-
-
-# func_remove_hook FUNC_NAME HOOK_FUNC
-# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
-func_remove_hook ()
-{
-    $debug_cmd
-
-    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
-}
-
-
-# func_run_hooks FUNC_NAME [ARG]...
-# ---------------------------------
-# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
-# than a whitespace-delimited list of legal shell function names, and
-# no effort is wasted trying to catch shell meta-characters or preserve
-# whitespace.
-func_run_hooks ()
-{
-    $debug_cmd
-
-    case " $hookable_fns " in
-      *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
-    esac
-
-    eval _G_hook_fns=\$$1_hooks; shift
-
-    for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
-    done
-
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
-}
-
-
-
-## --------------- ##
-## Option parsing. ##
-## --------------- ##
-
-# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
-#
-#    my_options_prep ()
-#    {
-#        $debug_cmd
-#
-#        # Extend the existing usage message.
-#        usage_message=$usage_message'
-#      -s, --silent       don'\''t print informational messages
-#    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_options_prep my_options_prep
-#
-#
-#    my_silent_option ()
-#    {
-#        $debug_cmd
-#
-#        # Note that for efficiency, we parse as many options as we can
-#        # recognise in a loop before passing the remainder back to the
-#        # caller on the first unrecognised argument we encounter.
-#        while test $# -gt 0; do
-#          opt=$1; shift
-#          case $opt in
-#            --silent|-s) opt_silent=: ;;
-#            # Separate non-argument short options:
-#            -s*)         func_split_short_opt "$_G_opt"
-#                         set dummy "$func_split_short_opt_name" \
-#                             "-$func_split_short_opt_arg" ${1+"$@"}
-#                         shift
-#                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
-#          esac
-#        done
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_parse_options my_silent_option
-#
-#
-#    my_option_validation ()
-#    {
-#        $debug_cmd
-#
-#        $opt_silent && $opt_verbose && func_fatal_help "\
-#    '--silent' and '--verbose' options are mutually exclusive."
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
-#    }
-#    func_add_hook func_validate_options my_option_validation
-#
-# You'll alse need to manually amend $usage_message to reflect the extra
-# options you parse.  It's preferable to append if you can, so that
-# multiple option parsing hooks can be added safely.
-
-
-# func_options [ARG]...
-# ---------------------
-# All the functions called inside func_options are hookable. See the
-# individual implementations for details.
-func_hookable func_options
-func_options ()
-{
-    $debug_cmd
-
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
-
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
-
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
-}
-
-
-# func_options_prep [ARG]...
-# --------------------------
-# All initialisations required before starting the option parse loop.
-# Note that when calling hook functions, we pass through the list of
-# positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
-func_hookable func_options_prep
-func_options_prep ()
-{
-    $debug_cmd
-
-    # Option defaults:
-    opt_verbose=false
-    opt_warning_types=
-
-    func_run_hooks func_options_prep ${1+"$@"}
-
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
-}
-
-
-# func_parse_options [ARG]...
-# ---------------------------
-# The main option parsing loop.
-func_hookable func_parse_options
-func_parse_options ()
-{
-    $debug_cmd
-
-    func_parse_options_result=
-
-    # this just eases exit handling
-    while test $# -gt 0; do
-      # Defer to hook functions for initial option parsing, so they
-      # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
-
-      # Break out of the loop if we already parsed every option.
-      test $# -gt 0 || break
-
-      _G_opt=$1
-      shift
-      case $_G_opt in
-        --debug|-x)   debug_cmd='set -x'
-                      func_echo "enabling shell trace mode"
-                      $debug_cmd
-                      ;;
-
-        --no-warnings|--no-warning|--no-warn)
-                      set dummy --warnings none ${1+"$@"}
-                      shift
-		      ;;
-
-        --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
-                      case " $warning_categories $1" in
-                        *" $1 "*)
-                          # trailing space prevents matching last $1 above
-                          func_append_uniq opt_warning_types " $1"
-                          ;;
-                        *all)
-                          opt_warning_types=$warning_categories
-                          ;;
-                        *none)
-                          opt_warning_types=none
-                          warning_func=:
-                          ;;
-                        *error)
-                          opt_warning_types=$warning_categories
-                          warning_func=func_fatal_error
-                          ;;
-                        *)
-                          func_fatal_error \
-                             "unsupported warning category: '$1'"
-                          ;;
-                      esac
-                      shift
-                      ;;
-
-        --verbose|-v) opt_verbose=: ;;
-        --version)    func_version ;;
-        -\?|-h)       func_usage ;;
-        --help)       func_help ;;
-
-	# Separate optargs to long options (plugins may need this):
-	--*=*)        func_split_equals "$_G_opt"
-	              set dummy "$func_split_equals_lhs" \
-                          "$func_split_equals_rhs" ${1+"$@"}
-                      shift
-                      ;;
-
-       # Separate optargs to short options:
-        -W*)
-                      func_split_short_opt "$_G_opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        # Separate non-argument short options:
-        -\?*|-h*|-v*|-x*)
-                      func_split_short_opt "$_G_opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "-$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        --)           break ;;
-        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
-      esac
-    done
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
-}
-
-
-# func_validate_options [ARG]...
-# ------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-func_hookable func_validate_options
-func_validate_options ()
-{
-    $debug_cmd
-
-    # Display all warnings if -W was not given.
-    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
-
-    func_run_hooks func_validate_options ${1+"$@"}
-
-    # Bail if the options were screwed!
-    $exit_cmd $EXIT_FAILURE
-
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
-}
-
-
-
-## ----------------- ##
-## Helper functions. ##
-## ----------------- ##
-
-# This section contains the helper functions used by the rest of the
-# hookable option parser framework in ascii-betical order.
-
-
-# func_fatal_help ARG...
-# ----------------------
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    $debug_cmd
-
-    eval \$ECHO \""Usage: $usage"\"
-    eval \$ECHO \""$fatal_help"\"
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-
-# func_help
-# ---------
-# Echo long help message to standard output and exit.
-func_help ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "$long_help_message"
-    exit 0
-}
-
-
-# func_missing_arg ARGNAME
-# ------------------------
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $debug_cmd
-
-    func_error "Missing argument for '$1'."
-    exit_cmd=exit
-}
-
-
-# func_split_equals STRING
-# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
-test -z "$_G_HAVE_XSI_OPS" \
-    && (eval 'x=a/b/c;
-      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-    && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=${1%%=*}
-      func_split_equals_rhs=${1#*=}
-      test "x$func_split_equals_lhs" = "x$1" \
-        && func_split_equals_rhs=
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
-      func_split_equals_rhs=
-      test "x$func_split_equals_lhs" = "x$1" \
-        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
-  }
-fi #func_split_equals
-
-
-# func_split_short_opt SHORTOPT
-# -----------------------------
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-if test yes = "$_G_HAVE_XSI_OPS"
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_arg=${1#??}
-      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
-      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
-  }
-fi #func_split_short_opt
-
-
-# func_usage
-# ----------
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $debug_cmd
-
-    func_usage_message
-    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
-    exit 0
-}
-
-
-# func_usage_message
-# ------------------
-# Echo short help message to standard output.
-func_usage_message ()
-{
-    $debug_cmd
-
-    eval \$ECHO \""Usage: $usage"\"
-    echo
-    $SED -n 's|^# ||
-        /^Written by/{
-          x;p;x
-        }
-	h
-	/^Written by/q' < "$progpath"
-    echo
-    eval \$ECHO \""$usage_message"\"
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
+  esac
 }
 
 
 # func_version
-# ------------
 # Echo version message to standard output and exit.
 func_version ()
 {
-    $debug_cmd
+    $opt_debug
 
-    printf '%s\n' "$progname $scriptversion"
-    $SED -n '
-        /(C)/!b go
-        :more
-        /\./!{
-          N
-          s|\n# | |
-          b more
-        }
-        :go
-        /^# Written by /,/# warranty; / {
-          s|^# ||
-          s|^# *$||
-          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
-          p
-        }
-        /^# Written by / {
-          s|^# ||
-          p
-        }
-        /^warranty; /q' < "$progpath"
+    $SED -n '/(C)/!b go
+	:more
+	/\./!{
+	  N
+	  s/\n# / /
+	  b more
+	}
+	:go
+	/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
 
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
     exit $?
 }
 
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-
-# Set a version string.
-scriptversion='(GNU libtool) 2.4.6'
-
-
-# func_echo ARG...
-# ----------------
-# Libtool also displays the current mode in messages, so override
-# funclib.sh func_echo with this custom definition.
-func_echo ()
-{
-    $debug_cmd
-
-    _G_message=$*
-
-    func_echo_IFS=$IFS
-    IFS=$nl
-    for _G_line in $_G_message; do
-      IFS=$func_echo_IFS
-      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
-    done
-    IFS=$func_echo_IFS
-}
-
-
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
-    $debug_cmd
-
-    $warning_func ${1+"$@"}
-}
-
-
-## ---------------- ##
-## Options parsing. ##
-## ---------------- ##
-
-# Hook in the functions to make sure our own options are parsed during
-# the option parsing loop.
-
-usage='$progpath [OPTION]... [MODE-ARG]...'
-
-# Short help message in response to '-h'.
-usage_message="Options:
-       --config             show all configuration variables
-       --debug              enable verbose shell tracing
-   -n, --dry-run            display commands without modifying any files
-       --features           display basic configuration information and exit
-       --mode=MODE          use operation mode MODE
-       --no-warnings        equivalent to '-Wnone'
-       --preserve-dup-deps  don't remove duplicate dependency libraries
-       --quiet, --silent    don't print informational messages
-       --tag=TAG            use configuration variables from tag TAG
-   -v, --verbose            print more informational messages than default
-       --version            print version information
-   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
-   -h, --help, --help-all   print short, long, or detailed help message
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
 func_help ()
 {
-    $debug_cmd
+    $opt_debug
 
-    func_usage_message
-    $ECHO "$long_help_message
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+	:print
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+	p
+	d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
 
-MODE must be one of the following:
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $opt_debug
 
-       clean           remove files from the build directory
-       compile         compile a source file into a libtool object
-       execute         automatically set library path, then run a program
-       finish          complete the installation of libtool libraries
-       install         install libraries or executables
-       link            create a library or an executable
-       uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  When passed as first option,
-'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
-Try '$progname --help --mode=MODE' for a more detailed description of MODE.
-
-When reporting a bug, please describe a test case to reproduce it and
-include the following information:
-
-       host-triplet:   $host
-       shell:          $SHELL
-       compiler:       $LTCC
-       compiler flags: $LTCFLAGS
-       linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname (GNU libtool) 2.4.6
-       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
-       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
-
-Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
-    exit 0
+    func_error "missing argument for $1."
+    exit_cmd=exit
 }
 
 
-# func_lo2o OBJECT-NAME
-# ---------------------
-# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
-# object suffix.
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
 
-lo2o=s/\\.lo\$/.$objext/
-o2lo=s/\\.$objext\$/.lo/
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
-  eval 'func_lo2o ()
-  {
-    case $1 in
-      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
-      *   ) func_lo2o_result=$1               ;;
-    esac
-  }'
-
-  # func_xform LIBOBJ-OR-SOURCE
-  # ---------------------------
-  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
-  # suffix to a '.lo' libtool-object suffix.
-  eval 'func_xform ()
-  {
-    func_xform_result=${1%.*}.lo
-  }'
-else
-  # ...otherwise fall back to using sed.
-  func_lo2o ()
-  {
-    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
-  }
-
-  func_xform ()
-  {
-    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
-  }
-fi
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
 
 
-# func_fatal_configuration ARG...
-# -------------------------------
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
+
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func__fatal_error ${1+"$@"} \
-      "See the $PACKAGE documentation for more information." \
-      "Fatal configuration error."
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
 }
 
 
 # func_config
-# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -2149,19 +915,17 @@
     exit $?
 }
 
-
 # func_features
-# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test yes = "$build_libtool_libs"; then
+    if test "$build_libtool_libs" = yes; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test yes = "$build_old_libs"; then
+    if test "$build_old_libs" = yes; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -2170,297 +934,289 @@
     exit $?
 }
 
-
-# func_enable_tag TAGNAME
-# -----------------------
+# func_enable_tag tagname
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-    # Global variable:
-    tagname=$1
+  # Global variable:
+  tagname="$1"
 
-    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-    sed_extractcf=/$re_begincf/,/$re_endcf/p
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
 
-    # Validate tagname.
-    case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-        func_fatal_error "invalid tag name: $tagname"
-        ;;
-    esac
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
 
-    # Don't test for the "default" C tag, as we know it's
-    # there but not specially marked.
-    case $tagname in
-        CC) ;;
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
     *)
-        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	  taglist="$taglist $tagname"
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
 
-	  # Evaluate the configuration.  Be careful to quote the path
-	  # and the sed script, to avoid splitting on whitespace, but
-	  # also don't use non-portable quotes within backquotes within
-	  # quotes we have to do it in 2 steps:
-	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	  eval "$extractedcf"
-        else
-	  func_error "ignoring unknown tag $tagname"
-        fi
-        ;;
-    esac
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
 }
 
-
 # func_check_version_match
-# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-    if test "$package_revision" != "$macro_revision"; then
-      if test "$VERSION" != "$macro_version"; then
-        if test -z "$macro_version"; then
-          cat >&2 <<_LT_EOF
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-        else
-          cat >&2 <<_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-        fi
-      else
-        cat >&2 <<_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-      fi
-
-      exit $EXIT_MISMATCH
-    fi
-}
-
-
-# libtool_options_prep [ARG]...
-# -----------------------------
-# Preparation for options parsed by libtool.
-libtool_options_prep ()
-{
-    $debug_mode
-
-    # Option defaults:
-    opt_config=false
-    opt_dlopen=
-    opt_dry_run=false
-    opt_help=false
-    opt_mode=
-    opt_preserve_dup_deps=false
-    opt_quiet=false
-
-    nonopt=
-    preserve_args=
-
-    # Shorthand for --mode=foo, only valid as the first argument
-    case $1 in
-    clean|clea|cle|cl)
-      shift; set dummy --mode clean ${1+"$@"}; shift
-      ;;
-    compile|compil|compi|comp|com|co|c)
-      shift; set dummy --mode compile ${1+"$@"}; shift
-      ;;
-    execute|execut|execu|exec|exe|ex|e)
-      shift; set dummy --mode execute ${1+"$@"}; shift
-      ;;
-    finish|finis|fini|fin|fi|f)
-      shift; set dummy --mode finish ${1+"$@"}; shift
-      ;;
-    install|instal|insta|inst|ins|in|i)
-      shift; set dummy --mode install ${1+"$@"}; shift
-      ;;
-    link|lin|li|l)
-      shift; set dummy --mode link ${1+"$@"}; shift
-      ;;
-    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-      shift; set dummy --mode uninstall ${1+"$@"}; shift
-      ;;
-    esac
-
-    # Pass back the list of options.
-    func_quote_for_eval ${1+"$@"}
-    libtool_options_prep_result=$func_quote_for_eval_result
-}
-func_add_hook func_options_prep libtool_options_prep
-
-
-# libtool_parse_options [ARG]...
-# ---------------------------------
-# Provide handling for libtool specific options.
-libtool_parse_options ()
-{
-    $debug_cmd
-
-    # Perform our own loop to consume as many options as possible in
-    # each iteration.
-    while test $# -gt 0; do
-      _G_opt=$1
-      shift
-      case $_G_opt in
-        --dry-run|--dryrun|-n)
-                        opt_dry_run=:
-                        ;;
-
-        --config)       func_config ;;
-
-        --dlopen|-dlopen)
-                        opt_dlopen="${opt_dlopen+$opt_dlopen
-}$1"
-                        shift
-                        ;;
-
-        --preserve-dup-deps)
-                        opt_preserve_dup_deps=: ;;
-
-        --features)     func_features ;;
-
-        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
-
-        --help)         opt_help=: ;;
-
-        --help-all)     opt_help=': help-all' ;;
-
-        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
-                        opt_mode=$1
-                        case $1 in
-                          # Valid mode arguments:
-                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-                          # Catch anything else as an error
-                          *) func_error "invalid argument for $_G_opt"
-                             exit_cmd=exit
-                             break
-                             ;;
-                        esac
-                        shift
-                        ;;
-
-        --no-silent|--no-quiet)
-                        opt_quiet=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --no-warnings|--no-warning|--no-warn)
-                        opt_warning=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --no-verbose)
-                        opt_verbose=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --silent|--quiet)
-                        opt_quiet=:
-                        opt_verbose=false
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
-                        opt_tag=$1
-                        func_append preserve_args " $_G_opt $1"
-                        func_enable_tag "$1"
-                        shift
-                        ;;
-
-        --verbose|-v)   opt_quiet=false
-                        opt_verbose=:
-                        func_append preserve_args " $_G_opt"
-                        ;;
-
-	# An option not handled by this hook function:
-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
-      esac
-    done
-
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    libtool_parse_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_parse_options libtool_parse_options
-
-
-
-# libtool_validate_options [ARG]...
-# ---------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-libtool_validate_options ()
-{
-    # save first non-option argument
-    if test 0 -lt $#; then
-      nonopt=$1
-      shift
     fi
 
-    # preserve --debug
-    test : = "$debug_cmd" || func_append preserve_args " --debug"
-
-    case $host in
-      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
-      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
-      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
-        # don't eliminate duplications in $postdeps and $predeps
-        opt_duplicate_compiler_generated_deps=:
-        ;;
-      *)
-        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-        ;;
-    esac
-
-    $opt_help || {
-      # Sanity checks first:
-      func_check_version_match
-
-      test yes != "$build_libtool_libs" \
-        && test yes != "$build_old_libs" \
-        && func_fatal_configuration "not configured to build any kind of library"
-
-      # Darwin sucks
-      eval std_shrext=\"$shrext_cmds\"
-
-      # Only execute mode is allowed to have -dlopen flags.
-      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
-        func_error "unrecognized option '-dlopen'"
-        $ECHO "$help" 1>&2
-        exit $EXIT_FAILURE
-      fi
-
-      # Change the help message to a mode-specific one.
-      generic_help=$help
-      help="Try '$progname --help --mode=$opt_mode' for more information."
-    }
-
-    # Pass back the unparsed argument list
-    func_quote_for_eval ${1+"$@"}
-    libtool_validate_options_result=$func_quote_for_eval_result
+    exit $EXIT_MISMATCH
+  fi
 }
-func_add_hook func_validate_options libtool_validate_options
 
 
-# Process options as early as possible so that --help and --version
-# can return quickly.
-func_options ${1+"$@"}
-eval set dummy "$func_options_result"; shift
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
+    opt="$1"
+    shift
+    case $opt in
+      --debug|-x)	opt_debug='set -x'
+			func_echo "enabling shell trace mode"
+			$opt_debug
+			;;
+      --dry-run|--dryrun|-n)
+			opt_dry_run=:
+			;;
+      --config)
+			opt_config=:
+func_config
+			;;
+      --dlopen|-dlopen)
+			optarg="$1"
+			opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+			shift
+			;;
+      --preserve-dup-deps)
+			opt_preserve_dup_deps=:
+			;;
+      --features)
+			opt_features=:
+func_features
+			;;
+      --finish)
+			opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+			;;
+      --help)
+			opt_help=:
+			;;
+      --help-all)
+			opt_help_all=:
+opt_help=': help-all'
+			;;
+      --mode)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+			shift
+			;;
+      --no-silent|--no-quiet)
+			opt_silent=false
+func_append preserve_args " $opt"
+			;;
+      --no-warning|--no-warn)
+			opt_warning=false
+func_append preserve_args " $opt"
+			;;
+      --no-verbose)
+			opt_verbose=false
+func_append preserve_args " $opt"
+			;;
+      --silent|--quiet)
+			opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+			;;
+      --verbose|-v)
+			opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+			;;
+      --tag)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+			shift
+			;;
+
+      -\?|-h)		func_usage				;;
+      --help)		func_help				;;
+      --version)	func_version				;;
+
+      # Separate optargs to long options:
+      --*=*)
+			func_split_long_opt "$opt"
+			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+			shift
+			;;
+
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+			func_split_short_opt "$opt"
+			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+			shift
+			;;
+
+      --)		break					;;
+      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
+      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+    esac
+  done
+
+  # Validate options:
+
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
+
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+      ;;
+  esac
+
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
+
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
+    fi
+
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
+
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
+
+
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
+
 
 
 
@@ -2468,52 +1224,24 @@
 ##    Main.    ##
 ## ----------- ##
 
-magic='%%%MAGIC variable%%%'
-magic_exe='%%%MAGIC EXE variable%%%'
-
-# Global variables.
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# func_generated_by_libtool
-# True iff stdin has been generated by Libtool. This function is only
-# a basic sanity check; it will hardly flush out determined imposters.
-func_generated_by_libtool_p ()
-{
-  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
 # func_lalib_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
+# True iff FILE is a libtool `.la' library or `.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
 {
     test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
+# True iff FILE is a libtool `.la' library or `.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if 'file' does not exist.
+# fatal anyway.  Works if `file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -2521,13 +1249,13 @@
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case $lalib_p_line in
+	    case "$lalib_p_line" in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test yes = "$lalib_p"
+    test "$lalib_p" = yes
 }
 
 # func_ltwrapper_script_p file
@@ -2536,8 +1264,7 @@
 # determined imposters.
 func_ltwrapper_script_p ()
 {
-    test -f "$1" &&
-      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
+    func_lalib_p "$1"
 }
 
 # func_ltwrapper_executable_p file
@@ -2562,7 +1289,7 @@
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
 }
 
 # func_ltwrapper_p file
@@ -2581,13 +1308,11 @@
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $debug_cmd
-
+    $opt_debug
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$sp$nl
-      eval cmd=\"$cmd\"
       IFS=$save_ifs
+      eval cmd=\"$cmd\"
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -2599,11 +1324,10 @@
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# 'FILE.' does not work on cygwin managed mounts.
+# `FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $debug_cmd
-
+    $opt_debug
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -2630,10 +1354,10 @@
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case $lt_sysroot:$1 in
+  case "$lt_sysroot:$1" in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result='='$func_stripname_result
+    func_replace_sysroot_result="=$func_stripname_result"
     ;;
   *)
     # Including no sysroot.
@@ -2650,8 +1374,7 @@
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $debug_cmd
-
+    $opt_debug
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -2670,7 +1393,7 @@
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -2695,7 +1418,7 @@
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with '--tag'"
+	  func_fatal_error "specify a tag with \`--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -2711,15 +1434,15 @@
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=$1
-    if test yes = "$build_libtool_libs"; then
-      write_lobj=\'$2\'
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
     else
       write_lobj=none
     fi
 
-    if test yes = "$build_old_libs"; then
-      write_oldobj=\'$3\'
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
     else
       write_oldobj=none
     fi
@@ -2727,7 +1450,7 @@
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -2739,7 +1462,7 @@
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "$write_libobj"
+      $MV "${write_libobj}T" "${write_libobj}"
     }
 }
 
@@ -2759,9 +1482,8 @@
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $debug_cmd
-
-  func_convert_core_file_wine_to_w32_result=$1
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -2769,9 +1491,9 @@
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$sed_naive_backslashify"`
+        $SED -e "$lt_sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -2792,19 +1514,18 @@
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $debug_cmd
-
+  $opt_debug
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=
+  func_convert_core_path_wine_to_w32_result=""
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result"; then
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -2833,8 +1554,7 @@
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $debug_cmd
-
+  $opt_debug
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -2843,7 +1563,7 @@
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -2854,11 +1574,10 @@
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $debug_cmd
-
+  $opt_debug
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -2869,14 +1588,13 @@
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $debug_cmd
-
-  if test -z "$2" && test -n "$1"; then
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  '$1'"
+    func_error "  \`$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result=$1
+    func_to_host_file_result="$1"
   fi
 }
 # end func_convert_file_check
@@ -2888,11 +1606,10 @@
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $debug_cmd
-
+  $opt_debug
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  '$3'"
+    func_error "  \`$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -2901,7 +1618,7 @@
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result=$3
+      func_to_host_path_result="$3"
     fi
   fi
 }
@@ -2913,10 +1630,9 @@
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $debug_cmd
-
+  $opt_debug
   case $4 in
-  $1 ) func_to_host_path_result=$3$func_to_host_path_result
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
     ;;
   esac
   case $4 in
@@ -2930,7 +1646,7 @@
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via '$to_host_file_cmd ARG'
+# invoked via `$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -2941,8 +1657,7 @@
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $debug_cmd
-
+  $opt_debug
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -2954,8 +1669,7 @@
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $debug_cmd
-
+  $opt_debug
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -2973,7 +1687,7 @@
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result=$1
+  func_to_host_file_result="$1"
 }
 # end func_convert_file_noop
 
@@ -2984,12 +1698,11 @@
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $debug_cmd
-
-  func_to_host_file_result=$1
+  $opt_debug
+  func_to_host_file_result="$1"
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result=$func_convert_core_msys_to_w32_result
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -3001,9 +1714,8 @@
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $debug_cmd
-
-  func_to_host_file_result=$1
+  $opt_debug
+  func_to_host_file_result="$1"
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -3019,12 +1731,11 @@
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $debug_cmd
-
-  func_to_host_file_result=$1
+  $opt_debug
+  func_to_host_file_result="$1"
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -3036,13 +1747,12 @@
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $debug_cmd
-
-  func_to_host_file_result=$1
+  $opt_debug
+  func_to_host_file_result="$1"
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result=$func_cygpath_result
+    func_to_host_file_result="$func_cygpath_result"
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -3055,14 +1765,13 @@
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $debug_cmd
-
-  func_to_host_file_result=$1
+  $opt_debug
+  func_to_host_file_result="$1"
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result=$func_cygpath_result
+    func_to_host_file_result="$func_cygpath_result"
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -3072,7 +1781,7 @@
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via '$to_host_path_cmd ARG'
+# invoked via `$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -3096,11 +1805,10 @@
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $debug_cmd
-
+  $opt_debug
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd=func_convert_path_$func_stripname_result
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
   fi
 }
 
@@ -3110,8 +1818,7 @@
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $debug_cmd
-
+  $opt_debug
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -3122,7 +1829,7 @@
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result=$1
+  func_to_host_path_result="$1"
 }
 # end func_convert_path_noop
 
@@ -3133,9 +1840,8 @@
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $debug_cmd
-
-  func_to_host_path_result=$1
+  $opt_debug
+  func_to_host_path_result="$1"
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -3143,7 +1849,7 @@
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result=$func_convert_core_msys_to_w32_result
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -3157,9 +1863,8 @@
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $debug_cmd
-
-  func_to_host_path_result=$1
+  $opt_debug
+  func_to_host_path_result="$1"
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -3178,15 +1883,14 @@
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $debug_cmd
-
-  func_to_host_path_result=$1
+  $opt_debug
+  func_to_host_path_result="$1"
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -3200,16 +1904,15 @@
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $debug_cmd
-
-  func_to_host_path_result=$1
+  $opt_debug
+  func_to_host_path_result="$1"
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result=$func_cygpath_result
+    func_to_host_path_result="$func_cygpath_result"
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -3224,9 +1927,8 @@
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $debug_cmd
-
-  func_to_host_path_result=$1
+  $opt_debug
+  func_to_host_path_result="$1"
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -3235,7 +1937,7 @@
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result=$func_cygpath_result
+    func_to_host_path_result="$func_cygpath_result"
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -3244,31 +1946,13 @@
 # end func_convert_path_nix_to_cygwin
 
 
-# func_dll_def_p FILE
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with _LT_DLL_DEF_P in libtool.m4
-func_dll_def_p ()
-{
-  $debug_cmd
-
-  func_dll_def_p_tmp=`$SED -n \
-    -e 's/^[	 ]*//' \
-    -e '/^\(;.*\)*$/d' \
-    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
-    -e q \
-    "$1"`
-  test DEF = "$func_dll_def_p_tmp"
-}
-
-
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $debug_cmd
-
+    $opt_debug
     # Get the compilation command and the source file.
     base_compile=
-    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -3281,12 +1965,12 @@
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg=$arg
+	lastarg="$arg"
 	arg_mode=normal
 	;;
 
       target )
-	libobj=$arg
+	libobj="$arg"
 	arg_mode=normal
 	continue
 	;;
@@ -3296,7 +1980,7 @@
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify '-o' more than once"
+	    func_fatal_error "you cannot specify \`-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
@@ -3325,12 +2009,12 @@
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs=$IFS; IFS=,
+	  save_ifs="$IFS"; IFS=','
 	  for arg in $args; do
-	    IFS=$save_ifs
+	    IFS="$save_ifs"
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS=$save_ifs
+	  IFS="$save_ifs"
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
@@ -3343,8 +2027,8 @@
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg=$srcfile
-	  srcfile=$arg
+	  lastarg="$srcfile"
+	  srcfile="$arg"
 	  ;;
 	esac  #  case $arg
 	;;
@@ -3359,13 +2043,13 @@
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with '-o'"
+      func_fatal_error "you must specify a target with \`-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj=$func_basename_result
+	libobj="$func_basename_result"
       }
       ;;
     esac
@@ -3385,7 +2069,7 @@
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from '$libobj'"
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
       ;;
     esac
 
@@ -3394,8 +2078,8 @@
     for arg in $later; do
       case $arg in
       -shared)
-	test yes = "$build_libtool_libs" \
-	  || func_fatal_configuration "cannot build a shared library"
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -3421,17 +2105,17 @@
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name '$libobj' may not contain shell special characters."
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname=$func_basename_result
-    xdir=$func_dirname_result
-    lobj=$xdir$objdir/$objname
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test yes = "$build_old_libs"; then
+    if test "$build_old_libs" = yes; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -3443,16 +2127,16 @@
       pic_mode=default
       ;;
     esac
-    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test no = "$compiler_c_o"; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
-      lockfile=$output_obj.lock
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
     else
       output_obj=
       need_locks=no
@@ -3461,12 +2145,12 @@
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test yes = "$need_locks"; then
+    if test "$need_locks" = yes; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test warn = "$need_locks"; then
+    elif test "$need_locks" = warn; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -3474,7 +2158,7 @@
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
+your compiler does not support \`-c' and \`-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -3496,11 +2180,11 @@
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test yes = "$build_libtool_libs"; then
+    if test "$build_libtool_libs" = yes; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test no != "$pic_mode"; then
+      if test "$pic_mode" != no; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -3517,7 +2201,7 @@
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test warn = "$need_locks" &&
+      if test "$need_locks" = warn &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -3528,7 +2212,7 @@
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
+your compiler does not support \`-c' and \`-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -3544,20 +2228,20 @@
       fi
 
       # Allow error messages only from the first compilation.
-      if test yes = "$suppress_opt"; then
+      if test "$suppress_opt" = yes; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test yes = "$build_old_libs"; then
-      if test yes != "$pic_mode"; then
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test yes = "$compiler_c_o"; then
+      if test "$compiler_c_o" = yes; then
 	func_append command " -o $obj"
       fi
 
@@ -3566,7 +2250,7 @@
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test warn = "$need_locks" &&
+      if test "$need_locks" = warn &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -3577,7 +2261,7 @@
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together.  If you
+your compiler does not support \`-c' and \`-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -3597,7 +2281,7 @@
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test no != "$need_locks"; then
+      if test "$need_locks" != no; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -3607,7 +2291,7 @@
 }
 
 $opt_help || {
-  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -3627,7 +2311,7 @@
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -3646,16 +2330,16 @@
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a '.o' file suitable for static linking
-  -static           only build a '.o' file suitable for static linking
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a 'standard' object file
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix '.c' with the
-library object suffix, '.lo'."
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
         ;;
 
       execute)
@@ -3668,7 +2352,7 @@
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to '-dlopen'
+This mode sets the library path environment variable according to \`-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -3687,7 +2371,7 @@
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the '--dry-run' option if you just want to see what would be executed."
+the \`--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -3697,7 +2381,7 @@
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the 'install' or 'cp' program.
+either the \`install' or \`cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -3723,7 +2407,7 @@
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -3737,8 +2421,7 @@
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  use a list of object files found in FILE to specify objects
-  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -3758,20 +2441,20 @@
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with '-') are ignored.
+All other options (arguments beginning with \`-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in '.la' are
+Every other argument is treated as a filename.  Files ending in \`.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in '.la', then a libtool library is created,
-only library objects ('.lo' files) may be specified, and '-rpath' is
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
-using 'ar' and 'ranlib', or on Windows using 'lib'.
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
 
-If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -3782,7 +2465,7 @@
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -3790,17 +2473,17 @@
         ;;
 
       *)
-        func_fatal_help "invalid operation mode '$opt_mode'"
+        func_fatal_help "invalid operation mode \`$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try '$progname --help' for more information about other modes."
+    $ECHO "Try \`$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test : = "$opt_help"; then
+  if test "$opt_help" = :; then
     func_mode_help
   else
     {
@@ -3808,7 +2491,7 @@
       for opt_mode in compile link execute install finish uninstall clean; do
 	func_mode_help
       done
-    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
     {
       func_help noexit
       for opt_mode in compile link execute install finish uninstall clean; do
@@ -3816,7 +2499,7 @@
 	func_mode_help
       done
     } |
-    $SED '1d
+    sed '1d
       /^When reporting/,/^Report/{
 	H
 	d
@@ -3833,17 +2516,16 @@
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $debug_cmd
-
+    $opt_debug
     # The first argument is the command name.
-    cmd=$nonopt
+    cmd="$nonopt"
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "'$file' is not a file"
+	|| func_fatal_help "\`$file' is not a file"
 
       dir=
       case $file in
@@ -3853,7 +2535,7 @@
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "'$lib' is not a valid libtool archive"
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -3864,18 +2546,18 @@
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "'$file' was not linked with '-export-dynamic'"
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir=$func_dirname_result
+	dir="$func_dirname_result"
 
 	if test -f "$dir/$objdir/$dlname"; then
 	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -3883,18 +2565,18 @@
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir=$func_dirname_result
+	dir="$func_dirname_result"
 	;;
 
       *)
-	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir=$absdir
+      test -n "$absdir" && dir="$absdir"
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -3906,7 +2588,7 @@
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic=$magic
+    libtool_execute_magic="$magic"
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -3919,12 +2601,12 @@
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file=$progdir/$program
+	  file="$progdir/$program"
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file=$progdir/$program
+	  file="$progdir/$program"
 	fi
 	;;
       esac
@@ -3932,15 +2614,7 @@
       func_append_quoted args "$file"
     done
 
-    if $opt_dry_run; then
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
-    else
+    if test "X$opt_dry_run" = Xfalse; then
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -3957,18 +2631,25 @@
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd=\$cmd$args
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
     fi
 }
 
-test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $debug_cmd
-
+    $opt_debug
     libs=
     libdirs=
     admincmds=
@@ -3982,11 +2663,11 @@
 	if func_lalib_unsafe_p "$opt"; then
 	  func_append libs " $opt"
 	else
-	  func_warning "'$opt' is not a valid libtool archive"
+	  func_warning "\`$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument '$opt'"
+	func_fatal_error "invalid argument \`$opt'"
       fi
     done
 
@@ -4001,12 +2682,12 @@
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -4031,7 +2712,7 @@
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_quiet && exit $EXIT_SUCCESS
+    $opt_silent && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -4042,27 +2723,27 @@
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the '$runpath_var' environment variable"
+	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the '$flag' linker flag"
+	$ECHO "   - use the \`$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
       fi
       echo
 
@@ -4081,20 +2762,18 @@
     exit $EXIT_SUCCESS
 }
 
-test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $debug_cmd
-
+    $opt_debug
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac
-    then
+       case $nonopt in *shtool*) :;; *) false;; esac; then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -4121,7 +2800,7 @@
     opts=
     prev=
     install_type=
-    isdir=false
+    isdir=no
     stripme=
     no_mode=:
     for arg
@@ -4134,7 +2813,7 @@
       fi
 
       case $arg in
-      -d) isdir=: ;;
+      -d) isdir=yes ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -4152,7 +2831,7 @@
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
+	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -4177,7 +2856,7 @@
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the '$prev' option requires an argument"
+      func_fatal_help "the \`$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
@@ -4199,19 +2878,19 @@
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=:
-    if $isdir; then
-      destdir=$dest
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir=$func_dirname_result
-      destname=$func_basename_result
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "'$dest' is not a directory"
+	func_fatal_help "\`$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -4220,7 +2899,7 @@
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "'$destdir' must be an absolute directory name"
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -4229,7 +2908,7 @@
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic=$magic
+    libtool_install_magic="$magic"
 
     staticlibs=
     future_libdirs=
@@ -4249,7 +2928,7 @@
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "'$file' is not a valid libtool archive"
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -4271,7 +2950,7 @@
 	fi
 
 	func_dirname "$file" "/" ""
-	dir=$func_dirname_result
+	dir="$func_dirname_result"
 	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
@@ -4285,7 +2964,7 @@
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -4294,36 +2973,29 @@
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking '$file'"
+	  func_warning "relinking \`$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname=$1
+	  realname="$1"
 	  shift
 
-	  srcname=$realname
-	  test -n "$relink_command" && srcname=${realname}T
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme=$stripme
+	  tstripme="$stripme"
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=
-	      ;;
-	    esac
-	    ;;
-	  os2*)
-	    case $realname in
-	    *_dll.a)
-	      tstripme=
+	      tstripme=""
 	      ;;
 	    esac
 	    ;;
@@ -4334,7 +3006,7 @@
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try 'ln -sf' first, because the 'ln' binary might depend on
+	    # Try `ln -sf' first, because the `ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -4345,14 +3017,14 @@
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib=$destdir/$realname
+	  lib="$destdir/$realname"
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name=$func_basename_result
-	instname=$dir/${name}i
+	name="$func_basename_result"
+	instname="$dir/$name"i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
@@ -4364,11 +3036,11 @@
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile=$destdir/$destname
+	  destfile="$destdir/$destname"
 	else
 	  func_basename "$file"
-	  destfile=$func_basename_result
-	  destfile=$destdir/$destfile
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -4378,11 +3050,11 @@
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest=$destfile
+	  staticdest="$destfile"
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to '$destfile'"
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
 	  ;;
 	esac
 
@@ -4391,7 +3063,7 @@
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test yes = "$build_old_libs"; then
+	if test "$build_old_libs" = yes; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -4403,23 +3075,23 @@
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile=$destdir/$destname
+	  destfile="$destdir/$destname"
 	else
 	  func_basename "$file"
-	  destfile=$func_basename_result
-	  destfile=$destdir/$destfile
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=
+	stripped_ext=""
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=.exe
+	      stripped_ext=".exe"
 	    fi
 	    ;;
 	esac
@@ -4447,19 +3119,19 @@
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
 
-	  finalize=:
+	  finalize=yes
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
+	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "'$lib' has not been installed in '$libdir'"
-	      finalize=false
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
 	    fi
 	  done
 
@@ -4467,29 +3139,29 @@
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test no = "$fast_install" && test -n "$relink_command"; then
+	  if test "$fast_install" = no && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if $finalize; then
+	      if test "$finalize" = yes; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file=$func_basename_result
-	        outputname=$tmpdir/$file
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_quiet || {
+	        $opt_silent || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink '$file' with the above command before installing it"
+		  func_error "error: relink \`$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file=$outputname
+	        file="$outputname"
 	      else
-	        func_warning "cannot relink '$file'"
+	        func_warning "cannot relink \`$file'"
 	      fi
 	    }
 	  else
@@ -4526,10 +3198,10 @@
 
     for file in $staticlibs; do
       func_basename "$file"
-      name=$func_basename_result
+      name="$func_basename_result"
 
       # Set up the ranlib parameters.
-      oldlib=$destdir/$name
+      oldlib="$destdir/$name"
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -4544,18 +3216,18 @@
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run '$progname --finish$future_libdirs'"
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test install = "$opt_mode" && func_mode_install ${1+"$@"}
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -4563,17 +3235,16 @@
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $debug_cmd
-
-    my_outputname=$1
-    my_originator=$2
-    my_pic_p=${3-false}
-    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms=${my_outputname}S.c
+	my_dlsyms="${my_outputname}S.c"
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -4584,7 +3255,7 @@
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist=$output_objdir/$my_outputname.nm
+	nlist="$output_objdir/${my_outputname}.nm"
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -4592,36 +3263,34 @@
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined __osf__
+#elif defined(__osf__)
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
 /* External symbol declarations for the compiler. */\
 "
 
-	if test yes = "$dlself"; then
-	  func_verbose "generating symbol list for '$output'"
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -4629,7 +3298,7 @@
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -4649,10 +3318,10 @@
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols=$output_objdir/$outputname.exp
+	    export_symbols="$output_objdir/$outputname.exp"
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -4662,7 +3331,7 @@
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -4676,22 +3345,22 @@
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from '$dlprefile'"
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
 	  func_basename "$dlprefile"
-	  name=$func_basename_result
+	  name="$func_basename_result"
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=
+	        dlprefile_dlbasename=""
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname"; then
+	          if test -n "$dlprefile_dlname" ; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename=$func_basename_result
+	            dlprefile_dlbasename="$func_basename_result"
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -4699,7 +3368,7 @@
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename"; then
+	          if test -n "$dlprefile_dlbasename" ; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -4755,11 +3424,6 @@
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
-	  func_show_eval '$RM "${nlist}I"'
-	  if test -n "$global_symbol_to_import"; then
-	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
-	  fi
-
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -4768,30 +3432,11 @@
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];\
-"
-
-	  if test -s "$nlist"I; then
-	    echo >> "$output_objdir/$my_dlsyms" "\
-static void lt_syminit(void)
-{
-  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
-  for (; symbol->name; ++symbol)
-    {"
-	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
-	    echo >> "$output_objdir/$my_dlsyms" "\
-    }
-}"
-	  fi
-	  echo >> "$output_objdir/$my_dlsyms" "\
+lt_${my_prefix}_LTX_preloaded_symbols[];
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{ {\"$my_originator\", (void *) 0},"
-
-	  if test -s "$nlist"I; then
-	    echo >> "$output_objdir/$my_dlsyms" "\
-  {\"@INIT@\", (void *) &lt_syminit},"
-	  fi
+{\
+  { \"$my_originator\", (void *) 0 },"
 
 	  case $need_lib_prefix in
 	  no)
@@ -4833,7 +3478,9 @@
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
 	    ;;
 	  esac
 	  ;;
@@ -4850,10 +3497,10 @@
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj=$output_objdir/${my_outputname}S.$objext
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -4871,7 +3518,7 @@
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for '$my_dlsyms'"
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
 	;;
       esac
     else
@@ -4885,32 +3532,6 @@
     fi
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $debug_cmd
-
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $debug_cmd
-
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -4920,9 +3541,8 @@
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $debug_cmd
-
-  win32_libid_type=unknown
+  $opt_debug
+  win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -4932,29 +3552,16 @@
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      case $nm_interface in
-      "MS dumpbin")
-	if func_cygming_ms_implib_p "$1" ||
-	   func_cygming_gnu_implib_p "$1"
-	then
-	  win32_nmres=import
-	else
-	  win32_nmres=
-	fi
-	;;
-      *)
-	func_to_tool_file "$1" func_convert_file_msys_to_w32
-	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	  $SED -n -e '
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	$SED -n -e '
 	    1,100{
 		/ I /{
-		    s|.*|import|
+		    s,.*,import,
 		    p
 		    q
 		}
 	    }'`
-	;;
-      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -4986,8 +3593,7 @@
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $debug_cmd
-
+  $opt_debug
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -5004,8 +3610,7 @@
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $debug_cmd
-
+  $opt_debug
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -5041,8 +3646,8 @@
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive that possess that section. Heuristic: eliminate
-    # all those that have a first or second character that is
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -5053,6 +3658,30 @@
     $SED -e '/^\./d;/^.\./d;q'
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -5066,17 +3695,16 @@
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $debug_cmd
-
-  if func_cygming_gnu_implib_p "$1"; then
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1"; then
+  elif func_cygming_ms_implib_p "$1" ; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=
+    sharedlib_from_linklib_result=""
   fi
 }
 
@@ -5084,11 +3712,10 @@
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $debug_cmd
-
-    f_ex_an_ar_dir=$1; shift
-    f_ex_an_ar_oldlib=$1
-    if test yes = "$lock_old_archive_extraction"; then
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -5097,7 +3724,7 @@
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test yes = "$lock_old_archive_extraction"; then
+    if test "$lock_old_archive_extraction" = yes; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -5111,23 +3738,22 @@
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $debug_cmd
-
-    my_gentop=$1; shift
+    $opt_debug
+    my_gentop="$1"; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=
-    my_xlib=
-    my_xabs=
-    my_xdir=
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib=$func_basename_result
+      my_xlib="$func_basename_result"
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -5139,7 +3765,7 @@
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir=$my_gentop/$my_xlib_u
+      my_xdir="$my_gentop/$my_xlib_u"
 
       func_mkdir_p "$my_xdir"
 
@@ -5152,23 +3778,22 @@
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  func_basename "$darwin_archive"
-	  darwin_base_archive=$func_basename_result
+	  darwin_base_archive=`basename "$darwin_archive"`
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches; do
-	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
-	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
-	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
@@ -5190,7 +3815,7 @@
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result=$my_oldobjs
+    func_extract_archives_result="$my_oldobjs"
 }
 
 
@@ -5205,7 +3830,7 @@
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory where it is stored is
+# will assume that the directory in which it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -5216,7 +3841,7 @@
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -5273,9 +3898,9 @@
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ that is used only on
+# /script/ and the wrapper /executable/ which is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options that match
+# (application programs are unlikely to have options which match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -5308,7 +3933,7 @@
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
   fi
 }
 
@@ -5319,7 +3944,7 @@
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -5333,7 +3958,7 @@
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -5343,7 +3968,7 @@
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -5418,13 +4043,13 @@
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test yes = "$fast_install"; then
+	if test "$fast_install" = yes; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -5441,7 +4066,7 @@
     if test -n \"\$relink_command\"; then
       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
       else
-	\$ECHO \"\$relink_command_output\" >&2
+	$ECHO \"\$relink_command_output\" >&2
 	$RM \"\$progdir/\$file\"
 	exit 1
       fi
@@ -5476,7 +4101,7 @@
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -5496,7 +4121,7 @@
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -5515,7 +4140,7 @@
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -5550,45 +4175,47 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
 /* declarations of non-ANSI functions */
-#if defined __MINGW32__
+#if defined(__MINGW32__)
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined __CYGWIN__
+#elif defined(__CYGWIN__)
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined other_platform || defined ... */
+/* #elif defined (other platforms) ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined _MSC_VER
+#if defined(_MSC_VER)
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-#elif defined __MINGW32__
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined __CYGWIN__
+#elif defined(__CYGWIN__)
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined other platforms ... */
+/* #elif defined (other platforms) ... */
 #endif
 
-#if defined PATH_MAX
+#if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
-#elif defined MAXPATHLEN
+#elif defined(MAXPATHLEN)
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -5607,8 +4234,8 @@
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
-  defined __OS2__
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -5641,10 +4268,10 @@
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free (stale); stale = 0; } \
+  if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
-#if defined LT_DEBUGWRAPPER
+#if defined(LT_DEBUGWRAPPER)
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -5673,16 +4300,11 @@
 EOF
 
 	    cat <<EOF
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
-# define externally_visible volatile
-#else
-# define externally_visible __attribute__((externally_visible)) volatile
-#endif
-externally_visible const char * MAGIC_EXE = "$magic_exe";
+volatile const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -5706,7 +4328,7 @@
 EOF
 	    fi
 
-	    if test yes = "$fast_install"; then
+	    if test "$fast_install" = yes; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -5735,12 +4357,12 @@
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  int rval = 127;
+  intptr_t rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, (size_t) argc + 1);
+  newargz = XMALLOC (char *, argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -5749,10 +4371,10 @@
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (STREQ (argv[i], dumpscript_opt))
+      if (strcmp (argv[i], dumpscript_opt) == 0)
 	{
 EOF
-	    case $host in
+	    case "$host" in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -5763,12 +4385,12 @@
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (STREQ (argv[i], debug_opt))
+      if (strcmp (argv[i], debug_opt) == 0)
 	{
           lt_debug = 1;
           continue;
 	}
-      if (STREQ (argv[i], ltwrapper_option_prefix))
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -5791,7 +4413,7 @@
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -5902,7 +4524,7 @@
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -5947,7 +4569,7 @@
 {
   const char *base;
 
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -6006,7 +4628,7 @@
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  size_t tmp_len;
+  int tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -6016,7 +4638,7 @@
     return NULL;
 
   /* Absolute path? */
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -6034,7 +4656,7 @@
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
     }
 #endif
 
@@ -6057,7 +4679,7 @@
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = (size_t) (q - p);
+	      p_len = q - p;
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -6176,7 +4798,7 @@
   if (patlen <= len)
     {
       str += len - patlen;
-      if (STREQ (str, pat))
+      if (strcmp (str, pat) == 0)
 	*str = '\0';
     }
   return str;
@@ -6241,7 +4863,7 @@
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    size_t len = strlen (name) + 1 + strlen (value) + 1;
+    int len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -6258,8 +4880,8 @@
   char *new_value;
   if (orig_value && *orig_value)
     {
-      size_t orig_value_len = strlen (orig_value);
-      size_t add_len = strlen (add);
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -6290,10 +4912,10 @@
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      size_t len = strlen (new_value);
-      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[--len] = '\0';
+          new_value[len-1] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -6460,47 +5082,27 @@
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $debug_cmd
-
+    $opt_debug
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
     esac
 }
 
-# func_suncc_cstd_abi
-# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
-# Several compiler flags select an ABI that is incompatible with the
-# Cstd library. Avoid specifying it if any are in CXXFLAGS.
-func_suncc_cstd_abi ()
-{
-    $debug_cmd
-
-    case " $compile_command " in
-    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
-      suncc_use_cstd_abi=no
-      ;;
-    *)
-      suncc_use_cstd_abi=yes
-      ;;
-    esac
-}
-
 # func_mode_link arg...
 func_mode_link ()
 {
-    $debug_cmd
-
+    $opt_debug
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # what system we are compiling for in order to pass an extra
+      # which system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll that has undefined symbols, in which case not
+      # to make a dll which has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -6544,11 +5146,10 @@
     module=no
     no_install=no
     objs=
-    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=false
+    preload=no
     prev=
     prevarg=
     release=
@@ -6560,7 +5161,7 @@
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module=$wl-single_module
+    single_module="${wl}-single_module"
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -6568,15 +5169,15 @@
     do
       case $arg in
       -shared)
-	test yes != "$build_libtool_libs" \
-	  && func_fatal_configuration "cannot build a shared library"
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -6609,7 +5210,7 @@
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg=$1
+      arg="$1"
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
@@ -6626,21 +5227,21 @@
 
 	case $prev in
 	bindir)
-	  bindir=$arg
+	  bindir="$arg"
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  $preload || {
+	  if test "$preload" = no; then
 	    # Add the symbol object into the linking commands.
 	    func_append compile_command " @SYMFILE@"
 	    func_append finalize_command " @SYMFILE@"
-	    preload=:
-	  }
+	    preload=yes
+	  fi
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test no = "$dlself"; then
+	    if test "$dlself" = no; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -6648,9 +5249,9 @@
 	    continue
 	    ;;
 	  self)
-	    if test dlprefiles = "$prev"; then
+	    if test "$prev" = dlprefiles; then
 	      dlself=yes
-	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -6660,7 +5261,7 @@
 	    continue
 	    ;;
 	  *)
-	    if test dlfiles = "$prev"; then
+	    if test "$prev" = dlfiles; then
 	      func_append dlfiles " $arg"
 	    else
 	      func_append dlprefiles " $arg"
@@ -6671,14 +5272,14 @@
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols=$arg
+	  export_symbols="$arg"
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file '$arg' does not exist"
+	    || func_fatal_error "symbol file \`$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex=$arg
+	  export_symbols_regex="$arg"
 	  prev=
 	  continue
 	  ;;
@@ -6696,13 +5297,7 @@
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir=$arg
-	  prev=
-	  continue
-	  ;;
-	mllvm)
-	  # Clang does not use LLVM to link, so we can simply discard any
-	  # '-mllvm $arg' options when doing the link step.
+	  inst_prefix_dir="$arg"
 	  prev=
 	  continue
 	  ;;
@@ -6726,21 +5321,21 @@
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test none = "$pic_object" &&
-		   test none = "$non_pic_object"; then
-		  func_fatal_error "cannot find name of object for '$arg'"
+		   test "$pic_object" = none &&
+		   test "$non_pic_object" = none; then
+		  func_fatal_error "cannot find name of object for \`$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir=$func_dirname_result
+		xdir="$func_dirname_result"
 
-		if test none != "$pic_object"; then
+		if test "$pic_object" != none; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object=$xdir$pic_object
+		  pic_object="$xdir$pic_object"
 
-		  if test dlfiles = "$prev"; then
-		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
 		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
@@ -6751,7 +5346,7 @@
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test dlprefiles = "$prev"; then
+		  if test "$prev" = dlprefiles; then
 		    # Preload the old-style object.
 		    func_append dlprefiles " $pic_object"
 		    prev=
@@ -6759,23 +5354,23 @@
 
 		  # A PIC object.
 		  func_append libobjs " $pic_object"
-		  arg=$pic_object
+		  arg="$pic_object"
 		fi
 
 		# Non-PIC object.
-		if test none != "$non_pic_object"; then
+		if test "$non_pic_object" != none; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object=$xdir$non_pic_object
+		  non_pic_object="$xdir$non_pic_object"
 
 		  # A standard non-PIC object
 		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test none = "$pic_object"; then
-		    arg=$non_pic_object
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object=$pic_object
+		  non_pic_object="$pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
@@ -6783,7 +5378,7 @@
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir=$func_dirname_result
+		  xdir="$func_dirname_result"
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
@@ -6791,29 +5386,24 @@
 		  func_append libobjs " $pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "'$arg' is not a valid libtool object"
+		  func_fatal_error "\`$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file '$arg' does not exist"
+	    func_fatal_error "link input file \`$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
-	os2dllname)
-	  os2dllname=$arg
-	  prev=
-	  continue
-	  ;;
 	precious_regex)
-	  precious_files_regex=$arg
+	  precious_files_regex="$arg"
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release=-$arg
+	  release="-$arg"
 	  prev=
 	  continue
 	  ;;
@@ -6825,7 +5415,7 @@
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test rpath = "$prev"; then
+	  if test "$prev" = rpath; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
 	    *) func_append rpath " $arg" ;;
@@ -6840,7 +5430,7 @@
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds=$arg
+	  shrext_cmds="$arg"
 	  prev=
 	  continue
 	  ;;
@@ -6880,7 +5470,7 @@
 	esac
       fi # test -n "$prev"
 
-      prevarg=$arg
+      prevarg="$arg"
 
       case $arg in
       -all-static)
@@ -6894,7 +5484,7 @@
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "'-allow-undefined' must not be used because it is the default"
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -6926,7 +5516,7 @@
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test X-export-symbols = "X$arg"; then
+	if test "X$arg" = "X-export-symbols"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -6960,9 +5550,9 @@
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between '-L' and '$1'"
+	    func_fatal_error "require no space between \`-L' and \`$1'"
 	  else
-	    func_fatal_error "need path for '-L' option"
+	    func_fatal_error "need path for \`-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -6973,8 +5563,8 @@
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of '$dir'"
-	  dir=$absdir
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
+	  dir="$absdir"
 	  ;;
 	esac
 	case "$deplibs " in
@@ -7009,7 +5599,7 @@
 	;;
 
       -l*)
-	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -7017,11 +5607,11 @@
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test X-lc = "X$arg" && continue
+	    test "X$arg" = "X-lc" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test X-lc = "X$arg" && continue
+	    test "X$arg" = "X-lc" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
@@ -7030,16 +5620,16 @@
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test X-lc = "X$arg" && continue
+	    test "X$arg" = "X-lc" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test X-lc = "X$arg" && continue
+	    test "X$arg" = "X-lc" && continue
 	    ;;
 	  esac
-	elif test X-lc_r = "X$arg"; then
+	elif test "X$arg" = "X-lc_r"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -7049,11 +5639,6 @@
 	continue
 	;;
 
-      -mllvm)
-	prev=mllvm
-	continue
-	;;
-
       -module)
 	module=yes
 	continue
@@ -7083,7 +5668,7 @@
 	;;
 
       -multi_module)
-	single_module=$wl-multi_module
+	single_module="${wl}-multi_module"
 	continue
 	;;
 
@@ -7097,8 +5682,8 @@
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "'-no-install' is ignored for $host"
-	  func_warning "assuming '-no-fast-install' instead"
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -7116,11 +5701,6 @@
 	continue
 	;;
 
-      -os2dllname)
-	prev=os2dllname
-	continue
-	;;
-
       -o) prev=output ;;
 
       -precious-files-regex)
@@ -7208,14 +5788,14 @@
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs=$IFS; IFS=,
+	save_ifs="$IFS"; IFS=','
 	for flag in $args; do
-	  IFS=$save_ifs
+	  IFS="$save_ifs"
           func_quote_for_eval "$flag"
 	  func_append arg " $func_quote_for_eval_result"
 	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS=$save_ifs
+	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -7224,15 +5804,15 @@
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs=$IFS; IFS=,
+	save_ifs="$IFS"; IFS=','
 	for flag in $args; do
-	  IFS=$save_ifs
+	  IFS="$save_ifs"
           func_quote_for_eval "$flag"
 	  func_append arg " $wl$func_quote_for_eval_result"
 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
 	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS=$save_ifs
+	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -7255,7 +5835,7 @@
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	arg="$func_quote_for_eval_result"
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -7267,46 +5847,25 @@
       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
       # -F/path              path to uninstalled frameworks, gcc on darwin
       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-      # -fstack-protector*   stack protector flags for GCC
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      # -stdlib=*            select c++ std lib with clang
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
         func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	arg="$func_quote_for_eval_result"
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
         continue
         ;;
 
-      -Z*)
-        if test os2 = "`expr $host : '.*\(os2\)'`"; then
-          # OS/2 uses -Zxxx to specify OS/2-specific options
-	  compiler_flags="$compiler_flags $arg"
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  case $arg in
-	  -Zlinker | -Zstack)
-	    prev=xcompiler
-	    ;;
-	  esac
-	  continue
-        else
-	  # Otherwise treat like 'Some other compiler flag' below
-	  func_quote_for_eval "$arg"
-	  arg=$func_quote_for_eval_result
-        fi
-	;;
-
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	arg="$func_quote_for_eval_result"
 	;;
 
       *.$objext)
@@ -7327,21 +5886,21 @@
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test none = "$pic_object" &&
-	     test none = "$non_pic_object"; then
-	    func_fatal_error "cannot find name of object for '$arg'"
+	     test "$pic_object" = none &&
+	     test "$non_pic_object" = none; then
+	    func_fatal_error "cannot find name of object for \`$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir=$func_dirname_result
+	  xdir="$func_dirname_result"
 
-	  test none = "$pic_object" || {
+	  if test "$pic_object" != none; then
 	    # Prepend the subdirectory the object is found in.
-	    pic_object=$xdir$pic_object
+	    pic_object="$xdir$pic_object"
 
-	    if test dlfiles = "$prev"; then
-	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
 		func_append dlfiles " $pic_object"
 		prev=
 		continue
@@ -7352,7 +5911,7 @@
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test dlprefiles = "$prev"; then
+	    if test "$prev" = dlprefiles; then
 	      # Preload the old-style object.
 	      func_append dlprefiles " $pic_object"
 	      prev=
@@ -7360,23 +5919,23 @@
 
 	    # A PIC object.
 	    func_append libobjs " $pic_object"
-	    arg=$pic_object
-	  }
+	    arg="$pic_object"
+	  fi
 
 	  # Non-PIC object.
-	  if test none != "$non_pic_object"; then
+	  if test "$non_pic_object" != none; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object=$xdir$non_pic_object
+	    non_pic_object="$xdir$non_pic_object"
 
 	    # A standard non-PIC object
 	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test none = "$pic_object"; then
-	      arg=$non_pic_object
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object=$pic_object
+	    non_pic_object="$pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
@@ -7384,7 +5943,7 @@
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir=$func_dirname_result
+	    xdir="$func_dirname_result"
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
@@ -7392,7 +5951,7 @@
 	    func_append libobjs " $pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "'$arg' is not a valid libtool object"
+	    func_fatal_error "\`$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -7408,11 +5967,11 @@
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test dlfiles = "$prev"; then
+	if test "$prev" = dlfiles; then
 	  # This library was specified with -dlopen.
 	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test dlprefiles = "$prev"; then
+	elif test "$prev" = dlprefiles; then
 	  # The library was specified with -dlpreopen.
 	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
@@ -7427,7 +5986,7 @@
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	arg="$func_quote_for_eval_result"
 	;;
       esac # arg
 
@@ -7439,9 +5998,9 @@
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the '$prevarg' option requires an argument"
+      func_fatal_help "the \`$prevarg' option requires an argument"
 
-    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       func_append compile_command " $arg"
       func_append finalize_command " $arg"
@@ -7450,23 +6009,20 @@
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname=$func_basename_result
-    libobjs_save=$libobjs
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
-    # Definition is injected by LT_CONFIG during libtool generation.
-    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
-
     func_dirname "$output" "/" ""
-    output_objdir=$func_dirname_result$objdir
+    output_objdir="$func_dirname_result$objdir"
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -7489,7 +6045,7 @@
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps; then
+      if $opt_preserve_dup_deps ; then
 	case "$libs " in
 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
@@ -7497,7 +6053,7 @@
       func_append libs " $deplib"
     done
 
-    if test lib = "$linkmode"; then
+    if test "$linkmode" = lib; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -7529,7 +6085,7 @@
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -7537,7 +6093,7 @@
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=false
+	alldeplibs=no
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -7549,29 +6105,32 @@
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test lib,link = "$linkmode,$pass"; then
+      if test "$linkmode,$pass" = "lib,link"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs=$tmp_deplibs
+	deplibs="$tmp_deplibs"
       fi
 
-      if test lib,link = "$linkmode,$pass" ||
-	 test prog,scan = "$linkmode,$pass"; then
-	libs=$deplibs
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
 	deplibs=
       fi
-      if test prog = "$linkmode"; then
+      if test "$linkmode" = prog; then
 	case $pass in
-	dlopen) libs=$dlfiles ;;
-	dlpreopen) libs=$dlprefiles ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link)
+	  libs="$deplibs %DEPLIBS%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+	  ;;
 	esac
       fi
-      if test lib,dlpreopen = "$linkmode,$pass"; then
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -7592,26 +6151,26 @@
 	    esac
 	  done
 	done
-	libs=$dlprefiles
+	libs="$dlprefiles"
       fi
-      if test dlopen = "$pass"; then
+      if test "$pass" = dlopen; then
 	# Collect dlpreopened libraries
-	save_deplibs=$deplibs
+	save_deplibs="$deplibs"
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=false
+	found=no
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test prog,link = "$linkmode,$pass"; then
+	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    func_append compiler_flags " $deplib"
-	    if test lib = "$linkmode"; then
+	    if test "$linkmode" = lib ; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -7621,13 +6180,13 @@
 	  continue
 	  ;;
 	-l*)
-	  if test lib != "$linkmode" && test prog != "$linkmode"; then
-	    func_warning "'-l' is ignored for archives/objects"
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    func_warning "\`-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test lib = "$linkmode"; then
+	  if test "$linkmode" = lib; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -7635,22 +6194,31 @@
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib=$searchdir/lib$name$search_ext
+	      lib="$searchdir/lib${name}${search_ext}"
 	      if test -f "$lib"; then
-		if test .la = "$search_ext"; then
-		  found=:
+		if test "$search_ext" = ".la"; then
+		  found=yes
 		else
-		  found=false
+		  found=no
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if $found; then
-	    # deplib is a libtool library
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -7658,19 +6226,19 @@
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll=$l
+		    ll="$l"
 		  done
-		  if test "X$ll" = "X$old_library"; then # only static version available
-		    found=false
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
 		    func_dirname "$lib" "" "."
-		    ladir=$func_dirname_result
+		    ladir="$func_dirname_result"
 		    lib=$ladir/$old_library
-		    if test prog,link = "$linkmode,$pass"; then
+		    if test "$linkmode,$pass" = "prog,link"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -7679,25 +6247,15 @@
 	      *) ;;
 	      esac
 	    fi
-	  else
-	    # deplib doesn't seem to be a libtool library
-	    if test prog,link = "$linkmode,$pass"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test prog,link = "$linkmode,$pass"; then
+	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test lib = "$linkmode"; then
+	    if test "$linkmode" = lib ; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -7710,18 +6268,18 @@
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test conv = "$pass" && continue
+	    test "$pass" = conv && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test conv = "$pass"; then
+	    if test "$pass" = conv; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test scan = "$pass"; then
+	    if test "$pass" = scan; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -7732,13 +6290,13 @@
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "'-L' is ignored for archives/objects"
+	    func_warning "\`-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test link = "$pass"; then
+	  if test "$pass" = link; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
@@ -7756,7 +6314,7 @@
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test conv = "$pass"; then
+	  if test "$pass" = conv; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -7767,26 +6325,21 @@
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=false
+	      valid_a_lib=no
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=:
+		    valid_a_lib=yes
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=:
+		  valid_a_lib=yes
 		;;
 	      esac
-	      if $valid_a_lib; then
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
-	      else
+	      if test "$valid_a_lib" != yes; then
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -7794,13 +6347,18 @@
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
+	      else
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test link != "$pass"; then
+	    if test "$pass" != link; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -7811,10 +6369,10 @@
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test conv = "$pass"; then
+	  if test "$pass" = conv; then
 	    deplibs="$deplib $deplibs"
-	  elif test prog = "$linkmode"; then
-	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
 	      func_append newdlprefiles " $deplib"
@@ -7827,20 +6385,22 @@
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=:
+	  alldeplibs=yes
 	  continue
 	  ;;
 	esac # case $deplib
 
-	$found || test -f "$lib" \
-	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+	fi
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "'$lib' is not a valid libtool archive"
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir=$func_dirname_result
+	ladir="$func_dirname_result"
 
 	dlname=
 	dlopen=
@@ -7870,36 +6430,36 @@
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test lib,link = "$linkmode,$pass" ||
-	   test prog,scan = "$linkmode,$pass" ||
-	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test conv = "$pass"; then
+	if test "$pass" = conv; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for '$lib'"
+	      func_fatal_error "cannot find name of link library for \`$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
-	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
-	    func_fatal_error "'$lib' is not a convenience library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      if $opt_preserve_dup_deps ; then
+		case "$tmp_libs " in
+		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+		esac
+	      fi
+	      func_append tmp_libs " $deplib"
+	    done
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
 	  continue
 	fi # $pass = conv
 
@@ -7907,26 +6467,26 @@
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test yes = "$prefer_static_libs" ||
-	     test built,no = "$prefer_static_libs,$installed"; }; then
+	   { test "$prefer_static_libs" = yes ||
+	     test "$prefer_static_libs,$installed" = "built,no"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib=$l
+	    linklib="$l"
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for '$lib'"
+	  func_fatal_error "cannot find name of link library for \`$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test dlopen = "$pass"; then
-	  test -z "$libdir" \
-	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+	  fi
 	  if test -z "$dlname" ||
-	     test yes != "$dlopen_support" ||
-	     test no = "$build_libtool_libs"
-	  then
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -7940,40 +6500,40 @@
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of '$ladir'"
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir=$ladir
+	    abs_ladir="$ladir"
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname=$func_basename_result
+	laname="$func_basename_result"
 
 	# Find the relevant object directory and library name.
-	if test yes = "$installed"; then
+	if test "X$installed" = Xyes; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library '$lib' was moved."
-	    dir=$ladir
-	    absdir=$abs_ladir
-	    libdir=$abs_ladir
+	    func_warning "library \`$lib' was moved."
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
 	  else
-	    dir=$lt_sysroot$libdir
-	    absdir=$lt_sysroot$libdir
+	    dir="$lt_sysroot$libdir"
+	    absdir="$lt_sysroot$libdir"
 	  fi
-	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir=$ladir
-	    absdir=$abs_ladir
+	    dir="$ladir"
+	    absdir="$abs_ladir"
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir=$ladir/$objdir
-	    absdir=$abs_ladir/$objdir
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  fi
@@ -7982,11 +6542,11 @@
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test dlpreopen = "$pass"; then
-	  if test -z "$libdir" && test prog = "$linkmode"; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
 	  fi
-	  case $host in
+	  case "$host" in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -8030,9 +6590,9 @@
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test lib = "$linkmode"; then
+	  if test "$linkmode" = lib; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test prog,link = "$linkmode,$pass"; then
+	  elif test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -8042,14 +6602,14 @@
 	fi
 
 
-	if test prog = "$linkmode" && test link != "$pass"; then
+	if test "$linkmode" = prog && test "$pass" != link; then
 	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=false
-	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
-	     test no = "$build_libtool_libs"; then
-	    linkalldeplibs=:
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
 	  fi
 
 	  tmp_libs=
@@ -8061,14 +6621,14 @@
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if $linkalldeplibs; then
+	    if test "$linkalldeplibs" = yes; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps; then
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -8078,15 +6638,15 @@
 	  continue
 	fi # $linkmode = prog...
 
-	if test prog,link = "$linkmode,$pass"; then
+	if test "$linkmode,$pass" = "prog,link"; then
 	  if test -n "$library_names" &&
-	     { { test no = "$prefer_static_libs" ||
-	         test built,yes = "$prefer_static_libs,$installed"; } ||
+	     { { test "$prefer_static_libs" = no ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 	      # Make sure the rpath contains only unique directories.
-	      case $temp_rpath: in
+	      case "$temp_rpath:" in
 	      *"$absdir:"*) ;;
 	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
@@ -8115,9 +6675,9 @@
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if $alldeplibs &&
-	     { test pass_all = "$deplibs_check_method" ||
-	       { test yes = "$build_libtool_libs" &&
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -8126,19 +6686,19 @@
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test built = "$use_static_libs" && test yes = "$installed"; then
+	if test "$use_static_libs" = built && test "$installed" = yes; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
 	  case $host in
-	  *cygwin* | *mingw* | *cegcc* | *os2*)
+	  *cygwin* | *mingw* | *cegcc*)
 	      # No point in relinking DLLs because paths are not encoded
 	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
-	    if test no = "$installed"; then
+	    if test "$installed" = no; then
 	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
@@ -8148,24 +6708,24 @@
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=
+	  dlopenmodule=""
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule=$dlpremoduletest
+	      dlopenmodule="$dlpremoduletest"
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
 	    echo
-	    if test prog = "$linkmode"; then
+	    if test "$linkmode" = prog; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test lib = "$linkmode" &&
-	     test yes = "$hardcode_into_libs"; then
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -8193,43 +6753,43 @@
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname=$1
+	    realname="$1"
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname=$dlname
+	      soname="$dlname"
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw* | *cegcc* | *os2*)
+	      *cygwin* | mingw* | *cegcc*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix=-$major
+		versuffix="-$major"
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname=$realname
+	      soname="$realname"
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot=$soname
+	    soroot="$soname"
 	    func_basename "$soroot"
-	    soname=$func_basename_result
+	    soname="$func_basename_result"
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from '$soname'"
+	      func_verbose "extracting exported symbol list from \`$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for '$soname'"
+	      func_verbose "generating import library for \`$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -8237,58 +6797,58 @@
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
+	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test no = "$hardcode_direct"; then
-		add=$dir/$linklib
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
-		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir=-L$dir ;;
+		    *-*-unixware7*) add_dir="-L$dir" ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we cannot
+		    # if the lib is a (non-dlopened) module then we can not
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null; then
+			 $GREP ": [^:]* bundle" >/dev/null ; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library"; then
+			if test -z "$old_library" ; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add=$dir/$old_library
+			  add="$dir/$old_library"
 			fi
 		      elif test -n "$old_library"; then
-			add=$dir/$old_library
+			add="$dir/$old_library"
 		      fi
 		    fi
 		esac
-	      elif test no = "$hardcode_minus_L"; then
+	      elif test "$hardcode_minus_L" = no; then
 		case $host in
-		*-*-sunos*) add_shlibpath=$dir ;;
+		*-*-sunos*) add_shlibpath="$dir" ;;
 		esac
-		add_dir=-L$dir
-		add=-l$name
-	      elif test no = "$hardcode_shlibpath_var"; then
-		add_shlibpath=$dir
-		add=-l$name
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test yes = "$hardcode_direct" &&
-	         test no = "$hardcode_direct_absolute"; then
-		add=$dir/$linklib
-	      elif test yes = "$hardcode_minus_L"; then
-		add_dir=-L$absdir
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$absdir"
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -8297,10 +6857,10 @@
 		      ;;
 		  esac
 		fi
-		add=-l$name
-	      elif test yes = "$hardcode_shlibpath_var"; then
-		add_shlibpath=$dir
-		add=-l$name
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
 	      else
 		lib_linked=no
 	      fi
@@ -8308,7 +6868,7 @@
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test yes != "$lib_linked"; then
+	    if test "$lib_linked" != yes; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
@@ -8318,15 +6878,15 @@
 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test prog = "$linkmode"; then
+	    if test "$linkmode" = prog; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test yes != "$hardcode_direct" &&
-		 test yes != "$hardcode_minus_L" &&
-		 test yes = "$hardcode_shlibpath_var"; then
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
+		 test "$hardcode_shlibpath_var" = yes; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
 		*) func_append finalize_shlibpath "$libdir:" ;;
@@ -8335,33 +6895,33 @@
 	    fi
 	  fi
 
-	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
+	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test yes = "$hardcode_direct" &&
-	       test no = "$hardcode_direct_absolute"; then
-	      add=$libdir/$linklib
-	    elif test yes = "$hardcode_minus_L"; then
-	      add_dir=-L$libdir
-	      add=-l$name
-	    elif test yes = "$hardcode_shlibpath_var"; then
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
 	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add=-l$name
-	    elif test yes = "$hardcode_automatic"; then
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib"; then
-		add=$inst_prefix_dir$libdir/$linklib
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+		add="$inst_prefix_dir$libdir/$linklib"
 	      else
-		add=$libdir/$linklib
+		add="$libdir/$linklib"
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir=-L$libdir
+	      add_dir="-L$libdir"
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
@@ -8370,10 +6930,10 @@
 		    ;;
 		esac
 	      fi
-	      add=-l$name
+	      add="-l$name"
 	    fi
 
-	    if test prog = "$linkmode"; then
+	    if test "$linkmode" = prog; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -8381,43 +6941,43 @@
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test prog = "$linkmode"; then
+	elif test "$linkmode" = prog; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test unsupported != "$hardcode_direct"; then
-	    test -n "$old_library" && linklib=$old_library
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test yes = "$build_libtool_libs"; then
+	elif test "$build_libtool_libs" = yes; then
 	  # Not a shared library
-	  if test pass_all != "$deplibs_check_method"; then
+	  if test "$deplibs_check_method" != pass_all; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test yes = "$module"; then
+	    if test "$module" = yes; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** 'nm' from GNU binutils and a full rebuild may help."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test no = "$build_old_libs"; then
+	      if test "$build_old_libs" = no; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8430,11 +6990,11 @@
 	  fi
 	fi # link shared/static library?
 
-	if test lib = "$linkmode"; then
+	if test "$linkmode" = lib; then
 	  if test -n "$dependency_libs" &&
-	     { test yes != "$hardcode_into_libs" ||
-	       test yes = "$build_old_libs" ||
-	       test yes = "$link_static"; }; then
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -8448,12 +7008,12 @@
 	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs=$temp_deplibs
+	    dependency_libs="$temp_deplibs"
 	  fi
 
 	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -8463,7 +7023,7 @@
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps; then
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -8472,12 +7032,12 @@
 	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test no != "$link_all_deplibs"; then
+	  if test "$link_all_deplibs" != no; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path=$deplib ;;
+	      -L*) path="$deplib" ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -8485,12 +7045,12 @@
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of '$dir'"
-		    absdir=$dir
+		    func_warning "cannot determine absolute directory name of \`$dir'"
+		    absdir="$dir"
 		  fi
 		  ;;
 		esac
@@ -8498,35 +7058,35 @@
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names"; then
-		    for tmp in $deplibrary_names; do
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl"; then
-		      depdepl=$absdir/$objdir/$depdepl
-		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
-		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
+		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path=-L$absdir/$objdir
+		  path="-L$absdir/$objdir"
 		  ;;
 		esac
 		else
-		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "'$deplib' is not a valid libtool archive"
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "'$deplib' seems to be moved"
+		    func_warning "\`$deplib' seems to be moved"
 
-		  path=-L$absdir
+		  path="-L$absdir"
 		fi
 		;;
 	      esac
@@ -8538,23 +7098,23 @@
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test link = "$pass"; then
-	if test prog = "$linkmode"; then
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs=$newdependency_libs
-      if test dlpreopen = "$pass"; then
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test dlopen != "$pass"; then
-	test conv = "$pass" || {
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
@@ -8564,12 +7124,12 @@
 	    esac
 	  done
 	  newlib_search_path=
-	}
+	fi
 
-	if test prog,link = "$linkmode,$pass"; then
-	  vars="compile_deplibs finalize_deplibs"
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
 	else
-	  vars=deplibs
+	  vars="compile_deplibs finalize_deplibs"
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -8627,93 +7187,62 @@
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
-
-      # Add Sun CC postdeps if required:
-      test CXX = "$tagname" && {
-        case $host_os in
-        linux*)
-          case `$CC -V 2>&1 | sed 5q` in
-          *Sun\ C*) # Sun C++ 5.9
-            func_suncc_cstd_abi
-
-            if test no != "$suncc_use_cstd_abi"; then
-              func_append postdeps ' -library=Cstd -library=Crun'
-            fi
-            ;;
-          esac
-          ;;
-
-        solaris*)
-          func_cc_basename "$CC"
-          case $func_cc_basename_result in
-          CC* | sunCC*)
-            func_suncc_cstd_abi
-
-            if test no != "$suncc_use_cstd_abi"; then
-              func_append postdeps ' -library=Cstd -library=Crun'
-            fi
-            ;;
-          esac
-          ;;
-        esac
-      }
-
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs; do
+      for i in $dependency_libs ; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=
+	  i=""
 	  ;;
 	esac
-	if test -n "$i"; then
+	if test -n "$i" ; then
 	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test prog = "$linkmode"; then
-      dlfiles=$newdlfiles
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
     fi
-    if test prog = "$linkmode" || test lib = "$linkmode"; then
-      dlprefiles=$newdlprefiles
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-	func_warning "'-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "'-l' and '-L' are ignored for archives" ;;
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "'-rpath' is ignored for archives"
+	func_warning "\`-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "'-R' is ignored for archives"
+	func_warning "\`-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "'-version-info/-version-number' is ignored for archives"
+	func_warning "\`-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "'-release' is ignored for archives"
+	func_warning "\`-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "'-export-symbols' is ignored for archives"
+	func_warning "\`-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs=$output
+      oldlibs="$output"
       func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form 'libNAME.la'.
+      # Make sure we only generate libraries of the form `libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -8722,10 +7251,10 @@
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test no = "$module" \
-	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
 
-	if test no != "$need_lib_prefix"; then
+	if test "$need_lib_prefix" != no; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -8739,8 +7268,8 @@
       esac
 
       if test -n "$objs"; then
-	if test pass_all != "$deplibs_check_method"; then
-	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
+	if test "$deplibs_check_method" != pass_all; then
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -8749,21 +7278,21 @@
 	fi
       fi
 
-      test no = "$dlself" \
-	|| func_warning "'-dlopen self' is ignored for libtool libraries"
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test 1 -lt "$#" \
-	&& func_warning "ignoring multiple '-rpath's for a libtool library"
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
 
-      install_libdir=$1
+      install_libdir="$1"
 
       oldlibs=
       if test -z "$rpath"; then
-	if test yes = "$build_libtool_libs"; then
+	if test "$build_libtool_libs" = yes; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a '.al' extension so
+	  # Some compilers have problems with a `.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -8772,20 +7301,20 @@
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "'-release' is ignored for convenience libraries"
+	  func_warning "\`-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs=$IFS; IFS=:
+	save_ifs="$IFS"; IFS=':'
 	set dummy $vinfo 0 0 0
 	shift
-	IFS=$save_ifs
+	IFS="$save_ifs"
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to '-version-info'"
+	  func_fatal_help "too many parameters to \`-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -8793,42 +7322,45 @@
 
 	case $vinfo_number in
 	yes)
-	  number_major=$1
-	  number_minor=$2
-	  number_revision=$3
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # that has an extra 1 added just for fun
+	  # which has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
-	  darwin|freebsd-elf|linux|osf|windows|none)
+	  darwin|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age=$number_minor
-	    revision=$number_revision
+	    age="$number_minor"
+	    revision="$number_revision"
 	    ;;
-	  freebsd-aout|qnx|sunos)
-	    current=$number_major
-	    revision=$number_minor
-	    age=0
+	  freebsd-aout|freebsd-elf|qnx|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age=$number_minor
-	    revision=$number_minor
+	    age="$number_minor"
+	    revision="$number_minor"
 	    lt_irix_increment=no
 	    ;;
+	  *)
+	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+	    ;;
 	  esac
 	  ;;
 	no)
-	  current=$1
-	  revision=$2
-	  age=$3
+	  current="$1"
+	  revision="$2"
+	  age="$3"
 	  ;;
 	esac
 
@@ -8836,30 +7368,30 @@
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT '$current' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION '$revision' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE '$age' must be a nonnegative integer"
-	  func_fatal_error "'$vinfo' is not valid version information"
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE '$age' is greater than the current interface number '$current'"
-	  func_fatal_error "'$vinfo' is not valid version information"
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -8874,36 +7406,26 @@
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
+	  versuffix="$major.$age.$revision"
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-          # On Darwin other compilers
-          case $CC in
-              nagfor*)
-                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
-                  ;;
-              *)
-                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-                  ;;
-          esac
 	  ;;
 
 	freebsd-aout)
-	  major=.$current
-	  versuffix=.$current.$revision
+	  major=".$current"
+	  versuffix=".$current.$revision";
 	  ;;
 
 	freebsd-elf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
+	  major=".$current"
+	  versuffix=".$current"
 	  ;;
 
 	irix | nonstopux)
-	  if test no = "$lt_irix_increment"; then
+	  if test "X$lt_irix_increment" = "Xno"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -8914,74 +7436,69 @@
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring=$verstring_prefix$major.$revision
+	  verstring="$verstring_prefix$major.$revision"
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test 0 -ne "$loop"; do
+	  while test "$loop" -ne 0; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring=$verstring_prefix$major.$iface:$verstring
+	    verstring="$verstring_prefix$major.$iface:$verstring"
 	  done
 
-	  # Before this point, $major must not contain '.'.
+	  # Before this point, $major must not contain `.'.
 	  major=.$major
-	  versuffix=$major.$revision
+	  versuffix="$major.$revision"
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=$major.$age.$revision
+	  versuffix="$major.$age.$revision"
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=.$current.$age.$revision
-	  verstring=$current.$age.$revision
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test 0 -ne "$loop"; do
+	  while test "$loop" -ne 0; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring=$verstring:$iface.0
+	    verstring="$verstring:${iface}.0"
 	  done
 
 	  # Make executables depend on our current version.
-	  func_append verstring ":$current.0"
+	  func_append verstring ":${current}.0"
 	  ;;
 
 	qnx)
-	  major=.$current
-	  versuffix=.$current
-	  ;;
-
-	sco)
-	  major=.$current
-	  versuffix=.$current
+	  major=".$current"
+	  versuffix=".$current"
 	  ;;
 
 	sunos)
-	  major=.$current
-	  versuffix=.$current.$revision
+	  major=".$current"
+	  versuffix=".$current.$revision"
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 file systems.
+	  # extension on DOS 8.3 filesystems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix=-$major
+	  versuffix="-$major"
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type '$version_type'"
+	  func_fatal_configuration "unknown library version type \`$version_type'"
 	  ;;
 	esac
 
@@ -8995,45 +7512,42 @@
 	    verstring=
 	    ;;
 	  *)
-	    verstring=0.0
+	    verstring="0.0"
 	    ;;
 	  esac
-	  if test no = "$need_version"; then
+	  if test "$need_version" = no; then
 	    versuffix=
 	  else
-	    versuffix=.0.0
+	    versuffix=".0.0"
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test yes,no = "$avoid_version,$need_version"; then
+	if test "$avoid_version" = yes && test "$need_version" = no; then
 	  major=
 	  versuffix=
-	  verstring=
+	  verstring=""
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test yes = "$allow_undefined"; then
-	  if test unsupported = "$allow_undefined_flag"; then
-	    if test yes = "$build_old_libs"; then
-	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
-	      build_libtool_libs=no
-	    else
-	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
-	    fi
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    func_warning "undefined symbols not allowed in $host shared libraries"
+	    build_libtool_libs=no
+	    build_old_libs=yes
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag=$no_undefined_flag
+	  allow_undefined_flag="$no_undefined_flag"
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" :
+      func_generate_dlsyms "$libname" "$libname" "yes"
       func_append libobjs " $symfileobj"
-      test " " = "$libobjs" && libobjs=
+      test "X$libobjs" = "X " && libobjs=
 
-      if test relink != "$opt_mode"; then
+      if test "$opt_mode" != relink; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -9042,8 +7556,8 @@
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
-	       if test -n "$precious_files_regex"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
@@ -9059,11 +7573,11 @@
       fi
 
       # Now set the variables for building old libraries.
-      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
 	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -9084,13 +7598,13 @@
 	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles=$dlfiles
+      old_dlfiles="$dlfiles"
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
@@ -9100,7 +7614,7 @@
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles=$dlprefiles
+      old_dlprefiles="$dlprefiles"
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
@@ -9109,7 +7623,7 @@
 	esac
       done
 
-      if test yes = "$build_libtool_libs"; then
+      if test "$build_libtool_libs" = yes; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -9133,7 +7647,7 @@
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test yes = "$build_libtool_need_lc"; then
+	    if test "$build_libtool_need_lc" = "yes"; then
 	      func_append deplibs " -lc"
 	    fi
 	    ;;
@@ -9149,9 +7663,9 @@
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=
-	versuffix=
-	major=
+	release=""
+	versuffix=""
+	major=""
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -9180,20 +7694,20 @@
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
 		    func_append newdeplibs " $i"
-		    i=
+		    i=""
 		    ;;
 		  esac
 		fi
-		if test -n "$i"; then
+		if test -n "$i" ; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
@@ -9223,20 +7737,20 @@
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
 		      func_append newdeplibs " $i"
-		      i=
+		      i=""
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i"; then
+		  if test -n "$i" ; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
@@ -9273,24 +7787,24 @@
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=
+		  a_deplib=""
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib"; then
+	      if test -n "$a_deplib" ; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
+		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test yes = "$want_nocaseglob"; then
+		  if test "$want_nocaseglob" = yes; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -9308,25 +7822,25 @@
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib=$potent_lib
+		      potlib="$potent_lib"
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
-			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
 			func_append newdeplibs " $a_deplib"
-			a_deplib=
+			a_deplib=""
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib"; then
+	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -9334,7 +7848,7 @@
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib"; then
+		if test -z "$potlib" ; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -9357,30 +7871,30 @@
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=
+		  a_deplib=""
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib"; then
+	      if test -n "$a_deplib" ; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib=$potent_lib # see symlink-check above in file_magic test
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      func_append newdeplibs " $a_deplib"
-		      a_deplib=
+		      a_deplib=""
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib"; then
+	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -9388,7 +7902,7 @@
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib"; then
+		if test -z "$potlib" ; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -9404,18 +7918,18 @@
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=
+	  newdeplibs=""
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
-	    for i in $predeps $postdeps; do
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test none = "$deplibs_check_method"; then
+	    if test "X$deplibs_check_method" = "Xnone"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -9439,8 +7953,8 @@
 	  ;;
 	esac
 
-	if test yes = "$droppeddeps"; then
-	  if test yes = "$module"; then
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -9449,12 +7963,12 @@
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test no = "$build_old_libs"; then
-	      oldlibs=$output_objdir/$libname.$libext
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -9465,14 +7979,14 @@
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test no = "$allow_undefined"; then
+	    if test "$allow_undefined" = no; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test no = "$build_old_libs"; then
-		oldlibs=$output_objdir/$libname.$libext
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -9518,7 +8032,7 @@
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs=$new_libs
+      deplibs="$new_libs"
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -9526,25 +8040,25 @@
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test yes = "$build_libtool_libs"; then
-	# Remove $wl instances when linking with ld.
+      if test "$build_libtool_libs" = yes; then
+	# Remove ${wl} instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test yes = "$hardcode_into_libs"; then
+	if test "$hardcode_into_libs" = yes; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath=$finalize_rpath
-	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+	  rpath="$finalize_rpath"
+	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs=$libdir
+		  hardcode_libdirs="$libdir"
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -9569,7 +8083,7 @@
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir=$hardcode_libdirs
+	    libdir="$hardcode_libdirs"
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -9583,8 +8097,8 @@
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath=$finalize_shlibpath
-	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
+	shlibpath="$finalize_shlibpath"
+	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -9594,19 +8108,19 @@
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname=$1
+	realname="$1"
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname=$realname
+	  soname="$realname"
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib=$output_objdir/$realname
+	lib="$output_objdir/$realname"
 	linknames=
 	for link
 	do
@@ -9620,7 +8134,7 @@
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols=$output_objdir/$libname.uexp
+	  export_symbols="$output_objdir/$libname.uexp"
 	  func_append delfiles " $export_symbols"
 	fi
 
@@ -9629,31 +8143,31 @@
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    func_dll_def_p "$export_symbols" || {
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols=$export_symbols
+	      orig_export_symbols="$export_symbols"
 	      export_symbols=
 	      always_export_symbols=yes
-	    }
+	    fi
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for '$libname.la'"
-	    export_symbols=$output_objdir/$libname.exp
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs=$IFS; IFS='~'
+	    save_ifs="$IFS"; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS=$save_ifs
+	      IFS="$save_ifs"
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -9667,7 +8181,7 @@
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test yes = "$try_normal_branch" \
+	      if test "$try_normal_branch" = yes \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -9678,7 +8192,7 @@
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=$output_objdir/$output_la.nm
+		output=${output_objdir}/${output_la}.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 		func_append delfiles " $output"
@@ -9701,8 +8215,8 @@
 		break
 	      fi
 	    done
-	    IFS=$save_ifs
-	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -9710,16 +8224,16 @@
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols=$export_symbols
-	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands, which not all seds can handle. GNU sed should be fine
+	  # 's' commands which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
@@ -9738,11 +8252,11 @@
 	    ;;
 	  esac
 	done
-	deplibs=$tmp_deplibs
+	deplibs="$tmp_deplibs"
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test yes = "$compiler_needs_object" &&
+	    test "$compiler_needs_object" = yes &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -9753,7 +8267,7 @@
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop=$output_objdir/${outputname}x
+	    gentop="$output_objdir/${outputname}x"
 	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
@@ -9762,18 +8276,18 @@
 	  fi
 	fi
 
-	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test relink = "$opt_mode"; then
+	if test "$opt_mode" = relink; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test yes = "$module" && test -n "$module_cmds"; then
+	if test "$module" = yes && test -n "$module_cmds" ; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -9791,7 +8305,7 @@
 	  fi
 	fi
 
-	if test : != "$skipped_export" &&
+	if test "X$skipped_export" != "X:" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -9824,8 +8338,8 @@
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
-	    output=$output_objdir/$output_la.lnkscript
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -9837,14 +8351,14 @@
 	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
-	    output=$output_objdir/$output_la.lnk
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test yes = "$compiler_needs_object"; then
+	    if test "$compiler_needs_object" = yes; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -9859,7 +8373,7 @@
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-$k.$objext
+	      output=$output_objdir/$output_la-${k}.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -9871,13 +8385,13 @@
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test -z "$objlist" ||
+		if test "X$objlist" = X ||
 		   test "$len" -lt "$max_cmd_len"; then
 		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test 1 -eq "$k"; then
+		  if test "$k" -eq 1 ; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -9887,10 +8401,10 @@
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-$k.$objext
+		  last_robj=$output_objdir/$output_la-${k}.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-$k.$objext
+		  output=$output_objdir/$output_la-${k}.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -9902,9 +8416,9 @@
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
 	      fi
 	      func_append delfiles " $output"
 
@@ -9912,9 +8426,9 @@
 	      output=
 	    fi
 
-	    ${skipped_export-false} && {
-	      func_verbose "generating symbol list for '$libname.la'"
-	      export_symbols=$output_objdir/$libname.exp
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -9923,16 +8437,16 @@
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    }
+	    fi
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs=$IFS; IFS='~'
+	    save_ifs="$IFS"; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS=$save_ifs
-	      $opt_quiet || {
+	      IFS="$save_ifs"
+	      $opt_silent || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -9940,7 +8454,7 @@
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test relink = "$opt_mode"; then
+		if test "$opt_mode" = relink; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -9949,7 +8463,7 @@
 		exit $lt_exit
 	      }
 	    done
-	    IFS=$save_ifs
+	    IFS="$save_ifs"
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -9957,18 +8471,18 @@
 	    fi
 	  fi
 
-          ${skipped_export-false} && {
+          if ${skipped_export-false}; then
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols=$export_symbols
-	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands, which not all seds can handle. GNU sed should be fine
+	      # 's' commands which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
@@ -9977,7 +8491,7 @@
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  }
+	  fi
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -9991,7 +8505,7 @@
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test yes = "$module" && test -n "$module_cmds"; then
+	  if test "$module" = yes && test -n "$module_cmds" ; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -10013,7 +8527,7 @@
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop=$output_objdir/${outputname}x
+	  gentop="$output_objdir/${outputname}x"
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -10021,12 +8535,11 @@
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs=$IFS; IFS='~'
+	save_ifs="$IFS"; IFS='~'
 	for cmd in $cmds; do
-	  IFS=$sp$nl
+	  IFS="$save_ifs"
 	  eval cmd=\"$cmd\"
-	  IFS=$save_ifs
-	  $opt_quiet || {
+	  $opt_silent || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -10034,7 +8547,7 @@
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test relink = "$opt_mode"; then
+	    if test "$opt_mode" = relink; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -10043,10 +8556,10 @@
 	    exit $lt_exit
 	  }
 	done
-	IFS=$save_ifs
+	IFS="$save_ifs"
 
 	# Restore the uninstalled library and exit
-	if test relink = "$opt_mode"; then
+	if test "$opt_mode" = relink; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -10066,39 +8579,39 @@
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test yes = "$module" || test yes = "$export_dynamic"; then
+	if test "$module" = yes || test "$export_dynamic" = yes; then
 	  # On all known operating systems, these are identical.
-	  dlname=$soname
+	  dlname="$soname"
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
-	func_warning "'-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "'-l' and '-L' are ignored for objects" ;;
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "'-rpath' is ignored for objects"
+	func_warning "\`-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "'-R' is ignored for objects"
+	func_warning "\`-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "'-version-info' is ignored for objects"
+	func_warning "\`-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "'-release' is ignored for objects"
+	func_warning "\`-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -10106,7 +8619,7 @@
 	;;
       *)
 	libobj=
-	obj=$output
+	obj="$output"
 	;;
       esac
 
@@ -10119,19 +8632,17 @@
       # the extraction.
       reload_conv_objs=
       gentop=
-      # if reload_cmds runs $LD directly, get rid of -Wl from
-      # whole_archive_flag_spec and hope we can get by with turning comma
-      # into space.
-      case $reload_cmds in
-        *\$LD[\ \$]*) wl= ;;
-      esac
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
-	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
+	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 	else
-	  gentop=$output_objdir/${obj}x
+	  gentop="$output_objdir/${obj}x"
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
@@ -10140,12 +8651,12 @@
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
 
       # Create the old-style object.
-      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
-      output=$obj
+      output="$obj"
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -10157,7 +8668,7 @@
 	exit $EXIT_SUCCESS
       fi
 
-      test yes = "$build_libtool_libs" || {
+      if test "$build_libtool_libs" != yes; then
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -10167,12 +8678,12 @@
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      }
+      fi
 
-      if test -n "$pic_flag" || test default != "$pic_mode"; then
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output=$libobj
+	output="$libobj"
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -10189,14 +8700,16 @@
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "'-version-info' is ignored for programs"
+	func_warning "\`-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "'-release' is ignored for programs"
+	func_warning "\`-release' is ignored for programs"
 
-      $preload \
-	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
-	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -10210,11 +8723,11 @@
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test CXX = "$tagname"; then
+	if test "$tagname" = CXX ; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      func_append compile_command " $wl-bind_at_load"
-	      func_append finalize_command " $wl-bind_at_load"
+	      func_append compile_command " ${wl}-bind_at_load"
+	      func_append finalize_command " ${wl}-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -10250,7 +8763,7 @@
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs=$new_libs
+      compile_deplibs="$new_libs"
 
 
       func_append compile_command " $compile_deplibs"
@@ -10274,7 +8787,7 @@
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs=$libdir
+	      hardcode_libdirs="$libdir"
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -10297,7 +8810,7 @@
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
@@ -10314,10 +8827,10 @@
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir=$hardcode_libdirs
+	libdir="$hardcode_libdirs"
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath=$rpath
+      compile_rpath="$rpath"
 
       rpath=
       hardcode_libdirs=
@@ -10325,7 +8838,7 @@
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs=$libdir
+	      hardcode_libdirs="$libdir"
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -10350,43 +8863,45 @@
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir=$hardcode_libdirs
+	libdir="$hardcode_libdirs"
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath=$rpath
+      finalize_rpath="$rpath"
 
-      if test -n "$libobjs" && test yes = "$build_old_libs"; then
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" false
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=:
+      wrappers_required=yes
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=false
+        wrappers_required=no
         ;;
       *cygwin* | *mingw* )
-        test yes = "$build_libtool_libs" || wrappers_required=false
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
         ;;
       *)
-        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
-          wrappers_required=false
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
         fi
         ;;
       esac
-      $wrappers_required || {
+      if test "$wrappers_required" = no; then
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command=$compile_command$compile_rpath
+	link_command="$compile_command$compile_rpath"
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -10399,12 +8914,12 @@
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.$objext"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
 	fi
 
 	exit $exit_status
-      }
+      fi
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -10434,9 +8949,9 @@
 	fi
       fi
 
-      if test yes = "$no_install"; then
+      if test "$no_install" = yes; then
 	# We don't need to create a wrapper script.
-	link_command=$compile_var$compile_command$compile_rpath
+	link_command="$compile_var$compile_command$compile_rpath"
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -10453,28 +8968,27 @@
 	exit $EXIT_SUCCESS
       fi
 
-      case $hardcode_action,$fast_install in
-        relink,*)
-	  # Fast installation is not supported
-	  link_command=$compile_var$compile_command$compile_rpath
-	  relink_command=$finalize_var$finalize_command$finalize_rpath
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
 
-	  func_warning "this platform does not like uninstalled shared libraries"
-	  func_warning "'$output' will be relinked during installation"
-	  ;;
-        *,yes)
-	  link_command=$finalize_var$compile_command$finalize_rpath
-	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-          ;;
-	*,no)
-	  link_command=$compile_var$compile_command$compile_rpath
-	  relink_command=$finalize_var$finalize_command$finalize_rpath
-          ;;
-	*,needless)
-	  link_command=$finalize_var$compile_command$finalize_rpath
-	  relink_command=
-          ;;
-      esac
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -10531,8 +9045,8 @@
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource=$output_path/$objdir/lt-$output_name.c
-	    cwrapper=$output_path/$output_name.exe
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -10553,7 +9067,7 @@
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host"; then
+	      if test "x$build" = "x$host" ; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -10576,27 +9090,25 @@
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      case $build_libtool_libs in
-        convenience)
-	  oldobjs="$libobjs_save $symfileobj"
-	  addlibs=$convenience
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save $symfileobj"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
 	  build_libtool_libs=no
-	  ;;
-	module)
-	  oldobjs=$libobjs_save
-	  addlibs=$old_convenience
-	  build_libtool_libs=no
-          ;;
-	*)
+	else
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  $preload && test -f "$symfileobj" \
-	    && func_append oldobjs " $symfileobj"
-	  addlibs=$old_convenience
-	  ;;
-      esac
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    func_append oldobjs " $symfileobj"
+	  fi
+	fi
+	addlibs="$old_convenience"
+      fi
 
       if test -n "$addlibs"; then
-	gentop=$output_objdir/${outputname}x
+	gentop="$output_objdir/${outputname}x"
 	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
@@ -10604,13 +9116,13 @@
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop=$output_objdir/${outputname}x
+	  gentop="$output_objdir/${outputname}x"
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -10631,7 +9143,7 @@
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop=$output_objdir/${outputname}x
+	  gentop="$output_objdir/${outputname}x"
 	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
@@ -10640,7 +9152,7 @@
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase=$func_basename_result
+	    objbase="$func_basename_result"
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -10709,18 +9221,18 @@
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj"; then
+	      if test "$obj" = "$last_oldobj" ; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test -z "$oldobjs"; then
+	  if test "X$oldobjs" = "X" ; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -10737,7 +9249,7 @@
     case $output in
     *.la)
       old_library=
-      test yes = "$build_old_libs" && old_library=$libname.$libext
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -10752,31 +9264,31 @@
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test yes = "$hardcode_automatic"; then
+      if test "$hardcode_automatic" = yes ; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test yes = "$installed"; then
+	  if test "$installed" = yes; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output=$output_objdir/${outputname}i
+	    output="$output_objdir/$outputname"i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name=$func_basename_result
+		name="$func_basename_result"
 		func_resolve_sysroot "$deplib"
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "'$deplib' is not a valid libtool archive"
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
@@ -10792,23 +9304,23 @@
 	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs=$newdependency_libs
+	    dependency_libs="$newdependency_libs"
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name=$func_basename_result
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "'$lib' is not a valid libtool archive"
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles=$newdlfiles
+	    dlfiles="$newdlfiles"
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -10818,34 +9330,34 @@
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name=$func_basename_result
-		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "'$lib' is not a valid libtool archive"
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles=$newdlprefiles
+	    dlprefiles="$newdlprefiles"
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles=$newdlfiles
+	    dlfiles="$newdlfiles"
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles=$newdlprefiles
+	    dlprefiles="$newdlprefiles"
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -10861,9 +9373,10 @@
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test -n "$bindir"; then
+	      if test "x$bindir" != x ;
+	      then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result/$dlname
+		tdlname=$func_relative_path_result$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -10872,7 +9385,7 @@
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -10886,7 +9399,7 @@
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that cannot go in dependency_libs.
+# Linker flags that can not go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -10912,7 +9425,7 @@
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test no,yes = "$installed,$need_relink"; then
+	  if test "$installed" = no && test "$need_relink" = yes; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -10927,29 +9440,27 @@
     exit $EXIT_SUCCESS
 }
 
-if test link = "$opt_mode" || test relink = "$opt_mode"; then
-  func_mode_link ${1+"$@"}
-fi
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+    func_mode_link ${1+"$@"}
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $debug_cmd
-
-    RM=$nonopt
+    $opt_debug
+    RM="$nonopt"
     files=
-    rmforce=false
+    rmforce=
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic=$magic
+    libtool_install_magic="$magic"
 
     for arg
     do
       case $arg in
-      -f) func_append RM " $arg"; rmforce=: ;;
+      -f) func_append RM " $arg"; rmforce=yes ;;
       -*) func_append RM " $arg" ;;
       *) func_append files " $arg" ;;
       esac
@@ -10962,18 +9473,18 @@
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir=$func_dirname_result
-      if test . = "$dir"; then
-	odir=$objdir
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+	odir="$objdir"
       else
-	odir=$dir/$objdir
+	odir="$dir/$objdir"
       fi
       func_basename "$file"
-      name=$func_basename_result
-      test uninstall = "$opt_mode" && odir=$dir
+      name="$func_basename_result"
+      test "$opt_mode" = uninstall && odir="$dir"
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test clean = "$opt_mode"; then
+      if test "$opt_mode" = clean; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
 	  *) func_append rmdirs " $odir" ;;
@@ -10988,11 +9499,11 @@
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif $rmforce; then
+      elif test "$rmforce" = yes; then
 	continue
       fi
 
-      rmfiles=$file
+      rmfiles="$file"
 
       case $name in
       *.la)
@@ -11006,7 +9517,7 @@
 	  done
 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case $opt_mode in
+	  case "$opt_mode" in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
@@ -11017,12 +9528,12 @@
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -11038,19 +9549,21 @@
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" && test none != "$pic_object"; then
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
 	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
 	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test clean = "$opt_mode"; then
+	if test "$opt_mode" = clean ; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -11077,12 +9590,12 @@
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
-	    if test yes = "$fast_install" && test -n "$relink_command"; then
+	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
 	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name"; then
-	      func_append rmfiles " $odir/lt-$noexename.c"
+	    if test "X$noexename" != "X$name" ; then
+	      func_append rmfiles " $odir/lt-${noexename}.c"
 	    fi
 	  fi
 	fi
@@ -11091,7 +9604,7 @@
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the $objdir's in the directories where we deleted files
+    # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -11101,17 +9614,16 @@
     exit $exit_status
 }
 
-if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
-  func_mode_uninstall ${1+"$@"}
-fi
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
 
 test -z "$opt_mode" && {
-  help=$generic_help
+  help="$generic_help"
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode '$opt_mode'"
+  func_fatal_help "invalid operation mode \`$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -11122,7 +9634,7 @@
 
 
 # The TAGs below are defined such that we never get into a situation
-# where we disable both kinds of libraries.  Given conflicting
+# in which we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -11145,3 +9657,5 @@
 # mode:shell-script
 # sh-indentation:2
 # End:
+# vi:sw=2
+
diff --git a/third_party/libxml/src/m4/libtool.m4 b/third_party/libxml/src/m4/libtool.m4
index a644432..d7c043f4f 100644
--- a/third_party/libxml/src/m4/libtool.m4
+++ b/third_party/libxml/src/m4/libtool.m4
@@ -1,6 +1,8 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -8,30 +10,36 @@
 # modifications, as long as this notice is preserved.
 
 m4_define([_LT_COPYING], [dnl
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
-# (at your option) any later version.
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
 #
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that is built
-# using GNU Libtool, you may include this file under the  same
-# distribution terms that you use for the rest of that program.
+#   This file is part of GNU Libtool.
 #
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ])
 
-# serial 58 LT_INIT
+# serial 57 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -59,7 +67,7 @@
 # LT_INIT([OPTIONS])
 # ------------------
 AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -83,7 +91,7 @@
 _LT_SET_OPTIONS([$0], [$1])
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
+LIBTOOL_DEPS="$ltmain"
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -103,43 +111,26 @@
 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
 
 
-# _LT_PREPARE_CC_BASENAME
-# -----------------------
-m4_defun([_LT_PREPARE_CC_BASENAME], [
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in @S|@*""; do
-      case $cc_temp in
-        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-])# _LT_PREPARE_CC_BASENAME
-
-
 # _LT_CC_BASENAME(CC)
 # -------------------
-# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
-# but that macro is also expanded into generated libtool script, which
-# arranges for $SED and $ECHO to be set by different means.
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
 m4_defun([_LT_CC_BASENAME],
-[m4_require([_LT_PREPARE_CC_BASENAME])dnl
-AC_REQUIRE([_LT_DECL_SED])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-func_cc_basename $1
-cc_basename=$func_cc_basename_result
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 ])
 
 
 # _LT_FILEUTILS_DEFAULTS
 # ----------------------
 # It is okay to use these file commands and assume they have been set
-# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
 m4_defun([_LT_FILEUTILS_DEFAULTS],
 [: ${CP="cp -f"}
 : ${MV="mv -f"}
@@ -186,16 +177,15 @@
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
 m4_require([_LT_WITH_SYSROOT])dnl
-m4_require([_LT_CMD_TRUNCATE])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options that allow our
+# See if we are running on zsh, and set the options which allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
+if test -n "\${ZSH_VERSION+set}" ; then
    setopt NO_GLOB_SUBST
 fi
 ])
-if test -n "${ZSH_VERSION+set}"; then
+if test -n "${ZSH_VERSION+set}" ; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -208,7 +198,7 @@
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test set != "${COLLECT_NAMES+set}"; then
+  if test "X${COLLECT_NAMES+set}" != Xset; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -219,14 +209,14 @@
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a '.a' archive for static linking (except MSVC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld=$lt_cv_prog_gnu_ld
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
-old_CC=$CC
-old_CFLAGS=$CFLAGS
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -279,14 +269,14 @@
 
 # _LT_PROG_LTMAIN
 # ---------------
-# Note that this code is called both from 'configure', and 'config.status'
+# Note that this code is called both from `configure', and `config.status'
 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# 'config.status' has no value for ac_aux_dir unless we are using Automake,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
 # so we pass a copy along to make sure it has a sensible value anyway.
 m4_defun([_LT_PROG_LTMAIN],
 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain=$ac_aux_dir/ltmain.sh
+ltmain="$ac_aux_dir/ltmain.sh"
 ])# _LT_PROG_LTMAIN
 
 
@@ -296,7 +286,7 @@
 
 # So that we can recreate a full libtool script including additional
 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the 'libtool'
+# in macros and then make a single call at the end using the `libtool'
 # label.
 
 
@@ -431,8 +421,8 @@
 
 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
 # ------------------------------------
-# Quote a variable value, and forward it to 'config.status' so that its
-# declaration there will have the same value as in 'configure'.  VARNAME
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -456,7 +446,7 @@
 # Output comment and list of tags supported by the script
 m4_defun([_LT_LIBTOOL_TAGS],
 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags='_LT_TAGS'dnl
+available_tags="_LT_TAGS"dnl
 ])
 
 
@@ -484,7 +474,7 @@
 # _LT_LIBTOOL_CONFIG_VARS
 # -----------------------
 # Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
 # section) are produced by _LT_LIBTOOL_TAG_VARS.
 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
@@ -510,8 +500,8 @@
 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
 # variables for single and double quote escaping we saved from calls
 # to _LT_DECL, we can put quote escaped variables declarations
-# into 'config.status', and then the shell code to quote escape them in
-# for loops in 'config.status'.  Finally, any additional code accumulated
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
 m4_defun([_LT_CONFIG_COMMANDS],
 [AC_PROVIDE_IFELSE([LT_OUTPUT],
@@ -557,7 +547,7 @@
 ]], lt_decl_quote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -570,7 +560,7 @@
 ]], lt_decl_dquote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -586,7 +576,7 @@
 # Generate a child script FILE with all initialization necessary to
 # reuse the environment learned by the parent script, and make the
 # file executable.  If COMMENT is supplied, it is inserted after the
-# '#!' sequence but before initialization text begins.  After this
+# `#!' sequence but before initialization text begins.  After this
 # macro, additional text can be appended to FILE to form the body of
 # the child script.  The macro ends with non-zero status if the
 # file could not be fully written (such as if the disk is full).
@@ -608,7 +598,7 @@
 _AS_PREPARE
 exec AS_MESSAGE_FD>&1
 _ASEOF
-test 0 = "$lt_write_fail" && chmod +x $1[]dnl
+test $lt_write_fail = 0 && chmod +x $1[]dnl
 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
@@ -631,7 +621,7 @@
 } >&AS_MESSAGE_LOG_FD
 
 lt_cl_help="\
-'$as_me' creates a local libtool stub from the current configuration,
+\`$as_me' creates a local libtool stub from the current configuration,
 for use in further configure time tests before the real libtool is
 generated.
 
@@ -653,7 +643,7 @@
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
-while test 0 != $[#]
+while test $[#] != 0
 do
   case $[1] in
     --version | --v* | -V )
@@ -666,10 +656,10 @@
       lt_cl_silent=: ;;
 
     -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try '$[0] --help' for more information.]) ;;
+Try \`$[0] --help' for more information.]) ;;
 
     *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try '$[0] --help' for more information.]) ;;
+Try \`$[0] --help' for more information.]) ;;
   esac
   shift
 done
@@ -695,7 +685,7 @@
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
 lt_cl_success=:
-test yes = "$silent" &&
+test "$silent" = yes &&
   lt_config_lt_args="$lt_config_lt_args --quiet"
 exec AS_MESSAGE_LOG_FD>/dev/null
 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
@@ -715,31 +705,27 @@
 _LT_CONFIG_SAVE_COMMANDS([
   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options that allow our
+    # See if we are running on zsh, and set the options which allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}"; then
+    if test -n "${ZSH_VERSION+set}" ; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile=${ofile}T
+    cfgfile="${ofile}T"
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-# Generated automatically by $as_me ($PACKAGE) $VERSION
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
-
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit, 1996
-
+#
 _LT_COPYING
 _LT_LIBTOOL_TAGS
 
-# Configured defaults for sys_lib_dlsearch_path munging.
-: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
-
 # ### BEGIN LIBTOOL CONFIG
 _LT_LIBTOOL_CONFIG_VARS
 _LT_LIBTOOL_TAG_VARS
@@ -747,24 +733,13 @@
 
 _LT_EOF
 
-    cat <<'_LT_EOF' >> "$cfgfile"
-
-# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_PREPARE_MUNGE_PATH_LIST
-_LT_PREPARE_CC_BASENAME
-
-# ### END FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_EOF
-
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
+if test "X${COLLECT_NAMES+set}" != Xset; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -781,6 +756,8 @@
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
+  _LT_PROG_REPLACE_SHELLFNS
+
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -798,6 +775,7 @@
 [m4_if([$1], [], [
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'], [])
 ])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -996,7 +974,7 @@
 
     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
       [lt_cv_apple_cc_single_mod=no
-      if test -z "$LT_MULTI_MODULE"; then
+      if test -z "${LT_MULTI_MODULE}"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -1014,7 +992,7 @@
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1032,7 +1010,7 @@
       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
 	[lt_cv_ld_exported_symbols_list=yes],
 	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS=$save_LDFLAGS
+	LDFLAGS="$save_LDFLAGS"
     ])
 
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
@@ -1054,7 +1032,7 @@
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1064,32 +1042,32 @@
     ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]][[,.]]*)
-	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test yes = "$lt_cv_apple_cc_single_mod"; then
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test yes = "$lt_cv_ld_exported_symbols_list"; then
-      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -1109,29 +1087,29 @@
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test yes = "$lt_cv_ld_force_load"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
     m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
                   [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
   case $cc_basename in
-     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     ifort*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test yes = "$_lt_dar_can_shared"; then
+  if test "$_lt_dar_can_shared" = "yes"; then
     output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
     m4_if([$1], [CXX],
-[   if test yes != "$lt_cv_apple_cc_single_mod"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
     fi
 ],[])
   else
@@ -1151,7 +1129,7 @@
 # Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-if test set = "${lt_cv_aix_libpath+set}"; then
+if test "${lt_cv_aix_libpath+set}" = set; then
   aix_libpath=$lt_cv_aix_libpath
 else
   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
@@ -1169,7 +1147,7 @@
     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
   fi],[])
   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
   fi
   ])
   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
@@ -1189,8 +1167,8 @@
 # -----------------------
 # Find how we can fake an echo command that does not interpret backslash.
 # In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script that will find a shell with a builtin
-# printf (that we can use as an echo command).
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1218,10 +1196,10 @@
 # Invoke $ECHO with all args, space-separated.
 func_echo_all ()
 {
-    $ECHO "$*"
+    $ECHO "$*" 
 }
 
-case $ECHO in
+case "$ECHO" in
   printf*) AC_MSG_RESULT([printf]) ;;
   print*) AC_MSG_RESULT([print -r]) ;;
   *) AC_MSG_RESULT([cat]) ;;
@@ -1247,17 +1225,16 @@
 AC_DEFUN([_LT_WITH_SYSROOT],
 [AC_MSG_CHECKING([for sysroot])
 AC_ARG_WITH([sysroot],
-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-  [Search for dependent libraries within DIR (or the compiler's sysroot
-   if not specified).])],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
 [], [with_sysroot=no])
 
 dnl lt_sysroot will always be passed unquoted.  We quote it here
 dnl in case the user passed a directory name.
 lt_sysroot=
-case $with_sysroot in #(
+case ${with_sysroot} in #(
  yes)
-   if test yes = "$GCC"; then
+   if test "$GCC" = yes; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -1267,14 +1244,14 @@
  no|'')
    ;; #(
  *)
-   AC_MSG_RESULT([$with_sysroot])
+   AC_MSG_RESULT([${with_sysroot}])
    AC_MSG_ERROR([The sysroot must be an absolute path.])
    ;;
 esac
 
  AC_MSG_RESULT([${lt_sysroot:-no}])
 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and where our libraries should be installed.])])
+[dependent libraries, and in which our libraries should be installed.])])
 
 # _LT_ENABLE_LOCK
 # ---------------
@@ -1282,33 +1259,31 @@
 [AC_ARG_ENABLE([libtool-lock],
   [AS_HELP_STRING([--disable-libtool-lock],
     [avoid locking (might break parallel builds)])])
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out what ABI is being produced by ac_compile, and set mode
-  # options accordingly.
+  # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE=32
+	HPUX_IA64_MODE="32"
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE=64
+	HPUX_IA64_MODE="64"
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
+  # Find out which ABI we are using.
   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    if test yes = "$lt_cv_prog_gnu_ld"; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -1337,46 +1312,9 @@
   rm -rf conftest*
   ;;
 
-mips64*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    emul=elf
-    case `/usr/bin/file conftest.$ac_objext` in
-      *32-bit*)
-	emul="${emul}32"
-	;;
-      *64-bit*)
-	emul="${emul}64"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *MSB*)
-	emul="${emul}btsmip"
-	;;
-      *LSB*)
-	emul="${emul}ltsmip"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *N32*)
-	emul="${emul}n32"
-	;;
-    esac
-    LD="${LD-ld} -m $emul"
-  fi
-  rm -rf conftest*
-  ;;
-
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.  Note that the listed cases only cover the
-  # situations where additional linker options are needed (such as when
-  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
-  # vice versa); the common cases where no linker options are needed do
-  # not appear in the list.
+  # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1395,10 +1333,10 @@
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*linux*)
+	  powerpc64le-*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*linux*)
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1417,10 +1355,10 @@
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*linux*)
+	  powerpcle-*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*linux*)
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -1438,20 +1376,19 @@
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS=$CFLAGS
+  SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_PUSH(C)
      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
      AC_LANG_POP])
-  if test yes != "$lt_cv_cc_needs_belf"; then
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS=$SAVE_CFLAGS
+    CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
 *-*solaris*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
+  # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1459,7 +1396,7 @@
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*|x86_64-*-solaris*)
+        i?86-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -1468,7 +1405,7 @@
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD=${LD-ld}_sol2
+          LD="${LD-ld}_sol2"
         fi
         ;;
       *)
@@ -1484,7 +1421,7 @@
   ;;
 esac
 
-need_locks=$enable_libtool_lock
+need_locks="$enable_libtool_lock"
 ])# _LT_ENABLE_LOCK
 
 
@@ -1503,11 +1440,11 @@
      [echo conftest.$ac_objext > conftest.lst
       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
       AC_TRY_EVAL([lt_ar_try])
-      if test 0 -eq "$ac_status"; then
+      if test "$ac_status" -eq 0; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	AC_TRY_EVAL([lt_ar_try])
-	if test 0 -ne "$ac_status"; then
+	if test "$ac_status" -ne 0; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -1515,7 +1452,7 @@
      ])
   ])
 
-if test no = "$lt_cv_ar_at_file"; then
+if test "x$lt_cv_ar_at_file" = xno; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -1546,7 +1483,7 @@
 
 if test -n "$RANLIB"; then
   case $host_os in
-  bitrig* | openbsd*)
+  openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -1582,7 +1519,7 @@
   [$2=no
    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
+   lt_compiler_flag="$3"
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -1609,7 +1546,7 @@
    $RM conftest*
 ])
 
-if test yes = "[$]$2"; then
+if test x"[$]$2" = xyes; then
     m4_if([$5], , :, [$5])
 else
     m4_if([$6], , :, [$6])
@@ -1631,7 +1568,7 @@
 m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
-   save_LDFLAGS=$LDFLAGS
+   save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $3"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -1650,10 +1587,10 @@
      fi
    fi
    $RM -r conftest*
-   LDFLAGS=$save_LDFLAGS
+   LDFLAGS="$save_LDFLAGS"
 ])
 
-if test yes = "[$]$2"; then
+if test x"[$]$2" = xyes; then
     m4_if([$4], , :, [$4])
 else
     m4_if([$5], , :, [$5])
@@ -1674,7 +1611,7 @@
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  teststring=ABCD
+  teststring="ABCD"
 
   case $build_os in
   msdosdjgpp*)
@@ -1714,7 +1651,7 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1765,22 +1702,22 @@
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-       test undefined != "$lt_cv_sys_max_cmd_len"; then
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8; do
+      for i in 1 2 3 4 5 6 7 8 ; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test 17 != "$i" # 1/2 MB should be enough
+	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -1796,7 +1733,7 @@
     ;;
   esac
 ])
-if test -n "$lt_cv_sys_max_cmd_len"; then
+if test -n $lt_cv_sys_max_cmd_len ; then
   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 else
   AC_MSG_RESULT(none)
@@ -1824,7 +1761,7 @@
 # ----------------------------------------------------------------
 m4_defun([_LT_TRY_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test yes = "$cross_compiling"; then :
+if test "$cross_compiling" = yes; then :
   [$4]
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1871,9 +1808,9 @@
 #  endif
 #endif
 
-/* When -fvisibility=hidden is used, assume the code has been annotated
+/* When -fvisbility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -1899,7 +1836,7 @@
   return status;
 }]
 _LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -1920,7 +1857,7 @@
 # ------------------
 AC_DEFUN([LT_SYS_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test yes != "$enable_dlopen"; then
+if test "x$enable_dlopen" != xyes; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -1930,52 +1867,44 @@
 
   case $host_os in
   beos*)
-    lt_cv_dlopen=load_add_on
+    lt_cv_dlopen="load_add_on"
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen=LoadLibrary
+    lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen=dlopen
+    lt_cv_dlopen="dlopen"
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-    # if libdl is installed we need to link against it
+  # if libdl is installed we need to link against it
     AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
-    lt_cv_dlopen=dyld
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ])
     ;;
 
-  tpf*)
-    # Don't try to run any link tests for TPF.  We know it's impossible
-    # because TPF is a cross-compiler, and we know how we open DSOs.
-    lt_cv_dlopen=dlopen
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=no
-    ;;
-
   *)
     AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen=shl_load],
+	  [lt_cv_dlopen="shl_load"],
       [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
 	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen=dlopen],
+	      [lt_cv_dlopen="dlopen"],
 	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
 	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
 	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
 	      ])
 	    ])
 	  ])
@@ -1984,21 +1913,21 @@
     ;;
   esac
 
-  if test no = "$lt_cv_dlopen"; then
-    enable_dlopen=no
-  else
+  if test "x$lt_cv_dlopen" != xno; then
     enable_dlopen=yes
+  else
+    enable_dlopen=no
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS=$CPPFLAGS
-    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS=$LDFLAGS
+    save_LDFLAGS="$LDFLAGS"
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS=$LIBS
+    save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -2008,7 +1937,7 @@
 	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
     ])
 
-    if test yes = "$lt_cv_dlopen_self"; then
+    if test "x$lt_cv_dlopen_self" = xyes; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 	  lt_cv_dlopen_self_static, [dnl
@@ -2018,9 +1947,9 @@
       ])
     fi
 
-    CPPFLAGS=$save_CPPFLAGS
-    LDFLAGS=$save_LDFLAGS
-    LIBS=$save_LIBS
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
     ;;
   esac
 
@@ -2112,8 +2041,8 @@
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 _LT_COMPILER_C_O([$1])
 
-hard_links=nottested
-if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
   AC_MSG_CHECKING([if we can lock with hard links])
   hard_links=yes
@@ -2123,8 +2052,8 @@
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   AC_MSG_RESULT([$hard_links])
-  if test no = "$hard_links"; then
-    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
     need_locks=warn
   fi
 else
@@ -2151,8 +2080,8 @@
 _LT_DECL([], [objdir], [0],
          [The name of the directory that contains temporary libtool files])dnl
 m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
-  [Define to the sub-directory where libtool stores uninstalled libraries.])
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
 ])# _LT_CHECK_OBJDIR
 
 
@@ -2164,15 +2093,15 @@
 _LT_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
 
   # We can hardcode non-existent directories.
-  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
-     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
     # Linking always hardcodes the temporary library directory.
     _LT_TAGVAR(hardcode_action, $1)=relink
   else
@@ -2186,12 +2115,12 @@
 fi
 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
 
-if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
-   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
-     test no = "$enable_shared"; then
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -2215,7 +2144,7 @@
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP"; then
+    if test -n "$STRIP" ; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       AC_MSG_RESULT([yes])
@@ -2233,47 +2162,6 @@
 ])# _LT_CMD_STRIPLIB
 
 
-# _LT_PREPARE_MUNGE_PATH_LIST
-# ---------------------------
-# Make sure func_munge_path_list() is defined correctly.
-m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
-[[# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x@S|@2 in
-    x)
-        ;;
-    *:)
-        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
-        ;;
-    x:*)
-        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
-        ;;
-    *)
-        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-]])# _LT_PREPARE_PATH_LIST
-
-
 # _LT_SYS_DYNAMIC_LINKER([TAG])
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
@@ -2284,18 +2172,17 @@
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   case $host_os in
-    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
-    *) lt_awk_arg='/^libraries:/' ;;
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
-    *) lt_sed_strip_eq='s|=/|/|g' ;;
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -2311,35 +2198,28 @@
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary...
+  # and add multilib dir if necessary.
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  # ...but if some path component already ends with the multilib dir we assume
-  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
-  case "$lt_multi_os_dir; $lt_search_path_spec " in
-  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
-    lt_multi_os_dir=
-    ;;
-  esac
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
-    elif test -n "$lt_multi_os_dir"; then
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
-  lt_foo = "";
-  lt_count = 0;
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo = "/" $lt_i lt_foo;
+          lt_foo="/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -2353,7 +2233,7 @@
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -2362,7 +2242,7 @@
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=.so
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -2379,17 +2259,14 @@
 # flags to be left without arguments
 need_version=unknown
 
-AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
-[User-defined run-time library search path.])
-
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='$libname$release$shared_ext$major'
+  soname_spec='${libname}${release}${shared_ext}$major'
   ;;
 
 aix[[4-9]]*)
@@ -2397,91 +2274,41 @@
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test ia64 = "$host_cpu"; then
+  if test "$host_cpu" = ia64; then
     # AIX 5 supports IA64
-    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line '#! .'.  This would cause the generated library to
-    # depend on '.', always an invalid library.  This was fixed in
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[[01]] | aix4.[[01]].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # Using Import Files as archive members, it is possible to support
-    # filename-based versioning of shared library archives on AIX. While
-    # this would work for both with and without runtime linking, it will
-    # prevent static linking of such archives. So we do filename-based
-    # shared library versioning with .so extension only, which is used
-    # when both runtime linking and shared linking is enabled.
-    # Unfortunately, runtime linking may impact performance, so we do
-    # not want this to be the default eventually. Also, we use the
-    # versioned .so libs for executables only if there is the -brtl
-    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
-    # To allow for filename-based versioning support, we need to create
-    # libNAME.so.V as an archive file, containing:
-    # *) an Import File, referring to the versioned filename of the
-    #    archive as well as the shared archive member, telling the
-    #    bitwidth (32 or 64) of that shared object, and providing the
-    #    list of exported symbols of that shared object, eventually
-    #    decorated with the 'weak' keyword
-    # *) the shared object with the F_LOADONLY flag set, to really avoid
-    #    it being seen by the linker.
-    # At run time we better use the real file rather than another symlink,
-    # but for link time we create the symlink libNAME.so -> libNAME.so.V
-
-    case $with_aix_soname,$aix_use_runtimelinking in
-    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    aix,yes) # traditional libtool
-      dynamic_linker='AIX unversionable lib.so'
+    if test "$aix_use_runtimelinking" = yes; then
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      ;;
-    aix,no) # traditional AIX only
-      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      ;;
-    svr4,*) # full svr4 only
-      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,yes) # both, prefer svr4
-      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # unpreferred sharedlib libNAME.a needs extra handling
-      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
-      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,no) # both, prefer aix
-      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
-      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
-      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
-      ;;
-    esac
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -2491,18 +2318,18 @@
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='$libname$shared_ext'
+  library_names_spec='${libname}${shared_ext}'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -2510,8 +2337,8 @@
 bsdi[[45]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -2523,7 +2350,7 @@
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=.dll
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
@@ -2532,8 +2359,8 @@
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -2549,17 +2376,17 @@
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
 m4_if([$1], [],[
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -2568,8 +2395,8 @@
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
-    library_names_spec='$libname.dll.lib'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
 
     case $build_os in
     mingw*)
@@ -2596,7 +2423,7 @@
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec=$LIB
+      sys_lib_search_path_spec="$LIB"
       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -2609,8 +2436,8 @@
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -2623,7 +2450,7 @@
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -2636,8 +2463,8 @@
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$major$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -2650,8 +2477,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2669,13 +2496,12 @@
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      soname_spec='$libname$release$shared_ext$major'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
       need_version=yes
       ;;
   esac
@@ -2705,10 +2531,10 @@
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=no
+  shlibpath_overrides_runpath=yes
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -2726,15 +2552,14 @@
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    if test 32 = "$HPUX_IA64_MODE"; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -2742,8 +2567,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -2752,8 +2577,8 @@
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -2766,8 +2591,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2778,7 +2603,7 @@
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test yes = "$lt_cv_prog_gnu_ld"; then
+	if test "$lt_cv_prog_gnu_ld" = yes; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -2786,8 +2611,8 @@
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -2806,8 +2631,8 @@
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
-  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
   hardcode_into_libs=yes
   ;;
 
@@ -2816,33 +2641,13 @@
   dynamic_linker=no
   ;;
 
-linux*android*)
-  version_type=none # Android doesn't support versioned libraries.
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext'
-  soname_spec='$libname$release$shared_ext'
-  finish_cmds=
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  dynamic_linker='Android linker'
-  # Don't embed -rpath directories since the linker doesn't support them.
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-  ;;
-
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2867,18 +2672,10 @@
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
-  # Ideally, we could use ldconfig to report *all* directores which are
-  # searched for libraries, however this is still not possible.  Aside from not
-  # being certain /sbin/ldconfig is available, command
-  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
-  # even though it is searched at run-time.  Try to do the best guess by
-  # appending ld.so.conf contents (and includes) to the search path.
+  # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -2890,17 +2687,29 @@
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -2910,7 +2719,7 @@
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -2919,68 +2728,58 @@
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd* | bitrig*)
+openbsd*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec=/usr/lib
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-    need_version=no
-  else
-    need_version=yes
-  fi
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
   ;;
 
 os2*)
   libname_spec='$name'
-  version_type=windows
-  shrext_cmds=.dll
-  need_version=no
+  shrext_cmds=".dll"
   need_lib_prefix=no
-  # OS/2 can only load a DLL with a base name of 8 characters or less.
-  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
-    v=$($ECHO $release$versuffix | tr -d .-);
-    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
-    $ECHO $n$v`$shared_ext'
-  library_names_spec='${libname}_dll.$libext'
+  library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=BEGINLIBPATH
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-  postinstall_cmds='base_file=`basename \$file`~
-    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
-    dldir=$destdir/`dirname \$dlpath`~
-    test -d \$dldir || mkdir -p \$dldir~
-    $install_prog $dir/$dlname \$dldir/$dlname~
-    chmod a+x \$dldir/$dlname~
-    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-    fi'
-  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
-    dlpath=$dir/\$dldll~
-    $RM \$dlpath'
+  shlibpath_var=LIBPATH
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
 rdos*)
@@ -2991,8 +2790,8 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -3002,11 +2801,11 @@
 
 sunos4*)
   version_type=sunos
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test yes = "$with_gnu_ld"; then
+  if test "$with_gnu_ld" = yes; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -3014,8 +2813,8 @@
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -3036,24 +2835,24 @@
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec; then
+  if test -d /usr/nec ;then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
-    soname_spec='$libname$shared_ext.$major'
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=sco
+  version_type=freebsd-elf
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test yes = "$with_gnu_ld"; then
+  if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -3071,7 +2870,7 @@
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -3079,8 +2878,8 @@
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -3089,30 +2888,20 @@
   ;;
 esac
 AC_MSG_RESULT([$dynamic_linker])
-test no = "$dynamic_linker" && can_build_shared=no
+test "$dynamic_linker" = no && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
-  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
 fi
-
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
-  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
 
-# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
-configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
-
-# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
-func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
-
-# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
-configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
-
 _LT_DECL([], [variables_saved_for_relink], [1],
     [Variables whose values should be saved in libtool wrapper scripts and
     restored at link time])
@@ -3145,41 +2934,39 @@
     [Whether we should hardcode library paths into libraries])
 _LT_DECL([], [sys_lib_search_path_spec], [2],
     [Compile-time system search path for libraries])
-_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
-    [Detected run-time system search path for libraries])
-_LT_DECL([], [configure_time_lt_sys_library_path], [2],
-    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
 ])# _LT_SYS_DYNAMIC_LINKER
 
 
 # _LT_PATH_TOOL_PREFIX(TOOL)
 # --------------------------
-# find a file program that can recognize shared library
+# find a file program which can recognize shared library
 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
 [m4_require([_LT_DECL_EGREP])dnl
 AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 [case $MAGIC_CMD in
 [[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD=$MAGIC_CMD
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
 dnl $ac_dummy forces splitting on constant user-supplied paths.
 dnl POSIX.2 word splitting is done only on the output of word expansions,
 dnl not every word.  This closes a longstanding sh security hole.
   ac_dummy="m4_if([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$1"; then
-      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -3202,11 +2989,11 @@
       break
     fi
   done
-  IFS=$lt_save_ifs
-  MAGIC_CMD=$lt_save_MAGIC_CMD
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
   ;;
 esac])
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
   AC_MSG_RESULT($MAGIC_CMD)
 else
@@ -3224,7 +3011,7 @@
 
 # _LT_PATH_MAGIC
 # --------------
-# find a file program that can recognize a shared library
+# find a file program which can recognize a shared library
 m4_defun([_LT_PATH_MAGIC],
 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -3251,16 +3038,16 @@
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
 	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test no = "$withval" || with_gnu_ld=yes],
+    [test "$withval" = no || with_gnu_ld=yes],
     [with_gnu_ld=no])dnl
 
 ac_prog=ld
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by $CC])
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return, which upsets mingw
+    # gcc leaves a trailing carriage return which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -3274,7 +3061,7 @@
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD=$ac_prog
+      test -z "$LD" && LD="$ac_prog"
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -3285,37 +3072,37 @@
     with_gnu_ld=unknown
     ;;
   esac
-elif test yes = "$with_gnu_ld"; then
+elif test "$with_gnu_ld" = yes; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
 AC_CACHE_VAL(lt_cv_path_LD,
 [if test -z "$LD"; then
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD=$ac_dir/$ac_prog
+      lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test no != "$with_gnu_ld" && break
+	test "$with_gnu_ld" != no && break
 	;;
       *)
-	test yes != "$with_gnu_ld" && break
+	test "$with_gnu_ld" != yes && break
 	;;
       esac
     fi
   done
-  IFS=$lt_save_ifs
+  IFS="$lt_save_ifs"
 else
-  lt_cv_path_LD=$LD # Let the user override the test with a path.
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
 fi])
-LD=$lt_cv_path_LD
+LD="$lt_cv_path_LD"
 if test -n "$LD"; then
   AC_MSG_RESULT($LD)
 else
@@ -3369,13 +3156,13 @@
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test yes != "$GCC"; then
+    if test "$GCC" != yes; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test yes = "$GCC"; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -3386,43 +3173,6 @@
 ])# _LT_CMD_RELOAD
 
 
-# _LT_PATH_DD
-# -----------
-# find a working dd
-m4_defun([_LT_PATH_DD],
-[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
-[printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-: ${lt_DD:=$DD}
-AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
-[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
-fi])
-rm -f conftest.i conftest2.i conftest.out])
-])# _LT_PATH_DD
-
-
-# _LT_CMD_TRUNCATE
-# ----------------
-# find command to truncate a binary pipe
-m4_defun([_LT_CMD_TRUNCATE],
-[m4_require([_LT_PATH_DD])
-AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
-[printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-lt_cv_truncate_bin=
-if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
-fi
-rm -f conftest.i conftest2.i conftest.out
-test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
-_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
-  [Command to truncate a binary pipe])
-])# _LT_CMD_TRUNCATE
-
-
 # _LT_CHECK_MAGIC_METHOD
 # ----------------------
 # how to check for library dependencies
@@ -3438,13 +3188,13 @@
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
+# `unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[[4-9]]*)
@@ -3471,7 +3221,8 @@
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -3549,7 +3300,7 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -3567,8 +3318,8 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd* | bitrig*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -3621,9 +3372,6 @@
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
-os2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 esac
 ])
 
@@ -3664,38 +3412,33 @@
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM=$NM
+  lt_cv_path_NM="$NM"
 else
-  lt_nm_to_check=${ac_tool_prefix}nm
+  lt_nm_to_check="${ac_tool_prefix}nm"
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm=$ac_dir/$lt_tmp_nm
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
-	case $build_os in
-	mingw*) lt_bad_file=conftest.nm/nofile ;;
-	*) lt_bad_file=/dev/null ;;
-	esac
-	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
-	*$lt_bad_file* | *'Invalid file or object type'*)
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break 2
+	  break
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break 2
+	    break
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3706,21 +3449,21 @@
 	esac
       fi
     done
-    IFS=$lt_save_ifs
+    IFS="$lt_save_ifs"
   done
   : ${lt_cv_path_NM=no}
 fi])
-if test no != "$lt_cv_path_NM"; then
-  NM=$lt_cv_path_NM
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
     # Let the user override the test.
   else
     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols -headers"
+      DUMPBIN="$DUMPBIN -symbols"
       ;;
     *)
       DUMPBIN=:
@@ -3728,8 +3471,8 @@
     esac
   fi
   AC_SUBST([DUMPBIN])
-  if test : != "$DUMPBIN"; then
-    NM=$DUMPBIN
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
   fi
 fi
 test -z "$NM" && NM=nm
@@ -3775,8 +3518,8 @@
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh;
-  # decide which one to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -3788,7 +3531,7 @@
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd=$ECHO
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
   ;;
 esac
 ])
@@ -3815,28 +3558,13 @@
     lt_cv_path_mainfest_tool=yes
   fi
   rm -f conftest*])
-if test yes != "$lt_cv_path_mainfest_tool"; then
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
   MANIFEST_TOOL=:
 fi
 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
 ])# _LT_PATH_MANIFEST_TOOL
 
 
-# _LT_DLL_DEF_P([FILE])
-# ---------------------
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with func_dll_def_p in the libtool script
-AC_DEFUN([_LT_DLL_DEF_P],
-[dnl
-  test DEF = "`$SED -n dnl
-    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
-    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
-    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
-    -e q dnl                          Only consider the first "real" line
-    $1`" dnl
-])# _LT_DLL_DEF_P
-
-
 # LT_LIB_M
 # --------
 # check for math library
@@ -3848,11 +3576,11 @@
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
   ;;
 *)
-  AC_CHECK_LIB(m, cos, LIBM=-lm)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
   ;;
 esac
 AC_SUBST([LIBM])
@@ -3871,7 +3599,7 @@
 
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
-if test yes = "$GCC"; then
+if test "$GCC" = yes; then
   case $cc_basename in
   nvcc*)
     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3923,7 +3651,7 @@
   symcode='[[ABCDGISTW]]'
   ;;
 hpux*)
-  if test ia64 = "$host_cpu"; then
+  if test "$host_cpu" = ia64; then
     symcode='[[ABCDEGRST]]'
   fi
   ;;
@@ -3956,44 +3684,14 @@
   symcode='[[ABCDGIRSTW]]' ;;
 esac
 
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  # Gets list of data symbols to import.
-  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
-  # Adjust the below global symbol transforms to fixup imported variables.
-  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
-  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
-  lt_c_name_lib_hook="\
-  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
-  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
-else
-  # Disable hooks by default.
-  lt_cv_sys_global_symbol_to_import=
-  lt_cdecl_hook=
-  lt_c_name_hook=
-  lt_c_name_lib_hook=
-fi
-
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -4011,24 +3709,21 @@
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function,
-    # D for any global variable and I for any imported variable.
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx]"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -4068,11 +3763,11 @@
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT@&t@_DLSYM_CONST
-#elif defined __osf__
+#elif defined(__osf__)
 /* This system does not cope well with relocations in const data.  */
 # define LT@&t@_DLSYM_CONST
 #else
@@ -4098,7 +3793,7 @@
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -4118,9 +3813,9 @@
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS=conftstm.$ac_objext
+	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -4141,7 +3836,7 @@
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test yes = "$pipe_works"; then
+  if test "$pipe_works" = yes; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -4168,16 +3863,12 @@
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
     [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
-    [Transform the output of nm into a list of symbols to manually relocate])
 _LT_DECL([global_symbol_to_c_name_address],
     [lt_cv_sys_global_symbol_to_c_name_address], [1],
     [Transform the output of nm in a C name address pair])
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
-    [The name lister interface])
 _LT_DECL([], [nm_file_list_spec], [1],
     [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -4193,18 +3884,17 @@
 
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
-  if test yes = "$GXX"; then
+  if test "$GXX" = yes; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -4215,8 +3905,8 @@
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the '-m68020' flag to GCC prevents building anything better,
-            # like '-m68040'.
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -4232,11 +3922,6 @@
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      case $host_os in
-      os2*)
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
-	;;
-      esac
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
@@ -4286,7 +3971,7 @@
     case $host_os in
       aix[[4-9]]*)
 	# All AIX code is PIC.
-	if test ia64 = "$host_cpu"; then
+	if test "$host_cpu" = ia64; then
 	  # AIX 5 now supports IA64 processor
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	else
@@ -4327,14 +4012,14 @@
 	case $cc_basename in
 	  CC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
-	    if test ia64 != "$host_cpu"; then
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
 	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -4371,7 +4056,7 @@
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64, which still supported -KPIC.
+	    # old Intel C++ for x86_64 which still supported -KPIC.
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4427,7 +4112,7 @@
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
 	;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4516,18 +4201,17 @@
   fi
 ],
 [
-  if test yes = "$GCC"; then
+  if test "$GCC" = yes; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -4538,8 +4222,8 @@
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the '-m68020' flag to GCC prevents building anything better,
-            # like '-m68040'.
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -4556,11 +4240,6 @@
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      case $host_os in
-      os2*)
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
-	;;
-      esac
       ;;
 
     darwin* | rhapsody*)
@@ -4631,7 +4310,7 @@
     case $host_os in
     aix*)
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       else
@@ -4639,30 +4318,11 @@
       fi
       ;;
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      case $cc_basename in
-      nagfor*)
-        # NAG Fortran compiler
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      esac
-      ;;
-
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      case $host_os in
-      os2*)
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
-	;;
-      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -4678,7 +4338,7 @@
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -4689,7 +4349,7 @@
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64, which still supported -KPIC.
+      # old Intel for x86_64 which still supported -KPIC.
       ecc*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4714,12 +4374,6 @@
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	;;
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -4817,7 +4471,7 @@
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec; then
+      if test -d /usr/nec ;then
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
@@ -4846,7 +4500,7 @@
   fi
 ])
 case $host_os in
-  # For platforms that do not support PIC, -DPIC is meaningless:
+  # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
@@ -4912,21 +4566,17 @@
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
-    # Without the "-l" option, or with the "-B" option, AIX nm treats
-    # weak defined symbols like other global defined symbols, whereas
-    # GNU nm marks them as "W".
-    # While the 'weak' keyword is ignored in the Export File, we need
-    # it in the Import File for the 'aix-soname' feature, so we have
-    # to replace the "-B" option with "-P" for AIX nm.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
-      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -4939,6 +4589,9 @@
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4972,9 +4625,9 @@
   # included in the symbol list
   _LT_TAGVAR(include_expsyms, $1)=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ' (' and ')$', so one must not match beginning or
-  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
-  # as well as any symbol that contains 'd'.
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -4990,7 +4643,7 @@
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test yes != "$GCC"; then
+    if test "$GCC" != yes; then
       with_gnu_ld=no
     fi
     ;;
@@ -4998,9 +4651,12 @@
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd* | bitrig*)
+  openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5008,7 +4664,7 @@
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test yes = "$with_gnu_ld"; then
+  if test "$with_gnu_ld" = yes; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -5030,24 +4686,24 @@
     esac
   fi
 
-  if test yes = "$lt_use_gnu_ld_interface"; then
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='$wl'
+    wlarc='${wl}'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
     else
       _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+    case `$LD -v 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -5060,7 +4716,7 @@
     case $host_os in
     aix[[3-9]]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test ia64 != "$host_cpu"; then
+      if test "$host_cpu" != ia64; then
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
@@ -5079,7 +4735,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -5095,7 +4751,7 @@
 	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -5105,7 +4761,7 @@
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5113,89 +4769,61 @@
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file, use it as
-	# is; otherwise, prepend EXPORTS...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-          cp $export_symbols $output_objdir/$soname.def;
-        else
-          echo EXPORTS > $output_objdir/$soname.def;
-          cat $export_symbols >> $output_objdir/$soname.def;
-        fi~
-        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      shrext_cmds=.dll
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test linux-dietlibc = "$host_os"; then
+      if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test no = "$tmp_diet"
+	 && test "$tmp_diet" = no
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -5206,47 +4834,42 @@
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
-        nagfor*)                        # NAGFOR 5.3
-          tmp_sharedflag='-Wl,-shared' ;;
 	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-        if test yes = "$supports_anon_versioning"; then
+        if test "x$supports_anon_versioning" = xyes; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-            echo "local: *; };" >> $output_objdir/$libname.ver~
-            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
-	tcc*)
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
-	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test yes = "$supports_anon_versioning"; then
+	  if test "x$supports_anon_versioning" = xyes; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-              echo "local: *; };" >> $output_objdir/$libname.ver~
-              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -5255,13 +4878,13 @@
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -5279,8 +4902,8 @@
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -5292,7 +4915,7 @@
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -5307,9 +4930,9 @@
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -5326,15 +4949,15 @@
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
     esac
 
-    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
       runpath_var=
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -5350,7 +4973,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_TAGVAR(hardcode_direct, $1)=unsupported
@@ -5358,57 +4981,34 @@
       ;;
 
     aix[[4-9]]*)
-      if test ia64 = "$host_cpu"; then
+      if test "$host_cpu" = ia64; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=
+	no_entry_flag=""
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
-	# Without the "-l" option, or with the "-B" option, AIX nm treats
-	# weak defined symbols like other global defined symbols, whereas
-	# GNU nm marks them as "W".
-	# While the 'weak' keyword is ignored in the Export File, we need
-	# it in the Import File for the 'aix-soname' feature, so we have
-	# to replace the "-B" option with "-P" for AIX nm.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# have runtime linking enabled, and use it for executables.
-	# For shared libraries, we enable/disable runtime linking
-	# depending on the kind of the shared library created -
-	# when "with_aix_soname,aix_use_runtimelinking" is:
-	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "aix,yes"  lib.so          shared, rtl:yes, for executables
-	#            lib.a           static archive
-	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
-	#            lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a(lib.so.V) shared, rtl:no
-	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a           static archive
+	# need to do runtime linking.
 	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
-	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
-	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
-	    # so we don't have lib.a shared libs to link our executables.
-	    # We have to force runtime linking in this case.
-	    aix_use_runtimelinking=yes
-	    LDFLAGS="$LDFLAGS -Wl,-brtl"
-	  fi
 	  ;;
 	esac
 
@@ -5427,21 +5027,13 @@
       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
-      case $with_aix_soname,$aix_use_runtimelinking in
-      aix,*) ;; # traditional, no import file
-      svr4,* | *,yes) # use import file
-	# The Import File defines what to hardcode.
-	_LT_TAGVAR(hardcode_direct, $1)=no
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-	;;
-      esac
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
 
-      if test yes = "$GCC"; then
+      if test "$GCC" = yes; then
 	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`$CC -print-prog-name=collect2`
+	  collect2name=`${CC} -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -5460,80 +5052,62 @@
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test yes = "$aix_use_runtimelinking"; then
-	  shared_flag="$shared_flag "'$wl-G'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
 	fi
-	# Need to ensure runtime linking is disabled for the traditional
-	# shared library, or the linker may eventually find shared libraries
-	# /with/ Import File - we do not want to mix them.
-	shared_flag_aix='-shared'
-	shared_flag_svr4='-shared $wl-G'
+	_LT_TAGVAR(link_all_deplibs, $1)=no
       else
 	# not using gcc
-	if test ia64 = "$host_cpu"; then
+	if test "$host_cpu" = ia64; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test yes = "$aix_use_runtimelinking"; then
-	    shared_flag='$wl-G'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
 	  else
-	    shared_flag='$wl-bM:SRE'
+	    shared_flag='${wl}-bM:SRE'
 	  fi
-	  shared_flag_aix='$wl-bM:SRE'
-	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+      if test "$aix_use_runtimelinking" = yes; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
         _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
       else
-	if test ia64 = "$host_cpu"; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
 	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
-	  if test yes = "$with_gnu_ld"; then
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
-	  # -brtl affects multiple linker settings, -berok does not and is overridden later
-	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
-	  if test svr4 != "$with_aix_soname"; then
-	    # This is similar to how AIX traditionally builds its shared libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
-	  fi
-	  if test aix != "$with_aix_soname"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
-	  else
-	    # used by -dlpreopen to get the symbols
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
-	  fi
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -5542,7 +5116,7 @@
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -5572,17 +5146,16 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
+	shrext_cmds=".dll"
 	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-            cp "$export_symbols" "$output_objdir/$soname.def";
-            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
-          else
-            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
-          fi~
-          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-          linknames='
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5591,18 +5164,18 @@
 	# Don't use ranlib
 	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-          lt_tool_outputfile="@TOOL_OUTPUT@"~
-          case $lt_outputfile in
-            *.exe|*.EXE) ;;
-            *)
-              lt_outputfile=$lt_outputfile.exe
-              lt_tool_outputfile=$lt_tool_outputfile.exe
-              ;;
-          esac~
-          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
-            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-            $RM "$lt_outputfile.manifest";
-          fi'
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -5611,7 +5184,7 @@
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
+	shrext_cmds=".dll"
 	# FIXME: Setting linknames here is a bad hack.
 	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -5661,33 +5234,33 @@
       ;;
 
     hpux9*)
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_direct, $1)=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       ;;
 
     hpux10*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test no = "$with_gnu_ld"; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5695,25 +5268,25 @@
       ;;
 
     hpux11*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	m4_if($1, [], [
@@ -5721,14 +5294,14 @@
 	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
 	  _LT_LINKER_OPTION([if $CC understands -b],
 	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
 	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
-      if test no = "$with_gnu_ld"; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	case $host_cpu in
@@ -5739,7 +5312,7 @@
 	*)
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -5750,16 +5323,16 @@
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
 	# This should be the same for all languages, so no per-tag cache variable.
 	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
 	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS=$LDFLAGS
-	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+	  [save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
 	   AC_LINK_IFELSE(
 	     [AC_LANG_SOURCE(
 	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
@@ -5772,32 +5345,22 @@
       end]])])],
 	      [lt_cv_irix_exported_symbol=yes],
 	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS=$save_LDFLAGS])
-	if test yes = "$lt_cv_irix_exported_symbol"; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+           LDFLAGS="$save_LDFLAGS"])
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
 	fi
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(inherit_rpath, $1)=yes
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    linux*)
-      case $cc_basename in
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	_LT_TAGVAR(ld_shlibs, $1)=yes
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      esac
-      ;;
-
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -5811,7 +5374,7 @@
     newsos6)
       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
@@ -5819,19 +5382,27 @@
     *nto* | *qnx*)
       ;;
 
-    openbsd* | bitrig*)
+    openbsd*)
       if test -f /usr/libexec/ld.so; then
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	else
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
 	fi
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5842,53 +5413,33 @@
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      shrext_cmds=.dll
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5899,24 +5450,24 @@
 
     solaris*)
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test yes = "$GCC"; then
-	wlarc='$wl'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='$wl'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -5926,11 +5477,11 @@
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands '-z linker_flag'.  GCC discards it without '$wl',
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test yes = "$GCC"; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 	else
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	fi
@@ -5940,10 +5491,10 @@
       ;;
 
     sunos4*)
-      if test sequent = "$host_vendor"; then
+      if test "x$host_vendor" = xsequent; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -5992,43 +5543,43 @@
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # Note: We can NOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -6043,17 +5594,17 @@
       ;;
     esac
 
-    if test sni = "$host_vendor"; then
+    if test x$host_vendor = xsni; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
 	;;
       esac
     fi
   fi
 ])
 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
 
@@ -6070,7 +5621,7 @@
   # Assume -lc should be added
   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 
-  if test yes,yes = "$GCC,$enable_shared"; then
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
     case $_LT_TAGVAR(archive_cmds, $1) in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -6150,12 +5701,12 @@
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
     DIR into the resulting binary])
 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
     DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting $shlibpath_var if the
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
     library is relocated])
 _LT_TAGDECL([], [hardcode_minus_L], [0],
     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -6196,10 +5747,10 @@
 # ------------------------
 # Ensure that the configuration variables for a C compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to 'libtool'.
+# the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_C_CONFIG],
 [m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC=$CC
+lt_save_CC="$CC"
 AC_LANG_PUSH(C)
 
 # Source file extension for C test sources.
@@ -6239,18 +5790,18 @@
   LT_SYS_DLOPEN_SELF
   _LT_CMD_STRIPLIB
 
-  # Report what library types will actually be built
+  # Report which library types will actually be built
   AC_MSG_CHECKING([if libtool supports shared libraries])
   AC_MSG_RESULT([$can_build_shared])
 
   AC_MSG_CHECKING([whether to build shared libraries])
-  test no = "$can_build_shared" && enable_shared=no
+  test "$can_build_shared" = "no" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test yes = "$enable_shared" && enable_static=no
+    test "$enable_shared" = yes && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -6258,12 +5809,8 @@
     ;;
 
   aix[[4-9]]*)
-    if test ia64 != "$host_cpu"; then
-      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-      yes,aix,yes) ;;			# shared object as lib.so file only
-      yes,svr4,*) ;;			# shared object as lib.so archive member only
-      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-      esac
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
     fi
     ;;
   esac
@@ -6271,13 +5818,13 @@
 
   AC_MSG_CHECKING([whether to build static libraries])
   # Make sure either enable_shared or enable_static is yes.
-  test yes = "$enable_shared" || enable_static=yes
+  test "$enable_shared" = yes || enable_static=yes
   AC_MSG_RESULT([$enable_static])
 
   _LT_CONFIG($1)
 fi
 AC_LANG_POP
-CC=$lt_save_CC
+CC="$lt_save_CC"
 ])# _LT_LANG_C_CONFIG
 
 
@@ -6285,14 +5832,14 @@
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to 'libtool'.
+# the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test no != "$CXX" &&
-    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
-    (test g++ != "$CXX"))); then
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
   AC_PROG_CXXCPP
 else
   _lt_caught_CXX_error=yes
@@ -6334,7 +5881,7 @@
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_caught_CXX_error"; then
+if test "$_lt_caught_CXX_error" != yes; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -6376,35 +5923,35 @@
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test yes = "$GXX"; then
+    if test "$GXX" = yes; then
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
     else
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
     fi
 
-    if test yes = "$GXX"; then
+    if test "$GXX" = yes; then
       # Set up default GNU C++ configuration
 
       LT_PATH_LD
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test yes = "$with_gnu_ld"; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='$wl'
+        wlarc='${wl}'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         else
           _LT_TAGVAR(whole_archive_flag_spec, $1)=
         fi
@@ -6440,30 +5987,18 @@
         _LT_TAGVAR(ld_shlibs, $1)=no
         ;;
       aix[[4-9]]*)
-        if test ia64 = "$host_cpu"; then
+        if test "$host_cpu" = ia64; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=
+          no_entry_flag=""
         else
           aix_use_runtimelinking=no
 
           # Test if we are trying to use run time linking or normal
           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # have runtime linking enabled, and use it for executables.
-          # For shared libraries, we enable/disable runtime linking
-          # depending on the kind of the shared library created -
-          # when "with_aix_soname,aix_use_runtimelinking" is:
-          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
-          # "aix,yes"  lib.so          shared, rtl:yes, for executables
-          #            lib.a           static archive
-          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
-          #            lib.a(lib.so.V) shared, rtl:no,  for executables
-          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
-          #            lib.a(lib.so.V) shared, rtl:no
-          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
-          #            lib.a           static archive
+          # need to do runtime linking.
           case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	    for ld_flag in $LDFLAGS; do
 	      case $ld_flag in
@@ -6473,13 +6008,6 @@
 	        ;;
 	      esac
 	    done
-	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
-	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
-	      # so we don't have lib.a shared libs to link our executables.
-	      # We have to force runtime linking in this case.
-	      aix_use_runtimelinking=yes
-	      LDFLAGS="$LDFLAGS -Wl,-brtl"
-	    fi
 	    ;;
           esac
 
@@ -6498,21 +6026,13 @@
         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
-        case $with_aix_soname,$aix_use_runtimelinking in
-        aix,*) ;;	# no import file
-        svr4,* | *,yes) # use import file
-          # The Import File defines what to hardcode.
-          _LT_TAGVAR(hardcode_direct, $1)=no
-          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-          ;;
-        esac
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
 
-        if test yes = "$GXX"; then
+        if test "$GXX" = yes; then
           case $host_os in aix4.[[012]]|aix4.[[012]].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`$CC -print-prog-name=collect2`
+	  collect2name=`${CC} -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -6530,84 +6050,64 @@
 	  fi
           esac
           shared_flag='-shared'
-	  if test yes = "$aix_use_runtimelinking"; then
-	    shared_flag=$shared_flag' $wl-G'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
 	  fi
-	  # Need to ensure runtime linking is disabled for the traditional
-	  # shared library, or the linker may eventually find shared libraries
-	  # /with/ Import File - we do not want to mix them.
-	  shared_flag_aix='-shared'
-	  shared_flag_svr4='-shared $wl-G'
         else
           # not using gcc
-          if test ia64 = "$host_cpu"; then
+          if test "$host_cpu" = ia64; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test yes = "$aix_use_runtimelinking"; then
-	      shared_flag='$wl-G'
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
 	    else
-	      shared_flag='$wl-bM:SRE'
+	      shared_flag='${wl}-bM:SRE'
 	    fi
-	    shared_flag_aix='$wl-bM:SRE'
-	    shared_flag_svr4='$wl-G'
           fi
         fi
 
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         _LT_TAGVAR(always_export_symbols, $1)=yes
-	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+        if test "$aix_use_runtimelinking" = yes; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
-          # The "-G" linker flag allows undefined symbols.
-          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
           _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         else
-          if test ia64 = "$host_cpu"; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
 	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
-	    if test yes = "$with_gnu_ld"; then
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	    fi
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
-	    # -brtl affects multiple linker settings, -berok does not and is overridden later
-	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
-	    if test svr4 != "$with_aix_soname"; then
-	      # This is similar to how AIX traditionally builds its shared
-	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
-	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
-	    fi
-	    if test aix != "$with_aix_soname"; then
-	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
-	    else
-	      # used by -dlpreopen to get the symbols
-	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
-	    fi
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
           fi
         fi
         ;;
@@ -6617,7 +6117,7 @@
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6645,58 +6145,57 @@
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=.dll
+	  shrext_cmds=".dll"
 	  # FIXME: Setting linknames here is a bad hack.
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-              cp "$export_symbols" "$output_objdir/$soname.def";
-              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
-            else
-              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
-            fi~
-            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-            linknames='
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 	  # Don't use ranlib
 	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-            lt_tool_outputfile="@TOOL_OUTPUT@"~
-            case $lt_outputfile in
-              *.exe|*.EXE) ;;
-              *)
-                lt_outputfile=$lt_outputfile.exe
-                lt_tool_outputfile=$lt_tool_outputfile.exe
-                ;;
-            esac~
-            func_to_tool_file "$lt_outputfile"~
-            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
-              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-              $RM "$lt_outputfile.manifest";
-            fi'
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  _LT_TAGVAR(always_export_symbols, $1)=no
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file, use it as
-	    # is; otherwise, prepend EXPORTS...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-              cp $export_symbols $output_objdir/$soname.def;
-            else
-              echo EXPORTS > $output_objdir/$soname.def;
-              cat $export_symbols >> $output_objdir/$soname.def;
-            fi~
-            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -6707,34 +6206,6 @@
         _LT_DARWIN_LINKER_FEATURES($1)
 	;;
 
-      os2*)
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	shrext_cmds=.dll
-	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	  $ECHO EXPORTS >> $output_objdir/$libname.def~
-	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	  emximp -o $lib $output_objdir/$libname.def'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	  $ECHO EXPORTS >> $output_objdir/$libname.def~
-	  prefix_cmds="$SED"~
-	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	    prefix_cmds="$prefix_cmds -e 1d";
-	  fi~
-	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	  emximp -o $lib $output_objdir/$libname.def'
-	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	;;
-
       dgux*)
         case $cc_basename in
           ec++*)
@@ -6770,14 +6241,14 @@
         ;;
 
       haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
         ;;
 
       hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         _LT_TAGVAR(hardcode_direct, $1)=yes
         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 				             # but as the default
@@ -6789,7 +6260,7 @@
             _LT_TAGVAR(ld_shlibs, $1)=no
             ;;
           aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -6798,11 +6269,11 @@
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test yes = "$GXX"; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6812,15 +6283,15 @@
         ;;
 
       hpux10*|hpux11*)
-        if test no = "$with_gnu_ld"; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
               ;;
           esac
         fi
@@ -6846,13 +6317,13 @@
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -6863,20 +6334,20 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test yes = "$GXX"; then
-	      if test no = "$with_gnu_ld"; then
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
 	        case $host_cpu in
 	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -6891,22 +6362,22 @@
       interix[[3-9]]*)
 	_LT_TAGVAR(hardcode_direct, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -6915,17 +6386,17 @@
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test yes = "$GXX"; then
-	      if test no = "$with_gnu_ld"; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 	    ;;
         esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
@@ -6938,8 +6409,8 @@
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -6948,10 +6419,10 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -6965,59 +6436,59 @@
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-                rm -rf $tpldir~
-                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-                $RANLIB $oldlib'
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-                rm -rf $tpldir~
-                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-                rm -rf $tpldir~
-                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -7031,18 +6502,18 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	    if test yes = "$supports_anon_versioning"; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-                echo "local: *; };" >> $output_objdir/$libname.ver~
-                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -7050,10 +6521,10 @@
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
@@ -7111,17 +6582,22 @@
         _LT_TAGVAR(ld_shlibs, $1)=yes
 	;;
 
-      openbsd* | bitrig*)
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
 	if test -f /usr/libexec/ld.so; then
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -7137,9 +6613,9 @@
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	    # Archives containing C++ object files must be created using
@@ -7157,17 +6633,17 @@
           cxx*)
 	    case $host in
 	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-                  echo "-hidden">> $lib.exp~
-                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
-                  $RM $lib.exp'
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
 	    esac
@@ -7182,21 +6658,21 @@
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test yes,no = "$GXX,$with_gnu_ld"; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -7242,9 +6718,9 @@
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -7252,7 +6728,7 @@
 	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands '-z linker_flag'.
+		# but understands `-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -7269,30 +6745,30 @@
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test yes,no = "$GXX,$with_gnu_ld"; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
 	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -7300,11 +6776,11 @@
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
 	      case $host_os in
 		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -7313,52 +6789,52 @@
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We CANNOT use -z defs as we might desire, because we do not
+	# Note: We can NOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
 	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
 	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-              '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
 	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-              '"$_LT_TAGVAR(reload_cmds, $1)"
+	      '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -7389,10 +6865,10 @@
     esac
 
     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-    _LT_TAGVAR(GCC, $1)=$GXX
-    _LT_TAGVAR(LD, $1)=$LD
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7419,7 +6895,7 @@
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test yes != "$_lt_caught_CXX_error"
+fi # test "$_lt_caught_CXX_error" != yes
 
 AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
@@ -7441,14 +6917,13 @@
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
 func_stripname_cnf ()
 {
-  case @S|@2 in
-  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
-  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
   esac
 } # func_stripname_cnf
 ])# _LT_FUNC_STRIPNAME_CNF
 
-
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -7532,13 +7007,13 @@
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case $prev$p in
+    case ${prev}${p} in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test x-L = "$p" ||
-          test x-R = "$p"; then
+       if test $p = "-L" ||
+          test $p = "-R"; then
 	 prev=$p
 	 continue
        fi
@@ -7554,16 +7029,16 @@
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test no = "$pre_test_object_deps_done"; then
-	 case $prev in
+       if test "$pre_test_object_deps_done" = no; then
+	 case ${prev} in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
 	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -7571,9 +7046,9 @@
 	 esac
        else
 	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)=$prev$p
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
 	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
 	 fi
        fi
        prev=
@@ -7588,15 +7063,15 @@
 	 continue
        fi
 
-       if test no = "$pre_test_object_deps_done"; then
+       if test "$pre_test_object_deps_done" = no; then
 	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)=$p
+	   _LT_TAGVAR(predep_objects, $1)="$p"
 	 else
 	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
 	 fi
        else
 	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)=$p
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
 	 else
 	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
 	 fi
@@ -7627,6 +7102,51 @@
   _LT_TAGVAR(postdep_objects,$1)=
   _LT_TAGVAR(postdeps,$1)=
   ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
 esac
 ])
 
@@ -7635,7 +7155,7 @@
 esac
  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
 fi
 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
     [The directories searched by this compiler when creating a shared library])
@@ -7655,10 +7175,10 @@
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
+# to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
 [AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test no = "$F77"; then
+if test -z "$F77" || test "X$F77" = "Xno"; then
   _lt_disable_F77=yes
 fi
 
@@ -7695,7 +7215,7 @@
 # the F77 compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_disable_F77"; then
+if test "$_lt_disable_F77" != yes; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7717,7 +7237,7 @@
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
+  lt_save_CC="$CC"
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
@@ -7731,25 +7251,21 @@
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test no = "$can_build_shared" && enable_shared=no
+    test "$can_build_shared" = "no" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test yes = "$enable_shared" && enable_static=no
+        test "$enable_shared" = yes && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test ia64 != "$host_cpu"; then
-	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-	  yes,aix,yes) ;;		# shared object as lib.so file only
-	  yes,svr4,*) ;;		# shared object as lib.so archive member only
-	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-	  esac
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
 	fi
         ;;
     esac
@@ -7757,11 +7273,11 @@
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test yes = "$enable_shared" || enable_static=yes
+    test "$enable_shared" = yes || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)=$G77
-    _LT_TAGVAR(LD, $1)=$LD
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7778,9 +7294,9 @@
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-fi # test yes != "$_lt_disable_F77"
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
@@ -7790,11 +7306,11 @@
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
+# to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
 [AC_LANG_PUSH(Fortran)
 
-if test -z "$FC" || test no = "$FC"; then
+if test -z "$FC" || test "X$FC" = "Xno"; then
   _lt_disable_FC=yes
 fi
 
@@ -7831,7 +7347,7 @@
 # the FC compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_disable_FC"; then
+if test "$_lt_disable_FC" != yes; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7853,7 +7369,7 @@
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
+  lt_save_CC="$CC"
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
@@ -7869,25 +7385,21 @@
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test no = "$can_build_shared" && enable_shared=no
+    test "$can_build_shared" = "no" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test yes = "$enable_shared" && enable_static=no
+        test "$enable_shared" = yes && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test ia64 != "$host_cpu"; then
-	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-	  yes,aix,yes) ;;		# shared object as lib.so file only
-	  yes,svr4,*) ;;		# shared object as lib.so archive member only
-	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-	  esac
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
 	fi
         ;;
     esac
@@ -7895,11 +7407,11 @@
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test yes = "$enable_shared" || enable_static=yes
+    test "$enable_shared" = yes || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
-    _LT_TAGVAR(LD, $1)=$LD
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7919,7 +7431,7 @@
   GCC=$lt_save_GCC
   CC=$lt_save_CC
   CFLAGS=$lt_save_CFLAGS
-fi # test yes != "$_lt_disable_FC"
+fi # test "$_lt_disable_FC" != yes
 
 AC_LANG_POP
 ])# _LT_LANG_FC_CONFIG
@@ -7929,7 +7441,7 @@
 # --------------------------
 # Ensure that the configuration variables for the GNU Java Compiler compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
+# to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
 AC_LANG_SAVE
@@ -7963,7 +7475,7 @@
 CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
+_LT_TAGVAR(LD, $1)="$LD"
 _LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -8000,7 +7512,7 @@
 # --------------------------
 # Ensure that the configuration variables for the GNU Go compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
+# to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
 AC_LANG_SAVE
@@ -8034,7 +7546,7 @@
 CFLAGS=$GOFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
+_LT_TAGVAR(LD, $1)="$LD"
 _LT_CC_BASENAME([$compiler])
 
 # Go did not exist at the time GCC didn't implicitly link libc in.
@@ -8071,7 +7583,7 @@
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
+# to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
 AC_LANG_SAVE
@@ -8087,7 +7599,7 @@
 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
-lt_simple_link_test_code=$lt_simple_compile_test_code
+lt_simple_link_test_code="$lt_simple_compile_test_code"
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_TAG_COMPILER
@@ -8097,7 +7609,7 @@
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC=$CC
+lt_save_CC="$CC"
 lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
@@ -8126,7 +7638,7 @@
 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
     [AC_CHECK_TOOL(GCJ, gcj,)
-      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
       AC_SUBST(GCJFLAGS)])])[]dnl
 ])
 
@@ -8237,7 +7749,7 @@
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f "$lt_ac_sed" && continue
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -8254,9 +7766,9 @@
     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
     cmp -s conftest.out conftest.nl || break
     # 10000 chars as input seems more than enough
-    test 10 -lt "$lt_ac_count" && break
+    test $lt_ac_count -gt 10 && break
     lt_ac_count=`expr $lt_ac_count + 1`
-    if test "$lt_ac_count" -gt "$lt_ac_max"; then
+    if test $lt_ac_count -gt $lt_ac_max; then
       lt_ac_max=$lt_ac_count
       lt_cv_path_SED=$lt_ac_sed
     fi
@@ -8280,7 +7792,27 @@
 # Find out whether the shell is Bourne or XSI compatible,
 # or has some other useful features.
 m4_defun([_LT_CHECK_SHELL_FEATURES],
-[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
   lt_unset=false
@@ -8304,9 +7836,102 @@
 ])# _LT_CHECK_SHELL_FEATURES
 
 
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
 # _LT_PATH_CONVERSION_FUNCTIONS
 # -----------------------------
-# Determine what file name conversion functions should be used by
+# Determine which file name conversion functions should be used by
 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
 # for certain cross-compile configurations and native mingw.
 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
diff --git a/third_party/libxml/src/m4/ltoptions.m4 b/third_party/libxml/src/m4/ltoptions.m4
index 94b08297..5d9acd8e2 100644
--- a/third_party/libxml/src/m4/ltoptions.m4
+++ b/third_party/libxml/src/m4/ltoptions.m4
@@ -1,14 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
-#   Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 8 ltoptions.m4
+# serial 7 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -29,7 +29,7 @@
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option '$2'])])[]dnl
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
 ])
 
 
@@ -75,15 +75,13 @@
   dnl
   dnl If no reference was made to various pairs of opposing options, then
   dnl we run the default mode handler for the pair.  For example, if neither
-  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
   dnl archives by default:
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-		   [_LT_ENABLE_FAST_INSTALL])
-  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
-		   [_LT_WITH_AIX_SONAME([aix])])
+  		   [_LT_ENABLE_FAST_INSTALL])
   ])
 ])# _LT_SET_OPTIONS
 
@@ -114,7 +112,7 @@
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'dlopen' option into LT_INIT's first parameter.])
+put the `dlopen' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -150,7 +148,7 @@
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'win32-dll' option into LT_INIT's first parameter.])
+put the `win32-dll' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -159,9 +157,9 @@
 
 # _LT_ENABLE_SHARED([DEFAULT])
 # ----------------------------
-# implement the --enable-shared flag, and supports the 'shared' and
-# 'disable-shared' LT_INIT options.
-# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 m4_define([_LT_ENABLE_SHARED],
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([shared],
@@ -174,14 +172,14 @@
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac],
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -213,9 +211,9 @@
 
 # _LT_ENABLE_STATIC([DEFAULT])
 # ----------------------------
-# implement the --enable-static flag, and support the 'static' and
-# 'disable-static' LT_INIT options.
-# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 m4_define([_LT_ENABLE_STATIC],
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([static],
@@ -228,14 +226,14 @@
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac],
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -267,9 +265,9 @@
 
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # ----------------------------------
-# implement the --enable-fast-install flag, and support the 'fast-install'
-# and 'disable-fast-install' LT_INIT options.
-# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
 m4_define([_LT_ENABLE_FAST_INSTALL],
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([fast-install],
@@ -282,14 +280,14 @@
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac],
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -306,14 +304,14 @@
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the 'fast-install' option into LT_INIT's first parameter.])
+the `fast-install' option into LT_INIT's first parameter.])
 ])
 
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the 'disable-fast-install' option into LT_INIT's first parameter.])
+the `disable-fast-install' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -321,64 +319,11 @@
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 
 
-# _LT_WITH_AIX_SONAME([DEFAULT])
-# ----------------------------------
-# implement the --with-aix-soname flag, and support the `aix-soname=aix'
-# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
-# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
-m4_define([_LT_WITH_AIX_SONAME],
-[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
-shared_archive_member_spec=
-case $host,$enable_shared in
-power*-*-aix[[5-9]]*,yes)
-  AC_MSG_CHECKING([which variant of shared library versioning to provide])
-  AC_ARG_WITH([aix-soname],
-    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
-      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
-    [case $withval in
-    aix|svr4|both)
-      ;;
-    *)
-      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
-      ;;
-    esac
-    lt_cv_with_aix_soname=$with_aix_soname],
-    [AC_CACHE_VAL([lt_cv_with_aix_soname],
-      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
-    with_aix_soname=$lt_cv_with_aix_soname])
-  AC_MSG_RESULT([$with_aix_soname])
-  if test aix != "$with_aix_soname"; then
-    # For the AIX way of multilib, we name the shared archive member
-    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
-    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
-    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
-    # the AIX toolchain works better with OBJECT_MODE set (default 32).
-    if test 64 = "${OBJECT_MODE-32}"; then
-      shared_archive_member_spec=shr_64
-    else
-      shared_archive_member_spec=shr
-    fi
-  fi
-  ;;
-*)
-  with_aix_soname=aix
-  ;;
-esac
-
-_LT_DECL([], [shared_archive_member_spec], [0],
-    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
-])# _LT_WITH_AIX_SONAME
-
-LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
-LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
-LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
-
-
 # _LT_WITH_PIC([MODE])
 # --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
 # LT_INIT options.
-# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -389,17 +334,19 @@
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for lt_pkg in $withval; do
-	IFS=$lt_save_ifs
+	IFS="$lt_save_ifs"
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS=$lt_save_ifs
+      IFS="$lt_save_ifs"
       ;;
     esac],
-    [pic_mode=m4_default([$1], [default])])
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
 
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 ])# _LT_WITH_PIC
@@ -412,7 +359,7 @@
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'pic-only' option into LT_INIT's first parameter.])
+put the `pic-only' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
diff --git a/third_party/libxml/src/m4/ltsugar.m4 b/third_party/libxml/src/m4/ltsugar.m4
index 48bc934..9000a05 100644
--- a/third_party/libxml/src/m4/ltsugar.m4
+++ b/third_party/libxml/src/m4/ltsugar.m4
@@ -1,7 +1,6 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -34,7 +33,7 @@
 # ------------
 # Manipulate m4 lists.
 # These macros are necessary as long as will still need to support
-# Autoconf-2.59, which quotes differently.
+# Autoconf-2.59 which quotes differently.
 m4_define([lt_car], [[$1]])
 m4_define([lt_cdr],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -45,7 +44,7 @@
 
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
diff --git a/third_party/libxml/src/m4/ltversion.m4 b/third_party/libxml/src/m4/ltversion.m4
index fa04b52..07a8602 100644
--- a/third_party/libxml/src/m4/ltversion.m4
+++ b/third_party/libxml/src/m4/ltversion.m4
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+#   Copyright (C) 2004 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 4179 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.6])
-m4_define([LT_PACKAGE_REVISION], [2.4.6])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.6'
-macro_revision='2.4.6'
+[macro_version='2.4.2'
+macro_revision='1.3337'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/third_party/libxml/src/m4/lt~obsolete.m4 b/third_party/libxml/src/m4/lt~obsolete.m4
index c6b26f8..c573da9 100644
--- a/third_party/libxml/src/m4/lt~obsolete.m4
+++ b/third_party/libxml/src/m4/lt~obsolete.m4
@@ -1,7 +1,6 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
-#   Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
@@ -12,7 +11,7 @@
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
 # which have later been changed to m4_define as they aren't part of the
 # exported API, or moved to Autoconf or Automake where they belong.
 #
@@ -26,7 +25,7 @@
 # included after everything else.  This provides aclocal with the
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
 #
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Yes, that means every name once taken will need to remain here until
diff --git a/third_party/libxml/src/missing b/third_party/libxml/src/missing
index f62bbae3..db98974f 100755
--- a/third_party/libxml/src/missing
+++ b/third_party/libxml/src/missing
@@ -3,7 +3,7 @@
 
 scriptversion=2013-10-28.13; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
diff --git a/third_party/libxml/src/parser.c b/third_party/libxml/src/parser.c
index 71315cff..978a585 100644
--- a/third_party/libxml/src/parser.c
+++ b/third_party/libxml/src/parser.c
@@ -3625,7 +3625,7 @@
     }
     /* failure (or end of input buffer), check with full function */
     ret = xmlParseName (ctxt);
-    /* strings coming from the dictionnary direct compare possible */
+    /* strings coming from the dictionary direct compare possible */
     if (ret == other) {
 	return (const xmlChar*) 1;
     }
@@ -8819,7 +8819,7 @@
  * @prefix:  the prefix to lookup
  *
  * Lookup the namespace name for the @prefix (which ca be NULL)
- * The prefix must come from the @ctxt->dict dictionnary
+ * The prefix must come from the @ctxt->dict dictionary
  *
  * Returns the namespace name or NULL if not bound
  */
@@ -11211,8 +11211,9 @@
 }
 /**
  * xmlCheckCdataPush:
- * @cur: pointer to the bock of characters
+ * @cur: pointer to the block of characters
  * @len: length of the block in bytes
+ * @complete: 1 if complete CDATA block is passed in, 0 if partial block
  *
  * Check that the block of characters is okay as SCdata content [20]
  *
@@ -11220,7 +11221,7 @@
  *         UTF-8 error occured otherwise
  */
 static int
-xmlCheckCdataPush(const xmlChar *utf, int len) {
+xmlCheckCdataPush(const xmlChar *utf, int len, int complete) {
     int ix;
     unsigned char c;
     int codepoint;
@@ -11238,7 +11239,7 @@
 	    else
 	        return(-ix);
 	} else if ((c & 0xe0) == 0xc0) {/* 2-byte code, starts with 110 */
-	    if (ix + 2 > len) return(-ix);
+	    if (ix + 2 > len) return(complete ? -ix : ix);
 	    if ((utf[ix+1] & 0xc0 ) != 0x80)
 	        return(-ix);
 	    codepoint = (utf[ix] & 0x1f) << 6;
@@ -11247,7 +11248,7 @@
 	        return(-ix);
 	    ix += 2;
 	} else if ((c & 0xf0) == 0xe0) {/* 3-byte code, starts with 1110 */
-	    if (ix + 3 > len) return(-ix);
+	    if (ix + 3 > len) return(complete ? -ix : ix);
 	    if (((utf[ix+1] & 0xc0) != 0x80) ||
 	        ((utf[ix+2] & 0xc0) != 0x80))
 		    return(-ix);
@@ -11258,7 +11259,7 @@
 	        return(-ix);
 	    ix += 3;
 	} else if ((c & 0xf8) == 0xf0) {/* 4-byte code, starts with 11110 */
-	    if (ix + 4 > len) return(-ix);
+	    if (ix + 4 > len) return(complete ? -ix : ix);
 	    if (((utf[ix+1] & 0xc0) != 0x80) ||
 	        ((utf[ix+2] & 0xc0) != 0x80) ||
 		((utf[ix+3] & 0xc0) != 0x80))
@@ -11773,7 +11774,7 @@
 		        int tmp;
 
 			tmp = xmlCheckCdataPush(ctxt->input->cur,
-			                        XML_PARSER_BIG_BUFFER_SIZE);
+			                        XML_PARSER_BIG_BUFFER_SIZE, 0);
 			if (tmp < 0) {
 			    tmp = -tmp;
 			    ctxt->input->cur += tmp;
@@ -11796,7 +11797,7 @@
 		} else {
 		    int tmp;
 
-		    tmp = xmlCheckCdataPush(ctxt->input->cur, base);
+		    tmp = xmlCheckCdataPush(ctxt->input->cur, base, 1);
 		    if ((tmp < 0) || (tmp != base)) {
 			tmp = -tmp;
 			ctxt->input->cur += tmp;
@@ -14991,7 +14992,7 @@
  * DICT_FREE:
  * @str:  a string
  *
- * Free a string if it is not owned by the "dict" dictionnary in the
+ * Free a string if it is not owned by the "dict" dictionary in the
  * current scope
  */
 #define DICT_FREE(str)						\
diff --git a/third_party/libxml/src/schematron.c b/third_party/libxml/src/schematron.c
index eb4befe..458984f 100644
--- a/third_party/libxml/src/schematron.c
+++ b/third_party/libxml/src/schematron.c
@@ -133,7 +133,7 @@
     int flags;			/* specific to this schematron */
 
     void *_private;		/* unused by the library */
-    xmlDictPtr dict;		/* the dictionnary used internally */
+    xmlDictPtr dict;		/* the dictionary used internally */
 
     const xmlChar *title;	/* the title if any */
 
@@ -186,7 +186,7 @@
     const char *buffer;
     int size;
 
-    xmlDictPtr dict;            /* dictionnary for interned string names */
+    xmlDictPtr dict;            /* dictionary for interned string names */
 
     int nberrors;
     int err;
diff --git a/third_party/libxml/src/testapi.c b/third_party/libxml/src/testapi.c
index 9205e643..60f4bdd 100644
--- a/third_party/libxml/src/testapi.c
+++ b/third_party/libxml/src/testapi.c
@@ -8175,7 +8175,7 @@
 
     int mem_base;
     xmlDictPtr ret_val;
-    xmlDictPtr sub; /* an existing dictionnary */
+    xmlDictPtr sub; /* an existing dictionary */
     int n_sub;
 
     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
@@ -8207,7 +8207,7 @@
 
     int mem_base;
     const xmlChar * ret_val;
-    xmlDictPtr dict; /* the dictionnary */
+    xmlDictPtr dict; /* the dictionary */
     int n_dict;
     xmlChar * name; /* the name of the userdata */
     int n_name;
@@ -8263,7 +8263,7 @@
 
     int mem_base;
     const xmlChar * ret_val;
-    xmlDictPtr dict; /* the dictionnary */
+    xmlDictPtr dict; /* the dictionary */
     int n_dict;
     xmlChar * name; /* the name of the userdata */
     int n_name;
@@ -8309,7 +8309,7 @@
 
     int mem_base;
     int ret_val;
-    xmlDictPtr dict; /* the dictionnary */
+    xmlDictPtr dict; /* the dictionary */
     int n_dict;
     xmlChar * str; /* the string */
     int n_str;
@@ -8348,7 +8348,7 @@
 
     int mem_base;
     const xmlChar * ret_val;
-    xmlDictPtr dict; /* the dictionnary */
+    xmlDictPtr dict; /* the dictionary */
     int n_dict;
     xmlChar * prefix; /* the prefix */
     int n_prefix;
@@ -8394,7 +8394,7 @@
 
     int mem_base;
     int ret_val;
-    xmlDictPtr dict; /* the dictionnary */
+    xmlDictPtr dict; /* the dictionary */
     int n_dict;
 
     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
@@ -8437,7 +8437,7 @@
 
     int mem_base;
     int ret_val;
-    xmlDictPtr dict; /* the dictionnary */
+    xmlDictPtr dict; /* the dictionary */
     int n_dict;
 
     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
diff --git a/third_party/libxml/src/tree.c b/third_party/libxml/src/tree.c
index 6a158ce..7fbca6e0 100644
--- a/third_party/libxml/src/tree.c
+++ b/third_party/libxml/src/tree.c
@@ -1044,7 +1044,7 @@
  * DICT_FREE:
  * @str:  a string
  *
- * Free a string if it is not owned by the "dict" dictionnary in the
+ * Free a string if it is not owned by the "dict" dictionary in the
  * current scope
  */
 #define DICT_FREE(str)						\
@@ -1057,7 +1057,7 @@
  * DICT_COPY:
  * @str:  a string
  *
- * Copy a string using a "dict" dictionnary in the current scope,
+ * Copy a string using a "dict" dictionary in the current scope,
  * if availabe.
  */
 #define DICT_COPY(str, cpy) \
@@ -1074,7 +1074,7 @@
  * DICT_CONST_COPY:
  * @str:  a string
  *
- * Copy a string using a "dict" dictionnary in the current scope,
+ * Copy a string using a "dict" dictionary in the current scope,
  * if availabe.
  */
 #define DICT_CONST_COPY(str, cpy) \
@@ -2270,7 +2270,7 @@
     cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
     if (cur == NULL) {
 	xmlTreeErrMemory("building node");
-	/* we can't check here that name comes from the doc dictionnary */
+	/* we can't check here that name comes from the doc dictionary */
 	return(NULL);
     }
     memset(cur, 0, sizeof(xmlNode));
@@ -2350,7 +2350,7 @@
 	    UPDATE_LAST_CHILD_AND_PARENT(cur)
 	}
     } else {
-        /* if name don't come from the doc dictionnary free it here */
+        /* if name don't come from the doc dictionary free it here */
         if ((name != NULL) && (doc != NULL) &&
 	    (!(xmlDictOwns(doc->dict, name))))
 	    xmlFree(name);
@@ -3701,7 +3701,7 @@
 	     * When a node is a text node or a comment, it uses a global static
 	     * variable for the name of the node.
 	     * Otherwise the node name might come from the document's
-	     * dictionnary
+	     * dictionary
 	     */
 	    if ((cur->name != NULL) &&
 		(cur->type != XML_TEXT_NODE) &&
@@ -3770,7 +3770,7 @@
     /*
      * When a node is a text node or a comment, it uses a global static
      * variable for the name of the node.
-     * Otherwise the node name might come from the document's dictionnary
+     * Otherwise the node name might come from the document's dictionary
      */
     if ((cur->name != NULL) &&
         (cur->type != XML_TEXT_NODE) &&
diff --git a/third_party/libxml/src/valid.c b/third_party/libxml/src/valid.c
index 45a3f70..6567f15 100644
--- a/third_party/libxml/src/valid.c
+++ b/third_party/libxml/src/valid.c
@@ -2532,7 +2532,7 @@
  * DICT_FREE:
  * @str:  a string
  *
- * Free a string if it is not owned by the "dict" dictionnary in the
+ * Free a string if it is not owned by the "dict" dictionary in the
  * current scope
  */
 #define DICT_FREE(str)						\
diff --git a/third_party/libxml/src/win32/VC10/config.h b/third_party/libxml/src/win32/VC10/config.h
deleted file mode 100644
index 8629944e..0000000
--- a/third_party/libxml/src/win32/VC10/config.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef __LIBXML_WIN32_CONFIG__
-#define __LIBXML_WIN32_CONFIG__
-
-#define HAVE_CTYPE_H
-#define HAVE_STDARG_H
-#define HAVE_MALLOC_H
-#define HAVE_ERRNO_H
-#define HAVE_STDINT_H
-
-#if defined(_WIN32_WCE)
-#undef HAVE_ERRNO_H
-#include <windows.h>
-#include "wincecompat.h"
-#else
-#define HAVE_SYS_STAT_H
-#define HAVE__STAT
-#define HAVE_STAT
-#define HAVE_STDLIB_H
-#define HAVE_TIME_H
-#define HAVE_FCNTL_H
-#include <io.h>
-#include <direct.h>
-#endif
-
-#include <libxml/xmlversion.h>
-
-#ifndef ICONV_CONST
-#define ICONV_CONST const
-#endif
-
-#ifdef NEED_SOCKETS
-#include <wsockcompat.h>
-#endif
-
-/*
- * Windows platforms may define except 
- */
-#undef except
-
-#define HAVE_ISINF
-#define HAVE_ISNAN
-#include <math.h>
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-/* MS C-runtime has functions which can be used in order to determine if
-   a given floating-point variable contains NaN, (+-)INF. These are 
-   preferred, because floating-point technology is considered propriatary
-   by MS and we can assume that their functions know more about their 
-   oddities than we do. */
-#include <float.h>
-/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
-   function. */
-#ifndef isinf
-#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
-	: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
-#endif
-/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
-#ifndef isnan
-#define isnan(d) (_isnan(d))
-#endif
-#else /* _MSC_VER */
-#ifndef isinf
-static int isinf (double d) {
-    int expon = 0;
-    double val = frexp (d, &expon);
-    if (expon == 1025) {
-        if (val == 0.5) {
-            return 1;
-        } else if (val == -0.5) {
-            return -1;
-        } else {
-            return 0;
-        }
-    } else {
-        return 0;
-    }
-}
-#endif
-#ifndef isnan
-static int isnan (double d) {
-    int expon = 0;
-    double val = frexp (d, &expon);
-    if (expon == 1025) {
-        if (val == 0.5) {
-            return 0;
-        } else if (val == -0.5) {
-            return 0;
-        } else {
-            return 1;
-        }
-    } else {
-        return 0;
-    }
-}
-#endif
-#endif /* _MSC_VER */
-
-#if defined(_MSC_VER)
-#define mkdir(p,m) _mkdir(p)
-#define snprintf _snprintf
-#if _MSC_VER < 1500
-#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
-#endif
-#elif defined(__MINGW32__)
-#define mkdir(p,m) _mkdir(p)
-#endif
-
-/* Threading API to use should be specified here for compatibility reasons.
-   This is however best specified on the compiler's command-line. */
-#if defined(LIBXML_THREAD_ENABLED)
-#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
-#define HAVE_WIN32_THREADS
-#endif
-#endif
-
-/* Some third-party libraries far from our control assume the following
-   is defined, which it is not if we don't include windows.h. */
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!(FALSE))
-#endif
-
-#endif /* __LIBXML_WIN32_CONFIG__ */
-
diff --git a/third_party/libxml/src/xmlcatalog.c b/third_party/libxml/src/xmlcatalog.c
deleted file mode 100644
index b9ed6a4..0000000
--- a/third_party/libxml/src/xmlcatalog.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * xmlcatalog.c : a small utility program to handle XML catalogs
- *
- * See Copyright for the status of this software.
- *
- * daniel@veillard.com
- */
-
-#include "libxml.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_LIBREADLINE
-#include <readline/readline.h>
-#ifdef HAVE_LIBHISTORY
-#include <readline/history.h>
-#endif
-#endif
-
-#include <libxml/xmlmemory.h>
-#include <libxml/uri.h>
-#include <libxml/catalog.h>
-#include <libxml/parser.h>
-#include <libxml/globals.h>
-
-#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
-static int shell = 0;
-static int sgml = 0;
-static int noout = 0;
-static int create = 0;
-static int add = 0;
-static int del = 0;
-static int convert = 0;
-static int no_super_update = 0;
-static int verbose = 0;
-static char *filename = NULL;
-
-
-#ifndef XML_SGML_DEFAULT_CATALOG
-#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
-#endif
-
-/************************************************************************
- *									*
- *			Shell Interface					*
- *									*
- ************************************************************************/
-/**
- * xmlShellReadline:
- * @prompt:  the prompt value
- *
- * Read a string
- *
- * Returns a pointer to it or NULL on EOF the caller is expected to
- *     free the returned string.
- */
-static char *
-xmlShellReadline(const char *prompt) {
-#ifdef HAVE_LIBREADLINE
-    char *line_read;
-
-    /* Get a line from the user. */
-    line_read = readline (prompt);
-
-    /* If the line has any text in it, save it on the history. */
-    if (line_read && *line_read)
-	add_history (line_read);
-
-    return (line_read);
-#else
-    char line_read[501];
-    char *ret;
-    int len;
-
-    if (prompt != NULL)
-	fprintf(stdout, "%s", prompt);
-    if (!fgets(line_read, 500, stdin))
-        return(NULL);
-    line_read[500] = 0;
-    len = strlen(line_read);
-    ret = (char *) malloc(len + 1);
-    if (ret != NULL) {
-	memcpy (ret, line_read, len + 1);
-    }
-    return(ret);
-#endif
-}
-
-static void usershell(void) {
-    char *cmdline = NULL, *cur;
-    int nbargs;
-    char command[100];
-    char arg[400];
-    char *argv[20];
-    int i, ret;
-    xmlChar *ans;
-
-    while (1) {
-	cmdline = xmlShellReadline("> ");
-	if (cmdline == NULL)
-	    return;
-
-	/*
-	 * Parse the command itself
-	 */
-	cur = cmdline;
-	nbargs = 0;
-	while ((*cur == ' ') || (*cur == '\t')) cur++;
-	i = 0;
-	while ((*cur != ' ') && (*cur != '\t') &&
-	       (*cur != '\n') && (*cur != '\r')) {
-	    if (*cur == 0)
-		break;
-	    command[i++] = *cur++;
-	}
-	command[i] = 0;
-	if (i == 0) {
-	    free(cmdline);
-	    continue;
-	}
-
-	/*
-	 * Parse the argument string
-	 */
-	memset(arg, 0, sizeof(arg));
-	while ((*cur == ' ') || (*cur == '\t')) cur++;
-	i = 0;
-	while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
-	    if (*cur == 0)
-		break;
-	    arg[i++] = *cur++;
-	}
-	arg[i] = 0;
-
-	/*
-	 * Parse the arguments
-	 */
-	i = 0;
-	nbargs = 0;
-	cur = arg;
-	memset(argv, 0, sizeof(argv));
-	while (*cur != 0) {
-	    while ((*cur == ' ') || (*cur == '\t')) cur++;
-	    if (*cur == '\'') {
-		cur++;
-		argv[i] = cur;
-		while ((*cur != 0) && (*cur != '\'')) cur++;
-		if (*cur == '\'') {
-		    *cur = 0;
-		    nbargs++;
-		    i++;
-		    cur++;
-		}
-	    } else if (*cur == '"') {
-		cur++;
-		argv[i] = cur;
-		while ((*cur != 0) && (*cur != '"')) cur++;
-		if (*cur == '"') {
-		    *cur = 0;
-		    nbargs++;
-		    i++;
-		    cur++;
-		}
-	    } else {
-		argv[i] = cur;
-		while ((*cur != 0) && (*cur != ' ') && (*cur != '\t'))
-		    cur++;
-		*cur = 0;
-		nbargs++;
-		i++;
-		cur++;
-	    }
-	}
-
-	/*
-	 * start interpreting the command
-	 */
-	if (!strcmp(command, "exit") ||
-	    !strcmp(command, "quit") ||
-	    !strcmp(command, "bye")) {
-	    free(cmdline);
-	    break;
-	}
-
-	if (!strcmp(command, "public")) {
-	    if (nbargs != 1) {
-		printf("public requires 1 arguments\n");
-	    } else {
-		ans = xmlCatalogResolvePublic((const xmlChar *) argv[0]);
-		if (ans == NULL) {
-		    printf("No entry for PUBLIC %s\n", argv[0]);
-		} else {
-		    printf("%s\n", (char *) ans);
-		    xmlFree(ans);
-		}
-	    }
-	} else if (!strcmp(command, "system")) {
-	    if (nbargs != 1) {
-		printf("system requires 1 arguments\n");
-	    } else {
-		ans = xmlCatalogResolveSystem((const xmlChar *) argv[0]);
-		if (ans == NULL) {
-		    printf("No entry for SYSTEM %s\n", argv[0]);
-		} else {
-		    printf("%s\n", (char *) ans);
-		    xmlFree(ans);
-		}
-	    }
-	} else if (!strcmp(command, "add")) {
-	    if (sgml) {
-		if ((nbargs != 3) && (nbargs != 2)) {
-		    printf("add requires 2 or 3 arguments\n");
-		} else {
-		    if (argv[2] == NULL)
-			ret = xmlCatalogAdd(BAD_CAST argv[0], NULL,
-					    BAD_CAST argv[1]);
-		    else
-			ret = xmlCatalogAdd(BAD_CAST argv[0], BAD_CAST argv[1],
-					    BAD_CAST argv[2]);
-		    if (ret != 0)
-			printf("add command failed\n");
-		}
-	    } else {
-		if ((nbargs != 3) && (nbargs != 2)) {
-		    printf("add requires 2 or 3 arguments\n");
-		} else {
-		    if (argv[2] == NULL)
-			ret = xmlCatalogAdd(BAD_CAST argv[0], NULL,
-					    BAD_CAST argv[1]);
-		    else
-			ret = xmlCatalogAdd(BAD_CAST argv[0], BAD_CAST argv[1],
-					    BAD_CAST argv[2]);
-		    if (ret != 0)
-			printf("add command failed\n");
-		}
-	    }
-	} else if (!strcmp(command, "del")) {
-	    if (nbargs != 1) {
-		printf("del requires 1\n");
-	    } else {
-		ret = xmlCatalogRemove(BAD_CAST argv[0]);
-		if (ret <= 0)
-		    printf("del command failed\n");
-
-	    }
-	} else if (!strcmp(command, "resolve")) {
-	    if (nbargs != 2) {
-		printf("resolve requires 2 arguments\n");
-	    } else {
-		ans = xmlCatalogResolve(BAD_CAST argv[0],
-			                BAD_CAST argv[1]);
-		if (ans == NULL) {
-		    printf("Resolver failed to find an answer\n");
-		} else {
-		    printf("%s\n", (char *) ans);
-		    xmlFree(ans);
-		}
-	    }
-	} else if (!strcmp(command, "dump")) {
-	    if (nbargs != 0) {
-		printf("dump has no arguments\n");
-	    } else {
-		xmlCatalogDump(stdout);
-	    }
-	} else if (!strcmp(command, "debug")) {
-	    if (nbargs != 0) {
-		printf("debug has no arguments\n");
-	    } else {
-		verbose++;
-		xmlCatalogSetDebug(verbose);
-	    }
-	} else if (!strcmp(command, "quiet")) {
-	    if (nbargs != 0) {
-		printf("quiet has no arguments\n");
-	    } else {
-		if (verbose > 0)
-		    verbose--;
-		xmlCatalogSetDebug(verbose);
-	    }
-	} else {
-	    if (strcmp(command, "help")) {
-		printf("Unrecognized command %s\n", command);
-	    }
-	    printf("Commands available:\n");
-	    printf("\tpublic PublicID: make a PUBLIC identifier lookup\n");
-	    printf("\tsystem SystemID: make a SYSTEM identifier lookup\n");
-	    printf("\tresolve PublicID SystemID: do a full resolver lookup\n");
-	    printf("\tadd 'type' 'orig' 'replace' : add an entry\n");
-	    printf("\tdel 'values' : remove values\n");
-	    printf("\tdump: print the current catalog state\n");
-	    printf("\tdebug: increase the verbosity level\n");
-	    printf("\tquiet: decrease the verbosity level\n");
-	    printf("\texit:  quit the shell\n");
-	}
-	free(cmdline); /* not xmlFree here ! */
-    }
-}
-
-/************************************************************************
- *									*
- *			Main						*
- *									*
- ************************************************************************/
-static void usage(const char *name) {
-    /* split into 2 printf's to avoid overly long string (gcc warning) */
-    printf("\
-Usage : %s [options] catalogfile entities...\n\
-\tParse the catalog file and query it for the entities\n\
-\t--sgml : handle SGML Super catalogs for --add and --del\n\
-\t--shell : run a shell allowing interactive queries\n\
-\t--create : create a new catalog\n\
-\t--add 'type' 'orig' 'replace' : add an XML entry\n\
-\t--add 'entry' : add an SGML entry\n", name);
-    printf("\
-\t--del 'values' : remove values\n\
-\t--noout: avoid dumping the result on stdout\n\
-\t         used with --add or --del, it saves the catalog changes\n\
-\t         and with --sgml it automatically updates the super catalog\n\
-\t--no-super-update: do not update the SGML super catalog\n\
-\t-v --verbose : provide debug informations\n");
-}
-int main(int argc, char **argv) {
-    int i;
-    int ret;
-    int exit_value = 0;
-
-
-    if (argc <= 1) {
-	usage(argv[0]);
-	return(1);
-    }
-
-    LIBXML_TEST_VERSION
-    for (i = 1; i < argc ; i++) {
-	if (!strcmp(argv[i], "-"))
-	    break;
-
-	if (argv[i][0] != '-')
-	    break;
-	if ((!strcmp(argv[i], "-verbose")) ||
-	    (!strcmp(argv[i], "-v")) ||
-	    (!strcmp(argv[i], "--verbose"))) {
-	    verbose++;
-	    xmlCatalogSetDebug(verbose);
-	} else if ((!strcmp(argv[i], "-noout")) ||
-	    (!strcmp(argv[i], "--noout"))) {
-            noout = 1;
-	} else if ((!strcmp(argv[i], "-shell")) ||
-	    (!strcmp(argv[i], "--shell"))) {
-	    shell++;
-            noout = 1;
-	} else if ((!strcmp(argv[i], "-sgml")) ||
-	    (!strcmp(argv[i], "--sgml"))) {
-	    sgml++;
-	} else if ((!strcmp(argv[i], "-create")) ||
-	    (!strcmp(argv[i], "--create"))) {
-	    create++;
-	} else if ((!strcmp(argv[i], "-convert")) ||
-	    (!strcmp(argv[i], "--convert"))) {
-	    convert++;
-	} else if ((!strcmp(argv[i], "-no-super-update")) ||
-	    (!strcmp(argv[i], "--no-super-update"))) {
-	    no_super_update++;
-	} else if ((!strcmp(argv[i], "-add")) ||
-	    (!strcmp(argv[i], "--add"))) {
-	    if (sgml)
-		i += 2;
-	    else
-		i += 3;
-	    add++;
-	} else if ((!strcmp(argv[i], "-del")) ||
-	    (!strcmp(argv[i], "--del"))) {
-	    i += 1;
-	    del++;
-	} else {
-	    fprintf(stderr, "Unknown option %s\n", argv[i]);
-	    usage(argv[0]);
-	    return(1);
-	}
-    }
-
-    for (i = 1; i < argc; i++) {
-	if ((!strcmp(argv[i], "-add")) ||
-	    (!strcmp(argv[i], "--add"))) {
-	    if (sgml)
-		i += 2;
-	    else
-		i += 3;
-	    continue;
-	} else if ((!strcmp(argv[i], "-del")) ||
-	    (!strcmp(argv[i], "--del"))) {
-	    i += 1;
-
-	    /* No catalog entry specified */
-	    if (i == argc || (sgml && i + 1 == argc)) {
-		fprintf(stderr, "No catalog entry specified to remove from\n");
-		usage (argv[0]);
-		return(1);
-	    }
-
-	    continue;
-	} else if (argv[i][0] == '-')
-	    continue;
-	filename = argv[i];
-	    ret = xmlLoadCatalog(argv[i]);
-	    if ((ret < 0) && (create)) {
-		xmlCatalogAdd(BAD_CAST "catalog", BAD_CAST argv[i], NULL);
-	    }
-	break;
-    }
-
-    if (convert)
-        ret = xmlCatalogConvert();
-
-    if ((add) || (del)) {
-	for (i = 1; i < argc ; i++) {
-	    if (!strcmp(argv[i], "-"))
-		break;
-
-	    if (argv[i][0] != '-')
-		continue;
-	    if (strcmp(argv[i], "-add") && strcmp(argv[i], "--add") &&
-		strcmp(argv[i], "-del") && strcmp(argv[i], "--del"))
-		continue;
-
-	    if (sgml) {
-		/*
-		 * Maintenance of SGML catalogs.
-		 */
-		xmlCatalogPtr catal = NULL;
-		xmlCatalogPtr super = NULL;
-
-		catal = xmlLoadSGMLSuperCatalog(argv[i + 1]);
-
-		if ((!strcmp(argv[i], "-add")) ||
-		    (!strcmp(argv[i], "--add"))) {
-		    if (catal == NULL)
-			catal = xmlNewCatalog(1);
-		    xmlACatalogAdd(catal, BAD_CAST "CATALOG",
-					 BAD_CAST argv[i + 2], NULL);
-
-		    if (!no_super_update) {
-			super = xmlLoadSGMLSuperCatalog(XML_SGML_DEFAULT_CATALOG);
-			if (super == NULL)
-			    super = xmlNewCatalog(1);
-
-			xmlACatalogAdd(super, BAD_CAST "CATALOG",
-					     BAD_CAST argv[i + 1], NULL);
-		    }
-		} else {
-		    if (catal != NULL)
-			ret = xmlACatalogRemove(catal, BAD_CAST argv[i + 2]);
-		    else
-			ret = -1;
-		    if (ret < 0) {
-			fprintf(stderr, "Failed to remove entry from %s\n",
-				argv[i + 1]);
-			exit_value = 1;
-		    }
-		    if ((!no_super_update) && (noout) && (catal != NULL) &&
-			(xmlCatalogIsEmpty(catal))) {
-			super = xmlLoadSGMLSuperCatalog(
-				   XML_SGML_DEFAULT_CATALOG);
-			if (super != NULL) {
-			    ret = xmlACatalogRemove(super,
-				    BAD_CAST argv[i + 1]);
-			    if (ret < 0) {
-				fprintf(stderr,
-					"Failed to remove entry from %s\n",
-					XML_SGML_DEFAULT_CATALOG);
-				exit_value = 1;
-			    }
-			}
-		    }
-		}
-		if (noout) {
-		    FILE *out;
-
-		    if (xmlCatalogIsEmpty(catal)) {
-			remove(argv[i + 1]);
-		    } else {
-			out = fopen(argv[i + 1], "w");
-			if (out == NULL) {
-			    fprintf(stderr, "could not open %s for saving\n",
-				    argv[i + 1]);
-			    exit_value = 2;
-			    noout = 0;
-			} else {
-			    xmlACatalogDump(catal, out);
-			    fclose(out);
-			}
-		    }
-		    if (!no_super_update && super != NULL) {
-			if (xmlCatalogIsEmpty(super)) {
-			    remove(XML_SGML_DEFAULT_CATALOG);
-			} else {
-			    out = fopen(XML_SGML_DEFAULT_CATALOG, "w");
-			    if (out == NULL) {
-				fprintf(stderr,
-					"could not open %s for saving\n",
-					XML_SGML_DEFAULT_CATALOG);
-				exit_value = 2;
-				noout = 0;
-			    } else {
-
-				xmlACatalogDump(super, out);
-				fclose(out);
-			    }
-			}
-		    }
-		} else {
-		    xmlACatalogDump(catal, stdout);
-		}
-		i += 2;
-	    } else {
-		if ((!strcmp(argv[i], "-add")) ||
-		    (!strcmp(argv[i], "--add"))) {
-			if ((argv[i + 3] == NULL) || (argv[i + 3][0] == 0))
-			    ret = xmlCatalogAdd(BAD_CAST argv[i + 1], NULL,
-						BAD_CAST argv[i + 2]);
-			else
-			    ret = xmlCatalogAdd(BAD_CAST argv[i + 1],
-						BAD_CAST argv[i + 2],
-						BAD_CAST argv[i + 3]);
-			if (ret != 0) {
-			    printf("add command failed\n");
-			    exit_value = 3;
-			}
-			i += 3;
-		} else if ((!strcmp(argv[i], "-del")) ||
-		    (!strcmp(argv[i], "--del"))) {
-		    ret = xmlCatalogRemove(BAD_CAST argv[i + 1]);
-		    if (ret < 0) {
-			fprintf(stderr, "Failed to remove entry %s\n",
-				argv[i + 1]);
-			exit_value = 1;
-		    }
-		    i += 1;
-		}
-	    }
-	}
-
-    } else if (shell) {
-	usershell();
-    } else {
-	for (i++; i < argc; i++) {
-	    xmlURIPtr uri;
-	    xmlChar *ans;
-
-	    uri = xmlParseURI(argv[i]);
-	    if (uri == NULL) {
-		ans = xmlCatalogResolvePublic((const xmlChar *) argv[i]);
-		if (ans == NULL) {
-		    printf("No entry for PUBLIC %s\n", argv[i]);
-		    exit_value = 4;
-		} else {
-		    printf("%s\n", (char *) ans);
-		    xmlFree(ans);
-		}
-	    } else {
-                xmlFreeURI(uri);
-		ans = xmlCatalogResolveSystem((const xmlChar *) argv[i]);
-		if (ans == NULL) {
-		    printf("No entry for SYSTEM %s\n", argv[i]);
-		    ans = xmlCatalogResolveURI ((const xmlChar *) argv[i]);
-		    if (ans == NULL) {
-			printf ("No entry for URI %s\n", argv[i]);
-		        exit_value = 4;
-		    } else {
-		        printf("%s\n", (char *) ans);
-			xmlFree (ans);
-		    }
-		} else {
-		    printf("%s\n", (char *) ans);
-		    xmlFree(ans);
-		}
-	    }
-	}
-    }
-    if ((!sgml) && ((add) || (del) || (create) || (convert))) {
-	if (noout && filename && *filename) {
-	    FILE *out;
-
-	    out = fopen(filename, "w");
-	    if (out == NULL) {
-		fprintf(stderr, "could not open %s for saving\n", filename);
-		exit_value = 2;
-		noout = 0;
-	    } else {
-		xmlCatalogDump(out);
-	    }
-	} else {
-	    xmlCatalogDump(stdout);
-	}
-    }
-
-    /*
-     * Cleanup and check for memory leaks
-     */
-    xmlCleanupParser();
-    xmlMemoryDump();
-    return(exit_value);
-}
-#else
-int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
-    fprintf(stderr, "libxml was not compiled with catalog and output support\n");
-    return(1);
-}
-#endif
diff --git a/third_party/libxml/src/xmllint.c b/third_party/libxml/src/xmllint.c
deleted file mode 100644
index 1e2eb4a..0000000
--- a/third_party/libxml/src/xmllint.c
+++ /dev/null
@@ -1,3801 +0,0 @@
-/*
- * xmllint.c : a small tester program for XML input.
- *
- * See Copyright for the status of this software.
- *
- * daniel@veillard.com
- */
-
-#include "libxml.h"
-
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-
-#if defined (_WIN32) && !defined(__CYGWIN__)
-#if defined (_MSC_VER) || defined(__BORLANDC__)
-#include <winsock2.h>
-#pragma comment(lib, "ws2_32.lib")
-#define gettimeofday(p1,p2)
-#endif /* _MSC_VER */
-#endif /* _WIN32 */
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#ifdef __MINGW32__
-#define _WINSOCKAPI_
-#include <wsockcompat.h>
-#include <winsock2.h>
-#undef XML_SOCKLEN_T
-#define XML_SOCKLEN_T unsigned int
-#endif
-
-#ifdef HAVE_SYS_TIMEB_H
-#include <sys/timeb.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-/* seems needed for Solaris */
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *) -1)
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_LIBREADLINE
-#include <readline/readline.h>
-#ifdef HAVE_LIBHISTORY
-#include <readline/history.h>
-#endif
-#endif
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/parserInternals.h>
-#include <libxml/HTMLparser.h>
-#include <libxml/HTMLtree.h>
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/debugXML.h>
-#include <libxml/xmlerror.h>
-#ifdef LIBXML_XINCLUDE_ENABLED
-#include <libxml/xinclude.h>
-#endif
-#ifdef LIBXML_CATALOG_ENABLED
-#include <libxml/catalog.h>
-#endif
-#include <libxml/globals.h>
-#include <libxml/xmlreader.h>
-#ifdef LIBXML_SCHEMATRON_ENABLED
-#include <libxml/schematron.h>
-#endif
-#ifdef LIBXML_SCHEMAS_ENABLED
-#include <libxml/relaxng.h>
-#include <libxml/xmlschemas.h>
-#endif
-#ifdef LIBXML_PATTERN_ENABLED
-#include <libxml/pattern.h>
-#endif
-#ifdef LIBXML_C14N_ENABLED
-#include <libxml/c14n.h>
-#endif
-#ifdef LIBXML_OUTPUT_ENABLED
-#include <libxml/xmlsave.h>
-#endif
-
-#ifndef XML_XML_DEFAULT_CATALOG
-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
-#endif
-
-typedef enum {
-    XMLLINT_RETURN_OK = 0,	/* No error */
-    XMLLINT_ERR_UNCLASS = 1,	/* Unclassified */
-    XMLLINT_ERR_DTD = 2,	/* Error in DTD */
-    XMLLINT_ERR_VALID = 3,	/* Validation error */
-    XMLLINT_ERR_RDFILE = 4,	/* CtxtReadFile error */
-    XMLLINT_ERR_SCHEMACOMP = 5,	/* Schema compilation */
-    XMLLINT_ERR_OUT = 6,	/* Error writing output */
-    XMLLINT_ERR_SCHEMAPAT = 7,	/* Error in schema pattern */
-    XMLLINT_ERR_RDREGIS = 8,	/* Error in Reader registration */
-    XMLLINT_ERR_MEM = 9,	/* Out of memory error */
-    XMLLINT_ERR_XPATH = 10	/* XPath evaluation error */
-} xmllintReturnCode;
-#ifdef LIBXML_DEBUG_ENABLED
-static int shell = 0;
-static int debugent = 0;
-#endif
-static int debug = 0;
-static int maxmem = 0;
-#ifdef LIBXML_TREE_ENABLED
-static int copy = 0;
-#endif /* LIBXML_TREE_ENABLED */
-static int recovery = 0;
-static int noent = 0;
-static int noenc = 0;
-static int noblanks = 0;
-static int noout = 0;
-static int nowrap = 0;
-#ifdef LIBXML_OUTPUT_ENABLED
-static int format = 0;
-static const char *output = NULL;
-static int compress = 0;
-static int oldout = 0;
-#endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_VALID_ENABLED
-static int valid = 0;
-static int postvalid = 0;
-static char * dtdvalid = NULL;
-static char * dtdvalidfpi = NULL;
-#endif
-#ifdef LIBXML_SCHEMAS_ENABLED
-static char * relaxng = NULL;
-static xmlRelaxNGPtr relaxngschemas = NULL;
-static char * schema = NULL;
-static xmlSchemaPtr wxschemas = NULL;
-#endif
-#ifdef LIBXML_SCHEMATRON_ENABLED
-static char * schematron = NULL;
-static xmlSchematronPtr wxschematron = NULL;
-#endif
-static int repeat = 0;
-static int insert = 0;
-#if defined(LIBXML_HTML_ENABLED) || defined(LIBXML_VALID_ENABLED)
-static int html = 0;
-static int xmlout = 0;
-#endif
-static int htmlout = 0;
-#if defined(LIBXML_HTML_ENABLED)
-static int nodefdtd = 0;
-#endif
-#ifdef LIBXML_PUSH_ENABLED
-static int push = 0;
-static int pushsize = 4096;
-#endif /* LIBXML_PUSH_ENABLED */
-#ifdef HAVE_MMAP
-static int memory = 0;
-#endif
-static int testIO = 0;
-static char *encoding = NULL;
-#ifdef LIBXML_XINCLUDE_ENABLED
-static int xinclude = 0;
-#endif
-static int dtdattrs = 0;
-static int loaddtd = 0;
-static xmllintReturnCode progresult = XMLLINT_RETURN_OK;
-static int timing = 0;
-static int generate = 0;
-static int dropdtd = 0;
-#ifdef LIBXML_CATALOG_ENABLED
-static int catalogs = 0;
-static int nocatalogs = 0;
-#endif
-#ifdef LIBXML_C14N_ENABLED
-static int canonical = 0;
-static int canonical_11 = 0;
-static int exc_canonical = 0;
-#endif
-#ifdef LIBXML_READER_ENABLED
-static int stream = 0;
-static int walker = 0;
-#endif /* LIBXML_READER_ENABLED */
-static int chkregister = 0;
-static int nbregister = 0;
-#ifdef LIBXML_SAX1_ENABLED
-static int sax1 = 0;
-#endif /* LIBXML_SAX1_ENABLED */
-#ifdef LIBXML_PATTERN_ENABLED
-static const char *pattern = NULL;
-static xmlPatternPtr patternc = NULL;
-static xmlStreamCtxtPtr patstream = NULL;
-#endif
-#ifdef LIBXML_XPATH_ENABLED
-static const char *xpathquery = NULL;
-#endif
-static int options = XML_PARSE_COMPACT | XML_PARSE_BIG_LINES;
-static int sax = 0;
-static int oldxml10 = 0;
-
-/************************************************************************
- *									*
- *		 Entity loading control and customization.		*
- *									*
- ************************************************************************/
-#define MAX_PATHS 64
-#ifdef _WIN32
-# define PATH_SEPARATOR ';'
-#else
-# define PATH_SEPARATOR ':'
-#endif
-static xmlChar *paths[MAX_PATHS + 1];
-static int nbpaths = 0;
-static int load_trace = 0;
-
-static
-void parsePath(const xmlChar *path) {
-    const xmlChar *cur;
-
-    if (path == NULL)
-	return;
-    while (*path != 0) {
-	if (nbpaths >= MAX_PATHS) {
-	    fprintf(stderr, "MAX_PATHS reached: too many paths\n");
-	    return;
-	}
-	cur = path;
-	while ((*cur == ' ') || (*cur == PATH_SEPARATOR))
-	    cur++;
-	path = cur;
-	while ((*cur != 0) && (*cur != ' ') && (*cur != PATH_SEPARATOR))
-	    cur++;
-	if (cur != path) {
-	    paths[nbpaths] = xmlStrndup(path, cur - path);
-	    if (paths[nbpaths] != NULL)
-		nbpaths++;
-	    path = cur;
-	}
-    }
-}
-
-static xmlExternalEntityLoader defaultEntityLoader = NULL;
-
-static xmlParserInputPtr
-xmllintExternalEntityLoader(const char *URL, const char *ID,
-			     xmlParserCtxtPtr ctxt) {
-    xmlParserInputPtr ret;
-    warningSAXFunc warning = NULL;
-    errorSAXFunc err = NULL;
-
-    int i;
-    const char *lastsegment = URL;
-    const char *iter = URL;
-
-    if ((nbpaths > 0) && (iter != NULL)) {
-	while (*iter != 0) {
-	    if (*iter == '/')
-		lastsegment = iter + 1;
-	    iter++;
-	}
-    }
-
-    if ((ctxt != NULL) && (ctxt->sax != NULL)) {
-	warning = ctxt->sax->warning;
-	err = ctxt->sax->error;
-	ctxt->sax->warning = NULL;
-	ctxt->sax->error = NULL;
-    }
-
-    if (defaultEntityLoader != NULL) {
-	ret = defaultEntityLoader(URL, ID, ctxt);
-	if (ret != NULL) {
-	    if (warning != NULL)
-		ctxt->sax->warning = warning;
-	    if (err != NULL)
-		ctxt->sax->error = err;
-	    if (load_trace) {
-		fprintf \
-			(stderr,
-			 "Loaded URL=\"%s\" ID=\"%s\"\n",
-			 URL ? URL : "(null)",
-			 ID ? ID : "(null)");
-	    }
-	    return(ret);
-	}
-    }
-    for (i = 0;i < nbpaths;i++) {
-	xmlChar *newURL;
-
-	newURL = xmlStrdup((const xmlChar *) paths[i]);
-	newURL = xmlStrcat(newURL, (const xmlChar *) "/");
-	newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment);
-	if (newURL != NULL) {
-	    ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
-	    if (ret != NULL) {
-		if (warning != NULL)
-		    ctxt->sax->warning = warning;
-		if (err != NULL)
-		    ctxt->sax->error = err;
-		if (load_trace) {
-		    fprintf \
-			(stderr,
-			 "Loaded URL=\"%s\" ID=\"%s\"\n",
-			 newURL,
-			 ID ? ID : "(null)");
-		}
-		xmlFree(newURL);
-		return(ret);
-	    }
-	    xmlFree(newURL);
-	}
-    }
-    if (err != NULL)
-        ctxt->sax->error = err;
-    if (warning != NULL) {
-	ctxt->sax->warning = warning;
-	if (URL != NULL)
-	    warning(ctxt, "failed to load external entity \"%s\"\n", URL);
-	else if (ID != NULL)
-	    warning(ctxt, "failed to load external entity \"%s\"\n", ID);
-    }
-    return(NULL);
-}
-/************************************************************************
- *									*
- * Memory allocation consumption debugging				*
- *									*
- ************************************************************************/
-
-static void
-OOM(void)
-{
-    fprintf(stderr, "Ran out of memory needs > %d bytes\n", maxmem);
-    progresult = XMLLINT_ERR_MEM;
-}
-
-static void
-myFreeFunc(void *mem)
-{
-    xmlMemFree(mem);
-}
-static void *
-myMallocFunc(size_t size)
-{
-    void *ret;
-
-    ret = xmlMemMalloc(size);
-    if (ret != NULL) {
-        if (xmlMemUsed() > maxmem) {
-            OOM();
-            xmlMemFree(ret);
-            return (NULL);
-        }
-    }
-    return (ret);
-}
-static void *
-myReallocFunc(void *mem, size_t size)
-{
-    void *ret;
-
-    ret = xmlMemRealloc(mem, size);
-    if (ret != NULL) {
-        if (xmlMemUsed() > maxmem) {
-            OOM();
-            xmlMemFree(ret);
-            return (NULL);
-        }
-    }
-    return (ret);
-}
-static char *
-myStrdupFunc(const char *str)
-{
-    char *ret;
-
-    ret = xmlMemoryStrdup(str);
-    if (ret != NULL) {
-        if (xmlMemUsed() > maxmem) {
-            OOM();
-            xmlFree(ret);
-            return (NULL);
-        }
-    }
-    return (ret);
-}
-/************************************************************************
- *									*
- * Internal timing routines to remove the necessity to have		*
- * unix-specific function calls.					*
- *									*
- ************************************************************************/
-
-#ifndef HAVE_GETTIMEOFDAY
-#ifdef HAVE_SYS_TIMEB_H
-#ifdef HAVE_SYS_TIME_H
-#ifdef HAVE_FTIME
-
-static int
-my_gettimeofday(struct timeval *tvp, void *tzp)
-{
-	struct timeb timebuffer;
-
-	ftime(&timebuffer);
-	if (tvp) {
-		tvp->tv_sec = timebuffer.time;
-		tvp->tv_usec = timebuffer.millitm * 1000L;
-	}
-	return (0);
-}
-#define HAVE_GETTIMEOFDAY 1
-#define gettimeofday my_gettimeofday
-
-#endif /* HAVE_FTIME */
-#endif /* HAVE_SYS_TIME_H */
-#endif /* HAVE_SYS_TIMEB_H */
-#endif /* !HAVE_GETTIMEOFDAY */
-
-#if defined(HAVE_GETTIMEOFDAY)
-static struct timeval begin, end;
-
-/*
- * startTimer: call where you want to start timing
- */
-static void
-startTimer(void)
-{
-    gettimeofday(&begin, NULL);
-}
-
-/*
- * endTimer: call where you want to stop timing and to print out a
- *           message about the timing performed; format is a printf
- *           type argument
- */
-static void XMLCDECL
-endTimer(const char *fmt, ...)
-{
-    long msec;
-    va_list ap;
-
-    gettimeofday(&end, NULL);
-    msec = end.tv_sec - begin.tv_sec;
-    msec *= 1000;
-    msec += (end.tv_usec - begin.tv_usec) / 1000;
-
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    va_end(ap);
-
-    fprintf(stderr, " took %ld ms\n", msec);
-}
-#elif defined(HAVE_TIME_H)
-/*
- * No gettimeofday function, so we have to make do with calling clock.
- * This is obviously less accurate, but there's little we can do about
- * that.
- */
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 100
-#endif
-
-static clock_t begin, end;
-static void
-startTimer(void)
-{
-    begin = clock();
-}
-static void XMLCDECL
-endTimer(const char *fmt, ...)
-{
-    long msec;
-    va_list ap;
-
-    end = clock();
-    msec = ((end - begin) * 1000) / CLOCKS_PER_SEC;
-
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    va_end(ap);
-    fprintf(stderr, " took %ld ms\n", msec);
-}
-#else
-
-/*
- * We don't have a gettimeofday or time.h, so we just don't do timing
- */
-static void
-startTimer(void)
-{
-    /*
-     * Do nothing
-     */
-}
-static void XMLCDECL
-endTimer(char *format, ...)
-{
-    /*
-     * We cannot do anything because we don't have a timing function
-     */
-#ifdef HAVE_STDARG_H
-    va_list ap;
-    va_start(ap, format);
-    vfprintf(stderr, format, ap);
-    va_end(ap);
-    fprintf(stderr, " was not timed\n");
-#else
-    /* We don't have gettimeofday, time or stdarg.h, what crazy world is
-     * this ?!
-     */
-#endif
-}
-#endif
-/************************************************************************
- *									*
- *			HTML ouput					*
- *									*
- ************************************************************************/
-static char buffer[50000];
-
-static void
-xmlHTMLEncodeSend(void) {
-    char *result;
-
-    result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
-    if (result) {
-	xmlGenericError(xmlGenericErrorContext, "%s", result);
-	xmlFree(result);
-    }
-    buffer[0] = 0;
-}
-
-/**
- * xmlHTMLPrintFileInfo:
- * @input:  an xmlParserInputPtr input
- *
- * Displays the associated file and line informations for the current input
- */
-
-static void
-xmlHTMLPrintFileInfo(xmlParserInputPtr input) {
-    int len;
-    xmlGenericError(xmlGenericErrorContext, "<p>");
-
-    len = strlen(buffer);
-    if (input != NULL) {
-	if (input->filename) {
-	    snprintf(&buffer[len], sizeof(buffer) - len, "%s:%d: ", input->filename,
-		    input->line);
-	} else {
-	    snprintf(&buffer[len], sizeof(buffer) - len, "Entity: line %d: ", input->line);
-	}
-    }
-    xmlHTMLEncodeSend();
-}
-
-/**
- * xmlHTMLPrintFileContext:
- * @input:  an xmlParserInputPtr input
- *
- * Displays current context within the input content for error tracking
- */
-
-static void
-xmlHTMLPrintFileContext(xmlParserInputPtr input) {
-    const xmlChar *cur, *base;
-    int len;
-    int n;
-
-    if (input == NULL) return;
-    xmlGenericError(xmlGenericErrorContext, "<pre>\n");
-    cur = input->cur;
-    base = input->base;
-    while ((cur > base) && ((*cur == '\n') || (*cur == '\r'))) {
-	cur--;
-    }
-    n = 0;
-    while ((n++ < 80) && (cur > base) && (*cur != '\n') && (*cur != '\r'))
-        cur--;
-    if ((*cur == '\n') || (*cur == '\r')) cur++;
-    base = cur;
-    n = 0;
-    while ((*cur != 0) && (*cur != '\n') && (*cur != '\r') && (n < 79)) {
-	len = strlen(buffer);
-        snprintf(&buffer[len], sizeof(buffer) - len, "%c",
-		    (unsigned char) *cur++);
-	n++;
-    }
-    len = strlen(buffer);
-    snprintf(&buffer[len], sizeof(buffer) - len, "\n");
-    cur = input->cur;
-    while ((*cur == '\n') || (*cur == '\r'))
-	cur--;
-    n = 0;
-    while ((cur != base) && (n++ < 80)) {
-	len = strlen(buffer);
-        snprintf(&buffer[len], sizeof(buffer) - len, " ");
-        base++;
-    }
-    len = strlen(buffer);
-    snprintf(&buffer[len], sizeof(buffer) - len, "^\n");
-    xmlHTMLEncodeSend();
-    xmlGenericError(xmlGenericErrorContext, "</pre>");
-}
-
-/**
- * xmlHTMLError:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format an error messages, gives file, line, position and
- * extra parameters.
- */
-static void XMLCDECL
-xmlHTMLError(void *ctx, const char *msg, ...)
-{
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-    xmlParserInputPtr input;
-    va_list args;
-    int len;
-
-    buffer[0] = 0;
-    input = ctxt->input;
-    if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
-        input = ctxt->inputTab[ctxt->inputNr - 2];
-    }
-
-    xmlHTMLPrintFileInfo(input);
-
-    xmlGenericError(xmlGenericErrorContext, "<b>error</b>: ");
-    va_start(args, msg);
-    len = strlen(buffer);
-    vsnprintf(&buffer[len],  sizeof(buffer) - len, msg, args);
-    va_end(args);
-    xmlHTMLEncodeSend();
-    xmlGenericError(xmlGenericErrorContext, "</p>\n");
-
-    xmlHTMLPrintFileContext(input);
-    xmlHTMLEncodeSend();
-}
-
-/**
- * xmlHTMLWarning:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format a warning messages, gives file, line, position and
- * extra parameters.
- */
-static void XMLCDECL
-xmlHTMLWarning(void *ctx, const char *msg, ...)
-{
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-    xmlParserInputPtr input;
-    va_list args;
-    int len;
-
-    buffer[0] = 0;
-    input = ctxt->input;
-    if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
-        input = ctxt->inputTab[ctxt->inputNr - 2];
-    }
-
-
-    xmlHTMLPrintFileInfo(input);
-
-    xmlGenericError(xmlGenericErrorContext, "<b>warning</b>: ");
-    va_start(args, msg);
-    len = strlen(buffer);
-    vsnprintf(&buffer[len],  sizeof(buffer) - len, msg, args);
-    va_end(args);
-    xmlHTMLEncodeSend();
-    xmlGenericError(xmlGenericErrorContext, "</p>\n");
-
-    xmlHTMLPrintFileContext(input);
-    xmlHTMLEncodeSend();
-}
-
-/**
- * xmlHTMLValidityError:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format an validity error messages, gives file,
- * line, position and extra parameters.
- */
-static void XMLCDECL
-xmlHTMLValidityError(void *ctx, const char *msg, ...)
-{
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-    xmlParserInputPtr input;
-    va_list args;
-    int len;
-
-    buffer[0] = 0;
-    input = ctxt->input;
-    if ((input->filename == NULL) && (ctxt->inputNr > 1))
-        input = ctxt->inputTab[ctxt->inputNr - 2];
-
-    xmlHTMLPrintFileInfo(input);
-
-    xmlGenericError(xmlGenericErrorContext, "<b>validity error</b>: ");
-    len = strlen(buffer);
-    va_start(args, msg);
-    vsnprintf(&buffer[len],  sizeof(buffer) - len, msg, args);
-    va_end(args);
-    xmlHTMLEncodeSend();
-    xmlGenericError(xmlGenericErrorContext, "</p>\n");
-
-    xmlHTMLPrintFileContext(input);
-    xmlHTMLEncodeSend();
-    progresult = XMLLINT_ERR_VALID;
-}
-
-/**
- * xmlHTMLValidityWarning:
- * @ctx:  an XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format a validity warning messages, gives file, line,
- * position and extra parameters.
- */
-static void XMLCDECL
-xmlHTMLValidityWarning(void *ctx, const char *msg, ...)
-{
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-    xmlParserInputPtr input;
-    va_list args;
-    int len;
-
-    buffer[0] = 0;
-    input = ctxt->input;
-    if ((input->filename == NULL) && (ctxt->inputNr > 1))
-        input = ctxt->inputTab[ctxt->inputNr - 2];
-
-    xmlHTMLPrintFileInfo(input);
-
-    xmlGenericError(xmlGenericErrorContext, "<b>validity warning</b>: ");
-    va_start(args, msg);
-    len = strlen(buffer);
-    vsnprintf(&buffer[len],  sizeof(buffer) - len, msg, args);
-    va_end(args);
-    xmlHTMLEncodeSend();
-    xmlGenericError(xmlGenericErrorContext, "</p>\n");
-
-    xmlHTMLPrintFileContext(input);
-    xmlHTMLEncodeSend();
-}
-
-/************************************************************************
- *									*
- *			Shell Interface					*
- *									*
- ************************************************************************/
-#ifdef LIBXML_DEBUG_ENABLED
-#ifdef LIBXML_XPATH_ENABLED
-/**
- * xmlShellReadline:
- * @prompt:  the prompt value
- *
- * Read a string
- *
- * Returns a pointer to it or NULL on EOF the caller is expected to
- *     free the returned string.
- */
-static char *
-xmlShellReadline(char *prompt) {
-#ifdef HAVE_LIBREADLINE
-    char *line_read;
-
-    /* Get a line from the user. */
-    line_read = readline (prompt);
-
-    /* If the line has any text in it, save it on the history. */
-    if (line_read && *line_read)
-	add_history (line_read);
-
-    return (line_read);
-#else
-    char line_read[501];
-    char *ret;
-    int len;
-
-    if (prompt != NULL)
-	fprintf(stdout, "%s", prompt);
-    if (!fgets(line_read, 500, stdin))
-        return(NULL);
-    line_read[500] = 0;
-    len = strlen(line_read);
-    ret = (char *) malloc(len + 1);
-    if (ret != NULL) {
-	memcpy (ret, line_read, len + 1);
-    }
-    return(ret);
-#endif
-}
-#endif /* LIBXML_XPATH_ENABLED */
-#endif /* LIBXML_DEBUG_ENABLED */
-
-/************************************************************************
- *									*
- *			I/O Interfaces					*
- *									*
- ************************************************************************/
-
-static int myRead(FILE *f, char * buf, int len) {
-    return(fread(buf, 1, len, f));
-}
-static void myClose(FILE *f) {
-  if (f != stdin) {
-    fclose(f);
-  }
-}
-
-/************************************************************************
- *									*
- *			SAX based tests					*
- *									*
- ************************************************************************/
-
-/*
- * empty SAX block
- */
-static xmlSAXHandler emptySAXHandlerStruct = {
-    NULL, /* internalSubset */
-    NULL, /* isStandalone */
-    NULL, /* hasInternalSubset */
-    NULL, /* hasExternalSubset */
-    NULL, /* resolveEntity */
-    NULL, /* getEntity */
-    NULL, /* entityDecl */
-    NULL, /* notationDecl */
-    NULL, /* attributeDecl */
-    NULL, /* elementDecl */
-    NULL, /* unparsedEntityDecl */
-    NULL, /* setDocumentLocator */
-    NULL, /* startDocument */
-    NULL, /* endDocument */
-    NULL, /* startElement */
-    NULL, /* endElement */
-    NULL, /* reference */
-    NULL, /* characters */
-    NULL, /* ignorableWhitespace */
-    NULL, /* processingInstruction */
-    NULL, /* comment */
-    NULL, /* xmlParserWarning */
-    NULL, /* xmlParserError */
-    NULL, /* xmlParserError */
-    NULL, /* getParameterEntity */
-    NULL, /* cdataBlock; */
-    NULL, /* externalSubset; */
-    XML_SAX2_MAGIC,
-    NULL,
-    NULL, /* startElementNs */
-    NULL, /* endElementNs */
-    NULL  /* xmlStructuredErrorFunc */
-};
-
-static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
-extern xmlSAXHandlerPtr debugSAXHandler;
-static int callbacks;
-
-/**
- * isStandaloneDebug:
- * @ctxt:  An XML parser context
- *
- * Is this document tagged standalone ?
- *
- * Returns 1 if true
- */
-static int
-isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return(0);
-    fprintf(stdout, "SAX.isStandalone()\n");
-    return(0);
-}
-
-/**
- * hasInternalSubsetDebug:
- * @ctxt:  An XML parser context
- *
- * Does this document has an internal subset
- *
- * Returns 1 if true
- */
-static int
-hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return(0);
-    fprintf(stdout, "SAX.hasInternalSubset()\n");
-    return(0);
-}
-
-/**
- * hasExternalSubsetDebug:
- * @ctxt:  An XML parser context
- *
- * Does this document has an external subset
- *
- * Returns 1 if true
- */
-static int
-hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return(0);
-    fprintf(stdout, "SAX.hasExternalSubset()\n");
-    return(0);
-}
-
-/**
- * internalSubsetDebug:
- * @ctxt:  An XML parser context
- *
- * Does this document has an internal subset
- */
-static void
-internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
-	       const xmlChar *ExternalID, const xmlChar *SystemID)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.internalSubset(%s,", name);
-    if (ExternalID == NULL)
-	fprintf(stdout, " ,");
-    else
-	fprintf(stdout, " %s,", ExternalID);
-    if (SystemID == NULL)
-	fprintf(stdout, " )\n");
-    else
-	fprintf(stdout, " %s)\n", SystemID);
-}
-
-/**
- * externalSubsetDebug:
- * @ctxt:  An XML parser context
- *
- * Does this document has an external subset
- */
-static void
-externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
-	       const xmlChar *ExternalID, const xmlChar *SystemID)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.externalSubset(%s,", name);
-    if (ExternalID == NULL)
-	fprintf(stdout, " ,");
-    else
-	fprintf(stdout, " %s,", ExternalID);
-    if (SystemID == NULL)
-	fprintf(stdout, " )\n");
-    else
-	fprintf(stdout, " %s)\n", SystemID);
-}
-
-/**
- * resolveEntityDebug:
- * @ctxt:  An XML parser context
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- *
- * Special entity resolver, better left to the parser, it has
- * more context than the application layer.
- * The default behaviour is to NOT resolve the entities, in that case
- * the ENTITY_REF nodes are built in the structure (and the parameter
- * values).
- *
- * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
- */
-static xmlParserInputPtr
-resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
-{
-    callbacks++;
-    if (noout)
-	return(NULL);
-    /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
-
-
-    fprintf(stdout, "SAX.resolveEntity(");
-    if (publicId != NULL)
-	fprintf(stdout, "%s", (char *)publicId);
-    else
-	fprintf(stdout, " ");
-    if (systemId != NULL)
-	fprintf(stdout, ", %s)\n", (char *)systemId);
-    else
-	fprintf(stdout, ", )\n");
-    return(NULL);
-}
-
-/**
- * getEntityDebug:
- * @ctxt:  An XML parser context
- * @name: The entity name
- *
- * Get an entity by name
- *
- * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
- */
-static xmlEntityPtr
-getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
-{
-    callbacks++;
-    if (noout)
-	return(NULL);
-    fprintf(stdout, "SAX.getEntity(%s)\n", name);
-    return(NULL);
-}
-
-/**
- * getParameterEntityDebug:
- * @ctxt:  An XML parser context
- * @name: The entity name
- *
- * Get a parameter entity by name
- *
- * Returns the xmlParserInputPtr
- */
-static xmlEntityPtr
-getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
-{
-    callbacks++;
-    if (noout)
-	return(NULL);
-    fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
-    return(NULL);
-}
-
-
-/**
- * entityDeclDebug:
- * @ctxt:  An XML parser context
- * @name:  the entity name
- * @type:  the entity type
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- * @content: the entity value (without processing).
- *
- * An entity definition has been parsed
- */
-static void
-entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
-          const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
-{
-const xmlChar *nullstr = BAD_CAST "(null)";
-    /* not all libraries handle printing null pointers nicely */
-    if (publicId == NULL)
-        publicId = nullstr;
-    if (systemId == NULL)
-        systemId = nullstr;
-    if (content == NULL)
-        content = (xmlChar *)nullstr;
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
-            name, type, publicId, systemId, content);
-}
-
-/**
- * attributeDeclDebug:
- * @ctxt:  An XML parser context
- * @name:  the attribute name
- * @type:  the attribute type
- *
- * An attribute definition has been parsed
- */
-static void
-attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem,
-                   const xmlChar * name, int type, int def,
-                   const xmlChar * defaultValue, xmlEnumerationPtr tree)
-{
-    callbacks++;
-    if (noout)
-        return;
-    if (defaultValue == NULL)
-        fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n",
-                elem, name, type, def);
-    else
-        fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
-                elem, name, type, def, defaultValue);
-    xmlFreeEnumeration(tree);
-}
-
-/**
- * elementDeclDebug:
- * @ctxt:  An XML parser context
- * @name:  the element name
- * @type:  the element type
- * @content: the element value (without processing).
- *
- * An element definition has been parsed
- */
-static void
-elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
-	    xmlElementContentPtr content ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
-            name, type);
-}
-
-/**
- * notationDeclDebug:
- * @ctxt:  An XML parser context
- * @name: The name of the notation
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- *
- * What to do when a notation declaration has been parsed.
- */
-static void
-notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
-	     const xmlChar *publicId, const xmlChar *systemId)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
-            (char *) name, (char *) publicId, (char *) systemId);
-}
-
-/**
- * unparsedEntityDeclDebug:
- * @ctxt:  An XML parser context
- * @name: The name of the entity
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- * @notationName: the name of the notation
- *
- * What to do when an unparsed entity declaration is parsed
- */
-static void
-unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
-		   const xmlChar *publicId, const xmlChar *systemId,
-		   const xmlChar *notationName)
-{
-const xmlChar *nullstr = BAD_CAST "(null)";
-
-    if (publicId == NULL)
-        publicId = nullstr;
-    if (systemId == NULL)
-        systemId = nullstr;
-    if (notationName == NULL)
-        notationName = nullstr;
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
-            (char *) name, (char *) publicId, (char *) systemId,
-	    (char *) notationName);
-}
-
-/**
- * setDocumentLocatorDebug:
- * @ctxt:  An XML parser context
- * @loc: A SAX Locator
- *
- * Receive the document locator at startup, actually xmlDefaultSAXLocator
- * Everything is available on the context, so this is useless in our case.
- */
-static void
-setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.setDocumentLocator()\n");
-}
-
-/**
- * startDocumentDebug:
- * @ctxt:  An XML parser context
- *
- * called when the document start being processed.
- */
-static void
-startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.startDocument()\n");
-}
-
-/**
- * endDocumentDebug:
- * @ctxt:  An XML parser context
- *
- * called when the document end has been detected.
- */
-static void
-endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.endDocument()\n");
-}
-
-/**
- * startElementDebug:
- * @ctxt:  An XML parser context
- * @name:  The element name
- *
- * called when an opening tag has been processed.
- */
-static void
-startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
-{
-    int i;
-
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.startElement(%s", (char *) name);
-    if (atts != NULL) {
-        for (i = 0;(atts[i] != NULL);i++) {
-	    fprintf(stdout, ", %s='", atts[i++]);
-	    if (atts[i] != NULL)
-	        fprintf(stdout, "%s'", atts[i]);
-	}
-    }
-    fprintf(stdout, ")\n");
-}
-
-/**
- * endElementDebug:
- * @ctxt:  An XML parser context
- * @name:  The element name
- *
- * called when the end of an element has been detected.
- */
-static void
-endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
-}
-
-/**
- * charactersDebug:
- * @ctxt:  An XML parser context
- * @ch:  a xmlChar string
- * @len: the number of xmlChar
- *
- * receiving some chars from the parser.
- * Question: how much at a time ???
- */
-static void
-charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
-{
-    char out[40];
-    int i;
-
-    callbacks++;
-    if (noout)
-	return;
-    for (i = 0;(i<len) && (i < 30);i++)
-	out[i] = ch[i];
-    out[i] = 0;
-
-    fprintf(stdout, "SAX.characters(%s, %d)\n", out, len);
-}
-
-/**
- * referenceDebug:
- * @ctxt:  An XML parser context
- * @name:  The entity name
- *
- * called when an entity reference is detected.
- */
-static void
-referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.reference(%s)\n", name);
-}
-
-/**
- * ignorableWhitespaceDebug:
- * @ctxt:  An XML parser context
- * @ch:  a xmlChar string
- * @start: the first char in the string
- * @len: the number of xmlChar
- *
- * receiving some ignorable whitespaces from the parser.
- * Question: how much at a time ???
- */
-static void
-ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
-{
-    char out[40];
-    int i;
-
-    callbacks++;
-    if (noout)
-	return;
-    for (i = 0;(i<len) && (i < 30);i++)
-	out[i] = ch[i];
-    out[i] = 0;
-    fprintf(stdout, "SAX.ignorableWhitespace(%s, %d)\n", out, len);
-}
-
-/**
- * processingInstructionDebug:
- * @ctxt:  An XML parser context
- * @target:  the target name
- * @data: the PI data's
- * @len: the number of xmlChar
- *
- * A processing instruction has been parsed.
- */
-static void
-processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
-                      const xmlChar *data)
-{
-    callbacks++;
-    if (noout)
-	return;
-    if (data != NULL)
-	fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
-		(char *) target, (char *) data);
-    else
-	fprintf(stdout, "SAX.processingInstruction(%s, NULL)\n",
-		(char *) target);
-}
-
-/**
- * cdataBlockDebug:
- * @ctx: the user data (XML parser context)
- * @value:  The pcdata content
- * @len:  the block length
- *
- * called when a pcdata block has been parsed
- */
-static void
-cdataBlockDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value, int len)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.pcdata(%.20s, %d)\n",
-	    (char *) value, len);
-}
-
-/**
- * commentDebug:
- * @ctxt:  An XML parser context
- * @value:  the comment content
- *
- * A comment has been parsed.
- */
-static void
-commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.comment(%s)\n", value);
-}
-
-/**
- * warningDebug:
- * @ctxt:  An XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format a warning messages, gives file, line, position and
- * extra parameters.
- */
-static void XMLCDECL
-warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
-{
-    va_list args;
-
-    callbacks++;
-    if (noout)
-	return;
-    va_start(args, msg);
-    fprintf(stdout, "SAX.warning: ");
-    vfprintf(stdout, msg, args);
-    va_end(args);
-}
-
-/**
- * errorDebug:
- * @ctxt:  An XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format a error messages, gives file, line, position and
- * extra parameters.
- */
-static void XMLCDECL
-errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
-{
-    va_list args;
-
-    callbacks++;
-    if (noout)
-	return;
-    va_start(args, msg);
-    fprintf(stdout, "SAX.error: ");
-    vfprintf(stdout, msg, args);
-    va_end(args);
-}
-
-/**
- * fatalErrorDebug:
- * @ctxt:  An XML parser context
- * @msg:  the message to display/transmit
- * @...:  extra parameters for the message display
- *
- * Display and format a fatalError messages, gives file, line, position and
- * extra parameters.
- */
-static void XMLCDECL
-fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
-{
-    va_list args;
-
-    callbacks++;
-    if (noout)
-	return;
-    va_start(args, msg);
-    fprintf(stdout, "SAX.fatalError: ");
-    vfprintf(stdout, msg, args);
-    va_end(args);
-}
-
-static xmlSAXHandler debugSAXHandlerStruct = {
-    internalSubsetDebug,
-    isStandaloneDebug,
-    hasInternalSubsetDebug,
-    hasExternalSubsetDebug,
-    resolveEntityDebug,
-    getEntityDebug,
-    entityDeclDebug,
-    notationDeclDebug,
-    attributeDeclDebug,
-    elementDeclDebug,
-    unparsedEntityDeclDebug,
-    setDocumentLocatorDebug,
-    startDocumentDebug,
-    endDocumentDebug,
-    startElementDebug,
-    endElementDebug,
-    referenceDebug,
-    charactersDebug,
-    ignorableWhitespaceDebug,
-    processingInstructionDebug,
-    commentDebug,
-    warningDebug,
-    errorDebug,
-    fatalErrorDebug,
-    getParameterEntityDebug,
-    cdataBlockDebug,
-    externalSubsetDebug,
-    1,
-    NULL,
-    NULL,
-    NULL,
-    NULL
-};
-
-xmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
-
-/*
- * SAX2 specific callbacks
- */
-/**
- * startElementNsDebug:
- * @ctxt:  An XML parser context
- * @name:  The element name
- *
- * called when an opening tag has been processed.
- */
-static void
-startElementNsDebug(void *ctx ATTRIBUTE_UNUSED,
-                    const xmlChar *localname,
-                    const xmlChar *prefix,
-                    const xmlChar *URI,
-		    int nb_namespaces,
-		    const xmlChar **namespaces,
-		    int nb_attributes,
-		    int nb_defaulted,
-		    const xmlChar **attributes)
-{
-    int i;
-
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.startElementNs(%s", (char *) localname);
-    if (prefix == NULL)
-	fprintf(stdout, ", NULL");
-    else
-	fprintf(stdout, ", %s", (char *) prefix);
-    if (URI == NULL)
-	fprintf(stdout, ", NULL");
-    else
-	fprintf(stdout, ", '%s'", (char *) URI);
-    fprintf(stdout, ", %d", nb_namespaces);
-
-    if (namespaces != NULL) {
-        for (i = 0;i < nb_namespaces * 2;i++) {
-	    fprintf(stdout, ", xmlns");
-	    if (namespaces[i] != NULL)
-	        fprintf(stdout, ":%s", namespaces[i]);
-	    i++;
-	    fprintf(stdout, "='%s'", namespaces[i]);
-	}
-    }
-    fprintf(stdout, ", %d, %d", nb_attributes, nb_defaulted);
-    if (attributes != NULL) {
-        for (i = 0;i < nb_attributes * 5;i += 5) {
-	    if (attributes[i + 1] != NULL)
-		fprintf(stdout, ", %s:%s='", attributes[i + 1], attributes[i]);
-	    else
-		fprintf(stdout, ", %s='", attributes[i]);
-	    fprintf(stdout, "%.4s...', %d", attributes[i + 3],
-		    (int)(attributes[i + 4] - attributes[i + 3]));
-	}
-    }
-    fprintf(stdout, ")\n");
-}
-
-/**
- * endElementDebug:
- * @ctxt:  An XML parser context
- * @name:  The element name
- *
- * called when the end of an element has been detected.
- */
-static void
-endElementNsDebug(void *ctx ATTRIBUTE_UNUSED,
-                  const xmlChar *localname,
-                  const xmlChar *prefix,
-                  const xmlChar *URI)
-{
-    callbacks++;
-    if (noout)
-	return;
-    fprintf(stdout, "SAX.endElementNs(%s", (char *) localname);
-    if (prefix == NULL)
-	fprintf(stdout, ", NULL");
-    else
-	fprintf(stdout, ", %s", (char *) prefix);
-    if (URI == NULL)
-	fprintf(stdout, ", NULL)\n");
-    else
-	fprintf(stdout, ", '%s')\n", (char *) URI);
-}
-
-static xmlSAXHandler debugSAX2HandlerStruct = {
-    internalSubsetDebug,
-    isStandaloneDebug,
-    hasInternalSubsetDebug,
-    hasExternalSubsetDebug,
-    resolveEntityDebug,
-    getEntityDebug,
-    entityDeclDebug,
-    notationDeclDebug,
-    attributeDeclDebug,
-    elementDeclDebug,
-    unparsedEntityDeclDebug,
-    setDocumentLocatorDebug,
-    startDocumentDebug,
-    endDocumentDebug,
-    NULL,
-    NULL,
-    referenceDebug,
-    charactersDebug,
-    ignorableWhitespaceDebug,
-    processingInstructionDebug,
-    commentDebug,
-    warningDebug,
-    errorDebug,
-    fatalErrorDebug,
-    getParameterEntityDebug,
-    cdataBlockDebug,
-    externalSubsetDebug,
-    XML_SAX2_MAGIC,
-    NULL,
-    startElementNsDebug,
-    endElementNsDebug,
-    NULL
-};
-
-static xmlSAXHandlerPtr debugSAX2Handler = &debugSAX2HandlerStruct;
-
-static void
-testSAX(const char *filename) {
-    xmlSAXHandlerPtr handler;
-    const char *user_data = "user_data"; /* mostly for debugging */
-    xmlParserInputBufferPtr buf = NULL;
-    xmlParserInputPtr inputStream;
-    xmlParserCtxtPtr ctxt = NULL;
-    xmlSAXHandlerPtr old_sax = NULL;
-
-    callbacks = 0;
-
-    if (noout) {
-        handler = emptySAXHandler;
-#ifdef LIBXML_SAX1_ENABLED
-    } else if (sax1) {
-        handler = debugSAXHandler;
-#endif
-    } else {
-        handler = debugSAX2Handler;
-    }
-
-    /*
-     * it's not the simplest code but the most generic in term of I/O
-     */
-    buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE);
-    if (buf == NULL) {
-        goto error;
-    }
-
-#ifdef LIBXML_SCHEMAS_ENABLED
-    if (wxschemas != NULL) {
-        int ret;
-	xmlSchemaValidCtxtPtr vctxt;
-
-	vctxt = xmlSchemaNewValidCtxt(wxschemas);
-	xmlSchemaSetValidErrors(vctxt,
-		(xmlSchemaValidityErrorFunc) fprintf,
-		(xmlSchemaValidityWarningFunc) fprintf,
-		stderr);
-	xmlSchemaValidateSetFilename(vctxt, filename);
-
-	ret = xmlSchemaValidateStream(vctxt, buf, 0, handler,
-	                              (void *)user_data);
-	if (repeat == 0) {
-	    if (ret == 0) {
-		fprintf(stderr, "%s validates\n", filename);
-	    } else if (ret > 0) {
-		fprintf(stderr, "%s fails to validate\n", filename);
-		progresult = XMLLINT_ERR_VALID;
-	    } else {
-		fprintf(stderr, "%s validation generated an internal error\n",
-		       filename);
-		progresult = XMLLINT_ERR_VALID;
-	    }
-	}
-	xmlSchemaFreeValidCtxt(vctxt);
-    } else
-#endif
-    {
-	/*
-	 * Create the parser context amd hook the input
-	 */
-	ctxt = xmlNewParserCtxt();
-	if (ctxt == NULL) {
-	    xmlFreeParserInputBuffer(buf);
-	    goto error;
-	}
-	old_sax = ctxt->sax;
-	ctxt->sax = handler;
-	ctxt->userData = (void *) user_data;
-	inputStream = xmlNewIOInputStream(ctxt, buf, XML_CHAR_ENCODING_NONE);
-	if (inputStream == NULL) {
-	    xmlFreeParserInputBuffer(buf);
-	    goto error;
-	}
-	inputPush(ctxt, inputStream);
-
-	/* do the parsing */
-	xmlParseDocument(ctxt);
-
-	if (ctxt->myDoc != NULL) {
-	    fprintf(stderr, "SAX generated a doc !\n");
-	    xmlFreeDoc(ctxt->myDoc);
-	    ctxt->myDoc = NULL;
-	}
-    }
-
-error:
-    if (ctxt != NULL) {
-        ctxt->sax = old_sax;
-        xmlFreeParserCtxt(ctxt);
-    }
-}
-
-/************************************************************************
- *									*
- *			Stream Test processing				*
- *									*
- ************************************************************************/
-#ifdef LIBXML_READER_ENABLED
-static void processNode(xmlTextReaderPtr reader) {
-    const xmlChar *name, *value;
-    int type, empty;
-
-    type = xmlTextReaderNodeType(reader);
-    empty = xmlTextReaderIsEmptyElement(reader);
-
-    if (debug) {
-	name = xmlTextReaderConstName(reader);
-	if (name == NULL)
-	    name = BAD_CAST "--";
-
-	value = xmlTextReaderConstValue(reader);
-
-
-	printf("%d %d %s %d %d",
-		xmlTextReaderDepth(reader),
-		type,
-		name,
-		empty,
-		xmlTextReaderHasValue(reader));
-	if (value == NULL)
-	    printf("\n");
-	else {
-	    printf(" %s\n", value);
-	}
-    }
-#ifdef LIBXML_PATTERN_ENABLED
-    if (patternc) {
-        xmlChar *path = NULL;
-        int match = -1;
-
-	if (type == XML_READER_TYPE_ELEMENT) {
-	    /* do the check only on element start */
-	    match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader));
-
-	    if (match) {
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
-		path = xmlGetNodePath(xmlTextReaderCurrentNode(reader));
-		printf("Node %s matches pattern %s\n", path, pattern);
-#else
-                printf("Node %s matches pattern %s\n",
-                       xmlTextReaderConstName(reader), pattern);
-#endif
-	    }
-	}
-	if (patstream != NULL) {
-	    int ret;
-
-	    if (type == XML_READER_TYPE_ELEMENT) {
-		ret = xmlStreamPush(patstream,
-		                    xmlTextReaderConstLocalName(reader),
-				    xmlTextReaderConstNamespaceUri(reader));
-		if (ret < 0) {
-		    fprintf(stderr, "xmlStreamPush() failure\n");
-                    xmlFreeStreamCtxt(patstream);
-		    patstream = NULL;
-		} else if (ret != match) {
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
-		    if (path == NULL) {
-		        path = xmlGetNodePath(
-		                       xmlTextReaderCurrentNode(reader));
-		    }
-#endif
-		    fprintf(stderr,
-		            "xmlPatternMatch and xmlStreamPush disagree\n");
-                    if (path != NULL)
-                        fprintf(stderr, "  pattern %s node %s\n",
-                                pattern, path);
-                    else
-		        fprintf(stderr, "  pattern %s node %s\n",
-			    pattern, xmlTextReaderConstName(reader));
-		}
-
-	    }
-	    if ((type == XML_READER_TYPE_END_ELEMENT) ||
-	        ((type == XML_READER_TYPE_ELEMENT) && (empty))) {
-	        ret = xmlStreamPop(patstream);
-		if (ret < 0) {
-		    fprintf(stderr, "xmlStreamPop() failure\n");
-                    xmlFreeStreamCtxt(patstream);
-		    patstream = NULL;
-		}
-	    }
-	}
-	if (path != NULL)
-	    xmlFree(path);
-    }
-#endif
-}
-
-static void streamFile(char *filename) {
-    xmlTextReaderPtr reader;
-    int ret;
-#ifdef HAVE_MMAP
-    int fd = -1;
-    struct stat info;
-    const char *base = NULL;
-    xmlParserInputBufferPtr input = NULL;
-
-    if (memory) {
-	if (stat(filename, &info) < 0)
-	    return;
-	if ((fd = open(filename, O_RDONLY)) < 0)
-	    return;
-	base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
-	if (base == (void *) MAP_FAILED) {
-	    close(fd);
-	    fprintf(stderr, "mmap failure for file %s\n", filename);
-	    progresult = XMLLINT_ERR_RDFILE;
-	    return;
-	}
-
-	reader = xmlReaderForMemory(base, info.st_size, filename,
-	                            NULL, options);
-    } else
-#endif
-	reader = xmlReaderForFile(filename, NULL, options);
-#ifdef LIBXML_PATTERN_ENABLED
-    if (pattern != NULL) {
-        patternc = xmlPatterncompile((const xmlChar *) pattern, NULL, 0, NULL);
-	if (patternc == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Pattern %s failed to compile\n", pattern);
-            progresult = XMLLINT_ERR_SCHEMAPAT;
-	    pattern = NULL;
-	}
-    }
-    if (patternc != NULL) {
-        patstream = xmlPatternGetStreamCtxt(patternc);
-	if (patstream != NULL) {
-	    ret = xmlStreamPush(patstream, NULL, NULL);
-	    if (ret < 0) {
-		fprintf(stderr, "xmlStreamPush() failure\n");
-		xmlFreeStreamCtxt(patstream);
-		patstream = NULL;
-            }
-	}
-    }
-#endif
-
-
-    if (reader != NULL) {
-#ifdef LIBXML_VALID_ENABLED
-	if (valid)
-	    xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
-	else
-#endif /* LIBXML_VALID_ENABLED */
-	    if (loaddtd)
-		xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
-#ifdef LIBXML_SCHEMAS_ENABLED
-	if (relaxng != NULL) {
-	    if ((timing) && (!repeat)) {
-		startTimer();
-	    }
-	    ret = xmlTextReaderRelaxNGValidate(reader, relaxng);
-	    if (ret < 0) {
-		xmlGenericError(xmlGenericErrorContext,
-			"Relax-NG schema %s failed to compile\n", relaxng);
-		progresult = XMLLINT_ERR_SCHEMACOMP;
-		relaxng = NULL;
-	    }
-	    if ((timing) && (!repeat)) {
-		endTimer("Compiling the schemas");
-	    }
-	}
-	if (schema != NULL) {
-	    if ((timing) && (!repeat)) {
-		startTimer();
-	    }
-	    ret = xmlTextReaderSchemaValidate(reader, schema);
-	    if (ret < 0) {
-		xmlGenericError(xmlGenericErrorContext,
-			"XSD schema %s failed to compile\n", schema);
-		progresult = XMLLINT_ERR_SCHEMACOMP;
-		schema = NULL;
-	    }
-	    if ((timing) && (!repeat)) {
-		endTimer("Compiling the schemas");
-	    }
-	}
-#endif
-
-	/*
-	 * Process all nodes in sequence
-	 */
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-	ret = xmlTextReaderRead(reader);
-	while (ret == 1) {
-	    if ((debug)
-#ifdef LIBXML_PATTERN_ENABLED
-	        || (patternc)
-#endif
-	       )
-		processNode(reader);
-	    ret = xmlTextReaderRead(reader);
-	}
-	if ((timing) && (!repeat)) {
-#ifdef LIBXML_SCHEMAS_ENABLED
-	    if (relaxng != NULL)
-		endTimer("Parsing and validating");
-	    else
-#endif
-#ifdef LIBXML_VALID_ENABLED
-	    if (valid)
-		endTimer("Parsing and validating");
-	    else
-#endif
-	    endTimer("Parsing");
-	}
-
-#ifdef LIBXML_VALID_ENABLED
-	if (valid) {
-	    if (xmlTextReaderIsValid(reader) != 1) {
-		xmlGenericError(xmlGenericErrorContext,
-			"Document %s does not validate\n", filename);
-		progresult = XMLLINT_ERR_VALID;
-	    }
-	}
-#endif /* LIBXML_VALID_ENABLED */
-#ifdef LIBXML_SCHEMAS_ENABLED
-	if ((relaxng != NULL) || (schema != NULL)) {
-	    if (xmlTextReaderIsValid(reader) != 1) {
-		fprintf(stderr, "%s fails to validate\n", filename);
-		progresult = XMLLINT_ERR_VALID;
-	    } else {
-		fprintf(stderr, "%s validates\n", filename);
-	    }
-	}
-#endif
-	/*
-	 * Done, cleanup and status
-	 */
-	xmlFreeTextReader(reader);
-	if (ret != 0) {
-	    fprintf(stderr, "%s : failed to parse\n", filename);
-	    progresult = XMLLINT_ERR_UNCLASS;
-	}
-    } else {
-	fprintf(stderr, "Unable to open %s\n", filename);
-	progresult = XMLLINT_ERR_UNCLASS;
-    }
-#ifdef LIBXML_PATTERN_ENABLED
-    if (patstream != NULL) {
-	xmlFreeStreamCtxt(patstream);
-	patstream = NULL;
-    }
-#endif
-#ifdef HAVE_MMAP
-    if (memory) {
-        xmlFreeParserInputBuffer(input);
-	munmap((char *) base, info.st_size);
-	close(fd);
-    }
-#endif
-}
-
-static void walkDoc(xmlDocPtr doc) {
-    xmlTextReaderPtr reader;
-    int ret;
-
-#ifdef LIBXML_PATTERN_ENABLED
-    xmlNodePtr root;
-    const xmlChar *namespaces[22];
-    int i;
-    xmlNsPtr ns;
-
-    root = xmlDocGetRootElement(doc);
-    for (ns = root->nsDef, i = 0;ns != NULL && i < 20;ns=ns->next) {
-        namespaces[i++] = ns->href;
-        namespaces[i++] = ns->prefix;
-    }
-    namespaces[i++] = NULL;
-    namespaces[i] = NULL;
-
-    if (pattern != NULL) {
-        patternc = xmlPatterncompile((const xmlChar *) pattern, doc->dict,
-	                             0, &namespaces[0]);
-	if (patternc == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Pattern %s failed to compile\n", pattern);
-            progresult = XMLLINT_ERR_SCHEMAPAT;
-	    pattern = NULL;
-	}
-    }
-    if (patternc != NULL) {
-        patstream = xmlPatternGetStreamCtxt(patternc);
-	if (patstream != NULL) {
-	    ret = xmlStreamPush(patstream, NULL, NULL);
-	    if (ret < 0) {
-		fprintf(stderr, "xmlStreamPush() failure\n");
-		xmlFreeStreamCtxt(patstream);
-		patstream = NULL;
-            }
-	}
-    }
-#endif /* LIBXML_PATTERN_ENABLED */
-    reader = xmlReaderWalker(doc);
-    if (reader != NULL) {
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-	ret = xmlTextReaderRead(reader);
-	while (ret == 1) {
-	    if ((debug)
-#ifdef LIBXML_PATTERN_ENABLED
-	        || (patternc)
-#endif
-	       )
-		processNode(reader);
-	    ret = xmlTextReaderRead(reader);
-	}
-	if ((timing) && (!repeat)) {
-	    endTimer("walking through the doc");
-	}
-	xmlFreeTextReader(reader);
-	if (ret != 0) {
-	    fprintf(stderr, "failed to walk through the doc\n");
-	    progresult = XMLLINT_ERR_UNCLASS;
-	}
-    } else {
-	fprintf(stderr, "Failed to crate a reader from the document\n");
-	progresult = XMLLINT_ERR_UNCLASS;
-    }
-#ifdef LIBXML_PATTERN_ENABLED
-    if (patstream != NULL) {
-	xmlFreeStreamCtxt(patstream);
-	patstream = NULL;
-    }
-#endif
-}
-#endif /* LIBXML_READER_ENABLED */
-
-#ifdef LIBXML_XPATH_ENABLED
-/************************************************************************
- *									*
- *			XPath Query                                     *
- *									*
- ************************************************************************/
-
-static void doXPathDump(xmlXPathObjectPtr cur) {
-    switch(cur->type) {
-        case XPATH_NODESET: {
-            int i;
-            xmlNodePtr node;
-#ifdef LIBXML_OUTPUT_ENABLED
-            xmlSaveCtxtPtr ctxt;
-
-            if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr <= 0)) {
-                fprintf(stderr, "XPath set is empty\n");
-                progresult = XMLLINT_ERR_XPATH;
-                break;
-            }
-            ctxt = xmlSaveToFd(1, NULL, 0);
-            if (ctxt == NULL) {
-                fprintf(stderr, "Out of memory for XPath\n");
-                progresult = XMLLINT_ERR_MEM;
-                return;
-            }
-            for (i = 0;i < cur->nodesetval->nodeNr;i++) {
-                node = cur->nodesetval->nodeTab[i];
-                xmlSaveTree(ctxt, node);
-            }
-            xmlSaveClose(ctxt);
-#else
-            printf("xpath returned %d nodes\n", cur->nodesetval->nodeNr);
-#endif
-	    break;
-        }
-        case XPATH_BOOLEAN:
-	    if (cur->boolval) printf("true");
-	    else printf("false");
-	    break;
-        case XPATH_NUMBER:
-	    switch (xmlXPathIsInf(cur->floatval)) {
-	    case 1:
-		printf("Infinity");
-		break;
-	    case -1:
-		printf("-Infinity");
-		break;
-	    default:
-		if (xmlXPathIsNaN(cur->floatval)) {
-		    printf("NaN");
-		} else {
-		    printf("%0g", cur->floatval);
-		}
-	    }
-	    break;
-        case XPATH_STRING:
-	    printf("%s", (const char *) cur->stringval);
-	    break;
-        case XPATH_UNDEFINED:
-	    fprintf(stderr, "XPath Object is uninitialized\n");
-            progresult = XMLLINT_ERR_XPATH;
-	    break;
-	default:
-	    fprintf(stderr, "XPath object of unexpected type\n");
-            progresult = XMLLINT_ERR_XPATH;
-	    break;
-    }
-}
-
-static void doXPathQuery(xmlDocPtr doc, const char *query) {
-    xmlXPathContextPtr ctxt;
-    xmlXPathObjectPtr res;
-
-    ctxt = xmlXPathNewContext(doc);
-    if (ctxt == NULL) {
-        fprintf(stderr, "Out of memory for XPath\n");
-        progresult = XMLLINT_ERR_MEM;
-        return;
-    }
-    ctxt->node = (xmlNodePtr) doc;
-    res = xmlXPathEval(BAD_CAST query, ctxt);
-    xmlXPathFreeContext(ctxt);
-
-    if (res == NULL) {
-        fprintf(stderr, "XPath evaluation failure\n");
-        progresult = XMLLINT_ERR_XPATH;
-        return;
-    }
-    doXPathDump(res);
-    xmlXPathFreeObject(res);
-}
-#endif /* LIBXML_XPATH_ENABLED */
-
-/************************************************************************
- *									*
- *			Tree Test processing				*
- *									*
- ************************************************************************/
-static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
-    xmlDocPtr doc = NULL;
-#ifdef LIBXML_TREE_ENABLED
-    xmlDocPtr tmp;
-#endif /* LIBXML_TREE_ENABLED */
-
-    if ((timing) && (!repeat))
-	startTimer();
-
-
-#ifdef LIBXML_TREE_ENABLED
-    if (filename == NULL) {
-	if (generate) {
-	    xmlNodePtr n;
-
-	    doc = xmlNewDoc(BAD_CAST "1.0");
-	    n = xmlNewDocNode(doc, NULL, BAD_CAST "info", NULL);
-	    xmlNodeSetContent(n, BAD_CAST "abc");
-	    xmlDocSetRootElement(doc, n);
-	}
-    }
-#endif /* LIBXML_TREE_ENABLED */
-#ifdef LIBXML_HTML_ENABLED
-#ifdef LIBXML_PUSH_ENABLED
-    else if ((html) && (push)) {
-        FILE *f;
-
-#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
-	f = fopen(filename, "rb");
-#elif defined(__OS400__)
-	f = fopen(filename, "rb");
-#else
-	f = fopen(filename, "r");
-#endif
-        if (f != NULL) {
-            int res;
-            char chars[4096];
-            htmlParserCtxtPtr ctxt;
-
-            res = fread(chars, 1, 4, f);
-            if (res > 0) {
-                ctxt = htmlCreatePushParserCtxt(NULL, NULL,
-                            chars, res, filename, XML_CHAR_ENCODING_NONE);
-                xmlCtxtUseOptions(ctxt, options);
-                while ((res = fread(chars, 1, pushsize, f)) > 0) {
-                    htmlParseChunk(ctxt, chars, res, 0);
-                }
-                htmlParseChunk(ctxt, chars, 0, 1);
-                doc = ctxt->myDoc;
-                htmlFreeParserCtxt(ctxt);
-            }
-            fclose(f);
-        }
-    }
-#endif /* LIBXML_PUSH_ENABLED */
-#ifdef HAVE_MMAP
-    else if ((html) && (memory)) {
-	int fd;
-	struct stat info;
-	const char *base;
-	if (stat(filename, &info) < 0)
-	    return;
-	if ((fd = open(filename, O_RDONLY)) < 0)
-	    return;
-	base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
-	if (base == (void *) MAP_FAILED) {
-	    close(fd);
-	    fprintf(stderr, "mmap failure for file %s\n", filename);
-	    progresult = XMLLINT_ERR_RDFILE;
-	    return;
-	}
-
-	doc = htmlReadMemory((char *) base, info.st_size, filename,
-	                     NULL, options);
-
-	munmap((char *) base, info.st_size);
-	close(fd);
-    }
-#endif
-    else if (html) {
-	doc = htmlReadFile(filename, NULL, options);
-    }
-#endif /* LIBXML_HTML_ENABLED */
-    else {
-#ifdef LIBXML_PUSH_ENABLED
-	/*
-	 * build an XML tree from a string;
-	 */
-	if (push) {
-	    FILE *f;
-
-	    /* '-' Usually means stdin -<sven@zen.org> */
-	    if ((filename[0] == '-') && (filename[1] == 0)) {
-	      f = stdin;
-	    } else {
-#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
-		f = fopen(filename, "rb");
-#elif defined(__OS400__)
-		f = fopen(filename, "rb");
-#else
-		f = fopen(filename, "r");
-#endif
-	    }
-	    if (f != NULL) {
-		int ret;
-	        int res, size = 1024;
-	        char chars[1024];
-                xmlParserCtxtPtr ctxt;
-
-		/* if (repeat) size = 1024; */
-		res = fread(chars, 1, 4, f);
-		if (res > 0) {
-		    ctxt = xmlCreatePushParserCtxt(NULL, NULL,
-		                chars, res, filename);
-		    xmlCtxtUseOptions(ctxt, options);
-		    while ((res = fread(chars, 1, size, f)) > 0) {
-			xmlParseChunk(ctxt, chars, res, 0);
-		    }
-		    xmlParseChunk(ctxt, chars, 0, 1);
-		    doc = ctxt->myDoc;
-		    ret = ctxt->wellFormed;
-		    xmlFreeParserCtxt(ctxt);
-		    if (!ret) {
-			xmlFreeDoc(doc);
-			doc = NULL;
-		    }
-	        }
-                if (f != stdin)
-                    fclose(f);
-	    }
-	} else
-#endif /* LIBXML_PUSH_ENABLED */
-        if (testIO) {
-	    if ((filename[0] == '-') && (filename[1] == 0)) {
-	        doc = xmlReadFd(0, NULL, NULL, options);
-	    } else {
-	        FILE *f;
-
-#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
-		f = fopen(filename, "rb");
-#elif defined(__OS400__)
-		f = fopen(filename, "rb");
-#else
-		f = fopen(filename, "r");
-#endif
-		if (f != NULL) {
-		    if (rectxt == NULL)
-			doc = xmlReadIO((xmlInputReadCallback) myRead,
-					(xmlInputCloseCallback) myClose, f,
-					filename, NULL, options);
-		    else
-			doc = xmlCtxtReadIO(rectxt,
-			                (xmlInputReadCallback) myRead,
-					(xmlInputCloseCallback) myClose, f,
-					filename, NULL, options);
-		} else
-		    doc = NULL;
-	    }
-	} else if (htmlout) {
-	    xmlParserCtxtPtr ctxt;
-
-	    if (rectxt == NULL)
-		ctxt = xmlNewParserCtxt();
-	    else
-	        ctxt = rectxt;
-	    if (ctxt == NULL) {
-	        doc = NULL;
-	    } else {
-	        ctxt->sax->error = xmlHTMLError;
-	        ctxt->sax->warning = xmlHTMLWarning;
-	        ctxt->vctxt.error = xmlHTMLValidityError;
-	        ctxt->vctxt.warning = xmlHTMLValidityWarning;
-
-		doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
-
-		if (rectxt == NULL)
-		    xmlFreeParserCtxt(ctxt);
-	    }
-#ifdef HAVE_MMAP
-	} else if (memory) {
-	    int fd;
-	    struct stat info;
-	    const char *base;
-	    if (stat(filename, &info) < 0)
-		return;
-	    if ((fd = open(filename, O_RDONLY)) < 0)
-		return;
-	    base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
-	    if (base == (void *) MAP_FAILED) {
-	        close(fd);
-	        fprintf(stderr, "mmap failure for file %s\n", filename);
-		progresult = XMLLINT_ERR_RDFILE;
-	        return;
-	    }
-
-	    if (rectxt == NULL)
-		doc = xmlReadMemory((char *) base, info.st_size,
-		                    filename, NULL, options);
-	    else
-		doc = xmlCtxtReadMemory(rectxt, (char *) base, info.st_size,
-			                filename, NULL, options);
-
-	    munmap((char *) base, info.st_size);
-	    close(fd);
-#endif
-#ifdef LIBXML_VALID_ENABLED
-	} else if (valid) {
-	    xmlParserCtxtPtr ctxt = NULL;
-
-	    if (rectxt == NULL)
-		ctxt = xmlNewParserCtxt();
-	    else
-	        ctxt = rectxt;
-	    if (ctxt == NULL) {
-	        doc = NULL;
-	    } else {
-		doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
-
-		if (ctxt->valid == 0)
-		    progresult = XMLLINT_ERR_RDFILE;
-		if (rectxt == NULL)
-		    xmlFreeParserCtxt(ctxt);
-	    }
-#endif /* LIBXML_VALID_ENABLED */
-	} else {
-	    if (rectxt != NULL)
-	        doc = xmlCtxtReadFile(rectxt, filename, NULL, options);
-	    else {
-#ifdef LIBXML_SAX1_ENABLED
-                if (sax1)
-		    doc = xmlParseFile(filename);
-		else
-#endif /* LIBXML_SAX1_ENABLED */
-		doc = xmlReadFile(filename, NULL, options);
-	    }
-	}
-    }
-
-    /*
-     * If we don't have a document we might as well give up.  Do we
-     * want an error message here?  <sven@zen.org> */
-    if (doc == NULL) {
-	progresult = XMLLINT_ERR_UNCLASS;
-	return;
-    }
-
-    if ((timing) && (!repeat)) {
-	endTimer("Parsing");
-    }
-
-    /*
-     * Remove DOCTYPE nodes
-     */
-    if (dropdtd) {
-	xmlDtdPtr dtd;
-
-	dtd = xmlGetIntSubset(doc);
-	if (dtd != NULL) {
-	    xmlUnlinkNode((xmlNodePtr)dtd);
-	    xmlFreeDtd(dtd);
-	}
-    }
-
-#ifdef LIBXML_XINCLUDE_ENABLED
-    if (xinclude) {
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-	if (xmlXIncludeProcessFlags(doc, options) < 0)
-	    progresult = XMLLINT_ERR_UNCLASS;
-	if ((timing) && (!repeat)) {
-	    endTimer("Xinclude processing");
-	}
-    }
-#endif
-
-#ifdef LIBXML_XPATH_ENABLED
-    if (xpathquery != NULL) {
-        doXPathQuery(doc, xpathquery);
-    }
-#endif
-
-#ifdef LIBXML_DEBUG_ENABLED
-#ifdef LIBXML_XPATH_ENABLED
-    /*
-     * shell interaction
-     */
-    if (shell) {
-        xmlXPathOrderDocElems(doc);
-        xmlShell(doc, filename, xmlShellReadline, stdout);
-    }
-#endif
-#endif
-
-#ifdef LIBXML_TREE_ENABLED
-    /*
-     * test intermediate copy if needed.
-     */
-    if (copy) {
-        tmp = doc;
-	if (timing) {
-	    startTimer();
-	}
-	doc = xmlCopyDoc(doc, 1);
-	if (timing) {
-	    endTimer("Copying");
-	}
-	if (timing) {
-	    startTimer();
-	}
-	xmlFreeDoc(tmp);
-	if (timing) {
-	    endTimer("Freeing original");
-	}
-    }
-#endif /* LIBXML_TREE_ENABLED */
-
-#ifdef LIBXML_VALID_ENABLED
-    if ((insert) && (!html)) {
-        const xmlChar* list[256];
-	int nb, i;
-	xmlNodePtr node;
-
-	if (doc->children != NULL) {
-	    node = doc->children;
-	    while ((node != NULL) && (node->last == NULL)) node = node->next;
-	    if (node != NULL) {
-		nb = xmlValidGetValidElements(node->last, NULL, list, 256);
-		if (nb < 0) {
-		    fprintf(stderr, "could not get valid list of elements\n");
-		} else if (nb == 0) {
-		    fprintf(stderr, "No element can be inserted under root\n");
-		} else {
-		    fprintf(stderr, "%d element types can be inserted under root:\n",
-		           nb);
-		    for (i = 0;i < nb;i++) {
-			 fprintf(stderr, "%s\n", (char *) list[i]);
-		    }
-		}
-	    }
-	}
-    }else
-#endif /* LIBXML_VALID_ENABLED */
-#ifdef LIBXML_READER_ENABLED
-    if (walker) {
-        walkDoc(doc);
-    }
-#endif /* LIBXML_READER_ENABLED */
-#ifdef LIBXML_OUTPUT_ENABLED
-    if (noout == 0) {
-        int ret;
-
-	/*
-	 * print it.
-	 */
-#ifdef LIBXML_DEBUG_ENABLED
-	if (!debug) {
-#endif
-	    if ((timing) && (!repeat)) {
-		startTimer();
-	    }
-#ifdef LIBXML_HTML_ENABLED
-            if ((html) && (!xmlout)) {
-		if (compress) {
-		    htmlSaveFile(output ? output : "-", doc);
-		}
-		else if (encoding != NULL) {
-		    if (format == 1) {
-			htmlSaveFileFormat(output ? output : "-", doc, encoding, 1);
-		    }
-		    else {
-			htmlSaveFileFormat(output ? output : "-", doc, encoding, 0);
-		    }
-		}
-		else if (format == 1) {
-		    htmlSaveFileFormat(output ? output : "-", doc, NULL, 1);
-		}
-		else {
-		    FILE *out;
-		    if (output == NULL)
-			out = stdout;
-		    else {
-			out = fopen(output,"wb");
-		    }
-		    if (out != NULL) {
-			if (htmlDocDump(out, doc) < 0)
-			    progresult = XMLLINT_ERR_OUT;
-
-			if (output != NULL)
-			    fclose(out);
-		    } else {
-			fprintf(stderr, "failed to open %s\n", output);
-			progresult = XMLLINT_ERR_OUT;
-		    }
-		}
-		if ((timing) && (!repeat)) {
-		    endTimer("Saving");
-		}
-	    } else
-#endif
-#ifdef LIBXML_C14N_ENABLED
-            if (canonical) {
-	        xmlChar *result = NULL;
-		int size;
-
-		size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_0, NULL, 1, &result);
-		if (size >= 0) {
-		    if (write(1, result, size) == -1) {
-		        fprintf(stderr, "Can't write data\n");
-		    }
-		    xmlFree(result);
-		} else {
-		    fprintf(stderr, "Failed to canonicalize\n");
-		    progresult = XMLLINT_ERR_OUT;
-		}
-	    } else if (canonical_11) {
-	        xmlChar *result = NULL;
-		int size;
-
-		size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_1, NULL, 1, &result);
-		if (size >= 0) {
-		    if (write(1, result, size) == -1) {
-		        fprintf(stderr, "Can't write data\n");
-		    }
-		    xmlFree(result);
-		} else {
-		    fprintf(stderr, "Failed to canonicalize\n");
-		    progresult = XMLLINT_ERR_OUT;
-		}
-	    } else
-            if (exc_canonical) {
-	        xmlChar *result = NULL;
-		int size;
-
-		size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_EXCLUSIVE_1_0, NULL, 1, &result);
-		if (size >= 0) {
-		    if (write(1, result, size) == -1) {
-		        fprintf(stderr, "Can't write data\n");
-		    }
-		    xmlFree(result);
-		} else {
-		    fprintf(stderr, "Failed to canonicalize\n");
-		    progresult = XMLLINT_ERR_OUT;
-		}
-	    } else
-#endif
-#ifdef HAVE_MMAP
-	    if (memory) {
-		xmlChar *result;
-		int len;
-
-		if (encoding != NULL) {
-		    if (format == 1) {
-		        xmlDocDumpFormatMemoryEnc(doc, &result, &len, encoding, 1);
-		    } else {
-			xmlDocDumpMemoryEnc(doc, &result, &len, encoding);
-		    }
-		} else {
-		    if (format == 1)
-			xmlDocDumpFormatMemory(doc, &result, &len, 1);
-		    else
-			xmlDocDumpMemory(doc, &result, &len);
-		}
-		if (result == NULL) {
-		    fprintf(stderr, "Failed to save\n");
-		    progresult = XMLLINT_ERR_OUT;
-		} else {
-		    if (write(1, result, len) == -1) {
-		        fprintf(stderr, "Can't write data\n");
-		    }
-		    xmlFree(result);
-		}
-
-	    } else
-#endif /* HAVE_MMAP */
-	    if (compress) {
-		xmlSaveFile(output ? output : "-", doc);
-	    } else if (oldout) {
-	        if (encoding != NULL) {
-		    if (format == 1) {
-			ret = xmlSaveFormatFileEnc(output ? output : "-", doc,
-						   encoding, 1);
-		    }
-		    else {
-			ret = xmlSaveFileEnc(output ? output : "-", doc,
-			                     encoding);
-		    }
-		    if (ret < 0) {
-			fprintf(stderr, "failed save to %s\n",
-				output ? output : "-");
-			progresult = XMLLINT_ERR_OUT;
-		    }
-		} else if (format == 1) {
-		    ret = xmlSaveFormatFile(output ? output : "-", doc, 1);
-		    if (ret < 0) {
-			fprintf(stderr, "failed save to %s\n",
-				output ? output : "-");
-			progresult = XMLLINT_ERR_OUT;
-		    }
-		} else {
-		    FILE *out;
-		    if (output == NULL)
-			out = stdout;
-		    else {
-			out = fopen(output,"wb");
-		    }
-		    if (out != NULL) {
-			if (xmlDocDump(out, doc) < 0)
-			    progresult = XMLLINT_ERR_OUT;
-
-			if (output != NULL)
-			    fclose(out);
-		    } else {
-			fprintf(stderr, "failed to open %s\n", output);
-			progresult = XMLLINT_ERR_OUT;
-		    }
-		}
-	    } else {
-	        xmlSaveCtxtPtr ctxt;
-		int saveOpts = 0;
-
-                if (format == 1)
-		    saveOpts |= XML_SAVE_FORMAT;
-                else if (format == 2)
-                    saveOpts |= XML_SAVE_WSNONSIG;
-
-#if defined(LIBXML_HTML_ENABLED) || defined(LIBXML_VALID_ENABLED)
-                if (xmlout)
-                    saveOpts |= XML_SAVE_AS_XML;
-#endif
-
-		if (output == NULL)
-		    ctxt = xmlSaveToFd(1, encoding, saveOpts);
-		else
-		    ctxt = xmlSaveToFilename(output, encoding, saveOpts);
-
-		if (ctxt != NULL) {
-		    if (xmlSaveDoc(ctxt, doc) < 0) {
-			fprintf(stderr, "failed save to %s\n",
-				output ? output : "-");
-			progresult = XMLLINT_ERR_OUT;
-		    }
-		    xmlSaveClose(ctxt);
-		} else {
-		    progresult = XMLLINT_ERR_OUT;
-		}
-	    }
-	    if ((timing) && (!repeat)) {
-		endTimer("Saving");
-	    }
-#ifdef LIBXML_DEBUG_ENABLED
-	} else {
-	    FILE *out;
-	    if (output == NULL)
-	        out = stdout;
-	    else {
-		out = fopen(output,"wb");
-	    }
-	    if (out != NULL) {
-		xmlDebugDumpDocument(out, doc);
-
-		if (output != NULL)
-		    fclose(out);
-	    } else {
-		fprintf(stderr, "failed to open %s\n", output);
-		progresult = XMLLINT_ERR_OUT;
-	    }
-	}
-#endif
-    }
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-#ifdef LIBXML_VALID_ENABLED
-    /*
-     * A posteriori validation test
-     */
-    if ((dtdvalid != NULL) || (dtdvalidfpi != NULL)) {
-	xmlDtdPtr dtd;
-
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-	if (dtdvalid != NULL)
-	    dtd = xmlParseDTD(NULL, (const xmlChar *)dtdvalid);
-	else
-	    dtd = xmlParseDTD((const xmlChar *)dtdvalidfpi, NULL);
-	if ((timing) && (!repeat)) {
-	    endTimer("Parsing DTD");
-	}
-	if (dtd == NULL) {
-	    if (dtdvalid != NULL)
-		xmlGenericError(xmlGenericErrorContext,
-			"Could not parse DTD %s\n", dtdvalid);
-	    else
-		xmlGenericError(xmlGenericErrorContext,
-			"Could not parse DTD %s\n", dtdvalidfpi);
-	    progresult = XMLLINT_ERR_DTD;
-	} else {
-	    xmlValidCtxtPtr cvp;
-
-	    if ((cvp = xmlNewValidCtxt()) == NULL) {
-		xmlGenericError(xmlGenericErrorContext,
-			"Couldn't allocate validation context\n");
-		exit(-1);
-	    }
-	    cvp->userData = (void *) stderr;
-	    cvp->error    = (xmlValidityErrorFunc) fprintf;
-	    cvp->warning  = (xmlValidityWarningFunc) fprintf;
-
-	    if ((timing) && (!repeat)) {
-		startTimer();
-	    }
-	    if (!xmlValidateDtd(cvp, doc, dtd)) {
-		if (dtdvalid != NULL)
-		    xmlGenericError(xmlGenericErrorContext,
-			    "Document %s does not validate against %s\n",
-			    filename, dtdvalid);
-		else
-		    xmlGenericError(xmlGenericErrorContext,
-			    "Document %s does not validate against %s\n",
-			    filename, dtdvalidfpi);
-		progresult = XMLLINT_ERR_VALID;
-	    }
-	    if ((timing) && (!repeat)) {
-		endTimer("Validating against DTD");
-	    }
-	    xmlFreeValidCtxt(cvp);
-	    xmlFreeDtd(dtd);
-	}
-    } else if (postvalid) {
-	xmlValidCtxtPtr cvp;
-
-	if ((cvp = xmlNewValidCtxt()) == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Couldn't allocate validation context\n");
-	    exit(-1);
-	}
-
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-	cvp->userData = (void *) stderr;
-	cvp->error    = (xmlValidityErrorFunc) fprintf;
-	cvp->warning  = (xmlValidityWarningFunc) fprintf;
-	if (!xmlValidateDocument(cvp, doc)) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Document %s does not validate\n", filename);
-	    progresult = XMLLINT_ERR_VALID;
-	}
-	if ((timing) && (!repeat)) {
-	    endTimer("Validating");
-	}
-	xmlFreeValidCtxt(cvp);
-    }
-#endif /* LIBXML_VALID_ENABLED */
-#ifdef LIBXML_SCHEMATRON_ENABLED
-    if (wxschematron != NULL) {
-	xmlSchematronValidCtxtPtr ctxt;
-	int ret;
-	int flag;
-
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-
-	if (debug)
-	    flag = XML_SCHEMATRON_OUT_XML;
-	else
-	    flag = XML_SCHEMATRON_OUT_TEXT;
-	if (noout)
-	    flag |= XML_SCHEMATRON_OUT_QUIET;
-	ctxt = xmlSchematronNewValidCtxt(wxschematron, flag);
-#if 0
-	xmlSchematronSetValidErrors(ctxt,
-		(xmlSchematronValidityErrorFunc) fprintf,
-		(xmlSchematronValidityWarningFunc) fprintf,
-		stderr);
-#endif
-	ret = xmlSchematronValidateDoc(ctxt, doc);
-	if (ret == 0) {
-	    fprintf(stderr, "%s validates\n", filename);
-	} else if (ret > 0) {
-	    fprintf(stderr, "%s fails to validate\n", filename);
-	    progresult = XMLLINT_ERR_VALID;
-	} else {
-	    fprintf(stderr, "%s validation generated an internal error\n",
-		   filename);
-	    progresult = XMLLINT_ERR_VALID;
-	}
-	xmlSchematronFreeValidCtxt(ctxt);
-	if ((timing) && (!repeat)) {
-	    endTimer("Validating");
-	}
-    }
-#endif
-#ifdef LIBXML_SCHEMAS_ENABLED
-    if (relaxngschemas != NULL) {
-	xmlRelaxNGValidCtxtPtr ctxt;
-	int ret;
-
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-
-	ctxt = xmlRelaxNGNewValidCtxt(relaxngschemas);
-	xmlRelaxNGSetValidErrors(ctxt,
-		(xmlRelaxNGValidityErrorFunc) fprintf,
-		(xmlRelaxNGValidityWarningFunc) fprintf,
-		stderr);
-	ret = xmlRelaxNGValidateDoc(ctxt, doc);
-	if (ret == 0) {
-	    fprintf(stderr, "%s validates\n", filename);
-	} else if (ret > 0) {
-	    fprintf(stderr, "%s fails to validate\n", filename);
-	    progresult = XMLLINT_ERR_VALID;
-	} else {
-	    fprintf(stderr, "%s validation generated an internal error\n",
-		   filename);
-	    progresult = XMLLINT_ERR_VALID;
-	}
-	xmlRelaxNGFreeValidCtxt(ctxt);
-	if ((timing) && (!repeat)) {
-	    endTimer("Validating");
-	}
-    } else if (wxschemas != NULL) {
-	xmlSchemaValidCtxtPtr ctxt;
-	int ret;
-
-	if ((timing) && (!repeat)) {
-	    startTimer();
-	}
-
-	ctxt = xmlSchemaNewValidCtxt(wxschemas);
-	xmlSchemaSetValidErrors(ctxt,
-		(xmlSchemaValidityErrorFunc) fprintf,
-		(xmlSchemaValidityWarningFunc) fprintf,
-		stderr);
-	ret = xmlSchemaValidateDoc(ctxt, doc);
-	if (ret == 0) {
-	    fprintf(stderr, "%s validates\n", filename);
-	} else if (ret > 0) {
-	    fprintf(stderr, "%s fails to validate\n", filename);
-	    progresult = XMLLINT_ERR_VALID;
-	} else {
-	    fprintf(stderr, "%s validation generated an internal error\n",
-		   filename);
-	    progresult = XMLLINT_ERR_VALID;
-	}
-	xmlSchemaFreeValidCtxt(ctxt);
-	if ((timing) && (!repeat)) {
-	    endTimer("Validating");
-	}
-    }
-#endif
-
-#ifdef LIBXML_DEBUG_ENABLED
-#if defined(LIBXML_HTML_ENABLED) || defined(LIBXML_VALID_ENABLED)
-    if ((debugent) && (!html))
-	xmlDebugDumpEntities(stderr, doc);
-#endif
-#endif
-
-    /*
-     * free it.
-     */
-    if ((timing) && (!repeat)) {
-	startTimer();
-    }
-    xmlFreeDoc(doc);
-    if ((timing) && (!repeat)) {
-	endTimer("Freeing");
-    }
-}
-
-/************************************************************************
- *									*
- *			Usage and Main					*
- *									*
- ************************************************************************/
-
-static void showVersion(const char *name) {
-    fprintf(stderr, "%s: using libxml version %s\n", name, xmlParserVersion);
-    fprintf(stderr, "   compiled with: ");
-    if (xmlHasFeature(XML_WITH_THREAD)) fprintf(stderr, "Threads ");
-    if (xmlHasFeature(XML_WITH_TREE)) fprintf(stderr, "Tree ");
-    if (xmlHasFeature(XML_WITH_OUTPUT)) fprintf(stderr, "Output ");
-    if (xmlHasFeature(XML_WITH_PUSH)) fprintf(stderr, "Push ");
-    if (xmlHasFeature(XML_WITH_READER)) fprintf(stderr, "Reader ");
-    if (xmlHasFeature(XML_WITH_PATTERN)) fprintf(stderr, "Patterns ");
-    if (xmlHasFeature(XML_WITH_WRITER)) fprintf(stderr, "Writer ");
-    if (xmlHasFeature(XML_WITH_SAX1)) fprintf(stderr, "SAXv1 ");
-    if (xmlHasFeature(XML_WITH_FTP)) fprintf(stderr, "FTP ");
-    if (xmlHasFeature(XML_WITH_HTTP)) fprintf(stderr, "HTTP ");
-    if (xmlHasFeature(XML_WITH_VALID)) fprintf(stderr, "DTDValid ");
-    if (xmlHasFeature(XML_WITH_HTML)) fprintf(stderr, "HTML ");
-    if (xmlHasFeature(XML_WITH_LEGACY)) fprintf(stderr, "Legacy ");
-    if (xmlHasFeature(XML_WITH_C14N)) fprintf(stderr, "C14N ");
-    if (xmlHasFeature(XML_WITH_CATALOG)) fprintf(stderr, "Catalog ");
-    if (xmlHasFeature(XML_WITH_XPATH)) fprintf(stderr, "XPath ");
-    if (xmlHasFeature(XML_WITH_XPTR)) fprintf(stderr, "XPointer ");
-    if (xmlHasFeature(XML_WITH_XINCLUDE)) fprintf(stderr, "XInclude ");
-    if (xmlHasFeature(XML_WITH_ICONV)) fprintf(stderr, "Iconv ");
-    if (xmlHasFeature(XML_WITH_ISO8859X)) fprintf(stderr, "ISO8859X ");
-    if (xmlHasFeature(XML_WITH_UNICODE)) fprintf(stderr, "Unicode ");
-    if (xmlHasFeature(XML_WITH_REGEXP)) fprintf(stderr, "Regexps ");
-    if (xmlHasFeature(XML_WITH_AUTOMATA)) fprintf(stderr, "Automata ");
-    if (xmlHasFeature(XML_WITH_EXPR)) fprintf(stderr, "Expr ");
-    if (xmlHasFeature(XML_WITH_SCHEMAS)) fprintf(stderr, "Schemas ");
-    if (xmlHasFeature(XML_WITH_SCHEMATRON)) fprintf(stderr, "Schematron ");
-    if (xmlHasFeature(XML_WITH_MODULES)) fprintf(stderr, "Modules ");
-    if (xmlHasFeature(XML_WITH_DEBUG)) fprintf(stderr, "Debug ");
-    if (xmlHasFeature(XML_WITH_DEBUG_MEM)) fprintf(stderr, "MemDebug ");
-    if (xmlHasFeature(XML_WITH_DEBUG_RUN)) fprintf(stderr, "RunDebug ");
-    if (xmlHasFeature(XML_WITH_ZLIB)) fprintf(stderr, "Zlib ");
-    if (xmlHasFeature(XML_WITH_LZMA)) fprintf(stderr, "Lzma ");
-    fprintf(stderr, "\n");
-}
-
-static void usage(const char *name) {
-    printf("Usage : %s [options] XMLfiles ...\n", name);
-#ifdef LIBXML_OUTPUT_ENABLED
-    printf("\tParse the XML files and output the result of the parsing\n");
-#else
-    printf("\tParse the XML files\n");
-#endif /* LIBXML_OUTPUT_ENABLED */
-    printf("\t--version : display the version of the XML library used\n");
-#ifdef LIBXML_DEBUG_ENABLED
-    printf("\t--debug : dump a debug tree of the in-memory document\n");
-    printf("\t--shell : run a navigating shell\n");
-    printf("\t--debugent : debug the entities defined in the document\n");
-#else
-#ifdef LIBXML_READER_ENABLED
-    printf("\t--debug : dump the nodes content when using --stream\n");
-#endif /* LIBXML_READER_ENABLED */
-#endif
-#ifdef LIBXML_TREE_ENABLED
-    printf("\t--copy : used to test the internal copy implementation\n");
-#endif /* LIBXML_TREE_ENABLED */
-    printf("\t--recover : output what was parsable on broken XML documents\n");
-    printf("\t--huge : remove any internal arbitrary parser limits\n");
-    printf("\t--noent : substitute entity references by their value\n");
-    printf("\t--noenc : ignore any encoding specified inside the document\n");
-    printf("\t--noout : don't output the result tree\n");
-    printf("\t--path 'paths': provide a set of paths for resources\n");
-    printf("\t--load-trace : print trace of all external entities loaded\n");
-    printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
-    printf("\t--nocompact : do not generate compact text nodes\n");
-    printf("\t--htmlout : output results as HTML\n");
-    printf("\t--nowrap : do not put HTML doc wrapper\n");
-#ifdef LIBXML_VALID_ENABLED
-    printf("\t--valid : validate the document in addition to std well-formed check\n");
-    printf("\t--postvalid : do a posteriori validation, i.e after parsing\n");
-    printf("\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
-    printf("\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
-#endif /* LIBXML_VALID_ENABLED */
-    printf("\t--timing : print some timings\n");
-    printf("\t--output file or -o file: save to a given file\n");
-    printf("\t--repeat : repeat 100 times, for timing or profiling\n");
-    printf("\t--insert : ad-hoc test for valid insertions\n");
-#ifdef LIBXML_OUTPUT_ENABLED
-#ifdef HAVE_ZLIB_H
-    printf("\t--compress : turn on gzip compression of output\n");
-#endif
-#endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_HTML_ENABLED
-    printf("\t--html : use the HTML parser\n");
-    printf("\t--xmlout : force to use the XML serializer when using --html\n");
-    printf("\t--nodefdtd : do not default HTML doctype\n");
-#endif
-#ifdef LIBXML_PUSH_ENABLED
-    printf("\t--push : use the push mode of the parser\n");
-    printf("\t--pushsmall : use the push mode of the parser using tiny increments\n");
-#endif /* LIBXML_PUSH_ENABLED */
-#ifdef HAVE_MMAP
-    printf("\t--memory : parse from memory\n");
-#endif
-    printf("\t--maxmem nbbytes : limits memory allocation to nbbytes bytes\n");
-    printf("\t--nowarning : do not emit warnings from parser/validator\n");
-    printf("\t--noblanks : drop (ignorable?) blanks spaces\n");
-    printf("\t--nocdata : replace cdata section with text nodes\n");
-#ifdef LIBXML_OUTPUT_ENABLED
-    printf("\t--format : reformat/reindent the output\n");
-    printf("\t--encode encoding : output in the given encoding\n");
-    printf("\t--dropdtd : remove the DOCTYPE of the input docs\n");
-    printf("\t--pretty STYLE : pretty-print in a particular style\n");
-    printf("\t                 0 Do not pretty print\n");
-    printf("\t                 1 Format the XML content, as --format\n");
-    printf("\t                 2 Add whitespace inside tags, preserving content\n");
-#endif /* LIBXML_OUTPUT_ENABLED */
-    printf("\t--c14n : save in W3C canonical format v1.0 (with comments)\n");
-    printf("\t--c14n11 : save in W3C canonical format v1.1 (with comments)\n");
-    printf("\t--exc-c14n : save in W3C exclusive canonical format (with comments)\n");
-#ifdef LIBXML_C14N_ENABLED
-#endif /* LIBXML_C14N_ENABLED */
-    printf("\t--nsclean : remove redundant namespace declarations\n");
-    printf("\t--testIO : test user I/O support\n");
-#ifdef LIBXML_CATALOG_ENABLED
-    printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n");
-    printf("\t             otherwise XML Catalogs starting from \n");
-    printf("\t         %s are activated by default\n", XML_XML_DEFAULT_CATALOG);
-    printf("\t--nocatalogs: deactivate all catalogs\n");
-#endif
-    printf("\t--auto : generate a small doc on the fly\n");
-#ifdef LIBXML_XINCLUDE_ENABLED
-    printf("\t--xinclude : do XInclude processing\n");
-    printf("\t--noxincludenode : same but do not generate XInclude nodes\n");
-    printf("\t--nofixup-base-uris : do not fixup xml:base uris\n");
-#endif
-    printf("\t--loaddtd : fetch external DTD\n");
-    printf("\t--dtdattr : loaddtd + populate the tree with inherited attributes \n");
-#ifdef LIBXML_READER_ENABLED
-    printf("\t--stream : use the streaming interface to process very large files\n");
-    printf("\t--walker : create a reader and walk though the resulting doc\n");
-#endif /* LIBXML_READER_ENABLED */
-#ifdef LIBXML_PATTERN_ENABLED
-    printf("\t--pattern pattern_value : test the pattern support\n");
-#endif
-    printf("\t--chkregister : verify the node registration code\n");
-#ifdef LIBXML_SCHEMAS_ENABLED
-    printf("\t--relaxng schema : do RelaxNG validation against the schema\n");
-    printf("\t--schema schema : do validation against the WXS schema\n");
-#endif
-#ifdef LIBXML_SCHEMATRON_ENABLED
-    printf("\t--schematron schema : do validation against a schematron\n");
-#endif
-#ifdef LIBXML_SAX1_ENABLED
-    printf("\t--sax1: use the old SAX1 interfaces for processing\n");
-#endif
-    printf("\t--sax: do not build a tree but work just at the SAX level\n");
-    printf("\t--oldxml10: use XML-1.0 parsing rules before the 5th edition\n");
-#ifdef LIBXML_XPATH_ENABLED
-    printf("\t--xpath expr: evaluate the XPath expression, imply --noout\n");
-#endif
-
-    printf("\nLibxml project home page: http://xmlsoft.org/\n");
-    printf("To report bugs or get some help check: http://xmlsoft.org/bugs.html\n");
-}
-
-static void registerNode(xmlNodePtr node)
-{
-    node->_private = malloc(sizeof(long));
-    if (node->_private == NULL) {
-        fprintf(stderr, "Out of memory in xmllint:registerNode()\n");
-	exit(XMLLINT_ERR_MEM);
-    }
-    *(long*)node->_private = (long) 0x81726354;
-    nbregister++;
-}
-
-static void deregisterNode(xmlNodePtr node)
-{
-    assert(node->_private != NULL);
-    assert(*(long*)node->_private == (long) 0x81726354);
-    free(node->_private);
-    nbregister--;
-}
-
-int
-main(int argc, char **argv) {
-    int i, acount;
-    int files = 0;
-    int version = 0;
-    const char* indent;
-
-    if (argc <= 1) {
-	usage(argv[0]);
-	return(1);
-    }
-    LIBXML_TEST_VERSION
-    for (i = 1; i < argc ; i++) {
-	if (!strcmp(argv[i], "-"))
-	    break;
-
-	if (argv[i][0] != '-')
-	    continue;
-	if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
-	    debug++;
-	else
-#ifdef LIBXML_DEBUG_ENABLED
-	if ((!strcmp(argv[i], "-shell")) ||
-	         (!strcmp(argv[i], "--shell"))) {
-	    shell++;
-            noout = 1;
-        } else
-#endif
-#ifdef LIBXML_TREE_ENABLED
-	if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
-	    copy++;
-	else
-#endif /* LIBXML_TREE_ENABLED */
-	if ((!strcmp(argv[i], "-recover")) ||
-	         (!strcmp(argv[i], "--recover"))) {
-	    recovery++;
-	    options |= XML_PARSE_RECOVER;
-	} else if ((!strcmp(argv[i], "-huge")) ||
-	         (!strcmp(argv[i], "--huge"))) {
-	    options |= XML_PARSE_HUGE;
-	} else if ((!strcmp(argv[i], "-noent")) ||
-	         (!strcmp(argv[i], "--noent"))) {
-	    noent++;
-	    options |= XML_PARSE_NOENT;
-	} else if ((!strcmp(argv[i], "-noenc")) ||
-	         (!strcmp(argv[i], "--noenc"))) {
-	    noenc++;
-	    options |= XML_PARSE_IGNORE_ENC;
-	} else if ((!strcmp(argv[i], "-nsclean")) ||
-	         (!strcmp(argv[i], "--nsclean"))) {
-	    options |= XML_PARSE_NSCLEAN;
-	} else if ((!strcmp(argv[i], "-nocdata")) ||
-	         (!strcmp(argv[i], "--nocdata"))) {
-	    options |= XML_PARSE_NOCDATA;
-	} else if ((!strcmp(argv[i], "-nodict")) ||
-	         (!strcmp(argv[i], "--nodict"))) {
-	    options |= XML_PARSE_NODICT;
-	} else if ((!strcmp(argv[i], "-version")) ||
-	         (!strcmp(argv[i], "--version"))) {
-	    showVersion(argv[0]);
-	    version = 1;
-	} else if ((!strcmp(argv[i], "-noout")) ||
-	         (!strcmp(argv[i], "--noout")))
-	    noout++;
-#ifdef LIBXML_OUTPUT_ENABLED
-	else if ((!strcmp(argv[i], "-o")) ||
-	         (!strcmp(argv[i], "-output")) ||
-	         (!strcmp(argv[i], "--output"))) {
-	    i++;
-	    output = argv[i];
-	}
-#endif /* LIBXML_OUTPUT_ENABLED */
-	else if ((!strcmp(argv[i], "-htmlout")) ||
-	         (!strcmp(argv[i], "--htmlout")))
-	    htmlout++;
-	else if ((!strcmp(argv[i], "-nowrap")) ||
-	         (!strcmp(argv[i], "--nowrap")))
-	    nowrap++;
-#ifdef LIBXML_HTML_ENABLED
-	else if ((!strcmp(argv[i], "-html")) ||
-	         (!strcmp(argv[i], "--html"))) {
-	    html++;
-        }
-	else if ((!strcmp(argv[i], "-xmlout")) ||
-	         (!strcmp(argv[i], "--xmlout"))) {
-	    xmlout++;
-	} else if ((!strcmp(argv[i], "-nodefdtd")) ||
-	         (!strcmp(argv[i], "--nodefdtd"))) {
-            nodefdtd++;
-	    options |= HTML_PARSE_NODEFDTD;
-        }
-#endif /* LIBXML_HTML_ENABLED */
-	else if ((!strcmp(argv[i], "-loaddtd")) ||
-	         (!strcmp(argv[i], "--loaddtd"))) {
-	    loaddtd++;
-	    options |= XML_PARSE_DTDLOAD;
-	} else if ((!strcmp(argv[i], "-dtdattr")) ||
-	         (!strcmp(argv[i], "--dtdattr"))) {
-	    loaddtd++;
-	    dtdattrs++;
-	    options |= XML_PARSE_DTDATTR;
-	}
-#ifdef LIBXML_VALID_ENABLED
-	else if ((!strcmp(argv[i], "-valid")) ||
-	         (!strcmp(argv[i], "--valid"))) {
-	    valid++;
-	    options |= XML_PARSE_DTDVALID;
-	} else if ((!strcmp(argv[i], "-postvalid")) ||
-	         (!strcmp(argv[i], "--postvalid"))) {
-	    postvalid++;
-	    loaddtd++;
-	    options |= XML_PARSE_DTDLOAD;
-	} else if ((!strcmp(argv[i], "-dtdvalid")) ||
-	         (!strcmp(argv[i], "--dtdvalid"))) {
-	    i++;
-	    dtdvalid = argv[i];
-	    loaddtd++;
-	    options |= XML_PARSE_DTDLOAD;
-	} else if ((!strcmp(argv[i], "-dtdvalidfpi")) ||
-	         (!strcmp(argv[i], "--dtdvalidfpi"))) {
-	    i++;
-	    dtdvalidfpi = argv[i];
-	    loaddtd++;
-	    options |= XML_PARSE_DTDLOAD;
-        }
-#endif /* LIBXML_VALID_ENABLED */
-	else if ((!strcmp(argv[i], "-dropdtd")) ||
-	         (!strcmp(argv[i], "--dropdtd")))
-	    dropdtd++;
-	else if ((!strcmp(argv[i], "-insert")) ||
-	         (!strcmp(argv[i], "--insert")))
-	    insert++;
-	else if ((!strcmp(argv[i], "-timing")) ||
-	         (!strcmp(argv[i], "--timing")))
-	    timing++;
-	else if ((!strcmp(argv[i], "-auto")) ||
-	         (!strcmp(argv[i], "--auto")))
-	    generate++;
-	else if ((!strcmp(argv[i], "-repeat")) ||
-	         (!strcmp(argv[i], "--repeat"))) {
-	    if (repeat)
-	        repeat *= 10;
-	    else
-	        repeat = 100;
-	}
-#ifdef LIBXML_PUSH_ENABLED
-	else if ((!strcmp(argv[i], "-push")) ||
-	         (!strcmp(argv[i], "--push")))
-	    push++;
-	else if ((!strcmp(argv[i], "-pushsmall")) ||
-	         (!strcmp(argv[i], "--pushsmall"))) {
-	    push++;
-            pushsize = 10;
-        }
-#endif /* LIBXML_PUSH_ENABLED */
-#ifdef HAVE_MMAP
-	else if ((!strcmp(argv[i], "-memory")) ||
-	         (!strcmp(argv[i], "--memory")))
-	    memory++;
-#endif
-	else if ((!strcmp(argv[i], "-testIO")) ||
-	         (!strcmp(argv[i], "--testIO")))
-	    testIO++;
-#ifdef LIBXML_XINCLUDE_ENABLED
-	else if ((!strcmp(argv[i], "-xinclude")) ||
-	         (!strcmp(argv[i], "--xinclude"))) {
-	    xinclude++;
-	    options |= XML_PARSE_XINCLUDE;
-	}
-	else if ((!strcmp(argv[i], "-noxincludenode")) ||
-	         (!strcmp(argv[i], "--noxincludenode"))) {
-	    xinclude++;
-	    options |= XML_PARSE_XINCLUDE;
-	    options |= XML_PARSE_NOXINCNODE;
-	}
-	else if ((!strcmp(argv[i], "-nofixup-base-uris")) ||
-	         (!strcmp(argv[i], "--nofixup-base-uris"))) {
-	    xinclude++;
-	    options |= XML_PARSE_XINCLUDE;
-	    options |= XML_PARSE_NOBASEFIX;
-	}
-#endif
-#ifdef LIBXML_OUTPUT_ENABLED
-#ifdef HAVE_ZLIB_H
-	else if ((!strcmp(argv[i], "-compress")) ||
-	         (!strcmp(argv[i], "--compress"))) {
-	    compress++;
-	    xmlSetCompressMode(9);
-        }
-#endif
-#endif /* LIBXML_OUTPUT_ENABLED */
-	else if ((!strcmp(argv[i], "-nowarning")) ||
-	         (!strcmp(argv[i], "--nowarning"))) {
-	    xmlGetWarningsDefaultValue = 0;
-	    xmlPedanticParserDefault(0);
-	    options |= XML_PARSE_NOWARNING;
-        }
-	else if ((!strcmp(argv[i], "-pedantic")) ||
-	         (!strcmp(argv[i], "--pedantic"))) {
-	    xmlGetWarningsDefaultValue = 1;
-	    xmlPedanticParserDefault(1);
-	    options |= XML_PARSE_PEDANTIC;
-        }
-#ifdef LIBXML_DEBUG_ENABLED
-	else if ((!strcmp(argv[i], "-debugent")) ||
-		 (!strcmp(argv[i], "--debugent"))) {
-	    debugent++;
-	    xmlParserDebugEntities = 1;
-	}
-#endif
-#ifdef LIBXML_C14N_ENABLED
-	else if ((!strcmp(argv[i], "-c14n")) ||
-		 (!strcmp(argv[i], "--c14n"))) {
-	    canonical++;
-	    options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
-	}
-	else if ((!strcmp(argv[i], "-c14n11")) ||
-		 (!strcmp(argv[i], "--c14n11"))) {
-	    canonical_11++;
-	    options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
-	}
-	else if ((!strcmp(argv[i], "-exc-c14n")) ||
-		 (!strcmp(argv[i], "--exc-c14n"))) {
-	    exc_canonical++;
-	    options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
-	}
-#endif
-#ifdef LIBXML_CATALOG_ENABLED
-	else if ((!strcmp(argv[i], "-catalogs")) ||
-		 (!strcmp(argv[i], "--catalogs"))) {
-	    catalogs++;
-	} else if ((!strcmp(argv[i], "-nocatalogs")) ||
-		 (!strcmp(argv[i], "--nocatalogs"))) {
-	    nocatalogs++;
-	}
-#endif
-	else if ((!strcmp(argv[i], "-encode")) ||
-	         (!strcmp(argv[i], "--encode"))) {
-	    i++;
-	    encoding = argv[i];
-	    /*
-	     * OK it's for testing purposes
-	     */
-	    xmlAddEncodingAlias("UTF-8", "DVEnc");
-        }
-	else if ((!strcmp(argv[i], "-noblanks")) ||
-	         (!strcmp(argv[i], "--noblanks"))) {
-	    noblanks++;
-	    xmlKeepBlanksDefault(0);
-	    options |= XML_PARSE_NOBLANKS;
-        }
-	else if ((!strcmp(argv[i], "-maxmem")) ||
-	         (!strcmp(argv[i], "--maxmem"))) {
-	     i++;
-	     if (sscanf(argv[i], "%d", &maxmem) == 1) {
-	         xmlMemSetup(myFreeFunc, myMallocFunc, myReallocFunc,
-		             myStrdupFunc);
-	     } else {
-	         maxmem = 0;
-	     }
-        }
-	else if ((!strcmp(argv[i], "-format")) ||
-	         (!strcmp(argv[i], "--format"))) {
-	     noblanks++;
-#ifdef LIBXML_OUTPUT_ENABLED
-	     format = 1;
-#endif /* LIBXML_OUTPUT_ENABLED */
-	     xmlKeepBlanksDefault(0);
-	}
-	else if ((!strcmp(argv[i], "-pretty")) ||
-	         (!strcmp(argv[i], "--pretty"))) {
-	     i++;
-#ifdef LIBXML_OUTPUT_ENABLED
-       if (argv[i] != NULL) {
-	         format = atoi(argv[i]);
-	         if (format == 1) {
-	             noblanks++;
-	             xmlKeepBlanksDefault(0);
-	         }
-       }
-#endif /* LIBXML_OUTPUT_ENABLED */
-	}
-#ifdef LIBXML_READER_ENABLED
-	else if ((!strcmp(argv[i], "-stream")) ||
-	         (!strcmp(argv[i], "--stream"))) {
-	     stream++;
-	}
-	else if ((!strcmp(argv[i], "-walker")) ||
-	         (!strcmp(argv[i], "--walker"))) {
-	     walker++;
-             noout++;
-	}
-#endif /* LIBXML_READER_ENABLED */
-#ifdef LIBXML_SAX1_ENABLED
-	else if ((!strcmp(argv[i], "-sax1")) ||
-	         (!strcmp(argv[i], "--sax1"))) {
-	    sax1++;
-	    options |= XML_PARSE_SAX1;
-	}
-#endif /* LIBXML_SAX1_ENABLED */
-	else if ((!strcmp(argv[i], "-sax")) ||
-	         (!strcmp(argv[i], "--sax"))) {
-	    sax++;
-	}
-	else if ((!strcmp(argv[i], "-chkregister")) ||
-	         (!strcmp(argv[i], "--chkregister"))) {
-	    chkregister++;
-#ifdef LIBXML_SCHEMAS_ENABLED
-	} else if ((!strcmp(argv[i], "-relaxng")) ||
-	         (!strcmp(argv[i], "--relaxng"))) {
-	    i++;
-	    relaxng = argv[i];
-	    noent++;
-	    options |= XML_PARSE_NOENT;
-	} else if ((!strcmp(argv[i], "-schema")) ||
-	         (!strcmp(argv[i], "--schema"))) {
-	    i++;
-	    schema = argv[i];
-	    noent++;
-#endif
-#ifdef LIBXML_SCHEMATRON_ENABLED
-	} else if ((!strcmp(argv[i], "-schematron")) ||
-	         (!strcmp(argv[i], "--schematron"))) {
-	    i++;
-	    schematron = argv[i];
-	    noent++;
-#endif
-        } else if ((!strcmp(argv[i], "-nonet")) ||
-                   (!strcmp(argv[i], "--nonet"))) {
-	    options |= XML_PARSE_NONET;
-	    xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
-        } else if ((!strcmp(argv[i], "-nocompact")) ||
-                   (!strcmp(argv[i], "--nocompact"))) {
-	    options &= ~XML_PARSE_COMPACT;
-	} else if ((!strcmp(argv[i], "-load-trace")) ||
-	           (!strcmp(argv[i], "--load-trace"))) {
-	    load_trace++;
-        } else if ((!strcmp(argv[i], "-path")) ||
-                   (!strcmp(argv[i], "--path"))) {
-	    i++;
-	    parsePath(BAD_CAST argv[i]);
-#ifdef LIBXML_PATTERN_ENABLED
-        } else if ((!strcmp(argv[i], "-pattern")) ||
-                   (!strcmp(argv[i], "--pattern"))) {
-	    i++;
-	    pattern = argv[i];
-#endif
-#ifdef LIBXML_XPATH_ENABLED
-        } else if ((!strcmp(argv[i], "-xpath")) ||
-                   (!strcmp(argv[i], "--xpath"))) {
-	    i++;
-	    noout++;
-	    xpathquery = argv[i];
-#endif
-	} else if ((!strcmp(argv[i], "-oldxml10")) ||
-	           (!strcmp(argv[i], "--oldxml10"))) {
-	    oldxml10++;
-	    options |= XML_PARSE_OLD10;
-	} else {
-	    fprintf(stderr, "Unknown option %s\n", argv[i]);
-	    usage(argv[0]);
-	    return(1);
-	}
-    }
-
-#ifdef LIBXML_CATALOG_ENABLED
-    if (nocatalogs == 0) {
-	if (catalogs) {
-	    const char *catal;
-
-	    catal = getenv("SGML_CATALOG_FILES");
-	    if (catal != NULL) {
-		xmlLoadCatalogs(catal);
-	    } else {
-		fprintf(stderr, "Variable $SGML_CATALOG_FILES not set\n");
-	    }
-	}
-    }
-#endif
-
-#ifdef LIBXML_SAX1_ENABLED
-    if (sax1)
-        xmlSAXDefaultVersion(1);
-    else
-        xmlSAXDefaultVersion(2);
-#endif /* LIBXML_SAX1_ENABLED */
-
-    if (chkregister) {
-	xmlRegisterNodeDefault(registerNode);
-	xmlDeregisterNodeDefault(deregisterNode);
-    }
-
-    indent = getenv("XMLLINT_INDENT");
-    if(indent != NULL) {
-	xmlTreeIndentString = indent;
-    }
-
-
-    defaultEntityLoader = xmlGetExternalEntityLoader();
-    xmlSetExternalEntityLoader(xmllintExternalEntityLoader);
-
-    xmlLineNumbersDefault(1);
-    if (loaddtd != 0)
-	xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
-    if (dtdattrs)
-	xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
-    if (noent != 0) xmlSubstituteEntitiesDefault(1);
-#ifdef LIBXML_VALID_ENABLED
-    if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
-#endif /* LIBXML_VALID_ENABLED */
-    if ((htmlout) && (!nowrap)) {
-	xmlGenericError(xmlGenericErrorContext,
-         "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n");
-	xmlGenericError(xmlGenericErrorContext,
-		"\t\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n");
-	xmlGenericError(xmlGenericErrorContext,
-	 "<html><head><title>%s output</title></head>\n",
-		argv[0]);
-	xmlGenericError(xmlGenericErrorContext,
-	 "<body bgcolor=\"#ffffff\"><h1 align=\"center\">%s output</h1>\n",
-		argv[0]);
-    }
-
-#ifdef LIBXML_SCHEMATRON_ENABLED
-    if ((schematron != NULL) && (sax == 0)
-#ifdef LIBXML_READER_ENABLED
-        && (stream == 0)
-#endif /* LIBXML_READER_ENABLED */
-	) {
-	xmlSchematronParserCtxtPtr ctxt;
-
-        /* forces loading the DTDs */
-        xmlLoadExtDtdDefaultValue |= 1;
-	options |= XML_PARSE_DTDLOAD;
-	if (timing) {
-	    startTimer();
-	}
-	ctxt = xmlSchematronNewParserCtxt(schematron);
-#if 0
-	xmlSchematronSetParserErrors(ctxt,
-		(xmlSchematronValidityErrorFunc) fprintf,
-		(xmlSchematronValidityWarningFunc) fprintf,
-		stderr);
-#endif
-	wxschematron = xmlSchematronParse(ctxt);
-	if (wxschematron == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Schematron schema %s failed to compile\n", schematron);
-            progresult = XMLLINT_ERR_SCHEMACOMP;
-	    schematron = NULL;
-	}
-	xmlSchematronFreeParserCtxt(ctxt);
-	if (timing) {
-	    endTimer("Compiling the schemas");
-	}
-    }
-#endif
-#ifdef LIBXML_SCHEMAS_ENABLED
-    if ((relaxng != NULL) && (sax == 0)
-#ifdef LIBXML_READER_ENABLED
-        && (stream == 0)
-#endif /* LIBXML_READER_ENABLED */
-	) {
-	xmlRelaxNGParserCtxtPtr ctxt;
-
-        /* forces loading the DTDs */
-        xmlLoadExtDtdDefaultValue |= 1;
-	options |= XML_PARSE_DTDLOAD;
-	if (timing) {
-	    startTimer();
-	}
-	ctxt = xmlRelaxNGNewParserCtxt(relaxng);
-	xmlRelaxNGSetParserErrors(ctxt,
-		(xmlRelaxNGValidityErrorFunc) fprintf,
-		(xmlRelaxNGValidityWarningFunc) fprintf,
-		stderr);
-	relaxngschemas = xmlRelaxNGParse(ctxt);
-	if (relaxngschemas == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Relax-NG schema %s failed to compile\n", relaxng);
-            progresult = XMLLINT_ERR_SCHEMACOMP;
-	    relaxng = NULL;
-	}
-	xmlRelaxNGFreeParserCtxt(ctxt);
-	if (timing) {
-	    endTimer("Compiling the schemas");
-	}
-    } else if ((schema != NULL)
-#ifdef LIBXML_READER_ENABLED
-		&& (stream == 0)
-#endif
-	) {
-	xmlSchemaParserCtxtPtr ctxt;
-
-	if (timing) {
-	    startTimer();
-	}
-	ctxt = xmlSchemaNewParserCtxt(schema);
-	xmlSchemaSetParserErrors(ctxt,
-		(xmlSchemaValidityErrorFunc) fprintf,
-		(xmlSchemaValidityWarningFunc) fprintf,
-		stderr);
-	wxschemas = xmlSchemaParse(ctxt);
-	if (wxschemas == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "WXS schema %s failed to compile\n", schema);
-            progresult = XMLLINT_ERR_SCHEMACOMP;
-	    schema = NULL;
-	}
-	xmlSchemaFreeParserCtxt(ctxt);
-	if (timing) {
-	    endTimer("Compiling the schemas");
-	}
-    }
-#endif /* LIBXML_SCHEMAS_ENABLED */
-#ifdef LIBXML_PATTERN_ENABLED
-    if ((pattern != NULL)
-#ifdef LIBXML_READER_ENABLED
-        && (walker == 0)
-#endif
-	) {
-        patternc = xmlPatterncompile((const xmlChar *) pattern, NULL, 0, NULL);
-	if (patternc == NULL) {
-	    xmlGenericError(xmlGenericErrorContext,
-		    "Pattern %s failed to compile\n", pattern);
-            progresult = XMLLINT_ERR_SCHEMAPAT;
-	    pattern = NULL;
-	}
-    }
-#endif /* LIBXML_PATTERN_ENABLED */
-    for (i = 1; i < argc ; i++) {
-	if ((!strcmp(argv[i], "-encode")) ||
-	         (!strcmp(argv[i], "--encode"))) {
-	    i++;
-	    continue;
-        } else if ((!strcmp(argv[i], "-o")) ||
-                   (!strcmp(argv[i], "-output")) ||
-                   (!strcmp(argv[i], "--output"))) {
-            i++;
-	    continue;
-        }
-#ifdef LIBXML_VALID_ENABLED
-	if ((!strcmp(argv[i], "-dtdvalid")) ||
-	         (!strcmp(argv[i], "--dtdvalid"))) {
-	    i++;
-	    continue;
-        }
-	if ((!strcmp(argv[i], "-path")) ||
-                   (!strcmp(argv[i], "--path"))) {
-            i++;
-	    continue;
-        }
-	if ((!strcmp(argv[i], "-dtdvalidfpi")) ||
-	         (!strcmp(argv[i], "--dtdvalidfpi"))) {
-	    i++;
-	    continue;
-        }
-#endif /* LIBXML_VALID_ENABLED */
-	if ((!strcmp(argv[i], "-relaxng")) ||
-	         (!strcmp(argv[i], "--relaxng"))) {
-	    i++;
-	    continue;
-        }
-	if ((!strcmp(argv[i], "-maxmem")) ||
-	         (!strcmp(argv[i], "--maxmem"))) {
-	    i++;
-	    continue;
-        }
-	if ((!strcmp(argv[i], "-pretty")) ||
-	         (!strcmp(argv[i], "--pretty"))) {
-	    i++;
-	    continue;
-        }
-	if ((!strcmp(argv[i], "-schema")) ||
-	         (!strcmp(argv[i], "--schema"))) {
-	    i++;
-	    continue;
-        }
-	if ((!strcmp(argv[i], "-schematron")) ||
-	         (!strcmp(argv[i], "--schematron"))) {
-	    i++;
-	    continue;
-        }
-#ifdef LIBXML_PATTERN_ENABLED
-        if ((!strcmp(argv[i], "-pattern")) ||
-	    (!strcmp(argv[i], "--pattern"))) {
-	    i++;
-	    continue;
-	}
-#endif
-#ifdef LIBXML_XPATH_ENABLED
-        if ((!strcmp(argv[i], "-xpath")) ||
-	    (!strcmp(argv[i], "--xpath"))) {
-	    i++;
-	    continue;
-	}
-#endif
-	if ((timing) && (repeat))
-	    startTimer();
-	/* Remember file names.  "-" means stdin.  <sven@zen.org> */
-	if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
-	    if (repeat) {
-		xmlParserCtxtPtr ctxt = NULL;
-
-		for (acount = 0;acount < repeat;acount++) {
-#ifdef LIBXML_READER_ENABLED
-		    if (stream != 0) {
-			streamFile(argv[i]);
-		    } else {
-#endif /* LIBXML_READER_ENABLED */
-                        if (sax) {
-			    testSAX(argv[i]);
-			} else {
-			    if (ctxt == NULL)
-				ctxt = xmlNewParserCtxt();
-			    parseAndPrintFile(argv[i], ctxt);
-			}
-#ifdef LIBXML_READER_ENABLED
-		    }
-#endif /* LIBXML_READER_ENABLED */
-		}
-		if (ctxt != NULL)
-		    xmlFreeParserCtxt(ctxt);
-	    } else {
-		nbregister = 0;
-
-#ifdef LIBXML_READER_ENABLED
-		if (stream != 0)
-		    streamFile(argv[i]);
-		else
-#endif /* LIBXML_READER_ENABLED */
-                if (sax) {
-		    testSAX(argv[i]);
-		} else {
-		    parseAndPrintFile(argv[i], NULL);
-		}
-
-                if ((chkregister) && (nbregister != 0)) {
-		    fprintf(stderr, "Registration count off: %d\n", nbregister);
-		    progresult = XMLLINT_ERR_RDREGIS;
-		}
-	    }
-	    files ++;
-	    if ((timing) && (repeat)) {
-		endTimer("%d iterations", repeat);
-	    }
-	}
-    }
-    if (generate)
-	parseAndPrintFile(NULL, NULL);
-    if ((htmlout) && (!nowrap)) {
-	xmlGenericError(xmlGenericErrorContext, "</body></html>\n");
-    }
-    if ((files == 0) && (!generate) && (version == 0)) {
-	usage(argv[0]);
-    }
-#ifdef LIBXML_SCHEMATRON_ENABLED
-    if (wxschematron != NULL)
-	xmlSchematronFree(wxschematron);
-#endif
-#ifdef LIBXML_SCHEMAS_ENABLED
-    if (relaxngschemas != NULL)
-	xmlRelaxNGFree(relaxngschemas);
-    if (wxschemas != NULL)
-	xmlSchemaFree(wxschemas);
-    xmlRelaxNGCleanupTypes();
-#endif
-#ifdef LIBXML_PATTERN_ENABLED
-    if (patternc != NULL)
-        xmlFreePattern(patternc);
-#endif
-    xmlCleanupParser();
-    xmlMemoryDump();
-
-    return(progresult);
-}
-
diff --git a/third_party/libxml/src/xmlreader.c b/third_party/libxml/src/xmlreader.c
index 471e7e2..d416dac 100644
--- a/third_party/libxml/src/xmlreader.c
+++ b/third_party/libxml/src/xmlreader.c
@@ -142,7 +142,7 @@
     xmlNodePtr			faketext;/* fake xmlNs chld */
     int				preserve;/* preserve the resulting document */
     xmlBufPtr		        buffer; /* used to return const xmlChar * */
-    xmlDictPtr			dict;	/* the context dictionnary */
+    xmlDictPtr			dict;	/* the context dictionary */
 
     /* entity stack when traversing entities content */
     xmlNodePtr         ent;          /* Current Entity Ref Node */
@@ -210,7 +210,7 @@
  * DICT_FREE:
  * @str:  a string
  *
- * Free a string if it is not owned by the "dict" dictionnary in the
+ * Free a string if it is not owned by the "dict" dictionary in the
  * current scope
  */
 #define DICT_FREE(str)						\
@@ -2158,7 +2158,7 @@
     ret->ctxt->dictNames = 1;
     ret->allocs = XML_TEXTREADER_CTXT;
     /*
-     * use the parser dictionnary to allocate all elements and attributes names
+     * use the parser dictionary to allocate all elements and attributes names
      */
     ret->ctxt->docdict = 1;
     ret->dict = ret->ctxt->dict;
@@ -5249,7 +5249,7 @@
     reader->ctxt->linenumbers = 1;
     reader->ctxt->dictNames = 1;
     /*
-     * use the parser dictionnary to allocate all elements and attributes names
+     * use the parser dictionary to allocate all elements and attributes names
      */
     reader->ctxt->docdict = 1;
     reader->ctxt->parseMode = XML_PARSE_READER;
diff --git a/third_party/libxml/src/xmlregexp.c b/third_party/libxml/src/xmlregexp.c
index 3e912ab9..727fef4 100644
--- a/third_party/libxml/src/xmlregexp.c
+++ b/third_party/libxml/src/xmlregexp.c
@@ -1544,6 +1544,7 @@
 xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from,
 	                 xmlRegStatePtr to, xmlRegAtomPtr atom) {
     xmlRegStatePtr end;
+    int nullable = 0;
 
     if (atom == NULL) {
 	ERROR("genrate transition: atom == NULL");
@@ -1730,6 +1731,13 @@
     if (xmlRegAtomPush(ctxt, atom) < 0) {
 	return(-1);
     }
+    if ((atom->quant == XML_REGEXP_QUANT_RANGE) &&
+        (atom->min == 0) && (atom->max > 0)) {
+	nullable = 1;
+	atom->min = 1;
+        if (atom->max == 1)
+	    atom->quant = XML_REGEXP_QUANT_OPT;
+    }
     xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
     ctxt->state = end;
     switch (atom->quant) {
@@ -1747,11 +1755,8 @@
 	    xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
 	    break;
 	case XML_REGEXP_QUANT_RANGE:
-#if DV_test
-	    if (atom->min == 0) {
+	    if (nullable)
 		xmlFAGenerateEpsilonTransition(ctxt, from, to);
-	    }
-#endif
 	    break;
 	default:
 	    break;
@@ -6345,7 +6350,7 @@
 /**
  * xmlExpNewCtxt:
  * @maxNodes:  the maximum number of nodes
- * @dict:  optional dictionnary to use internally
+ * @dict:  optional dictionary to use internally
  *
  * Creates a new context for manipulating expressions
  *
@@ -7204,7 +7209,7 @@
         return(NULL);
     }
     /*
-     * check the string is in the dictionnary, if yes use an interned
+     * check the string is in the dictionary, if yes use an interned
      * copy, otherwise we know it's not an acceptable input
      */
     input = xmlDictExists(ctxt->dict, str, len);
diff --git a/third_party/libxml/src/xmlschemas.c b/third_party/libxml/src/xmlschemas.c
index fe533e6..ee22a6d 100644
--- a/third_party/libxml/src/xmlschemas.c
+++ b/third_party/libxml/src/xmlschemas.c
@@ -617,7 +617,7 @@
     xmlAutomataStatePtr end;
     xmlAutomataStatePtr state;
 
-    xmlDictPtr dict;		/* dictionnary for interned string names */
+    xmlDictPtr dict;		/* dictionary for interned string names */
     xmlSchemaTypePtr ctxtType; /* The current context simple/complex type */
     int options;
     xmlSchemaValidCtxtPtr vctxt;
@@ -27382,10 +27382,17 @@
 
         for (j = 0, i = 0; i < nb_attributes; i++, j += 5) {
 	    /*
-	    * Duplicate the value.
+	    * Duplicate the value, changing any &#38; to a literal ampersand.
+	    *
+	    * libxml2 differs from normal SAX here in that it escapes all ampersands
+	    * as &#38; instead of delivering the raw converted string. Changing the
+	    * behavior at this point would break applications that use this API, so
+	    * we are forced to work around it. There is no danger of accidentally
+	    * decoding some entity other than &#38; in this step because without
+	    * unescaped ampersands there can be no other entities in the string.
 	    */
-	    value = xmlStrndup(attributes[j+3],
-		attributes[j+4] - attributes[j+3]);
+	    value = xmlStringLenDecodeEntities(vctxt->parserCtxt, attributes[j+3],
+		attributes[j+4] - attributes[j+3], XML_SUBSTITUTE_REF, 0, 0, 0);
 	    /*
 	    * TODO: Set the node line.
 	    */
diff --git a/third_party/libxml/src/xmlschemastypes.c b/third_party/libxml/src/xmlschemastypes.c
index ff64f50..5f38599 100644
--- a/third_party/libxml/src/xmlschemastypes.c
+++ b/third_party/libxml/src/xmlschemastypes.c
@@ -62,7 +62,7 @@
     long		year;
     unsigned int	mon	:4;	/* 1 <=  mon    <= 12   */
     unsigned int	day	:5;	/* 1 <=  day    <= 31   */
-    unsigned int	hour	:5;	/* 0 <=  hour   <= 23   */
+    unsigned int	hour	:5;	/* 0 <=  hour   <= 24   */
     unsigned int	min	:6;	/* 0 <=  min    <= 59	*/
     double		sec;
     unsigned int	tz_flag	:1;	/* is tzo explicitely set? */
@@ -1139,9 +1139,13 @@
 #define VALID_DATE(dt)						\
 	(VALID_YEAR(dt->year) && VALID_MONTH(dt->mon) && VALID_MDAY(dt))
 
+#define VALID_END_OF_DAY(dt)					\
+	((dt)->hour == 24 && (dt)->min == 0 && (dt)->sec == 0)
+
 #define VALID_TIME(dt)						\
-	(VALID_HOUR(dt->hour) && VALID_MIN(dt->min) &&		\
-	 VALID_SEC(dt->sec) && VALID_TZO(dt->tzo))
+	(((VALID_HOUR(dt->hour) && VALID_MIN(dt->min) &&	\
+	  VALID_SEC(dt->sec)) || VALID_END_OF_DAY(dt)) &&	\
+	 VALID_TZO(dt->tzo))
 
 #define VALID_DATETIME(dt)					\
 	(VALID_DATE(dt) && VALID_TIME(dt))
@@ -1355,7 +1359,7 @@
 	return ret;
     if (*cur != ':')
 	return 1;
-    if (!VALID_HOUR(value))
+    if (!VALID_HOUR(value) && value != 24 /* Allow end-of-day hour */)
 	return 2;
     cur++;
 
@@ -1377,7 +1381,7 @@
     if (ret != 0)
 	return ret;
 
-    if ((!VALID_SEC(dt->sec)) || (!VALID_TZO(dt->tzo)))
+    if (!VALID_TIME(dt))
 	return 2;
 
     *str = cur;
@@ -5303,6 +5307,7 @@
 			       xmlSchemaWhitespaceValueType ws)
 {
     int ret;
+    int stringType;
 
     if (facet == NULL)
 	return(-1);
@@ -5315,7 +5320,15 @@
 	    */
 	    if (value == NULL)
 		return(-1);
-	    ret = xmlRegexpExec(facet->regexp, value);
+	    /*
+	    * If string-derived type, regexp must be tested on the value space of
+	    * the datatype.
+	    * See https://www.w3.org/TR/xmlschema-2/#rf-pattern
+	    */
+	    stringType = val && ((val->type >= XML_SCHEMAS_STRING && val->type <= XML_SCHEMAS_NORMSTRING)
+			      || (val->type >= XML_SCHEMAS_TOKEN && val->type <= XML_SCHEMAS_NCNAME));
+	    ret = xmlRegexpExec(facet->regexp,
+	                        (stringType && val->value.str) ? val->value.str : value);
 	    if (ret == 1)
 		return(0);
 	    if (ret == 0)
diff --git a/third_party/libxml/src/xpath.c b/third_party/libxml/src/xpath.c
index 132930b..620e8144 100644
--- a/third_party/libxml/src/xpath.c
+++ b/third_party/libxml/src/xpath.c
@@ -945,7 +945,7 @@
     xmlXPathStepOp *steps;	/* ops for computation of this expression */
     int last;			/* index of last step in expression */
     xmlChar *expr;		/* the expression being computed */
-    xmlDictPtr dict;		/* the dictionnary to use if any */
+    xmlDictPtr dict;		/* the dictionary to use if any */
 #ifdef DEBUG_EVAL_COUNTS
     int nb;
     xmlChar *string;
@@ -1132,7 +1132,6 @@
 	comp->steps[comp->nbStep].value5 = value5;
     }
     comp->steps[comp->nbStep].cache = NULL;
-    comp->steps[comp->nbStep].cacheURI = NULL;
     return(comp->nbStep++);
 }
 
@@ -3707,7 +3706,7 @@
 
     /* @@ with_ns to check whether namespace nodes should be looked at @@ */
     /*
-     * prevent duplcates
+     * prevent duplicates
      */
     for (i = 0;i < cur->nodeNr;i++)
         if (cur->nodeTab[i] == val) return(0);
@@ -8391,7 +8390,7 @@
 xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
     if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
     if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
-    if (ctxt->context->tmpNsList == NULL && cur != (xmlNodePtr) xmlXPathXMLNamespace) {
+    if (cur == NULL) {
         if (ctxt->context->tmpNsList != NULL)
 	    xmlFree(ctxt->context->tmpNsList);
 	ctxt->context->tmpNsList =
@@ -9997,7 +9996,7 @@
         (c == '[') || (c == ']') || (c == '@') || /* accelerators */
         (c == '*') || /* accelerators */
 	(!IS_LETTER(c) && (c != '_') &&
-         ((qualified) && (c != ':')))) {
+         ((!qualified) || (c != ':')))) {
 	return(NULL);
     }
 
@@ -12380,11 +12379,6 @@
                     STRANGE
 		    goto error;
                 case NODE_TEST_TYPE:
-		    /*
-		    * TODO: Don't we need to use
-		    *  xmlXPathNodeSetAddNs() for namespace nodes here?
-		    *  Surprisingly, some c14n tests fail, if we do this.
-		    */
 		    if (type == NODE_TYPE_NODE) {
 			switch (cur->type) {
 			    case XML_DOCUMENT_NODE:
@@ -12398,9 +12392,17 @@
 			    case XML_COMMENT_NODE:
 			    case XML_CDATA_SECTION_NODE:
 			    case XML_TEXT_NODE:
-			    case XML_NAMESPACE_DECL:
 				XP_TEST_HIT
 				break;
+			    case XML_NAMESPACE_DECL: {
+				if (axis == AXIS_NAMESPACE) {
+				    XP_TEST_HIT_NS
+				} else {
+	                            hasNsNodes = 1;
+				    XP_TEST_HIT
+				}
+				break;
+                            }
 			    default:
 				break;
 			}
@@ -12692,6 +12694,14 @@
     * Reset the context node.
     */
     xpctxt->node = oldContextNode;
+    /*
+    * When traversing the namespace axis in "toBool" mode, it's
+    * possible that tmpNsList wasn't freed.
+    */
+    if (xpctxt->tmpNsList != NULL) {
+        xmlFree(xpctxt->tmpNsList);
+        xpctxt->tmpNsList = NULL;
+    }
 
 #ifdef DEBUG_STEP
     xmlGenericError(xmlGenericErrorContext,
@@ -14733,12 +14743,8 @@
 #endif /* XPATH_STREAMING */
 
 static void
-xmlXPathOptimizeExpressionInternal(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op)
+xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op)
 {
-    /* Already optimized? */
-    if (op->cacheURI != NULL)
-        return;
-
     /*
     * Try to rewrite "descendant-or-self::node()/foo" to an optimized
     * internal representation.
@@ -14789,28 +14795,15 @@
 	}
     }
 
-    /* Mark the node. */
-    op->cacheURI = (void*)(~0);
+    /* OP_VALUE has invalid ch1. */
+    if (op->op == XPATH_OP_VALUE)
+        return;
 
     /* Recurse */
     if (op->ch1 != -1)
-        xmlXPathOptimizeExpressionInternal(comp, &comp->steps[op->ch1]);
+        xmlXPathOptimizeExpression(comp, &comp->steps[op->ch1]);
     if (op->ch2 != -1)
-	xmlXPathOptimizeExpressionInternal(comp, &comp->steps[op->ch2]);
-}
-
-static void
-xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, int root)
-{
-    int i;
-    /* The expression tree/graph traversal is linear, visiting
-     * each node at most once. Mark each xmlXPathStepOp node
-     * upon visiting, taking care of clearing out the marks
-     * afterwards.
-     */
-    xmlXPathOptimizeExpressionInternal(comp, &comp->steps[root]);
-    for (i = 0; i <= root; ++i)
-        comp->steps[i].cacheURI = NULL;
+	xmlXPathOptimizeExpression(comp, &comp->steps[op->ch2]);
 }
 
 /**
@@ -14869,7 +14862,7 @@
 	comp->nb = 0;
 #endif
 	if ((comp->nbStep > 1) && (comp->last >= 0)) {
-	    xmlXPathOptimizeExpression(comp, comp->last);
+	    xmlXPathOptimizeExpression(comp, &comp->steps[comp->last]);
 	}
     }
     return(comp);
@@ -15051,7 +15044,8 @@
 	    (ctxt->comp->nbStep > 1) &&
 	    (ctxt->comp->last >= 0))
 	{
-	    xmlXPathOptimizeExpression(ctxt->comp, ctxt->comp->last);
+	    xmlXPathOptimizeExpression(ctxt->comp,
+		&ctxt->comp->steps[ctxt->comp->last]);
 	}
     }
     CHECK_ERROR;
diff --git a/third_party/libxml/src/xstc/Makefile.am b/third_party/libxml/src/xstc/Makefile.am
deleted file mode 100644
index 5ef1819..0000000
--- a/third_party/libxml/src/xstc/Makefile.am
+++ /dev/null
@@ -1,132 +0,0 @@
-#
-# Definition for the tests from W3C
-#
-PYSCRIPTS=nist-test.py ms-test.py sun-test.py
-TESTDIR=Tests
-TESTDIRS=$(TESTDIR)/msxsdtest $(TESTDIR)/suntest $(TESTDIR)/Datatypes
-TARBALL=xsts-2002-01-16.tar.gz
-TARBALL_2=xsts-2004-01-14.tar.gz
-TSNAME=xmlschema2002-01-16
-TSNAME_2=xmlschema2004-01-14
-TARBALLURL=http://www.w3.org/XML/2004/xml-schema-test-suite/$(TSNAME)/$(TARBALL)
-TARBALLURL_2=http://www.w3.org/XML/2004/xml-schema-test-suite/$(TSNAME_2)/$(TARBALL_2)
-MSTESTDEF=MSXMLSchema1-0-20020116.testSet
-SUNTESTDEF=SunXMLSchema1-0-20020116.testSet
-NISTTESTDEF=NISTXMLSchema1-0-20020116.testSet
-NISTTESTDEF_2=NISTXMLSchemaDatatypes.testSet
-
-#
-# The local data and scripts
-#
-EXTRA_DIST=xstc.py xstc-to-python.xsl
-#
-# Nothing is done by make, only make tests and
-# only if Python and Schemas are enabled.
-#
-all:
-
-#
-# Rule to load the test description and extract the informations
-#
-$(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/Metadata/$(SUNTESTDEF):
-	-@(if [ ! -d Tests ] ; then \
-	   mkdir Tests ; \
-	   fi)
-	-@(if [ ! -f $(TARBALL_2) ] ; then \
-	   if [ -f $(srcdir)/$(TARBALL_2) ] ; then \
-	   $(LN_S) $(srcdir)/$(TARBALL_2) $(TARBALL_2) ; else \
-	   echo "Missing the test suite description (2004-01-14), trying to fetch it" ;\
-	   if [ -x "$(WGET)" ] ; then \
-	   $(WGET) $(TARBALLURL_2) ; \
-	   else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi)
-	-@(if [ -f $(TARBALL_2) ] ; then \
-	   echo -n "extracting test data (NIST)..." ; \
-	   $(TAR) -xzf $(TARBALL_2) --wildcards '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
-	   echo "done" ; \
-	   fi)
-	-@(if [ ! -f $(TARBALL) ] ; then \
-	   if [ -f $(srcdir)/$(TARBALL) ] ; then \
-	   $(LN_S) $(srcdir)/$(TARBALL) $(TARBALL) ; else \
-	   echo "Missing the test suite description (2002-01-16), trying to fetch it" ;\
-	   if [ -x "$(WGET)" ] ; then \
-	   $(WGET) $(TARBALLURL) ; \
-	   else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi)
-	-@(if [ -f $(TARBALL) ] ; then \
-	   echo -n "extracting test data (Sun, Microsoft)..." ; \
-	   $(TAR) -C Tests -xzf $(TARBALL) --wildcards '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
-	   if [ -d Tests/suntest ] ; then rm -r Tests/suntest ; fi ; \
-	   if [ -d Tests/msxsdtest ] ; then rm -r Tests/msxsdtest ; fi ; \
-	   mv Tests/xmlschema2002-01-16/* Tests ; \
-	   mv Tests/*.testSet Tests/Metadata ; \
-	   rm -r Tests/xmlschema2002-01-16 ; \
-	   echo "done" ; \
-	   fi)
-
-#
-# The python tests are generated via XSLT
-#
-nist-test.py: Tests/Metadata/$(NISTTESTDEF_2) xstc-to-python.xsl
-	-@(if [ -x $(XSLTPROC) ] ; then \
-	  echo "Rebuilding script (NIST)" $@ ; \
-	  $(XSLTPROC) --nonet --stringparam vendor NIST-2 \
-	                     $(srcdir)/xstc-to-python.xsl \
-	                     $(srcdir)/Tests/Metadata/$(NISTTESTDEF_2) > $@ ; \
-	  chmod +x $@ ; fi )
-
-ms-test.py: Tests/Metadata/$(MSTTESTDEF) xstc-to-python.xsl
-	-@(if [ -x $(XSLTPROC) ] ; then \
-	  echo "Rebuilding script (Microsoft)" $@ ; \
-	  $(XSLTPROC) --nonet --stringparam vendor MS \
-	                     $(srcdir)/xstc-to-python.xsl \
-	                     $(srcdir)/Tests/Metadata/$(MSTESTDEF) > $@ ; \
-	  chmod +x $@ ; fi )
-
-sun-test.py: Tests/Metadata/$(SUNTESTDEF) xstc-to-python.xsl
-	-@(if [ -x $(XSLTPROC) ] ; then \
-	  echo "Rebuilding script (Sun)" $@ ; \
-	  $(XSLTPROC) --nonet --stringparam vendor SUN \
-	                     $(srcdir)/xstc-to-python.xsl \
-	                     $(srcdir)/Tests/Metadata/$(SUNTESTDEF) > $@ ; \
-	  chmod +x $@ ; fi )
-
-#
-# The actual test run if present. PYTHONPATH is updated to make sure
-# we run the version from the loacl build and not preinstalled bindings
-#
-pytests: $(PYSCRIPTS) $(TESTDIRS)
-	-@(if [ -x nist-test.py -a -d $(TESTDIR)/Datatypes ] ; then 		\
-	   echo "## Running XML Schema tests (NIST)";			\
-	   PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
-	   export PYTHONPATH;						\
-	   LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ;	\
-	   export LD_LIBRARY_PATH;					\
-	   $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi)
-	-@(if [ -x sun-test.py -a -d $(TESTDIR)/suntest ] ; then 			\
-	   echo "## Running Schema tests (Sun)";				\
-	   PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
-	   export PYTHONPATH;						\
-	   LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ;	\
-	   export LD_LIBRARY_PATH;					\
-	   $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi)
-	-@(if [ -x ms-test.py -a -d $(TESTDIR)/msxsdtest ] ; then 			\
-	   echo "## Running Schema tests (Microsoft)";			\
-	   PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
-	   export PYTHONPATH;						\
-	   LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ;	\
-	   export LD_LIBRARY_PATH;					\
-	   $(CHECKER) $(PYTHON) ms-test.py -s -b $(srcdir) ; fi)
-
-tests:
-	-@(if [ -x $(PYTHON) ] ; then 					\
-	   $(MAKE) pytests ; fi);
-
-#
-# Heavy, works well only on RHEL3
-#
-valgrind:
-	-@(if [ -x $(PYTHON) ] ; then 					\
-	   echo '## Running the regression tests under Valgrind' ;	\
-	   $(MAKE) CHECKER='valgrind -q' pytests ; fi);
-
-CLEANFILES=$(PYSCRIPTS) test.log
-
diff --git a/third_party/libxml/src/xstc/Makefile.in b/third_party/libxml/src/xstc/Makefile.in
deleted file mode 100644
index f44da71..0000000
--- a/third_party/libxml/src/xstc/Makefile.in
+++ /dev/null
@@ -1,681 +0,0 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = xstc
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASE_THREAD_LIBS = @BASE_THREAD_LIBS@
-C14N_OBJ = @C14N_OBJ@
-CATALOG_OBJ = @CATALOG_OBJ@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@
-CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@
-DEBUG_OBJ = @DEBUG_OBJ@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOCB_OBJ = @DOCB_OBJ@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-FTP_OBJ = @FTP_OBJ@
-GREP = @GREP@
-HAVE_ISINF = @HAVE_ISINF@
-HAVE_ISNAN = @HAVE_ISNAN@
-HTML_DIR = @HTML_DIR@
-HTML_OBJ = @HTML_OBJ@
-HTTP_OBJ = @HTTP_OBJ@
-ICONV_LIBS = @ICONV_LIBS@
-ICU_LIBS = @ICU_LIBS@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@
-LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@
-LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@
-LIBXML_VERSION = @LIBXML_VERSION@
-LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@
-LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@
-LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-LZMA_CFLAGS = @LZMA_CFLAGS@
-LZMA_LIBS = @LZMA_LIBS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-MODULE_EXTENSION = @MODULE_EXTENSION@
-MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@
-MV = @MV@
-M_LIBS = @M_LIBS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-PYTHON = @PYTHON@
-PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
-PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@
-PYTHON_SUBDIR = @PYTHON_SUBDIR@
-PYTHON_TESTS = @PYTHON_TESTS@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RDL_LIBS = @RDL_LIBS@
-READER_TEST = @READER_TEST@
-RELDATE = @RELDATE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STATIC_BINARIES = @STATIC_BINARIES@
-STRIP = @STRIP@
-TAR = @TAR@
-TEST_C14N = @TEST_C14N@
-TEST_CATALOG = @TEST_CATALOG@
-TEST_DEBUG = @TEST_DEBUG@
-TEST_HTML = @TEST_HTML@
-TEST_MODULES = @TEST_MODULES@
-TEST_PATTERN = @TEST_PATTERN@
-TEST_PHTML = @TEST_PHTML@
-TEST_PUSH = @TEST_PUSH@
-TEST_REGEXPS = @TEST_REGEXPS@
-TEST_SAX = @TEST_SAX@
-TEST_SCHEMAS = @TEST_SCHEMAS@
-TEST_SCHEMATRON = @TEST_SCHEMATRON@
-TEST_THREADS = @TEST_THREADS@
-TEST_VALID = @TEST_VALID@
-TEST_VTIME = @TEST_VTIME@
-TEST_XINCLUDE = @TEST_XINCLUDE@
-TEST_XPATH = @TEST_XPATH@
-TEST_XPTR = @TEST_XPTR@
-THREAD_CFLAGS = @THREAD_CFLAGS@
-THREAD_LIBS = @THREAD_LIBS@
-VERSION = @VERSION@
-VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
-WGET = @WGET@
-WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@
-WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@
-WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@
-WITH_C14N = @WITH_C14N@
-WITH_CATALOG = @WITH_CATALOG@
-WITH_DEBUG = @WITH_DEBUG@
-WITH_DOCB = @WITH_DOCB@
-WITH_FTP = @WITH_FTP@
-WITH_HTML = @WITH_HTML@
-WITH_HTTP = @WITH_HTTP@
-WITH_ICONV = @WITH_ICONV@
-WITH_ICU = @WITH_ICU@
-WITH_ISO8859X = @WITH_ISO8859X@
-WITH_LEGACY = @WITH_LEGACY@
-WITH_LZMA = @WITH_LZMA@
-WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
-WITH_MODULES = @WITH_MODULES@
-WITH_OUTPUT = @WITH_OUTPUT@
-WITH_PATTERN = @WITH_PATTERN@
-WITH_PUSH = @WITH_PUSH@
-WITH_READER = @WITH_READER@
-WITH_REGEXPS = @WITH_REGEXPS@
-WITH_RUN_DEBUG = @WITH_RUN_DEBUG@
-WITH_SAX1 = @WITH_SAX1@
-WITH_SCHEMAS = @WITH_SCHEMAS@
-WITH_SCHEMATRON = @WITH_SCHEMATRON@
-WITH_THREADS = @WITH_THREADS@
-WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@
-WITH_TREE = @WITH_TREE@
-WITH_TRIO = @WITH_TRIO@
-WITH_VALID = @WITH_VALID@
-WITH_WRITER = @WITH_WRITER@
-WITH_XINCLUDE = @WITH_XINCLUDE@
-WITH_XPATH = @WITH_XPATH@
-WITH_XPTR = @WITH_XPTR@
-WITH_ZLIB = @WITH_ZLIB@
-XINCLUDE_OBJ = @XINCLUDE_OBJ@
-XMLLINT = @XMLLINT@
-XML_CFLAGS = @XML_CFLAGS@
-XML_INCLUDEDIR = @XML_INCLUDEDIR@
-XML_LIBDIR = @XML_LIBDIR@
-XML_LIBS = @XML_LIBS@
-XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@
-XPATH_OBJ = @XPATH_OBJ@
-XPTR_OBJ = @XPTR_OBJ@
-XSLTPROC = @XSLTPROC@
-Z_CFLAGS = @Z_CFLAGS@
-Z_LIBS = @Z_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# Definition for the tests from W3C
-#
-PYSCRIPTS = nist-test.py ms-test.py sun-test.py
-TESTDIR = Tests
-TESTDIRS = $(TESTDIR)/msxsdtest $(TESTDIR)/suntest $(TESTDIR)/Datatypes
-TARBALL = xsts-2002-01-16.tar.gz
-TARBALL_2 = xsts-2004-01-14.tar.gz
-TSNAME = xmlschema2002-01-16
-TSNAME_2 = xmlschema2004-01-14
-TARBALLURL = http://www.w3.org/XML/2004/xml-schema-test-suite/$(TSNAME)/$(TARBALL)
-TARBALLURL_2 = http://www.w3.org/XML/2004/xml-schema-test-suite/$(TSNAME_2)/$(TARBALL_2)
-MSTESTDEF = MSXMLSchema1-0-20020116.testSet
-SUNTESTDEF = SunXMLSchema1-0-20020116.testSet
-NISTTESTDEF = NISTXMLSchema1-0-20020116.testSet
-NISTTESTDEF_2 = NISTXMLSchemaDatatypes.testSet
-
-#
-# The local data and scripts
-#
-EXTRA_DIST = xstc.py xstc-to-python.xsl
-CLEANFILES = $(PYSCRIPTS) test.log
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xstc/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu xstc/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags-am uninstall uninstall-am
-
-.PRECIOUS: Makefile
-
-#
-# Nothing is done by make, only make tests and
-# only if Python and Schemas are enabled.
-#
-all:
-
-#
-# Rule to load the test description and extract the informations
-#
-$(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/Metadata/$(SUNTESTDEF):
-	-@(if [ ! -d Tests ] ; then \
-	   mkdir Tests ; \
-	   fi)
-	-@(if [ ! -f $(TARBALL_2) ] ; then \
-	   if [ -f $(srcdir)/$(TARBALL_2) ] ; then \
-	   $(LN_S) $(srcdir)/$(TARBALL_2) $(TARBALL_2) ; else \
-	   echo "Missing the test suite description (2004-01-14), trying to fetch it" ;\
-	   if [ -x "$(WGET)" ] ; then \
-	   $(WGET) $(TARBALLURL_2) ; \
-	   else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi)
-	-@(if [ -f $(TARBALL_2) ] ; then \
-	   echo -n "extracting test data (NIST)..." ; \
-	   $(TAR) -xzf $(TARBALL_2) --wildcards '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
-	   echo "done" ; \
-	   fi)
-	-@(if [ ! -f $(TARBALL) ] ; then \
-	   if [ -f $(srcdir)/$(TARBALL) ] ; then \
-	   $(LN_S) $(srcdir)/$(TARBALL) $(TARBALL) ; else \
-	   echo "Missing the test suite description (2002-01-16), trying to fetch it" ;\
-	   if [ -x "$(WGET)" ] ; then \
-	   $(WGET) $(TARBALLURL) ; \
-	   else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi)
-	-@(if [ -f $(TARBALL) ] ; then \
-	   echo -n "extracting test data (Sun, Microsoft)..." ; \
-	   $(TAR) -C Tests -xzf $(TARBALL) --wildcards '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
-	   if [ -d Tests/suntest ] ; then rm -r Tests/suntest ; fi ; \
-	   if [ -d Tests/msxsdtest ] ; then rm -r Tests/msxsdtest ; fi ; \
-	   mv Tests/xmlschema2002-01-16/* Tests ; \
-	   mv Tests/*.testSet Tests/Metadata ; \
-	   rm -r Tests/xmlschema2002-01-16 ; \
-	   echo "done" ; \
-	   fi)
-
-#
-# The python tests are generated via XSLT
-#
-nist-test.py: Tests/Metadata/$(NISTTESTDEF_2) xstc-to-python.xsl
-	-@(if [ -x $(XSLTPROC) ] ; then \
-	  echo "Rebuilding script (NIST)" $@ ; \
-	  $(XSLTPROC) --nonet --stringparam vendor NIST-2 \
-	                     $(srcdir)/xstc-to-python.xsl \
-	                     $(srcdir)/Tests/Metadata/$(NISTTESTDEF_2) > $@ ; \
-	  chmod +x $@ ; fi )
-
-ms-test.py: Tests/Metadata/$(MSTTESTDEF) xstc-to-python.xsl
-	-@(if [ -x $(XSLTPROC) ] ; then \
-	  echo "Rebuilding script (Microsoft)" $@ ; \
-	  $(XSLTPROC) --nonet --stringparam vendor MS \
-	                     $(srcdir)/xstc-to-python.xsl \
-	                     $(srcdir)/Tests/Metadata/$(MSTESTDEF) > $@ ; \
-	  chmod +x $@ ; fi )
-
-sun-test.py: Tests/Metadata/$(SUNTESTDEF) xstc-to-python.xsl
-	-@(if [ -x $(XSLTPROC) ] ; then \
-	  echo "Rebuilding script (Sun)" $@ ; \
-	  $(XSLTPROC) --nonet --stringparam vendor SUN \
-	                     $(srcdir)/xstc-to-python.xsl \
-	                     $(srcdir)/Tests/Metadata/$(SUNTESTDEF) > $@ ; \
-	  chmod +x $@ ; fi )
-
-#
-# The actual test run if present. PYTHONPATH is updated to make sure
-# we run the version from the loacl build and not preinstalled bindings
-#
-pytests: $(PYSCRIPTS) $(TESTDIRS)
-	-@(if [ -x nist-test.py -a -d $(TESTDIR)/Datatypes ] ; then 		\
-	   echo "## Running XML Schema tests (NIST)";			\
-	   PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
-	   export PYTHONPATH;						\
-	   LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ;	\
-	   export LD_LIBRARY_PATH;					\
-	   $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi)
-	-@(if [ -x sun-test.py -a -d $(TESTDIR)/suntest ] ; then 			\
-	   echo "## Running Schema tests (Sun)";				\
-	   PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
-	   export PYTHONPATH;						\
-	   LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ;	\
-	   export LD_LIBRARY_PATH;					\
-	   $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi)
-	-@(if [ -x ms-test.py -a -d $(TESTDIR)/msxsdtest ] ; then 			\
-	   echo "## Running Schema tests (Microsoft)";			\
-	   PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\
-	   export PYTHONPATH;						\
-	   LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ;	\
-	   export LD_LIBRARY_PATH;					\
-	   $(CHECKER) $(PYTHON) ms-test.py -s -b $(srcdir) ; fi)
-
-tests:
-	-@(if [ -x $(PYTHON) ] ; then 					\
-	   $(MAKE) pytests ; fi);
-
-#
-# Heavy, works well only on RHEL3
-#
-valgrind:
-	-@(if [ -x $(PYTHON) ] ; then 					\
-	   echo '## Running the regression tests under Valgrind' ;	\
-	   $(MAKE) CHECKER='valgrind -q' pytests ; fi);
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/third_party/libxml/src/xstc/xstc-to-python.xsl b/third_party/libxml/src/xstc/xstc-to-python.xsl
deleted file mode 100644
index 4de0e12..0000000
--- a/third_party/libxml/src/xstc/xstc-to-python.xsl
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xsl:stylesheet 
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-	xmlns:ts="TestSuite" version="1.0"
-	xmlns:xl="http://www.w3.org/1999/xlink">
-	<xsl:param name="vendor" select="'NIST'"/>
-    <xsl:output method="text"/>   
-
-    <xsl:template match="/">
-        <xsl:text>#!/usr/bin/python -u
-# -*- coding: UTF-8 -*-
-#
-# This file is generated from the W3C test suite description file.
-#
-
-import xstc
-from xstc import XSTCTestRunner, XSTCTestGroup, XSTCSchemaTest, XSTCInstanceTest
-
-xstc.vendor = "</xsl:text><xsl:value-of select="$vendor"/><xsl:text>"
-
-r = XSTCTestRunner()
-
-# Group definitions.
-                                 
-</xsl:text>
-		      
-        <xsl:apply-templates select="ts:testSet/ts:testGroup" mode="group-def"/>
-<xsl:text>
-
-# Test definitions.
-
-</xsl:text>
-		<xsl:apply-templates select="ts:testSet/ts:testGroup" mode="test-def"/>
-        <xsl:text>
-           
-r.run()    
-
-</xsl:text>
-            
-    </xsl:template>       
-
-	<!-- groupName, descr -->
-    <xsl:template match="ts:testGroup" mode="group-def">
-		<xsl:text>r.addGroup(XSTCTestGroup("</xsl:text>
-		<!-- group -->
-		<xsl:value-of select="@name"/><xsl:text>", "</xsl:text>
-		<!-- main schema -->
-		<xsl:value-of select="ts:schemaTest[1]/ts:schemaDocument/@xl:href"/><xsl:text>", """</xsl:text>
-		<!-- group-description -->
-		<xsl:call-template name="str">
-			<xsl:with-param name="str" select="ts:annotation/ts:documentation/text()"/>
-		</xsl:call-template>
-		<xsl:text>"""))
-</xsl:text>
-	</xsl:template>
-	
-	<xsl:template name="str">
-		<xsl:param name="str"/>
-		<xsl:choose>
-			<xsl:when test="contains($str, '&quot;')">
-				<xsl:call-template name="str">
-					<xsl:with-param name="str" select="substring-before($str, '&quot;')"/>
-				</xsl:call-template>
-				<xsl:text>'</xsl:text>
-				<xsl:call-template name="str">
-					<xsl:with-param name="str" select="substring-after($str, '&quot;')"/>
-				</xsl:call-template>
-			
-			</xsl:when>
-			<xsl:otherwise>
-				<xsl:value-of select="$str"/>
-			</xsl:otherwise>
-		</xsl:choose>
-	</xsl:template>
-
-	<xsl:template match="ts:testGroup" mode="test-def">	    
-		<xsl:param name="group" select="@name"/>
-		<xsl:for-each select="ts:schemaTest">
-			<!-- groupName, isSchema, Name, Accepted, File, Val, Descr -->
-			<xsl:text>r.addTest(XSTCSchemaTest("</xsl:text>
-			<!-- group -->
-			<xsl:value-of select="$group"/><xsl:text>", "</xsl:text>
-			<!-- test-name -->
-			<xsl:value-of select="@name"/><xsl:text>", </xsl:text>
-			<!-- accepted -->
-			<xsl:value-of select="number(ts:current/@status = 'accepted')"/><xsl:text>, "</xsl:text>
-			<!-- filename -->			
-			<xsl:value-of select="ts:schemaDocument/@xl:href"/><xsl:text>", </xsl:text>
-			<!-- validity -->
-			<xsl:value-of select="number(ts:expected/@validity = 'valid')"/><xsl:text>, "</xsl:text>
-			<!-- test-description -->
-			<xsl:value-of select="ts:annotation/ts:documentation/text()"/><xsl:text>"))
-</xsl:text>
-		</xsl:for-each>
-		<xsl:for-each select="ts:instanceTest">
-			<!-- groupName, isSchema, Name, Accepted, File, Val, Descr -->
-			<xsl:text>r.addTest(XSTCInstanceTest("</xsl:text>
-			<!-- group -->
-			<xsl:value-of select="$group"/><xsl:text>", "</xsl:text>
-			<!-- test-name -->
-			<xsl:value-of select="@name"/><xsl:text>", </xsl:text>
-			<!-- accepted -->
-			<xsl:value-of select="number(ts:current/@status = 'accepted')"/><xsl:text>, "</xsl:text>
-			<!-- filename -->			
-			<xsl:value-of select="ts:instanceDocument/@xl:href"/><xsl:text>", </xsl:text>
-			<!-- validity -->
-			<xsl:value-of select="number(ts:expected/@validity = 'valid')"/><xsl:text>, "</xsl:text>
-			<!-- test-description -->
-			<xsl:value-of select="ts:annotation/ts:documentation/text()"/><xsl:text>"))
-</xsl:text>
-		</xsl:for-each>
-	</xsl:template>                     
-        
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/third_party/libxml/src/xstc/xstc.py b/third_party/libxml/src/xstc/xstc.py
deleted file mode 100755
index ca011bb..0000000
--- a/third_party/libxml/src/xstc/xstc.py
+++ /dev/null
@@ -1,693 +0,0 @@
-#!/usr/bin/env python
-
-#
-# This is the MS subset of the W3C test suite for XML Schemas.
-# This file is generated from the MS W3c test suite description file.
-#
-
-import sys, os
-import exceptions, optparse
-import libxml2
-
-opa = optparse.OptionParser()
-
-opa.add_option("-b", "--base", action="store", type="string", dest="baseDir",
-			   default="",
-			   help="""The base directory; i.e. the parent folder of the
-			   "nisttest", "suntest" and "msxsdtest" directories.""")
-
-opa.add_option("-o", "--out", action="store", type="string", dest="logFile",
-			   default="test.log",
-			   help="The filepath of the log file to be created")
-
-opa.add_option("--log", action="store_true", dest="enableLog",
-			   default=False,
-			   help="Create the log file")
-
-opa.add_option("--no-test-out", action="store_true", dest="disableTestStdOut",
-			   default=False,
-			   help="Don't output test results")
-
-opa.add_option("-s", "--silent", action="store_true", dest="silent", default=False,
-			   help="Disables display of all tests")
-
-opa.add_option("-v", "--verbose", action="store_true", dest="verbose",
-			   default=False,
-			   help="Displays all tests (only if --silent is not set)")
-
-opa.add_option("-x", "--max", type="int", dest="maxTestCount",
-			   default="-1",
-			   help="The maximum number of tests to be run")
-
-opa.add_option("-t", "--test", type="string", dest="singleTest",
-			   default=None,
-			   help="Runs the specified test only")
-			   
-opa.add_option("--tsw", "--test-starts-with", type="string", dest="testStartsWith",
-			   default=None,
-			   help="Runs the specified test(s), starting with the given string")
-
-opa.add_option("--rieo", "--report-internal-errors-only", action="store_true",
-			   dest="reportInternalErrOnly", default=False,
-			   help="Display erroneous tests of type 'internal' only")
-
-opa.add_option("--rueo", "--report-unimplemented-errors-only", action="store_true",
-			   dest="reportUnimplErrOnly", default=False,
-			   help="Display erroneous tests of type 'unimplemented' only")
-
-opa.add_option("--rmleo", "--report-mem-leak-errors-only", action="store_true",
-			   dest="reportMemLeakErrOnly", default=False,
-			   help="Display erroneous tests of type 'memory leak' only")
-
-opa.add_option("-c", "--combines", type="string", dest="combines",
-			   default=None,
-			   help="Combines to be run (all if omitted)")
-			   
-opa.add_option("--csw", "--csw", type="string", dest="combineStartsWith",
-			   default=None,
-			   help="Combines to be run (all if omitted)")			   
-
-opa.add_option("--rc", "--report-combines", action="store_true",
-			   dest="reportCombines", default=False,
-			   help="Display combine reports")
-
-opa.add_option("--rec", "--report-err-combines", action="store_true",
-			   dest="reportErrCombines", default=False,
-			   help="Display erroneous combine reports only")
-
-opa.add_option("--debug", action="store_true",
-			   dest="debugEnabled", default=False,
-			   help="Displays debug messages")
-
-opa.add_option("--info", action="store_true",
-			   dest="info", default=False,
-			   help="Displays info on the suite only. Does not run any test.")
-opa.add_option("--sax", action="store_true",
-			   dest="validationSAX", default=False,
-			   help="Use SAX2-driven validation.")
-opa.add_option("--tn", action="store_true",
-			   dest="displayTestName", default=False,
-			   help="Display the test name in every case.")
-
-(options, args) = opa.parse_args()
-
-if options.combines is not None:
-	options.combines = options.combines.split()
-
-################################################
-# The vars below are not intended to be changed.
-#
-
-msgSchemaNotValidButShould =  "The schema should be valid."
-msgSchemaValidButShouldNot = "The schema should be invalid."
-msgInstanceNotValidButShould = "The instance should be valid."
-msgInstanceValidButShouldNot = "The instance should be invalid."
-vendorNIST = "NIST"
-vendorNIST_2 = "NIST-2"
-vendorSUN  = "SUN"
-vendorMS   = "MS"
-
-###################
-# Helper functions.
-#
-vendor = None
-
-def handleError(test, msg):
-	global options
-	if not options.silent:
-		test.addLibLog("'%s'   LIB: %s" % (test.name, msg))
-	if msg.find("Unimplemented") > -1:
-		test.failUnimplemented()
-	elif msg.find("Internal") > -1:
-		test.failInternal()
-		
-	
-def fixFileNames(fileName):
-	if (fileName is None) or (fileName == ""):
-		return ""
-	dirs = fileName.split("/")
-	if dirs[1] != "Tests":
-		fileName = os.path.join(".", "Tests")
-		for dir in dirs[1:]:
-			fileName = os.path.join(fileName, dir)	
-	return fileName
-
-class XSTCTestGroup:
-	def __init__(self, name, schemaFileName, descr):
-		global vendor, vendorNIST_2
-		self.name = name
-		self.descr = descr
-		self.mainSchema = True
-		self.schemaFileName = fixFileNames(schemaFileName)
-		self.schemaParsed = False
-		self.schemaTried = False
-
-	def setSchema(self, schemaFileName, parsed):
-		if not self.mainSchema:			
-			return
-		self.mainSchema = False
-		self.schemaParsed = parsed
-		self.schemaTried = True
-
-class XSTCTestCase:
-
-		   # <!-- groupName, Name, Accepted, File, Val, Descr
-	def __init__(self, isSchema, groupName, name, accepted, file, val, descr):
-		global options
-		#
-		# Constructor.
-		#
-		self.testRunner = None
-		self.isSchema = isSchema
-		self.groupName = groupName
-		self.name = name
-		self.accepted = accepted		
-		self.fileName = fixFileNames(file)
-		self.val = val
-		self.descr = descr
-		self.failed = False
-		self.combineName = None
-
-		self.log = []
-		self.libLog = []
-		self.initialMemUsed = 0
-		self.memLeak = 0
-		self.excepted = False
-		self.bad = False
-		self.unimplemented = False
-		self.internalErr = False
-		self.noSchemaErr = False
-		self.failed = False
-		#
-		# Init the log.
-		#
-		if not options.silent:
-			if self.descr is not None:
-				self.log.append("'%s'   descr: %s\n" % (self.name, self.descr))		
-			self.log.append("'%s'   exp validity: %d\n" % (self.name, self.val))
-
-	def initTest(self, runner):
-		global vendorNIST, vendorSUN, vendorMS, vendorNIST_2, options, vendor
-		#
-		# Get the test-group.
-		#
-		self.runner = runner
-		self.group = runner.getGroup(self.groupName)				
-		if vendor == vendorMS or vendor == vendorSUN:
-			#
-			# Use the last given directory for the combine name.
-			#
-			dirs = self.fileName.split("/")
-			self.combineName = dirs[len(dirs) -2]					
-		elif vendor == vendorNIST:
-			#
-			# NIST files are named in the following form:
-			# "NISTSchema-short-pattern-1.xsd"
-			#						
-			tokens = self.name.split("-")
-			self.combineName = tokens[1]
-		elif vendor == vendorNIST_2:
-			#
-			# Group-names have the form: "atomic-normalizedString-length-1"
-			#
-			tokens = self.groupName.split("-")
-			self.combineName = "%s-%s" % (tokens[0], tokens[1])
-		else:
-			self.combineName = "unkown"
-			raise Exception("Could not compute the combine name of a test.")
-		if (not options.silent) and (self.group.descr is not None):
-			self.log.append("'%s'   group-descr: %s\n" % (self.name, self.group.descr))
-		
-
-	def addLibLog(self, msg):		
-		"""This one is intended to be used by the error handler
-		function"""
-		global options		
-		if not options.silent:
-			self.libLog.append(msg)
-
-	def fail(self, msg):
-		global options
-		self.failed = True
-		if not options.silent:
-			self.log.append("'%s' ( FAILED: %s\n" % (self.name, msg))
-
-	def failNoSchema(self):
-		global options
-		self.failed = True
-		self.noSchemaErr = True
-		if not options.silent:
-			self.log.append("'%s' X NO-SCHEMA\n" % (self.name))
-
-	def failInternal(self):
-		global options
-		self.failed = True
-		self.internalErr = True
-		if not options.silent:
-			self.log.append("'%s' * INTERNAL\n" % self.name)
-
-	def failUnimplemented(self):
-		global options
-		self.failed = True
-		self.unimplemented = True
-		if not options.silent:
-			self.log.append("'%s' ? UNIMPLEMENTED\n" % self.name)
-
-	def failCritical(self, msg):
-		global options
-		self.failed = True
-		self.bad = True
-		if not options.silent:
-			self.log.append("'%s' ! BAD: %s\n" % (self.name, msg))
-
-	def failExcept(self, e):
-		global options
-		self.failed = True
-		self.excepted = True
-		if not options.silent:
-			self.log.append("'%s' # EXCEPTION: %s\n" % (self.name, e.__str__()))
-
-	def setUp(self):
-		#
-		# Set up Libxml2.
-		#
-		self.initialMemUsed = libxml2.debugMemory(1)
-		libxml2.initParser()
-		libxml2.lineNumbersDefault(1)
-		libxml2.registerErrorHandler(handleError, self)
-
-	def tearDown(self):
-		libxml2.schemaCleanupTypes()
-		libxml2.cleanupParser()
-		self.memLeak = libxml2.debugMemory(1) - self.initialMemUsed
-
-	def isIOError(self, file, docType):
-		err = None
-		try:
-			err = libxml2.lastError()
-		except:
-			# Suppress exceptions.
-			pass
-		if (err is None):
-			return False
-		if err.domain() == libxml2.XML_FROM_IO:
-			self.failCritical("failed to access the %s resource '%s'\n" % (docType, file))
-
-	def debugMsg(self, msg):
-		global options
-		if options.debugEnabled:
-			sys.stdout.write("'%s'   DEBUG: %s\n" % (self.name, msg))
-
-	def finalize(self):
-		global options
-		"""Adds additional info to the log."""
-		#
-		# Add libxml2 messages.
-		#
-		if not options.silent:
-			self.log.extend(self.libLog)
-			#
-			# Add memory leaks.
-			#
-			if self.memLeak != 0:
-				self.log.append("%s + memory leak: %d bytes\n" % (self.name, self.memLeak))
-
-	def run(self):
-		"""Runs a test."""
-		global options
-
-		##filePath = os.path.join(options.baseDir, self.fileName)
-		# filePath = "%s/%s/%s/%s" % (options.baseDir, self.test_Folder, self.schema_Folder, self.schema_File)
-		if options.displayTestName:
-			sys.stdout.write("'%s'\n" % self.name)
-		try:
-			self.validate()
-		except (Exception, libxml2.parserError, libxml2.treeError), e:
-			self.failExcept(e)
-			
-def parseSchema(fileName):
-	schema = None
-	ctxt = libxml2.schemaNewParserCtxt(fileName)
-	try:
-		try:
-			schema = ctxt.schemaParse()
-		except:
-			pass
-	finally:		
-		del ctxt
-		return schema
-				
-
-class XSTCSchemaTest(XSTCTestCase):
-
-	def __init__(self, groupName, name, accepted, file, val, descr):
-		XSTCTestCase.__init__(self, 1, groupName, name, accepted, file, val, descr)
-
-	def validate(self):
-		global msgSchemaNotValidButShould, msgSchemaValidButShouldNot
-		schema = None
-		filePath = self.fileName
-		# os.path.join(options.baseDir, self.fileName)
-		valid = 0
-		try:
-			#
-			# Parse the schema.
-			#
-			self.debugMsg("loading schema: %s" % filePath)
-			schema = parseSchema(filePath)
-			self.debugMsg("after loading schema")						
-			if schema is None:
-				self.debugMsg("schema is None")
-				self.debugMsg("checking for IO errors...")
-				if self.isIOError(file, "schema"):
-					return
-			self.debugMsg("checking schema result")
-			if (schema is None and self.val) or (schema is not None and self.val == 0):
-				self.debugMsg("schema result is BAD")
-				if (schema == None):
-					self.fail(msgSchemaNotValidButShould)
-				else:
-					self.fail(msgSchemaValidButShouldNot)
-			else:
-				self.debugMsg("schema result is OK")
-		finally:
-			self.group.setSchema(self.fileName, schema is not None)
-			del schema
-
-class XSTCInstanceTest(XSTCTestCase):
-
-	def __init__(self, groupName, name, accepted, file, val, descr):
-		XSTCTestCase.__init__(self, 0, groupName, name, accepted, file, val, descr)
-
-	def validate(self):
-		instance = None
-		schema = None
-		filePath = self.fileName
-		# os.path.join(options.baseDir, self.fileName)
-
-		if not self.group.schemaParsed and self.group.schemaTried:
-			self.failNoSchema()
-			return
-					
-		self.debugMsg("loading instance: %s" % filePath)
-		parserCtxt = libxml2.newParserCtxt()
-		if (parserCtxt is None):
-			# TODO: Is this one necessary, or will an exception
-			# be already raised?
-			raise Exception("Could not create the instance parser context.")
-		if not options.validationSAX:
-			try:
-				try:
-					instance = parserCtxt.ctxtReadFile(filePath, None, libxml2.XML_PARSE_NOWARNING)
-				except:
-					# Suppress exceptions.
-					pass
-			finally:
-				del parserCtxt
-			self.debugMsg("after loading instance")
-			if instance is None:
-				self.debugMsg("instance is None")
-				self.failCritical("Failed to parse the instance for unknown reasons.")
-				return		
-		try:
-			#
-			# Validate the instance.
-			#
-			self.debugMsg("loading schema: %s" % self.group.schemaFileName)
-			schema = parseSchema(self.group.schemaFileName)
-			try:
-				validationCtxt = schema.schemaNewValidCtxt()
-				#validationCtxt = libxml2.schemaNewValidCtxt(None)
-				if (validationCtxt is None):
-					self.failCritical("Could not create the validation context.")
-					return
-				try:
-					self.debugMsg("validating instance")
-					if options.validationSAX:
-						instance_Err = validationCtxt.schemaValidateFile(filePath, 0)
-					else:
-						instance_Err = validationCtxt.schemaValidateDoc(instance)
-					self.debugMsg("after instance validation")
-					self.debugMsg("instance-err: %d" % instance_Err)
-					if (instance_Err != 0 and self.val == 1) or (instance_Err == 0 and self.val == 0):
-						self.debugMsg("instance result is BAD")
-						if (instance_Err != 0):
-							self.fail(msgInstanceNotValidButShould)
-						else:
-							self.fail(msgInstanceValidButShouldNot)
-
-					else:
-								self.debugMsg("instance result is OK")
-				finally:
-					del validationCtxt
-			finally:
-				del schema
-		finally:
-			if instance is not None:
-				instance.freeDoc()
-
-
-####################
-# Test runner class.
-#
-
-class XSTCTestRunner:
-
-	CNT_TOTAL = 0
-	CNT_RAN = 1
-	CNT_SUCCEEDED = 2
-	CNT_FAILED = 3
-	CNT_UNIMPLEMENTED = 4
-	CNT_INTERNAL = 5
-	CNT_BAD = 6
-	CNT_EXCEPTED = 7
-	CNT_MEMLEAK = 8
-	CNT_NOSCHEMA = 9
-	CNT_NOTACCEPTED = 10
-	CNT_SCHEMA_TEST = 11
-
-	def __init__(self):
-		self.logFile = None
-		self.counters = self.createCounters()
-		self.testList = []
-		self.combinesRan = {}
-		self.groups = {}
-		self.curGroup = None
-
-	def createCounters(self):
-		counters = {self.CNT_TOTAL:0, self.CNT_RAN:0, self.CNT_SUCCEEDED:0,
-		self.CNT_FAILED:0, self.CNT_UNIMPLEMENTED:0, self.CNT_INTERNAL:0, self.CNT_BAD:0,
-		self.CNT_EXCEPTED:0, self.CNT_MEMLEAK:0, self.CNT_NOSCHEMA:0, self.CNT_NOTACCEPTED:0,
-		self.CNT_SCHEMA_TEST:0}
-
-		return counters
-
-	def addTest(self, test):
-		self.testList.append(test)
-		test.initTest(self)
-
-	def getGroup(self, groupName):
-		return self.groups[groupName]
-
-	def addGroup(self, group):
-		self.groups[group.name] = group
-
-	def updateCounters(self, test, counters):
-		if test.memLeak != 0:
-			counters[self.CNT_MEMLEAK] += 1
-		if not test.failed:
-			counters[self.CNT_SUCCEEDED] +=1
-		if test.failed:
-			counters[self.CNT_FAILED] += 1
-		if test.bad:
-			counters[self.CNT_BAD] += 1
-		if test.unimplemented:
-			counters[self.CNT_UNIMPLEMENTED] += 1
-		if test.internalErr:
-			counters[self.CNT_INTERNAL] += 1
-		if test.noSchemaErr:
-			counters[self.CNT_NOSCHEMA] += 1
-		if test.excepted:
-			counters[self.CNT_EXCEPTED] += 1
-		if not test.accepted:
-			counters[self.CNT_NOTACCEPTED] += 1
-		if test.isSchema:
-			counters[self.CNT_SCHEMA_TEST] += 1
-		return counters
-
-	def displayResults(self, out, all, combName, counters):
-		out.write("\n")
-		if all:
-			if options.combines is not None:
-				out.write("combine(s): %s\n" % str(options.combines))
-		elif combName is not None:
-			out.write("combine : %s\n" % combName)
-		out.write("  total           : %d\n" % counters[self.CNT_TOTAL])
-		if all or options.combines is not None:
-			out.write("  ran             : %d\n" % counters[self.CNT_RAN])
-			out.write("    (schemata)    : %d\n" % counters[self.CNT_SCHEMA_TEST])
-		# out.write("    succeeded       : %d\n" % counters[self.CNT_SUCCEEDED])
-		out.write("  not accepted    : %d\n" % counters[self.CNT_NOTACCEPTED])
-		if counters[self.CNT_FAILED] > 0:		    
-			out.write("    failed                  : %d\n" % counters[self.CNT_FAILED])
-			out.write("     -> internal            : %d\n" % counters[self.CNT_INTERNAL])
-			out.write("     -> unimpl.             : %d\n" % counters[self.CNT_UNIMPLEMENTED])
-			out.write("     -> skip-invalid-schema : %d\n" % counters[self.CNT_NOSCHEMA])
-			out.write("     -> bad                 : %d\n" % counters[self.CNT_BAD])
-			out.write("     -> exceptions          : %d\n" % counters[self.CNT_EXCEPTED])
-			out.write("    memory leaks            : %d\n" % counters[self.CNT_MEMLEAK])
-
-	def displayShortResults(self, out, all, combName, counters):
-		out.write("Ran %d of %d tests (%d schemata):" % (counters[self.CNT_RAN],
-				  counters[self.CNT_TOTAL], counters[self.CNT_SCHEMA_TEST]))
-		# out.write("    succeeded       : %d\n" % counters[self.CNT_SUCCEEDED])
-		if counters[self.CNT_NOTACCEPTED] > 0:
-			out.write(" %d not accepted" % (counters[self.CNT_NOTACCEPTED]))
-		if counters[self.CNT_FAILED] > 0 or counters[self.CNT_MEMLEAK] > 0:
-			if counters[self.CNT_FAILED] > 0:
-				out.write(" %d failed" % (counters[self.CNT_FAILED]))
-				out.write(" (")
-				if counters[self.CNT_INTERNAL] > 0:
-					out.write(" %d internal" % (counters[self.CNT_INTERNAL]))
-				if counters[self.CNT_UNIMPLEMENTED] > 0:
-					out.write(" %d unimplemented" % (counters[self.CNT_UNIMPLEMENTED]))
-				if counters[self.CNT_NOSCHEMA] > 0:
-					out.write(" %d skip-invalid-schema" % (counters[self.CNT_NOSCHEMA]))
-				if counters[self.CNT_BAD] > 0:
-					out.write(" %d bad" % (counters[self.CNT_BAD]))
-				if counters[self.CNT_EXCEPTED] > 0:
-					out.write(" %d exception" % (counters[self.CNT_EXCEPTED]))
-				out.write(" )")
-			if counters[self.CNT_MEMLEAK] > 0:
-				out.write(" %d leaks" % (counters[self.CNT_MEMLEAK]))			
-			out.write("\n")
-		else:
-			out.write(" all passed\n")
-
-	def reportCombine(self, combName):
-		global options
-
-		counters = self.createCounters()
-		#
-		# Compute evaluation counters.
-		#
-		for test in self.combinesRan[combName]:
-			counters[self.CNT_TOTAL] += 1
-			counters[self.CNT_RAN] += 1
-			counters = self.updateCounters(test, counters)
-		if options.reportErrCombines and (counters[self.CNT_FAILED] == 0) and (counters[self.CNT_MEMLEAK] == 0):
-			pass
-		else:
-			if options.enableLog:
-				self.displayResults(self.logFile, False, combName, counters)				
-			self.displayResults(sys.stdout, False, combName, counters)
-
-	def displayTestLog(self, test):
-		sys.stdout.writelines(test.log)
-		sys.stdout.write("~~~~~~~~~~\n")
-
-	def reportTest(self, test):
-		global options
-
-		error = test.failed or test.memLeak != 0
-		#
-		# Only erroneous tests will be written to the log,
-		# except @verbose is switched on.
-		#
-		if options.enableLog and (options.verbose or error):
-			self.logFile.writelines(test.log)
-			self.logFile.write("~~~~~~~~~~\n")
-		#
-		# if not @silent, only erroneous tests will be
-		# written to stdout, except @verbose is switched on.
-		#
-		if not options.silent:
-			if options.reportInternalErrOnly and test.internalErr:
-				self.displayTestLog(test)
-			if options.reportMemLeakErrOnly and test.memLeak != 0:
-				self.displayTestLog(test)
-			if options.reportUnimplErrOnly and test.unimplemented:
-				self.displayTestLog(test)
-			if (options.verbose or error) and (not options.reportInternalErrOnly) and (not options.reportMemLeakErrOnly) and (not options.reportUnimplErrOnly):
-				self.displayTestLog(test)
-
-
-	def addToCombines(self, test):
-		found = False
-		if self.combinesRan.has_key(test.combineName):
-			self.combinesRan[test.combineName].append(test)
-		else:
-			self.combinesRan[test.combineName] = [test]
-
-	def run(self):
-
-		global options
-
-		if options.info:
-			for test in self.testList:
-				self.addToCombines(test)
-			sys.stdout.write("Combines: %d\n" % len(self.combinesRan))
-			sys.stdout.write("%s\n" % self.combinesRan.keys())
-			return
-
-		if options.enableLog:
-			self.logFile = open(options.logFile, "w")
-		try:
-			for test in self.testList:
-				self.counters[self.CNT_TOTAL] += 1
-				#
-				# Filter tests.
-				#
-				if options.singleTest is not None and options.singleTest != "":
-					if (test.name != options.singleTest):
-						continue
-				elif options.combines is not None:
-					if not options.combines.__contains__(test.combineName):
-						continue
-				elif options.testStartsWith is not None:
-					if not test.name.startswith(options.testStartsWith):
-						continue
-				elif options.combineStartsWith is not None:
-					if not test.combineName.startswith(options.combineStartsWith):
-						continue
-				
-				if options.maxTestCount != -1 and self.counters[self.CNT_RAN] >= options.maxTestCount:
-					break
-				self.counters[self.CNT_RAN] += 1
-				#
-				# Run the thing, dammit.
-				#
-				try:
-					test.setUp()
-					try:
-						test.run()
-					finally:
-						test.tearDown()
-				finally:
-					#
-					# Evaluate.
-					#
-					test.finalize()
-					self.reportTest(test)
-					if options.reportCombines or options.reportErrCombines:
-						self.addToCombines(test)
-					self.counters = self.updateCounters(test, self.counters)
-		finally:
-			if options.reportCombines or options.reportErrCombines:
-				#
-				# Build a report for every single combine.
-				#
-				# TODO: How to sort a dict?
-				#
-				self.combinesRan.keys().sort(None)
-				for key in self.combinesRan.keys():
-					self.reportCombine(key)
-
-			#
-			# Display the final report.
-			#
-			if options.silent:
-				self.displayShortResults(sys.stdout, True, None, self.counters)
-			else:
-				sys.stdout.write("===========================\n")
-				self.displayResults(sys.stdout, True, None, self.counters)
diff --git a/third_party/libxml/win32/config.h b/third_party/libxml/win32/config.h
index b9e0e5c0..891b57e4 100644
--- a/third_party/libxml/win32/config.h
+++ b/third_party/libxml/win32/config.h
@@ -96,7 +96,7 @@
 
 #if defined(_MSC_VER)
 #define mkdir(p,m) _mkdir(p)
-#if _MSC_VER < 1900
+#if _MSC_VER < 1900 // Cannot define this in VS 2015 and above!
 #define snprintf _snprintf
 #endif
 #if _MSC_VER < 1500
diff --git a/third_party/libxml/win32/xmlversion.h b/third_party/libxml/win32/xmlversion.h
new file mode 100644
index 0000000..82de0fd
--- /dev/null
+++ b/third_party/libxml/win32/xmlversion.h
@@ -0,0 +1,489 @@
+/*
+ * Summary: compile-time version informations
+ * Description: compile-time version informations for the XML library
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ */
+
+#ifndef __XML_VERSION_H__
+#define __XML_VERSION_H__
+
+#include <libxml/xmlexports.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * use those to be sure nothing nasty will happen if
+ * your library and includes mismatch
+ */
+#ifndef LIBXML2_COMPILING_MSCCDEF
+XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
+#endif /* LIBXML2_COMPILING_MSCCDEF */
+
+/**
+ * LIBXML_DOTTED_VERSION:
+ *
+ * the version string like "1.2.3"
+ */
+#define LIBXML_DOTTED_VERSION "2.9.4"
+
+/**
+ * LIBXML_VERSION:
+ *
+ * the version number: 1.2.3 value is 10203
+ */
+#define LIBXML_VERSION 20904
+
+/**
+ * LIBXML_VERSION_STRING:
+ *
+ * the version number string, 1.2.3 value is "10203"
+ */
+#define LIBXML_VERSION_STRING "20904"
+
+/**
+ * LIBXML_VERSION_EXTRA:
+ *
+ * extra version information, used to show a CVS compilation
+ */
+#define LIBXML_VERSION_EXTRA ""
+
+/**
+ * LIBXML_TEST_VERSION:
+ *
+ * Macro to check that the libxml version in use is compatible with
+ * the version the software has been compiled against
+ */
+#define LIBXML_TEST_VERSION xmlCheckVersion(20904);
+
+#ifndef VMS
+#if 0
+/**
+ * WITH_TRIO:
+ *
+ * defined if the trio support need to be configured in
+ */
+#define WITH_TRIO
+#else
+/**
+ * WITHOUT_TRIO:
+ *
+ * defined if the trio support should not be configured in
+ */
+#define WITHOUT_TRIO
+#endif
+#else /* VMS */
+/**
+ * WITH_TRIO:
+ *
+ * defined if the trio support need to be configured in
+ */
+#define WITH_TRIO 1
+#endif /* VMS */
+
+/**
+ * LIBXML_THREAD_ENABLED:
+ *
+ * Whether the thread support is configured in
+ */
+#if 1
+#if defined(_REENTRANT) || defined(__MT__) || \
+    (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
+#define LIBXML_THREAD_ENABLED
+#endif
+#endif
+
+/**
+ * LIBXML_THREAD_ALLOC_ENABLED:
+ *
+ * Whether the allocation hooks are per-thread
+ */
+#if 0
+#define LIBXML_THREAD_ALLOC_ENABLED
+#endif
+
+/**
+ * LIBXML_TREE_ENABLED:
+ *
+ * Whether the DOM like tree manipulation API support is configured in
+ */
+#if 1
+#define LIBXML_TREE_ENABLED
+#endif
+
+/**
+ * LIBXML_OUTPUT_ENABLED:
+ *
+ * Whether the serialization/saving support is configured in
+ */
+#if 1
+#define LIBXML_OUTPUT_ENABLED
+#endif
+
+/**
+ * LIBXML_PUSH_ENABLED:
+ *
+ * Whether the push parsing interfaces are configured in
+ */
+#if 1
+#define LIBXML_PUSH_ENABLED
+#endif
+
+/**
+ * LIBXML_READER_ENABLED:
+ *
+ * Whether the xmlReader parsing interface is configured in
+ */
+#if 1
+#define LIBXML_READER_ENABLED
+#endif
+
+/**
+ * LIBXML_PATTERN_ENABLED:
+ *
+ * Whether the xmlPattern node selection interface is configured in
+ */
+#if 1
+#define LIBXML_PATTERN_ENABLED
+#endif
+
+/**
+ * LIBXML_WRITER_ENABLED:
+ *
+ * Whether the xmlWriter saving interface is configured in
+ */
+#if 1
+#define LIBXML_WRITER_ENABLED
+#endif
+
+/**
+ * LIBXML_SAX1_ENABLED:
+ *
+ * Whether the older SAX1 interface is configured in
+ */
+#if 1
+#define LIBXML_SAX1_ENABLED
+#endif
+
+/**
+ * LIBXML_FTP_ENABLED:
+ *
+ * Whether the FTP support is configured in
+ */
+#if 0
+#define LIBXML_FTP_ENABLED
+#endif
+
+/**
+ * LIBXML_HTTP_ENABLED:
+ *
+ * Whether the HTTP support is configured in
+ */
+#if 0
+#define LIBXML_HTTP_ENABLED
+#endif
+
+/**
+ * LIBXML_VALID_ENABLED:
+ *
+ * Whether the DTD validation support is configured in
+ */
+#if 1
+#define LIBXML_VALID_ENABLED
+#endif
+
+/**
+ * LIBXML_HTML_ENABLED:
+ *
+ * Whether the HTML support is configured in
+ */
+#if 1
+#define LIBXML_HTML_ENABLED
+#endif
+
+/**
+ * LIBXML_LEGACY_ENABLED:
+ *
+ * Whether the deprecated APIs are compiled in for compatibility
+ */
+#if 1
+#define LIBXML_LEGACY_ENABLED
+#endif
+
+/**
+ * LIBXML_C14N_ENABLED:
+ *
+ * Whether the Canonicalization support is configured in
+ */
+#if 1
+#define LIBXML_C14N_ENABLED
+#endif
+
+/**
+ * LIBXML_CATALOG_ENABLED:
+ *
+ * Whether the Catalog support is configured in
+ */
+#if 1
+#define LIBXML_CATALOG_ENABLED
+#endif
+
+/**
+ * LIBXML_DOCB_ENABLED:
+ *
+ * Whether the SGML Docbook support is configured in
+ */
+#if 1
+#define LIBXML_DOCB_ENABLED
+#endif
+
+/**
+ * LIBXML_XPATH_ENABLED:
+ *
+ * Whether XPath is configured in
+ */
+#if 1
+#define LIBXML_XPATH_ENABLED
+#endif
+
+/**
+ * LIBXML_XPTR_ENABLED:
+ *
+ * Whether XPointer is configured in
+ */
+#if 1
+#define LIBXML_XPTR_ENABLED
+#endif
+
+/**
+ * LIBXML_XINCLUDE_ENABLED:
+ *
+ * Whether XInclude is configured in
+ */
+#if 1
+#define LIBXML_XINCLUDE_ENABLED
+#endif
+
+/**
+ * LIBXML_ICONV_ENABLED:
+ *
+ * Whether iconv support is available
+ */
+#if 0
+#define LIBXML_ICONV_ENABLED
+#endif
+
+/**
+ * LIBXML_ICU_ENABLED:
+ *
+ * Whether icu support is available
+ */
+#if 1
+#define LIBXML_ICU_ENABLED
+#endif
+
+/**
+ * LIBXML_ISO8859X_ENABLED:
+ *
+ * Whether ISO-8859-* support is made available in case iconv is not
+ */
+#if 0
+#define LIBXML_ISO8859X_ENABLED
+#endif
+
+/**
+ * LIBXML_DEBUG_ENABLED:
+ *
+ * Whether Debugging module is configured in
+ */
+#if 1
+#define LIBXML_DEBUG_ENABLED
+#endif
+
+/**
+ * DEBUG_MEMORY_LOCATION:
+ *
+ * Whether the memory debugging is configured in
+ */
+#if 0
+#define DEBUG_MEMORY_LOCATION
+#endif
+
+/**
+ * LIBXML_DEBUG_RUNTIME:
+ *
+ * Whether the runtime debugging is configured in
+ */
+#if 0
+#define LIBXML_DEBUG_RUNTIME
+#endif
+
+/**
+ * LIBXML_UNICODE_ENABLED:
+ *
+ * Whether the Unicode related interfaces are compiled in
+ */
+#if 1
+#define LIBXML_UNICODE_ENABLED
+#endif
+
+/**
+ * LIBXML_REGEXP_ENABLED:
+ *
+ * Whether the regular expressions interfaces are compiled in
+ */
+#if 1
+#define LIBXML_REGEXP_ENABLED
+#endif
+
+/**
+ * LIBXML_AUTOMATA_ENABLED:
+ *
+ * Whether the automata interfaces are compiled in
+ */
+#if 1
+#define LIBXML_AUTOMATA_ENABLED
+#endif
+
+/**
+ * LIBXML_EXPR_ENABLED:
+ *
+ * Whether the formal expressions interfaces are compiled in
+ */
+#if 1
+#define LIBXML_EXPR_ENABLED
+#endif
+
+/**
+ * LIBXML_SCHEMAS_ENABLED:
+ *
+ * Whether the Schemas validation interfaces are compiled in
+ */
+#if 1
+#define LIBXML_SCHEMAS_ENABLED
+#endif
+
+/**
+ * LIBXML_SCHEMATRON_ENABLED:
+ *
+ * Whether the Schematron validation interfaces are compiled in
+ */
+#if 1
+#define LIBXML_SCHEMATRON_ENABLED
+#endif
+
+/**
+ * LIBXML_MODULES_ENABLED:
+ *
+ * Whether the module interfaces are compiled in
+ */
+#if 1
+#define LIBXML_MODULES_ENABLED
+/**
+ * LIBXML_MODULE_EXTENSION:
+ *
+ * the string suffix used by dynamic modules (usually shared libraries)
+ */
+#define LIBXML_MODULE_EXTENSION ".dll" 
+#endif
+
+/**
+ * LIBXML_ZLIB_ENABLED:
+ *
+ * Whether the Zlib support is compiled in
+ */
+#if 0
+#define LIBXML_ZLIB_ENABLED
+#endif
+
+/**
+ * LIBXML_LZMA_ENABLED:
+ *
+ * Whether the Lzma support is compiled in
+ */
+#if 0
+#define LIBXML_LZMA_ENABLED
+#endif
+
+#ifdef __GNUC__
+#ifdef HAVE_ANSIDECL_H
+#include <ansidecl.h>
+#endif
+
+/**
+ * ATTRIBUTE_UNUSED:
+ *
+ * Macro used to signal to GCC unused function parameters
+ */
+
+#ifndef ATTRIBUTE_UNUSED
+# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
+#  define ATTRIBUTE_UNUSED __attribute__((unused))
+# else
+#  define ATTRIBUTE_UNUSED
+# endif
+#endif
+
+/**
+ * LIBXML_ATTR_ALLOC_SIZE:
+ *
+ * Macro used to indicate to GCC this is an allocator function
+ */
+
+#ifndef LIBXML_ATTR_ALLOC_SIZE
+# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
+#  define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
+# else
+#  define LIBXML_ATTR_ALLOC_SIZE(x)
+# endif
+#else
+# define LIBXML_ATTR_ALLOC_SIZE(x)
+#endif
+
+/**
+ * LIBXML_ATTR_FORMAT:
+ *
+ * Macro used to indicate to GCC the parameter are printf like
+ */
+
+#ifndef LIBXML_ATTR_FORMAT
+# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
+#  define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
+# else
+#  define LIBXML_ATTR_FORMAT(fmt,args)
+# endif
+#else
+# define LIBXML_ATTR_FORMAT(fmt,args)
+#endif
+
+#else /* ! __GNUC__ */
+/**
+ * ATTRIBUTE_UNUSED:
+ *
+ * Macro used to signal to GCC unused function parameters
+ */
+#define ATTRIBUTE_UNUSED
+/**
+ * LIBXML_ATTR_ALLOC_SIZE:
+ *
+ * Macro used to indicate to GCC this is an allocator function
+ */
+#define LIBXML_ATTR_ALLOC_SIZE(x)
+/**
+ * LIBXML_ATTR_FORMAT:
+ *
+ * Macro used to indicate to GCC the parameter are printf like
+ */
+#define LIBXML_ATTR_FORMAT(fmt,args)
+#endif /* __GNUC__ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif
+
+
diff --git a/third_party/libxslt/Makefile.am b/third_party/libxslt/Makefile.am
index e357f19..50af9b5 100644
--- a/third_party/libxslt/Makefile.am
+++ b/third_party/libxslt/Makefile.am
@@ -56,8 +56,8 @@
 valgrind:
 	@echo '## Running the regression tests under Valgrind'
 	@echo '## Go get a cup of coffee it is gonna take a while ...'
-	@(cd tests ; $(MAKE) CHECKER='valgrind -q' tests)
-	@(cd xsltproc ; $(MAKE) CHECKER='valgrind -q' tests)
+	@(cd tests ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests)
+	@(cd xsltproc ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests)
 
 cleanup:
 	-@(find . -name .\#\* -exec rm {} \;)
diff --git a/third_party/libxslt/Makefile.in b/third_party/libxslt/Makefile.in
index 54a58e0..396f26c6 100644
--- a/third_party/libxslt/Makefile.in
+++ b/third_party/libxslt/Makefile.in
@@ -1054,8 +1054,8 @@
 valgrind:
 	@echo '## Running the regression tests under Valgrind'
 	@echo '## Go get a cup of coffee it is gonna take a while ...'
-	@(cd tests ; $(MAKE) CHECKER='valgrind -q' tests)
-	@(cd xsltproc ; $(MAKE) CHECKER='valgrind -q' tests)
+	@(cd tests ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests)
+	@(cd xsltproc ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests)
 
 cleanup:
 	-@(find . -name .\#\* -exec rm {} \;)
diff --git a/third_party/libxslt/README.chromium b/third_party/libxslt/README.chromium
index 056d196..1f421b5 100644
--- a/third_party/libxslt/README.chromium
+++ b/third_party/libxslt/README.chromium
@@ -1,6 +1,6 @@
 Name: libxslt
 URL: http://xmlsoft.org/XSLT
-Version: 891681e3e948f31732229f53cb6db7215f740fc7
+Version: 87c3d9ea214fc0503fd8130b6dd97431d69cc066
 Security Critical: yes
 License: MIT
 License File: Copyright
diff --git a/third_party/libxslt/configure b/third_party/libxslt/configure
index 4241e2d..29fbd56 100644
--- a/third_party/libxslt/configure
+++ b/third_party/libxslt/configure
@@ -14382,7 +14382,7 @@
 rm -f COPYING.LIB COPYING 2>/dev/null && $LN_S $srcdir/Copyright COPYING
 
 
-ac_config_files="$ac_config_files Makefile libxslt.pc libexslt.pc libxslt/Makefile libxslt/xsltconfig.h libxslt/xsltwin32config.h libexslt/Makefile libexslt/exsltconfig.h xsltproc/Makefile python/Makefile python/tests/Makefile tests/Makefile tests/docs/Makefile tests/REC1/Makefile tests/REC2/Makefile tests/REC/Makefile tests/general/Makefile tests/reports/Makefile tests/extensions/Makefile tests/namespaces/Makefile tests/keys/Makefile tests/numbers/Makefile tests/documents/Makefile tests/xmlspec/Makefile tests/multiple/Makefile tests/xinclude/Makefile tests/XSLTMark/Makefile tests/docbook/Makefile tests/exslt/Makefile tests/exslt/common/Makefile tests/exslt/functions/Makefile tests/exslt/math/Makefile tests/exslt/sets/Makefile tests/exslt/strings/Makefile tests/exslt/date/Makefile tests/exslt/dynamic/Makefile tests/exslt/crypto/Makefile tests/plugins/Makefile doc/Makefile xslt-config libxslt.spec"
+ac_config_files="$ac_config_files Makefile libxslt.pc libexslt.pc libxslt/Makefile libxslt/xsltconfig.h libxslt/xsltwin32config.h libexslt/Makefile libexslt/exsltconfig.h xsltproc/Makefile python/Makefile python/tests/Makefile tests/Makefile tests/docs/Makefile tests/REC1/Makefile tests/REC2/Makefile tests/REC/Makefile tests/general/Makefile tests/reports/Makefile tests/extensions/Makefile tests/namespaces/Makefile tests/keys/Makefile tests/numbers/Makefile tests/documents/Makefile tests/xmlspec/Makefile tests/multiple/Makefile tests/xinclude/Makefile tests/XSLTMark/Makefile tests/docbook/Makefile tests/exslt/Makefile tests/exslt/common/Makefile tests/exslt/functions/Makefile tests/exslt/math/Makefile tests/exslt/saxon/Makefile tests/exslt/sets/Makefile tests/exslt/strings/Makefile tests/exslt/date/Makefile tests/exslt/dynamic/Makefile tests/exslt/crypto/Makefile tests/plugins/Makefile doc/Makefile xslt-config libxslt.spec"
 
 
 cat >confcache <<\_ACEOF
@@ -15440,6 +15440,7 @@
     "tests/exslt/common/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/common/Makefile" ;;
     "tests/exslt/functions/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/functions/Makefile" ;;
     "tests/exslt/math/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/math/Makefile" ;;
+    "tests/exslt/saxon/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/saxon/Makefile" ;;
     "tests/exslt/sets/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/sets/Makefile" ;;
     "tests/exslt/strings/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/strings/Makefile" ;;
     "tests/exslt/date/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/date/Makefile" ;;
diff --git a/third_party/libxslt/configure.in b/third_party/libxslt/configure.in
index fee676fe..7e03d117 100644
--- a/third_party/libxslt/configure.in
+++ b/third_party/libxslt/configure.in
@@ -716,6 +716,7 @@
 tests/exslt/common/Makefile
 tests/exslt/functions/Makefile
 tests/exslt/math/Makefile
+tests/exslt/saxon/Makefile
 tests/exslt/sets/Makefile
 tests/exslt/strings/Makefile
 tests/exslt/date/Makefile
diff --git a/third_party/libxslt/libexslt/Makefile.am b/third_party/libxslt/libexslt/Makefile.am
index 0e92e51..1cf5138 100644
--- a/third_party/libxslt/libexslt/Makefile.am
+++ b/third_party/libxslt/libexslt/Makefile.am
@@ -10,8 +10,9 @@
 
 exsltinc_HEADERS =                      \
 	exslt.h				\
-	exsltconfig.h			\
 	exsltexports.h
+nodist_exsltinc_HEADERS =               \
+	exsltconfig.h
 
 libexslt_la_SOURCES =                   \
 	exslt.c				\
diff --git a/third_party/libxslt/libexslt/Makefile.in b/third_party/libxslt/libexslt/Makefile.in
index 4bcde6b..7080fd7c 100644
--- a/third_party/libxslt/libexslt/Makefile.in
+++ b/third_party/libxslt/libexslt/Makefile.in
@@ -119,7 +119,7 @@
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \
-	"$(DESTDIR)$(exsltincdir)"
+	"$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libexslt_la_DEPENDENCIES = $(top_builddir)/libxslt/libxslt.la \
@@ -178,7 +178,7 @@
 man3dir = $(mandir)/man3
 NROFF = nroff
 MANS = $(man_MANS)
-HEADERS = $(exsltinc_HEADERS)
+HEADERS = $(exsltinc_HEADERS) $(nodist_exsltinc_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -385,9 +385,11 @@
 exsltincdir = $(includedir)/libexslt
 exsltinc_HEADERS = \
 	exslt.h				\
-	exsltconfig.h			\
 	exsltexports.h
 
+nodist_exsltinc_HEADERS = \
+	exsltconfig.h
+
 libexslt_la_SOURCES = \
 	exslt.c				\
 	common.c			\
@@ -587,6 +589,27 @@
 	@list='$(exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir)
+install-nodist_exsltincHEADERS: $(nodist_exsltinc_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(exsltincdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(exsltincdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(exsltincdir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(exsltincdir)" || exit $$?; \
+	done
+
+uninstall-nodist_exsltincHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir)
 
 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
@@ -674,7 +697,7 @@
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(exsltincdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -730,7 +753,8 @@
 
 info-am:
 
-install-data-am: install-exsltincHEADERS install-man
+install-data-am: install-exsltincHEADERS install-man \
+	install-nodist_exsltincHEADERS
 
 install-dvi: install-dvi-am
 
@@ -777,7 +801,7 @@
 ps-am:
 
 uninstall-am: uninstall-exsltincHEADERS uninstall-libLTLIBRARIES \
-	uninstall-man
+	uninstall-man uninstall-nodist_exsltincHEADERS
 
 uninstall-man: uninstall-man3
 
@@ -791,13 +815,15 @@
 	install-data-am install-dvi install-dvi-am install-exec \
 	install-exec-am install-exsltincHEADERS install-html \
 	install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-man install-man3 install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
+	install-libLTLIBRARIES install-man install-man3 \
+	install-nodist_exsltincHEADERS install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-exsltincHEADERS \
-	uninstall-libLTLIBRARIES uninstall-man uninstall-man3
+	uninstall-libLTLIBRARIES uninstall-man uninstall-man3 \
+	uninstall-nodist_exsltincHEADERS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/third_party/libxslt/libexslt/crypto.c b/third_party/libxslt/libexslt/crypto.c
index 6aa9dd25..e13db8b 100644
--- a/third_party/libxslt/libexslt/crypto.c
+++ b/third_party/libxslt/libexslt/crypto.c
@@ -499,11 +499,8 @@
     unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
 
     str_len = exsltCryptoPopString (ctxt, nargs, &str);
-    if (str_len == 0) {
-	xmlXPathReturnEmptyString (ctxt);
-	xmlFree (str);
+    if (str_len == 0)
 	return;
-    }
 
     PLATFORM_HASH (ctxt, PLATFORM_MD4, (const char *) str, str_len,
 		   (char *) hash);
@@ -532,11 +529,8 @@
     unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
 
     str_len = exsltCryptoPopString (ctxt, nargs, &str);
-    if (str_len == 0) {
-	xmlXPathReturnEmptyString (ctxt);
-	xmlFree (str);
+    if (str_len == 0)
 	return;
-    }
 
     PLATFORM_HASH (ctxt, PLATFORM_MD5, (const char *) str, str_len,
 		   (char *) hash);
@@ -565,11 +559,8 @@
     unsigned char hex[SHA1_DIGEST_LENGTH * 2 + 1];
 
     str_len = exsltCryptoPopString (ctxt, nargs, &str);
-    if (str_len == 0) {
-	xmlXPathReturnEmptyString (ctxt);
-	xmlFree (str);
+    if (str_len == 0)
 	return;
-    }
 
     PLATFORM_HASH (ctxt, PLATFORM_SHA1, (const char *) str, str_len,
 		   (char *) hash);
diff --git a/third_party/libxslt/libexslt/date.c b/third_party/libxslt/libexslt/date.c
index 272c61b..87c48487 100644
--- a/third_party/libxslt/libexslt/date.c
+++ b/third_party/libxslt/libexslt/date.c
@@ -1283,7 +1283,7 @@
     }
 
     if (dt->type & XS_GYEAR) {
-        xmlChar buf[20], *cur = buf;
+        xmlChar buf[100], *cur = buf;
 
         FORMAT_GYEAR(dt->value.date.year, cur);
         if (dt->type == XS_GYEARMONTH) {
@@ -1478,10 +1478,6 @@
     d = &(dt->value.date);
     u = &(dur->value.dur);
 
-    /* normalize for time zone offset */
-    u->sec -= (d->tzo * 60);	/* changed from + to - (bug 153000) */
-    d->tzo = 0;
-
     /* month */
     carry  = d->mon + u->mon;
     r->mon = (unsigned int)MODULO_RANGE(carry, 1, 13);
@@ -1585,40 +1581,6 @@
 }
 
 /**
- * exsltDateNormalize:
- * @dt: an #exsltDateValPtr
- *
- * Normalize @dt to GMT time.
- *
- */
-static void
-exsltDateNormalize (exsltDateValPtr dt)
-{
-    exsltDateValPtr dur, tmp;
-
-    if (dt == NULL)
-        return;
-
-    if (((dt->type & XS_TIME) != XS_TIME) && (dt->value.date.tzo == 0))
-        return;
-
-    dur = exsltDateCreateDate(XS_DURATION);
-    if (dur == NULL)
-        return;
-
-    tmp = _exsltDateAdd(dt, dur);
-    if (tmp == NULL)
-        return;
-
-    memcpy(dt, tmp, sizeof(exsltDateVal));
-
-    exsltDateFreeDate(tmp);
-    exsltDateFreeDate(dur);
-
-    dt->value.date.tzo = 0;
-}
-
-/**
  * _exsltDateDifference:
  * @x: an #exsltDateValPtr
  * @y: an #exsltDateValPtr
@@ -1642,9 +1604,6 @@
         ((y->type < XS_GYEAR) || (y->type > XS_DATETIME)))
         return NULL;
 
-    exsltDateNormalize(x);
-    exsltDateNormalize(y);
-
     /*
      * the operand with the most specific format must be converted to
      * the same type as the operand with the least specific format.
@@ -1672,6 +1631,8 @@
                               _exsltDateCastYMToDays(x);
         ret->value.dur.day += y->value.date.day - x->value.date.day;
         ret->value.dur.sec  = TIME_TO_NUMBER(y) - TIME_TO_NUMBER(x);
+        ret->value.dur.sec += (x->value.date.tzo - y->value.date.tzo) *
+                              SECS_PER_MIN;
 	if (ret->value.dur.day > 0.0 && ret->value.dur.sec < 0.0) {
 	    ret->value.dur.day -= 1;
 	    ret->value.dur.sec = ret->value.dur.sec + SECS_PER_DAY;
diff --git a/third_party/libxslt/libexslt/dynamic.c b/third_party/libxslt/libexslt/dynamic.c
index e0bfe8170..7b95fc5e 100644
--- a/third_party/libxslt/libexslt/dynamic.c
+++ b/third_party/libxslt/libexslt/dynamic.c
@@ -167,10 +167,27 @@
         ctxt->context->proximityPosition = 0;
         for (i = 0; i < nodeset->nodeNr; i++) {
             xmlXPathObjectPtr subResult = NULL;
+            xmlNodePtr cur = nodeset->nodeTab[i];
 
             ctxt->context->proximityPosition++;
-            ctxt->context->node = nodeset->nodeTab[i];
-            ctxt->context->doc = nodeset->nodeTab[i]->doc;
+            ctxt->context->node = cur;
+
+            if (cur->type == XML_NAMESPACE_DECL) {
+                /*
+                * The XPath module sets the owner element of a ns-node on
+                * the ns->next field.
+                */
+                cur = (xmlNodePtr) ((xmlNsPtr) cur)->next;
+                if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
+                    xsltGenericError(xsltGenericErrorContext,
+                        "Internal error in exsltDynMapFunction: "
+                        "Cannot retrieve the doc of a namespace node.\n");
+                    continue;
+                }
+                ctxt->context->doc = cur->doc;
+            } else {
+                ctxt->context->doc = cur->doc;
+            }
 
             subResult = xmlXPathCompiledEval(comp, ctxt->context);
             if (subResult != NULL) {
diff --git a/third_party/libxslt/libexslt/saxon.c b/third_party/libxslt/libexslt/saxon.c
index e92ba8d..7a2f63b 100644
--- a/third_party/libxslt/libexslt/saxon.c
+++ b/third_party/libxslt/libexslt/saxon.c
@@ -101,9 +101,7 @@
 	 ret = xmlXPathCompile(arg);
 	 if (ret == NULL) {
 	      xmlFree(arg);
-	      xsltGenericError(xsltGenericErrorContext,
-			"{%s}:%s: argument is not an XPath expression\n",
-			ctxt->context->functionURI, ctxt->context->function);
+              xmlXPathSetError(ctxt, XPATH_EXPR_ERROR);
 	      return;
 	 }
 	 xmlHashAddEntry(hash, arg, (void *) ret);
@@ -147,6 +145,10 @@
      expr = (xmlXPathCompExprPtr) xmlXPathPopExternal(ctxt);
 
      ret = xmlXPathCompiledEval(expr, ctxt->context);
+     if (ret == NULL) {
+	  xmlXPathSetError(ctxt, XPATH_EXPR_ERROR);
+	  return;
+     }
 
      valuePush(ctxt, ret);
 }
@@ -227,11 +229,12 @@
 static void
 exsltSaxonLineNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) {
     xmlNodePtr cur = NULL;
+    xmlXPathObjectPtr obj = NULL;
+    long lineNo = -1;
 
     if (nargs == 0) {
 	cur = ctxt->context->node;
     } else if (nargs == 1) {
-	xmlXPathObjectPtr obj;
 	xmlNodeSetPtr nodelist;
 	int i;
 
@@ -244,18 +247,14 @@
 
 	obj = valuePop(ctxt);
 	nodelist = obj->nodesetval;
-	if ((nodelist == NULL) || (nodelist->nodeNr <= 0)) {
-	    xmlXPathFreeObject(obj);
-	    valuePush(ctxt, xmlXPathNewFloat(-1));
-	    return;
-	}
-	cur = nodelist->nodeTab[0];
-	for (i = 1;i < nodelist->nodeNr;i++) {
-	    int ret = xmlXPathCmpNodes(cur, nodelist->nodeTab[i]);
-	    if (ret == -1)
-		cur = nodelist->nodeTab[i];
-	}
-	xmlXPathFreeObject(obj);
+	if ((nodelist != NULL) && (nodelist->nodeNr > 0)) {
+            cur = nodelist->nodeTab[0];
+            for (i = 1;i < nodelist->nodeNr;i++) {
+                int ret = xmlXPathCmpNodes(cur, nodelist->nodeTab[i]);
+                if (ret == -1)
+                    cur = nodelist->nodeTab[i];
+            }
+        }
     } else {
 	xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
 		"saxon:line-number() : invalid number of args %d\n",
@@ -264,8 +263,26 @@
 	return;
     }
 
-    valuePush(ctxt, xmlXPathNewFloat(xmlGetLineNo(cur)));
-    return;
+    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) {
+        /*
+        * The XPath module sets the owner element of a ns-node on
+        * the ns->next field.
+        */
+        cur = (xmlNodePtr) ((xmlNsPtr) cur)->next;
+        if (cur == NULL || cur->type != XML_ELEMENT_NODE) {
+            xsltGenericError(xsltGenericErrorContext,
+                "Internal error in exsltSaxonLineNumberFunction: "
+                "Cannot retrieve the doc of a namespace node.\n");
+            cur = NULL;
+        }
+    }
+
+    if (cur != NULL)
+        lineNo = xmlGetLineNo(cur);
+
+    valuePush(ctxt, xmlXPathNewFloat(lineNo));
+
+    xmlXPathFreeObject(obj);
 }
 
 /**
diff --git a/third_party/libxslt/libxslt/Makefile.am b/third_party/libxslt/libxslt/Makefile.am
index d4619d22..d9fed68 100644
--- a/third_party/libxslt/libxslt/Makefile.am
+++ b/third_party/libxslt/libxslt/Makefile.am
@@ -25,9 +25,10 @@
 	transform.h			\
 	security.h			\
 	xsltInternals.h			\
-	xsltconfig.h			\
 	xsltexports.h			\
 	xsltlocale.h
+nodist_xsltinc_HEADERS = 		\
+	xsltconfig.h
 
 libxslt_la_SOURCES = 			\
 	attrvt.c			\
@@ -50,9 +51,10 @@
 	transform.c			\
 	security.c			\
 	win32config.h			\
-	xsltwin32config.h		\
 	xsltwin32config.h.in		\
 	libxslt.h
+nodist_libxslt_la_SOURCES =		\
+	xsltwin32config.h
 
 if USE_VERSION_SCRIPT
 LIBXSLT_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxslt.syms
diff --git a/third_party/libxslt/libxslt/Makefile.in b/third_party/libxslt/libxslt/Makefile.in
index b0f421d..da61c58 100644
--- a/third_party/libxslt/libxslt/Makefile.in
+++ b/third_party/libxslt/libxslt/Makefile.in
@@ -119,7 +119,7 @@
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \
-	"$(DESTDIR)$(xsltincdir)"
+	"$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libxslt_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
@@ -127,7 +127,9 @@
 	pattern.lo templates.lo variables.lo keys.lo numbers.lo \
 	extensions.lo extra.lo functions.lo namespaces.lo imports.lo \
 	attributes.lo documents.lo preproc.lo transform.lo security.lo
-libxslt_la_OBJECTS = $(am_libxslt_la_OBJECTS)
+nodist_libxslt_la_OBJECTS =
+libxslt_la_OBJECTS = $(am_libxslt_la_OBJECTS) \
+	$(nodist_libxslt_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -169,7 +171,7 @@
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libxslt_la_SOURCES)
+SOURCES = $(libxslt_la_SOURCES) $(nodist_libxslt_la_SOURCES)
 DIST_SOURCES = $(libxslt_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -179,7 +181,7 @@
 man3dir = $(mandir)/man3
 NROFF = nroff
 MANS = $(man_MANS)
-HEADERS = $(xsltinc_HEADERS)
+HEADERS = $(nodist_xsltinc_HEADERS) $(xsltinc_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -400,10 +402,12 @@
 	transform.h			\
 	security.h			\
 	xsltInternals.h			\
-	xsltconfig.h			\
 	xsltexports.h			\
 	xsltlocale.h
 
+nodist_xsltinc_HEADERS = \
+	xsltconfig.h
+
 libxslt_la_SOURCES = \
 	attrvt.c			\
 	xslt.c				\
@@ -425,10 +429,12 @@
 	transform.c			\
 	security.c			\
 	win32config.h			\
-	xsltwin32config.h		\
 	xsltwin32config.h.in		\
 	libxslt.h
 
+nodist_libxslt_la_SOURCES = \
+	xsltwin32config.h
+
 @USE_VERSION_SCRIPT_FALSE@LIBXSLT_VERSION_SCRIPT = 
 @USE_VERSION_SCRIPT_TRUE@LIBXSLT_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxslt.syms
 libxslt_la_LIBADD = $(LIBXML_LIBS) $(EXTRA_LIBS)
@@ -611,6 +617,27 @@
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
 	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
+install-nodist_xsltincHEADERS: $(nodist_xsltinc_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(xsltincdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(xsltincdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xsltincdir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(xsltincdir)" || exit $$?; \
+	done
+
+uninstall-nodist_xsltincHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(xsltincdir)'; $(am__uninstall_files_from_dir)
 install-xsltincHEADERS: $(xsltinc_HEADERS)
 	@$(NORMAL_INSTALL)
 	@list='$(xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \
@@ -719,7 +746,7 @@
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(xsltincdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -775,7 +802,8 @@
 
 info-am:
 
-install-data-am: install-man install-xsltincHEADERS
+install-data-am: install-man install-nodist_xsltincHEADERS \
+	install-xsltincHEADERS
 
 install-dvi: install-dvi-am
 
@@ -823,7 +851,7 @@
 ps-am:
 
 uninstall-am: uninstall-libLTLIBRARIES uninstall-man \
-	uninstall-xsltincHEADERS
+	uninstall-nodist_xsltincHEADERS uninstall-xsltincHEADERS
 
 uninstall-man: uninstall-man3
 
@@ -837,13 +865,15 @@
 	install-data-am install-dvi install-dvi-am install-exec \
 	install-exec-am install-exec-hook install-html install-html-am \
 	install-info install-info-am install-libLTLIBRARIES \
-	install-man install-man3 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip install-xsltincHEADERS \
-	installcheck installcheck-am installdirs maintainer-clean \
+	install-man install-man3 install-nodist_xsltincHEADERS \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-xsltincHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
-	uninstall-man uninstall-man3 uninstall-xsltincHEADERS
+	uninstall-man uninstall-man3 uninstall-nodist_xsltincHEADERS \
+	uninstall-xsltincHEADERS
 
 
 xsltproc: all
diff --git a/third_party/libxslt/libxslt/extensions.c b/third_party/libxslt/libxslt/extensions.c
index 5ad73cb..ae6eef08 100644
--- a/third_party/libxslt/libxslt/extensions.c
+++ b/third_party/libxslt/libxslt/extensions.c
@@ -367,8 +367,11 @@
         i++;
     }
 
-    if (*(i - 1) == '_')
+    /* Strip underscores from end of string. */
+    while (i > ext_name && *(i - 1) == '_') {
+        i--;
         *i = '\0';
+    }
 
     /* determine module directory */
     ext_directory = (xmlChar *) getenv("LIBXSLT_PLUGINS_PATH");
diff --git a/third_party/libxslt/libxslt/numbers.c b/third_party/libxslt/libxslt/numbers.c
index c6d755d..e769c42b 100644
--- a/third_party/libxslt/libxslt/numbers.c
+++ b/third_party/libxslt/libxslt/numbers.c
@@ -227,7 +227,8 @@
 }
 
 static void
-xsltNumberFormatAlpha(xmlBufferPtr buffer,
+xsltNumberFormatAlpha(xsltNumberDataPtr data,
+		      xmlBufferPtr buffer,
 		      double number,
 		      int is_upper)
 {
@@ -237,8 +238,25 @@
     char *alpha_list;
     double alpha_size = (double)(sizeof(alpha_upper_list) - 1);
 
-    if (number < 1.0)
+    /*
+     * XSLT 1.0 isn't clear on how to handle zero, but XSLT 2.0 says:
+     *
+     *     For all format tokens other than the first kind above (one that
+     *     consists of decimal digits), there may be implementation-defined
+     *     lower and upper bounds on the range of numbers that can be
+     *     formatted using this format token; indeed, for some numbering
+     *     sequences there may be intrinsic limits. [...] Numbers that fall
+     *     outside this range must be formatted using the format token 1.
+     *
+     * The "a" token has an intrinsic lower limit of 1.
+     */
+    if (number < 1.0) {
+        xsltNumberFormatDecimal(buffer, number, '0', 1,
+                                data->digitsPerGroup,
+                                data->groupingCharacter,
+                                data->groupingCharacterLen);
         return;
+    }
 
     /* Build buffer from back */
     pointer = &temp_string[sizeof(temp_string)];
@@ -256,11 +274,24 @@
 }
 
 static void
-xsltNumberFormatRoman(xmlBufferPtr buffer,
+xsltNumberFormatRoman(xsltNumberDataPtr data,
+		      xmlBufferPtr buffer,
 		      double number,
 		      int is_upper)
 {
     /*
+     * See discussion in xsltNumberFormatAlpha. Also use a reasonable upper
+     * bound to avoid denial of service.
+     */
+    if (number < 1.0 || number > 5000.0) {
+        xsltNumberFormatDecimal(buffer, number, '0', 1,
+                                data->digitsPerGroup,
+                                data->groupingCharacter,
+                                data->groupingCharacterLen);
+        return;
+    }
+
+    /*
      * Based on an example by Jim Walsh
      */
     while (number >= 1000.0) {
@@ -443,6 +474,23 @@
     for (i = 0; i < numbers_max; i++) {
 	/* Insert number */
 	number = numbers[(numbers_max - 1) - i];
+        /* Round to nearest like XSLT 2.0 */
+        number = floor(number + 0.5);
+        /*
+         * XSLT 1.0 isn't clear on how to handle negative numbers, but XSLT
+         * 2.0 says:
+         *
+         *     It is a non-recoverable dynamic error if any undiscarded item
+         *     in the atomized sequence supplied as the value of the value
+         *     attribute of xsl:number cannot be converted to an integer, or
+         *     if the resulting integer is less than 0 (zero).
+         */
+        if (number < 0.0) {
+            xsltTransformError(NULL, NULL, NULL,
+                    "xsl-number : negative value\n");
+            /* Recover by treating negative values as zero. */
+            number = 0.0;
+        }
 	if (i < tokens->nTokens) {
 	  /*
 	   * The "n"th format token will be used to format the "n"th
@@ -486,28 +534,16 @@
 
 		switch (token->token) {
 		case 'A':
-		    xsltNumberFormatAlpha(buffer,
-					  number,
-					  TRUE);
-
+		    xsltNumberFormatAlpha(data, buffer, number, TRUE);
 		    break;
 		case 'a':
-		    xsltNumberFormatAlpha(buffer,
-					  number,
-					  FALSE);
-
+		    xsltNumberFormatAlpha(data, buffer, number, FALSE);
 		    break;
 		case 'I':
-		    xsltNumberFormatRoman(buffer,
-					  number,
-					  TRUE);
-
+		    xsltNumberFormatRoman(data, buffer, number, TRUE);
 		    break;
 		case 'i':
-		    xsltNumberFormatRoman(buffer,
-					  number,
-					  FALSE);
-
+		    xsltNumberFormatRoman(data, buffer, number, FALSE);
 		    break;
 		default:
 		    if (IS_DIGIT_ZERO(token->token)) {
diff --git a/third_party/libxslt/libxslt/pattern.c b/third_party/libxslt/libxslt/pattern.c
index 720b0cb..e211a01 100644
--- a/third_party/libxslt/libxslt/pattern.c
+++ b/third_party/libxslt/libxslt/pattern.c
@@ -2104,7 +2104,7 @@
             void *dup = xmlHashLookup2(style->namedTemplates, cur->name,
                                        cur->nameURI);
             if (dup != NULL) {
-                xsltTransformError(NULL, style, NULL,
+                xsltTransformError(NULL, style, cur->elem,
                                    "xsl:template: error duplicate name '%s'\n",
                                    cur->name);
                 style->errors++;
diff --git a/third_party/libxslt/libxslt/xsltlocale.h b/third_party/libxslt/libxslt/xsltlocale.h
index 9af4adc..8a9ca15 100644
--- a/third_party/libxslt/libxslt/xsltlocale.h
+++ b/third_party/libxslt/libxslt/xsltlocale.h
@@ -12,6 +12,7 @@
 #define __XML_XSLTLOCALE_H__
 
 #include <libxml/xmlstring.h>
+#include "xsltexports.h"
 
 #ifdef XSLT_LOCALE_XLOCALE
 
@@ -49,10 +50,18 @@
 
 #endif
 
-xsltLocale xsltNewLocale(const xmlChar *langName);
-void xsltFreeLocale(xsltLocale locale);
-xsltLocaleChar *xsltStrxfrm(xsltLocale locale, const xmlChar *string);
-int xsltLocaleStrcmp(xsltLocale locale, const xsltLocaleChar *str1, const xsltLocaleChar *str2);
-void xsltFreeLocales(void);
+XSLTPUBFUN xsltLocale XSLTCALL
+	xsltNewLocale			(const xmlChar *langName);
+XSLTPUBFUN void XSLTCALL
+	xsltFreeLocale			(xsltLocale locale);
+XSLTPUBFUN xsltLocaleChar * XSLTCALL
+	xsltStrxfrm			(xsltLocale locale,
+					 const xmlChar *string);
+XSLTPUBFUN int XSLTCALL
+	xsltLocaleStrcmp		(xsltLocale locale,
+					 const xsltLocaleChar *str1,
+					 const xsltLocaleChar *str2);
+XSLTPUBFUN void XSLTCALL
+	xsltFreeLocales			(void);
 
 #endif /* __XML_XSLTLOCALE_H__ */
diff --git a/third_party/libxslt/linux/Makefile b/third_party/libxslt/linux/Makefile
index 1436248..3c6d6c7 100644
--- a/third_party/libxslt/linux/Makefile
+++ b/third_party/libxslt/linux/Makefile
@@ -226,14 +226,14 @@
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
-ACLOCAL = ${SHELL} /work/cb/src/third_party/libxslt/missing aclocal-1.14
+ACLOCAL = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing aclocal-1.14
 AMTAR = $${TAR-tar}
 AM_DEFAULT_VERBOSITY = 0
 AR = ar
 AS = as
-AUTOCONF = ${SHELL} /work/cb/src/third_party/libxslt/missing autoconf
-AUTOHEADER = ${SHELL} /work/cb/src/third_party/libxslt/missing autoheader
-AUTOMAKE = ${SHELL} /work/cb/src/third_party/libxslt/missing automake-1.14
+AUTOCONF = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoconf
+AUTOHEADER = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoheader
+AUTOMAKE = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing automake-1.14
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -254,7 +254,7 @@
 EXEEXT = 
 EXSLT_INCLUDEDIR = -I${includedir}
 EXSLT_LIBDIR = -L${libdir}
-EXSLT_LIBS = -lexslt -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
+EXSLT_LIBS = -lexslt -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
 EXTRA_LIBS = 
 FGREP = /bin/grep -F
 GREP = /bin/grep
@@ -279,8 +279,8 @@
 LIBOBJS = 
 LIBS = 
 LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LIBXML_CFLAGS = -I/work/cb/src/third_party/libxml/linux/include
-LIBXML_LIBS = -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl
+LIBXML_CFLAGS = -I/usr/local/google/work/cb/src/third_party/libxml/linux/include
+LIBXML_LIBS = -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl
 LIBXML_REQUIRED_VERSION = 2.6.27
 LIBXML_SRC = ../../libxml/linux/
 LIBXSLT_DEFAULT_PLUGINS_PATH = /usr/local/lib/libxslt-plugins
@@ -295,7 +295,7 @@
 LIPO = 
 LN_S = ln -s
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /work/cb/src/third_party/libxslt/missing makeinfo
+MAKEINFO = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing makeinfo
 MANIFEST_TOOL = :
 MKDIR_P = /bin/mkdir -p
 MV = /bin/mv
@@ -323,7 +323,7 @@
 PYTHON_SUBDIR = python
 PYTHON_VERSION = 2.7
 RANLIB = ranlib
-RELDATE = Sat Apr  2 2016
+RELDATE = Sat May 14 2016
 RM = /bin/rm
 SED = /bin/sed
 SET_MAKE = 
@@ -342,18 +342,18 @@
 WITH_TRIO = 0
 WITH_XSLT_DEBUG = 0
 XMLLINT = /usr/bin/xmllint
-XML_CONFIG = /work/cb/src/third_party/libxml/linux/xml2-config
+XML_CONFIG = /usr/local/google/work/cb/src/third_party/libxml/linux/xml2-config
 XSLTPROC = /usr/bin/xsltproc
 XSLTPROCDV = 
 XSLT_INCLUDEDIR = -I${includedir}
 XSLT_LIBDIR = -L${libdir}
-XSLT_LIBS = -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm
+XSLT_LIBS = -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm
 XSLT_LOCALE_WINAPI = 0
 XSLT_LOCALE_XLOCALE = 1
-abs_builddir = /work/cb/src/third_party/libxslt/linux
-abs_srcdir = /work/cb/src/third_party/libxslt/linux/..
-abs_top_builddir = /work/cb/src/third_party/libxslt/linux
-abs_top_srcdir = /work/cb/src/third_party/libxslt/linux/..
+abs_builddir = /usr/local/google/work/cb/src/third_party/libxslt/linux
+abs_srcdir = /usr/local/google/work/cb/src/third_party/libxslt/linux/..
+abs_top_builddir = /usr/local/google/work/cb/src/third_party/libxslt/linux
+abs_top_srcdir = /usr/local/google/work/cb/src/third_party/libxslt/linux/..
 ac_ct_AR = ar
 ac_ct_CC = gcc
 ac_ct_DUMPBIN = 
@@ -382,7 +382,7 @@
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
-install_sh = ${SHELL} /work/cb/src/third_party/libxslt/install-sh
+install_sh = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localedir = ${datarootdir}/locale
@@ -1054,8 +1054,8 @@
 valgrind:
 	@echo '## Running the regression tests under Valgrind'
 	@echo '## Go get a cup of coffee it is gonna take a while ...'
-	@(cd tests ; $(MAKE) CHECKER='valgrind -q' tests)
-	@(cd xsltproc ; $(MAKE) CHECKER='valgrind -q' tests)
+	@(cd tests ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests)
+	@(cd xsltproc ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests)
 
 cleanup:
 	-@(find . -name .\#\* -exec rm {} \;)
diff --git a/third_party/libxslt/linux/config.log b/third_party/libxslt/linux/config.log
index 100b084..a76c6d8 100644
--- a/third_party/libxslt/linux/config.log
+++ b/third_party/libxslt/linux/config.log
@@ -10,11 +10,11 @@
 ## Platform. ##
 ## --------- ##
 
-hostname = dominicc-linux2.tok.corp.google.com
+hostname = kittyhawk.tok.corp.google.com
 uname -m = x86_64
-uname -r = 3.13.0-79-generic
+uname -r = 3.13.0-83-generic
 uname -s = Linux
-uname -v = #123-Ubuntu SMP Fri Feb 19 14:27:58 UTC 2016
+uname -v = #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016
 
 /usr/bin/uname -p = unknown
 /bin/uname -X     = unknown
@@ -27,10 +27,8 @@
 /usr/bin/oslevel       = unknown
 /bin/universe          = unknown
 
-PATH: /usr/local/google/home/dominicc/google-cloud-sdk/bin
-PATH: /work/depot_tools
-PATH: /usr/local/google/home/dominicc/google-cloud-sdk/bin
-PATH: /work/depot_tools
+PATH: /usr/local/google/home/dominicc/depot_tools
+PATH: /usr/local/google/home/dominicc/depot_tools
 PATH: /usr/lib/google-golang/bin
 PATH: /usr/local/buildtools/java/jdk/bin
 PATH: /usr/local/sbin
@@ -54,7 +52,7 @@
 configure:2473: result: gcc
 configure:2702: checking for C compiler version
 configure:2711: gcc --version >&5
-gcc-4.8.real (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
+gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
 Copyright (C) 2013 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -62,7 +60,7 @@
 configure:2722: $? = 0
 configure:2711: gcc -v >&5
 Using built-in specs.
-COLLECT_GCC=/usr/bin/gcc-4.8.real
+COLLECT_GCC=gcc
 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
 Target: x86_64-linux-gnu
 Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
@@ -70,13 +68,13 @@
 gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1) 
 configure:2722: $? = 0
 configure:2711: gcc -V >&5
-gcc-4.8.real: error: unrecognized command line option '-V'
-gcc-4.8.real: fatal error: no input files
+gcc: error: unrecognized command line option '-V'
+gcc: fatal error: no input files
 compilation terminated.
 configure:2722: $? = 4
 configure:2711: gcc -qversion >&5
-gcc-4.8.real: error: unrecognized command line option '-qversion'
-gcc-4.8.real: fatal error: no input files
+gcc: error: unrecognized command line option '-qversion'
+gcc: fatal error: no input files
 compilation terminated.
 configure:2722: $? = 4
 configure:2742: checking whether the C compiler works
@@ -321,7 +319,7 @@
 configure:4686: result: gcc
 configure:4915: checking for C compiler version
 configure:4924: gcc --version >&5
-gcc-4.8.real (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
+gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
 Copyright (C) 2013 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -329,7 +327,7 @@
 configure:4935: $? = 0
 configure:4924: gcc -v >&5
 Using built-in specs.
-COLLECT_GCC=/usr/bin/gcc-4.8.real
+COLLECT_GCC=gcc
 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
 Target: x86_64-linux-gnu
 Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
@@ -337,13 +335,13 @@
 gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1) 
 configure:4935: $? = 0
 configure:4924: gcc -V >&5
-gcc-4.8.real: error: unrecognized command line option '-V'
-gcc-4.8.real: fatal error: no input files
+gcc: error: unrecognized command line option '-V'
+gcc: fatal error: no input files
 compilation terminated.
 configure:4935: $? = 4
 configure:4924: gcc -qversion >&5
-gcc-4.8.real: error: unrecognized command line option '-qversion'
-gcc-4.8.real: fatal error: no input files
+gcc: error: unrecognized command line option '-qversion'
+gcc: fatal error: no input files
 compilation terminated.
 configure:4935: $? = 4
 configure:4939: checking whether we are using the GNU C compiler
@@ -1180,8 +1178,8 @@
 configure:13307: result: yes
 configure:13307: checking for _stat
 configure:13307: gcc -o conftest -g -O2   conftest.c  >&5
-/tmp/ccW2LKaI.o: In function `main':
-/work/cb/src/third_party/libxslt/linux/conftest.c:80: undefined reference to `_stat'
+/tmp/ccypx5ac.o: In function `main':
+/usr/local/google/work/cb/src/third_party/libxslt/linux/conftest.c:80: undefined reference to `_stat'
 collect2: error: ld returned 1 exit status
 configure:13307: $? = 1
 configure: failed program was:
@@ -1274,8 +1272,8 @@
 conftest.c:69:6: warning: conflicting types for built-in function 'pow' [enabled by default]
  char pow ();
       ^
-/tmp/ccfSajZH.o: In function `main':
-/work/cb/src/third_party/libxslt/linux/conftest.c:80: undefined reference to `pow'
+/tmp/ccrPu6rh.o: In function `main':
+/usr/local/google/work/cb/src/third_party/libxslt/linux/conftest.c:80: undefined reference to `pow'
 collect2: error: ld returned 1 exit status
 configure:13316: $? = 1
 configure: failed program was:
@@ -1375,8 +1373,8 @@
 conftest.c:70:6: warning: conflicting types for built-in function 'floor' [enabled by default]
  char floor ();
       ^
-/tmp/ccdbFkcV.o: In function `main':
-/work/cb/src/third_party/libxslt/linux/conftest.c:81: undefined reference to `floor'
+/tmp/ccKNWiSn.o: In function `main':
+/usr/local/google/work/cb/src/third_party/libxslt/linux/conftest.c:81: undefined reference to `floor'
 collect2: error: ld returned 1 exit status
 configure:13365: $? = 1
 configure: failed program was:
@@ -1477,8 +1475,8 @@
 conftest.c:71:6: warning: conflicting types for built-in function 'fabs' [enabled by default]
  char fabs ();
       ^
-/tmp/cc566ab7.o: In function `main':
-/work/cb/src/third_party/libxslt/linux/conftest.c:82: undefined reference to `fabs'
+/tmp/ccWT8GXy.o: In function `main':
+/usr/local/google/work/cb/src/third_party/libxslt/linux/conftest.c:82: undefined reference to `fabs'
 collect2: error: ld returned 1 exit status
 configure:13414: $? = 1
 configure: failed program was:
@@ -1704,52 +1702,53 @@
   CONFIG_COMMANDS = 
   $ ./config.status 
 
-on dominicc-linux2.tok.corp.google.com
+on kittyhawk.tok.corp.google.com
 
-config.status:1237: creating Makefile
-config.status:1237: creating libxslt.pc
-config.status:1237: creating libexslt.pc
-config.status:1237: creating libxslt/Makefile
-config.status:1237: creating libxslt/xsltconfig.h
-config.status:1237: creating libxslt/xsltwin32config.h
-config.status:1237: creating libexslt/Makefile
-config.status:1237: creating libexslt/exsltconfig.h
-config.status:1237: creating xsltproc/Makefile
-config.status:1237: creating python/Makefile
-config.status:1237: creating python/tests/Makefile
-config.status:1237: creating tests/Makefile
-config.status:1237: creating tests/docs/Makefile
-config.status:1237: creating tests/REC1/Makefile
-config.status:1237: creating tests/REC2/Makefile
-config.status:1237: creating tests/REC/Makefile
-config.status:1237: creating tests/general/Makefile
-config.status:1237: creating tests/reports/Makefile
-config.status:1237: creating tests/extensions/Makefile
-config.status:1237: creating tests/namespaces/Makefile
-config.status:1237: creating tests/keys/Makefile
-config.status:1237: creating tests/numbers/Makefile
-config.status:1237: creating tests/documents/Makefile
-config.status:1237: creating tests/xmlspec/Makefile
-config.status:1237: creating tests/multiple/Makefile
-config.status:1237: creating tests/xinclude/Makefile
-config.status:1237: creating tests/XSLTMark/Makefile
-config.status:1237: creating tests/docbook/Makefile
-config.status:1237: creating tests/exslt/Makefile
-config.status:1237: creating tests/exslt/common/Makefile
-config.status:1237: creating tests/exslt/functions/Makefile
-config.status:1237: creating tests/exslt/math/Makefile
-config.status:1237: creating tests/exslt/sets/Makefile
-config.status:1237: creating tests/exslt/strings/Makefile
-config.status:1237: creating tests/exslt/date/Makefile
-config.status:1237: creating tests/exslt/dynamic/Makefile
-config.status:1237: creating tests/exslt/crypto/Makefile
-config.status:1237: creating tests/plugins/Makefile
-config.status:1237: creating doc/Makefile
-config.status:1237: creating xslt-config
-config.status:1237: creating libxslt.spec
-config.status:1237: creating config.h
-config.status:1451: executing depfiles commands
-config.status:1451: executing libtool commands
+config.status:1238: creating Makefile
+config.status:1238: creating libxslt.pc
+config.status:1238: creating libexslt.pc
+config.status:1238: creating libxslt/Makefile
+config.status:1238: creating libxslt/xsltconfig.h
+config.status:1238: creating libxslt/xsltwin32config.h
+config.status:1238: creating libexslt/Makefile
+config.status:1238: creating libexslt/exsltconfig.h
+config.status:1238: creating xsltproc/Makefile
+config.status:1238: creating python/Makefile
+config.status:1238: creating python/tests/Makefile
+config.status:1238: creating tests/Makefile
+config.status:1238: creating tests/docs/Makefile
+config.status:1238: creating tests/REC1/Makefile
+config.status:1238: creating tests/REC2/Makefile
+config.status:1238: creating tests/REC/Makefile
+config.status:1238: creating tests/general/Makefile
+config.status:1238: creating tests/reports/Makefile
+config.status:1238: creating tests/extensions/Makefile
+config.status:1238: creating tests/namespaces/Makefile
+config.status:1238: creating tests/keys/Makefile
+config.status:1238: creating tests/numbers/Makefile
+config.status:1238: creating tests/documents/Makefile
+config.status:1238: creating tests/xmlspec/Makefile
+config.status:1238: creating tests/multiple/Makefile
+config.status:1238: creating tests/xinclude/Makefile
+config.status:1238: creating tests/XSLTMark/Makefile
+config.status:1238: creating tests/docbook/Makefile
+config.status:1238: creating tests/exslt/Makefile
+config.status:1238: creating tests/exslt/common/Makefile
+config.status:1238: creating tests/exslt/functions/Makefile
+config.status:1238: creating tests/exslt/math/Makefile
+config.status:1238: creating tests/exslt/saxon/Makefile
+config.status:1238: creating tests/exslt/sets/Makefile
+config.status:1238: creating tests/exslt/strings/Makefile
+config.status:1238: creating tests/exslt/date/Makefile
+config.status:1238: creating tests/exslt/dynamic/Makefile
+config.status:1238: creating tests/exslt/crypto/Makefile
+config.status:1238: creating tests/plugins/Makefile
+config.status:1238: creating doc/Makefile
+config.status:1238: creating xslt-config
+config.status:1238: creating libxslt.spec
+config.status:1238: creating config.h
+config.status:1452: executing depfiles commands
+config.status:1452: executing libtool commands
 
 ## ---------------- ##
 ## Cache variables. ##
@@ -1891,7 +1890,7 @@
 ## Output variables. ##
 ## ----------------- ##
 
-ACLOCAL='${SHELL} /work/cb/src/third_party/libxslt/missing aclocal-1.14'
+ACLOCAL='${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing aclocal-1.14'
 AMDEPBACKSLASH='\'
 AMDEP_FALSE='#'
 AMDEP_TRUE=''
@@ -1902,9 +1901,9 @@
 AM_V='$(V)'
 AR='ar'
 AS='as'
-AUTOCONF='${SHELL} /work/cb/src/third_party/libxslt/missing autoconf'
-AUTOHEADER='${SHELL} /work/cb/src/third_party/libxslt/missing autoheader'
-AUTOMAKE='${SHELL} /work/cb/src/third_party/libxslt/missing automake-1.14'
+AUTOCONF='${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoconf'
+AUTOHEADER='${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoheader'
+AUTOMAKE='${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing automake-1.14'
 AWK='gawk'
 CC='gcc'
 CCDEPMODE='depmode=gcc3'
@@ -1925,7 +1924,7 @@
 EXEEXT=''
 EXSLT_INCLUDEDIR='-I${includedir}'
 EXSLT_LIBDIR='-L${libdir}'
-EXSLT_LIBS='-lexslt -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt'
+EXSLT_LIBS='-lexslt -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt'
 EXTRA_LIBS=''
 FGREP='/bin/grep -F'
 GREP='/bin/grep'
@@ -1949,8 +1948,8 @@
 LIBOBJS=''
 LIBS=''
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-LIBXML_CFLAGS='-I/work/cb/src/third_party/libxml/linux/include'
-LIBXML_LIBS='-L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl'
+LIBXML_CFLAGS='-I/usr/local/google/work/cb/src/third_party/libxml/linux/include'
+LIBXML_LIBS='-L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl'
 LIBXML_REQUIRED_VERSION='2.6.27'
 LIBXML_SRC='../../libxml/linux/'
 LIBXSLT_DEFAULT_PLUGINS_PATH='/usr/local/lib/libxslt-plugins'
@@ -1965,7 +1964,7 @@
 LIPO=''
 LN_S='ln -s'
 LTLIBOBJS=''
-MAKEINFO='${SHELL} /work/cb/src/third_party/libxslt/missing makeinfo'
+MAKEINFO='${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing makeinfo'
 MANIFEST_TOOL=':'
 MKDIR_P='/bin/mkdir -p'
 MV='/bin/mv'
@@ -1993,7 +1992,7 @@
 PYTHON_SUBDIR='python'
 PYTHON_VERSION='2.7'
 RANLIB='ranlib'
-RELDATE='Sat Apr  2 2016'
+RELDATE='Sat May 14 2016'
 RM='/bin/rm'
 SED='/bin/sed'
 SET_MAKE=''
@@ -2020,12 +2019,12 @@
 WITH_TRIO='0'
 WITH_XSLT_DEBUG='0'
 XMLLINT='/usr/bin/xmllint'
-XML_CONFIG='/work/cb/src/third_party/libxml/linux/xml2-config'
+XML_CONFIG='/usr/local/google/work/cb/src/third_party/libxml/linux/xml2-config'
 XSLTPROC='/usr/bin/xsltproc'
 XSLTPROCDV=''
 XSLT_INCLUDEDIR='-I${includedir}'
 XSLT_LIBDIR='-L${libdir}'
-XSLT_LIBS='-lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm'
+XSLT_LIBS='-lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm'
 XSLT_LOCALE_WINAPI='0'
 XSLT_LOCALE_XLOCALE='1'
 ac_ct_AR='ar'
@@ -2061,7 +2060,7 @@
 htmldir='${docdir}'
 includedir='${prefix}/include'
 infodir='${datarootdir}/info'
-install_sh='${SHELL} /work/cb/src/third_party/libxslt/install-sh'
+install_sh='${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/install-sh'
 libdir='${exec_prefix}/lib'
 libexecdir='${exec_prefix}/libexec'
 localedir='${datarootdir}/locale'
diff --git a/third_party/libxslt/linux/libexslt.pc b/third_party/libxslt/linux/libexslt.pc
index 00064a2e..39c79f10 100644
--- a/third_party/libxslt/linux/libexslt.pc
+++ b/third_party/libxslt/linux/libexslt.pc
@@ -8,5 +8,5 @@
 Version: 0.8.17
 Description: EXSLT Extension library
 Requires: libxml-2.0
-Libs: -L${libdir} -lexslt -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
+Libs: -L${libdir} -lexslt -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
 Cflags: -I${includedir}
diff --git a/third_party/libxslt/linux/libexslt/Makefile b/third_party/libxslt/linux/libexslt/Makefile
index 93bd384..5915228 100644
--- a/third_party/libxslt/linux/libexslt/Makefile
+++ b/third_party/libxslt/linux/libexslt/Makefile
@@ -119,7 +119,7 @@
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \
-	"$(DESTDIR)$(exsltincdir)"
+	"$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libexslt_la_DEPENDENCIES = $(top_builddir)/libxslt/libxslt.la \
@@ -178,7 +178,7 @@
 man3dir = $(mandir)/man3
 NROFF = nroff
 MANS = $(man_MANS)
-HEADERS = $(exsltinc_HEADERS)
+HEADERS = $(exsltinc_HEADERS) $(nodist_exsltinc_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -199,14 +199,14 @@
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /work/cb/src/third_party/libxslt/missing aclocal-1.14
+ACLOCAL = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing aclocal-1.14
 AMTAR = $${TAR-tar}
 AM_DEFAULT_VERBOSITY = 0
 AR = ar
 AS = as
-AUTOCONF = ${SHELL} /work/cb/src/third_party/libxslt/missing autoconf
-AUTOHEADER = ${SHELL} /work/cb/src/third_party/libxslt/missing autoheader
-AUTOMAKE = ${SHELL} /work/cb/src/third_party/libxslt/missing automake-1.14
+AUTOCONF = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoconf
+AUTOHEADER = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoheader
+AUTOMAKE = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing automake-1.14
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -227,7 +227,7 @@
 EXEEXT = 
 EXSLT_INCLUDEDIR = -I${includedir}
 EXSLT_LIBDIR = -L${libdir}
-EXSLT_LIBS = -lexslt -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
+EXSLT_LIBS = -lexslt -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
 EXTRA_LIBS = 
 FGREP = /bin/grep -F
 GREP = /bin/grep
@@ -252,8 +252,8 @@
 LIBOBJS = 
 LIBS = 
 LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LIBXML_CFLAGS = -I/work/cb/src/third_party/libxml/linux/include
-LIBXML_LIBS = -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl
+LIBXML_CFLAGS = -I/usr/local/google/work/cb/src/third_party/libxml/linux/include
+LIBXML_LIBS = -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl
 LIBXML_REQUIRED_VERSION = 2.6.27
 LIBXML_SRC = ../../libxml/linux/
 LIBXSLT_DEFAULT_PLUGINS_PATH = /usr/local/lib/libxslt-plugins
@@ -268,7 +268,7 @@
 LIPO = 
 LN_S = ln -s
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /work/cb/src/third_party/libxslt/missing makeinfo
+MAKEINFO = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing makeinfo
 MANIFEST_TOOL = :
 MKDIR_P = /bin/mkdir -p
 MV = /bin/mv
@@ -296,7 +296,7 @@
 PYTHON_SUBDIR = python
 PYTHON_VERSION = 2.7
 RANLIB = ranlib
-RELDATE = Sat Apr  2 2016
+RELDATE = Sat May 14 2016
 RM = /bin/rm
 SED = /bin/sed
 SET_MAKE = 
@@ -315,18 +315,18 @@
 WITH_TRIO = 0
 WITH_XSLT_DEBUG = 0
 XMLLINT = /usr/bin/xmllint
-XML_CONFIG = /work/cb/src/third_party/libxml/linux/xml2-config
+XML_CONFIG = /usr/local/google/work/cb/src/third_party/libxml/linux/xml2-config
 XSLTPROC = /usr/bin/xsltproc
 XSLTPROCDV = 
 XSLT_INCLUDEDIR = -I${includedir}
 XSLT_LIBDIR = -L${libdir}
-XSLT_LIBS = -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm
+XSLT_LIBS = -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm
 XSLT_LOCALE_WINAPI = 0
 XSLT_LOCALE_XLOCALE = 1
-abs_builddir = /work/cb/src/third_party/libxslt/linux/libexslt
-abs_srcdir = /work/cb/src/third_party/libxslt/linux/../libexslt
-abs_top_builddir = /work/cb/src/third_party/libxslt/linux
-abs_top_srcdir = /work/cb/src/third_party/libxslt/linux/..
+abs_builddir = /usr/local/google/work/cb/src/third_party/libxslt/linux/libexslt
+abs_srcdir = /usr/local/google/work/cb/src/third_party/libxslt/linux/../libexslt
+abs_top_builddir = /usr/local/google/work/cb/src/third_party/libxslt/linux
+abs_top_srcdir = /usr/local/google/work/cb/src/third_party/libxslt/linux/..
 ac_ct_AR = ar
 ac_ct_CC = gcc
 ac_ct_DUMPBIN = 
@@ -355,7 +355,7 @@
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
-install_sh = ${SHELL} /work/cb/src/third_party/libxslt/install-sh
+install_sh = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localedir = ${datarootdir}/locale
@@ -385,9 +385,11 @@
 exsltincdir = $(includedir)/libexslt
 exsltinc_HEADERS = \
 	exslt.h				\
-	exsltconfig.h			\
 	exsltexports.h
 
+nodist_exsltinc_HEADERS = \
+	exsltconfig.h
+
 libexslt_la_SOURCES = \
 	exslt.c				\
 	common.c			\
@@ -587,6 +589,27 @@
 	@list='$(exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir)
+install-nodist_exsltincHEADERS: $(nodist_exsltinc_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(exsltincdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(exsltincdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(exsltincdir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(exsltincdir)" || exit $$?; \
+	done
+
+uninstall-nodist_exsltincHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir)
 
 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
@@ -674,7 +697,7 @@
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(exsltincdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -730,7 +753,8 @@
 
 info-am:
 
-install-data-am: install-exsltincHEADERS install-man
+install-data-am: install-exsltincHEADERS install-man \
+	install-nodist_exsltincHEADERS
 
 install-dvi: install-dvi-am
 
@@ -777,7 +801,7 @@
 ps-am:
 
 uninstall-am: uninstall-exsltincHEADERS uninstall-libLTLIBRARIES \
-	uninstall-man
+	uninstall-man uninstall-nodist_exsltincHEADERS
 
 uninstall-man: uninstall-man3
 
@@ -791,13 +815,15 @@
 	install-data-am install-dvi install-dvi-am install-exec \
 	install-exec-am install-exsltincHEADERS install-html \
 	install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-man install-man3 install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
+	install-libLTLIBRARIES install-man install-man3 \
+	install-nodist_exsltincHEADERS install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-exsltincHEADERS \
-	uninstall-libLTLIBRARIES uninstall-man uninstall-man3
+	uninstall-libLTLIBRARIES uninstall-man uninstall-man3 \
+	uninstall-nodist_exsltincHEADERS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/third_party/libxslt/linux/libxslt.pc b/third_party/libxslt/linux/libxslt.pc
index ea995b6..3b0563c 100644
--- a/third_party/libxslt/linux/libxslt.pc
+++ b/third_party/libxslt/linux/libxslt.pc
@@ -8,5 +8,5 @@
 Version: 1.1.28
 Description: XSLT library version 2.
 Requires: libxml-2.0
-Libs: -L${libdir} -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm 
+Libs: -L${libdir} -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm 
 Cflags: -I${includedir}
diff --git a/third_party/libxslt/linux/libxslt.spec b/third_party/libxslt/linux/libxslt.spec
index c09f7a9d..810750f 100644
--- a/third_party/libxslt/linux/libxslt.spec
+++ b/third_party/libxslt/linux/libxslt.spec
@@ -126,5 +126,5 @@
 %doc python/tests/*.xsl
 
 %changelog
-* Sat Apr  2 2016 Daniel Veillard <veillard@redhat.com>
+* Sat May 14 2016 Daniel Veillard <veillard@redhat.com>
 - upstream release 1.1.28 see http://xmlsoft.org/XSLT/news.html
diff --git a/third_party/libxslt/linux/libxslt/Makefile b/third_party/libxslt/linux/libxslt/Makefile
index 9ae229b..50b345a 100644
--- a/third_party/libxslt/linux/libxslt/Makefile
+++ b/third_party/libxslt/linux/libxslt/Makefile
@@ -119,7 +119,7 @@
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \
-	"$(DESTDIR)$(xsltincdir)"
+	"$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libxslt_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
@@ -127,7 +127,9 @@
 	pattern.lo templates.lo variables.lo keys.lo numbers.lo \
 	extensions.lo extra.lo functions.lo namespaces.lo imports.lo \
 	attributes.lo documents.lo preproc.lo transform.lo security.lo
-libxslt_la_OBJECTS = $(am_libxslt_la_OBJECTS)
+nodist_libxslt_la_OBJECTS =
+libxslt_la_OBJECTS = $(am_libxslt_la_OBJECTS) \
+	$(nodist_libxslt_la_OBJECTS)
 AM_V_lt = $(am__v_lt_$(V))
 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
 am__v_lt_0 = --silent
@@ -169,7 +171,7 @@
 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libxslt_la_SOURCES)
+SOURCES = $(libxslt_la_SOURCES) $(nodist_libxslt_la_SOURCES)
 DIST_SOURCES = $(libxslt_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -179,7 +181,7 @@
 man3dir = $(mandir)/man3
 NROFF = nroff
 MANS = $(man_MANS)
-HEADERS = $(xsltinc_HEADERS)
+HEADERS = $(nodist_xsltinc_HEADERS) $(xsltinc_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -200,14 +202,14 @@
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /work/cb/src/third_party/libxslt/missing aclocal-1.14
+ACLOCAL = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing aclocal-1.14
 AMTAR = $${TAR-tar}
 AM_DEFAULT_VERBOSITY = 0
 AR = ar
 AS = as
-AUTOCONF = ${SHELL} /work/cb/src/third_party/libxslt/missing autoconf
-AUTOHEADER = ${SHELL} /work/cb/src/third_party/libxslt/missing autoheader
-AUTOMAKE = ${SHELL} /work/cb/src/third_party/libxslt/missing automake-1.14
+AUTOCONF = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoconf
+AUTOHEADER = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing autoheader
+AUTOMAKE = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing automake-1.14
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -228,7 +230,7 @@
 EXEEXT = 
 EXSLT_INCLUDEDIR = -I${includedir}
 EXSLT_LIBDIR = -L${libdir}
-EXSLT_LIBS = -lexslt -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
+EXSLT_LIBS = -lexslt -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm -lgcrypt
 EXTRA_LIBS = 
 FGREP = /bin/grep -F
 GREP = /bin/grep
@@ -253,8 +255,8 @@
 LIBOBJS = 
 LIBS = 
 LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LIBXML_CFLAGS = -I/work/cb/src/third_party/libxml/linux/include
-LIBXML_LIBS = -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl
+LIBXML_CFLAGS = -I/usr/local/google/work/cb/src/third_party/libxml/linux/include
+LIBXML_LIBS = -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl
 LIBXML_REQUIRED_VERSION = 2.6.27
 LIBXML_SRC = ../../libxml/linux/
 LIBXSLT_DEFAULT_PLUGINS_PATH = /usr/local/lib/libxslt-plugins
@@ -269,7 +271,7 @@
 LIPO = 
 LN_S = ln -s
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /work/cb/src/third_party/libxslt/missing makeinfo
+MAKEINFO = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/missing makeinfo
 MANIFEST_TOOL = :
 MKDIR_P = /bin/mkdir -p
 MV = /bin/mv
@@ -297,7 +299,7 @@
 PYTHON_SUBDIR = python
 PYTHON_VERSION = 2.7
 RANLIB = ranlib
-RELDATE = Sat Apr  2 2016
+RELDATE = Sat May 14 2016
 RM = /bin/rm
 SED = /bin/sed
 SET_MAKE = 
@@ -316,18 +318,18 @@
 WITH_TRIO = 0
 WITH_XSLT_DEBUG = 0
 XMLLINT = /usr/bin/xmllint
-XML_CONFIG = /work/cb/src/third_party/libxml/linux/xml2-config
+XML_CONFIG = /usr/local/google/work/cb/src/third_party/libxml/linux/xml2-config
 XSLTPROC = /usr/bin/xsltproc
 XSLTPROCDV = 
 XSLT_INCLUDEDIR = -I${includedir}
 XSLT_LIBDIR = -L${libdir}
-XSLT_LIBS = -lxslt -L/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm
+XSLT_LIBS = -lxslt -L/usr/local/google/work/cb/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -lz -lm -ldl -lm
 XSLT_LOCALE_WINAPI = 0
 XSLT_LOCALE_XLOCALE = 1
-abs_builddir = /work/cb/src/third_party/libxslt/linux/libxslt
-abs_srcdir = /work/cb/src/third_party/libxslt/linux/../libxslt
-abs_top_builddir = /work/cb/src/third_party/libxslt/linux
-abs_top_srcdir = /work/cb/src/third_party/libxslt/linux/..
+abs_builddir = /usr/local/google/work/cb/src/third_party/libxslt/linux/libxslt
+abs_srcdir = /usr/local/google/work/cb/src/third_party/libxslt/linux/../libxslt
+abs_top_builddir = /usr/local/google/work/cb/src/third_party/libxslt/linux
+abs_top_srcdir = /usr/local/google/work/cb/src/third_party/libxslt/linux/..
 ac_ct_AR = ar
 ac_ct_CC = gcc
 ac_ct_DUMPBIN = 
@@ -356,7 +358,7 @@
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
-install_sh = ${SHELL} /work/cb/src/third_party/libxslt/install-sh
+install_sh = ${SHELL} /usr/local/google/work/cb/src/third_party/libxslt/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localedir = ${datarootdir}/locale
@@ -400,10 +402,12 @@
 	transform.h			\
 	security.h			\
 	xsltInternals.h			\
-	xsltconfig.h			\
 	xsltexports.h			\
 	xsltlocale.h
 
+nodist_xsltinc_HEADERS = \
+	xsltconfig.h
+
 libxslt_la_SOURCES = \
 	attrvt.c			\
 	xslt.c				\
@@ -425,10 +429,12 @@
 	transform.c			\
 	security.c			\
 	win32config.h			\
-	xsltwin32config.h		\
 	xsltwin32config.h.in		\
 	libxslt.h
 
+nodist_libxslt_la_SOURCES = \
+	xsltwin32config.h
+
 #LIBXSLT_VERSION_SCRIPT = 
 LIBXSLT_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxslt.syms
 libxslt_la_LIBADD = $(LIBXML_LIBS) $(EXTRA_LIBS)
@@ -611,6 +617,27 @@
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
 	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
+install-nodist_xsltincHEADERS: $(nodist_xsltinc_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(xsltincdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(xsltincdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xsltincdir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(xsltincdir)" || exit $$?; \
+	done
+
+uninstall-nodist_xsltincHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(xsltincdir)'; $(am__uninstall_files_from_dir)
 install-xsltincHEADERS: $(xsltinc_HEADERS)
 	@$(NORMAL_INSTALL)
 	@list='$(xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \
@@ -719,7 +746,7 @@
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(xsltincdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -775,7 +802,8 @@
 
 info-am:
 
-install-data-am: install-man install-xsltincHEADERS
+install-data-am: install-man install-nodist_xsltincHEADERS \
+	install-xsltincHEADERS
 
 install-dvi: install-dvi-am
 
@@ -823,7 +851,7 @@
 ps-am:
 
 uninstall-am: uninstall-libLTLIBRARIES uninstall-man \
-	uninstall-xsltincHEADERS
+	uninstall-nodist_xsltincHEADERS uninstall-xsltincHEADERS
 
 uninstall-man: uninstall-man3
 
@@ -837,13 +865,15 @@
 	install-data-am install-dvi install-dvi-am install-exec \
 	install-exec-am install-exec-hook install-html install-html-am \
 	install-info install-info-am install-libLTLIBRARIES \
-	install-man install-man3 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip install-xsltincHEADERS \
-	installcheck installcheck-am installdirs maintainer-clean \
+	install-man install-man3 install-nodist_xsltincHEADERS \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-xsltincHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
-	uninstall-man uninstall-man3 uninstall-xsltincHEADERS
+	uninstall-man uninstall-man3 uninstall-nodist_xsltincHEADERS \
+	uninstall-xsltincHEADERS
 
 
 xsltproc: all
diff --git a/third_party/libxslt/win32/Makefile.mingw b/third_party/libxslt/win32/Makefile.mingw
index 946ffa3..5b102b38 100644
--- a/third_party/libxslt/win32/Makefile.mingw
+++ b/third_party/libxslt/win32/Makefile.mingw
@@ -72,6 +72,7 @@
 
 # Libxslt object files.
 XSLT_OBJS = $(XSLT_INTDIR)/attributes.o\
+	$(XSLT_INTDIR)/attrvt.o\
 	$(XSLT_INTDIR)/documents.o\
 	$(XSLT_INTDIR)/extensions.o\
 	$(XSLT_INTDIR)/extra.o\
@@ -93,6 +94,7 @@
 
 # Static libxslt object files.
 XSLT_OBJS_A = $(XSLT_INTDIR_A)/attributes.o\
+	$(XSLT_INTDIR_A)/attrvt.o\
 	$(XSLT_INTDIR_A)/documents.o\
 	$(XSLT_INTDIR_A)/extensions.o\
 	$(XSLT_INTDIR_A)/extra.o\
@@ -290,11 +292,11 @@
 APP_LDFLAGS += -Bstatic
 $(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
 	$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $< 
-	$(LD) $(APP_LDFLAGS) -o $@ $(APPLIBS) $(subst .c,.o,$(UTILS_INTDIR)/$(<F))
+	$(LD) $(APP_LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) $(APPLIBS)
 else
 $(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c 
 	$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $< 
-	$(LD) $(APP_LDFLAGS) -o $@ $(APPLIBS) $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) 
+	$(LD) $(APP_LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) $(APPLIBS)
 endif
 
 # Builds xsltproc and friends. Uses the implicit rule for commands.
diff --git a/third_party/libxslt/win32/runtests.py b/third_party/libxslt/win32/runtests.py
index 6986650..4d9aabb 100644
--- a/third_party/libxslt/win32/runtests.py
+++ b/third_party/libxslt/win32/runtests.py
@@ -8,7 +8,9 @@
 
 xsltproc = path.join(os.getcwd(), "win32", "bin.msvc", "xsltproc.exe")
 if not path.isfile(xsltproc):
-    raise FileNotFoundError(xsltproc)
+    xsltproc = path.join(os.getcwd(), "win32", "bin.mingw", "xsltproc.exe")
+    if not path.isfile(xsltproc):
+        raise FileNotFoundError(xsltproc)
 
 def runtests(xsl_dir, xml_dir="."):
     old_dir = os.getcwd()
@@ -68,6 +70,9 @@
 print("## Running exslt math tests")
 runtests("tests/exslt/math")
 
+print("## Running exslt saxon tests")
+runtests("tests/exslt/saxon")
+
 print("## Running exslt sets tests")
 runtests("tests/exslt/sets")
 
diff --git a/tools/android/loading/cloud/backend/report_task_handler.py b/tools/android/loading/cloud/backend/report_task_handler.py
index 1836bbf..ef2335c0 100644
--- a/tools/android/loading/cloud/backend/report_task_handler.py
+++ b/tools/android/loading/cloud/backend/report_task_handler.py
@@ -7,6 +7,7 @@
 
 from googleapiclient import errors
 
+import common.clovis_paths
 from common.loading_trace_database import LoadingTraceDatabase
 import common.google_error_helper as google_error_helper
 from failure_database import FailureDatabase
@@ -134,7 +135,5 @@
 
     if rows:
       tag = clovis_task.BackendParams()['tag']
-      # BigQuery table names can contain only alpha numeric characters and
-      # underscores.
-      table_id = ''.join(c for c in tag if c.isalnum() or c == '_')
+      table_id = common.clovis_paths.GetBigQueryTableID(tag)
       self._StreamRowsToBigQuery(rows, table_id)
diff --git a/tools/android/loading/cloud/backend/trace_task_handler.py b/tools/android/loading/cloud/backend/trace_task_handler.py
index a549c29a..d718ab7 100644
--- a/tools/android/loading/cloud/backend/trace_task_handler.py
+++ b/tools/android/loading/cloud/backend/trace_task_handler.py
@@ -7,6 +7,7 @@
 import re
 import sys
 
+import common.clovis_paths
 from common.clovis_task import ClovisTask
 from common.loading_trace_database import LoadingTraceDatabase
 import controller
@@ -32,10 +33,11 @@
     self._base_path = base_path
     self._is_initialized = False
     self._trace_database = None
+    trace_database_filename = common.clovis_paths.TRACE_DATABASE_PREFIX
     if instance_name:
-      trace_database_filename = 'trace_database_%s.json' % instance_name
+      trace_database_filename += '_%s.json' % instance_name
     else:
-      trace_database_filename = 'trace_database.json'
+      trace_database_filename += '.json'
     self._trace_database_path = os.path.join(base_path, trace_database_filename)
 
     # Initialize the global options that will be used during trace generation.
diff --git a/tools/android/loading/cloud/common/clovis_paths.py b/tools/android/loading/cloud/common/clovis_paths.py
new file mode 100644
index 0000000..03c1b33
--- /dev/null
+++ b/tools/android/loading/cloud/common/clovis_paths.py
@@ -0,0 +1,36 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+# BigQuery path constants.
+
+# Name of the dataset.
+BIGQUERY_DATASET = 'clovis_dataset'
+# Name of the table used as a template for new tables.
+BIGQUERY_TABLE_TEMPLATE = 'report'
+
+
+# Trace path constants.
+
+# Prefix for the loading trace database files.
+TRACE_DATABASE_PREFIX = 'trace_database'
+# Name of the directory where traces are located.
+TRACE_DIR = 'trace'
+
+
+def GetBigQueryTableID(tag):
+  """Returns the ID of the BigQuery table associated with tag. This ID is
+  appended at the end of the table name.
+  """
+  # BigQuery table names can contain only alpha numeric characters and
+  # underscores.
+  return ''.join(c for c in tag if c.isalnum() or c == '_')
+
+
+def GetBigQueryTableURL(project_name, tag):
+  """Returns the full URL for the BigQuery table associated with tag."""
+  table_id = GetBigQueryTableID(tag)
+  table_name = BIGQUERY_DATASET + '.' + BIGQUERY_TABLE_TEMPLATE + '_' + table_id
+  return 'https://bigquery.cloud.google.com/table/%s:%s' % (project_name,
+                                                            table_name)
diff --git a/tools/android/loading/cloud/frontend/README.md b/tools/android/loading/cloud/frontend/README.md
index 7e06898..1384d10c 100644
--- a/tools/android/loading/cloud/frontend/README.md
+++ b/tools/android/loading/cloud/frontend/README.md
@@ -7,7 +7,8 @@
 Visit the application URL in your browser, and upload a JSON dictionary with the
 following keys:
 
--   `action` (string): the action to perform. Only `trace` is supported.
+-   `action` (string): the action to perform. Only `trace` and `report` are
+    supported.
 -   `action_params` (dictionary): the parameters associated to the action.
     See below for more details.
 -   `backend_params` (dictionary): the parameters configuring the backend for
@@ -30,12 +31,22 @@
 
 ### Parameters for the `trace` action
 
+The trace action takes a list of URLs as input and generates a list of traces by
+running Chrome.
+
 -   `urls` (list of strings): the list of URLs to process.
 -   `repeat_count` (integer, optional): the number of traces to be generated
     for each URL. Defaults to 1.
 -   `emulate_device` (string, optional): the device to emulate (e.g. `Nexus 4`).
 -   `emulate_network` (string, optional): the network to emulate.
 
+### Parameters for the `report` action
+
+Finds all the traces in the bucket (specified in the backend parameters) and
+generates a report in BigQuery.
+
+This action has no parameters.
+
 ## Development
 
 ### Design overview
diff --git a/tools/android/loading/cloud/frontend/clovis_frontend.py b/tools/android/loading/cloud/frontend/clovis_frontend.py
index 33f14d9..2a23aa1 100644
--- a/tools/android/loading/cloud/frontend/clovis_frontend.py
+++ b/tools/android/loading/cloud/frontend/clovis_frontend.py
@@ -7,13 +7,16 @@
 import sys
 import time
 
+import cloudstorage
 import flask
 from google.appengine.api import (app_identity, taskqueue)
 from google.appengine.ext import deferred
 from oauth2client.client import GoogleCredentials
 
+import common.clovis_paths
 from common.clovis_task import ClovisTask
 import common.google_instance_helper
+from common.loading_trace_database import LoadingTraceDatabase
 import email_helper
 from memory_logs import MemoryLogs
 
@@ -149,6 +152,89 @@
   clovis_logger.info('Cleanup complete for tag: ' + tag)
 
 
+def SplitClovisTask(task):
+  """Splits a ClovisTask in smaller ClovisTasks.
+
+  Args:
+    task: (ClovisTask) The task to split.
+
+  Returns:
+    list: The list of ClovisTasks.
+  """
+  # For report task, need to find the traces first.
+  if task.Action() == 'report':
+    bucket = task.BackendParams().get('storage_bucket')
+    if not bucket:
+      clovis_logger.error('Missing storage bucket for report task.')
+      return None
+    traces = GetTracePaths(bucket)
+    if not traces:
+      clovis_logger.error('No traces found in bucket: ' + bucket)
+      return None
+    task.ActionParams()['traces'] = traces
+
+  # Compute the split key.
+  split_params_for_action = {'trace': ('urls', 1), 'report': ('traces', 5)}
+  (split_key, slice_size) = split_params_for_action.get(task.Action(),
+                                                        (None, 0))
+  if not split_key:
+    clovis_logger.error('Cannot split task with action: ' + task.Action())
+    return None
+
+  # Split the task using the split key.
+  clovis_logger.debug('Splitting task by: ' + split_key)
+  action_params = task.ActionParams()
+  values = action_params[split_key]
+  sub_tasks = []
+  for i in range(0, len(values), slice_size):
+    sub_task_params = action_params.copy()
+    sub_task_params[split_key] = [v for v in values[i:i+slice_size]]
+    sub_tasks.append(ClovisTask(task.Action(), sub_task_params,
+                                task.BackendParams()))
+  return sub_tasks
+
+
+def GetTracePaths(bucket):
+  """Returns a list of trace files in a bucket.
+
+  Finds and loads the trace databases, and returns their content as a list of
+  paths.
+
+  This function assumes a specific structure for the files in the bucket. These
+  assumptions must match the behavior of the backend:
+  - The trace databases are located under the TRACE_DIR directory in the bucket.
+  - The trace databases files are the only objects with the
+    TRACE_DATABASE_PREFIX prefix in their name.
+
+  Returns:
+    list: The list of paths to traces, as strings.
+  """
+  traces = []
+  prefix = os.path.join('/', bucket, common.clovis_paths.TRACE_DIR,
+                        common.clovis_paths.TRACE_DATABASE_PREFIX)
+  file_stats = cloudstorage.listbucket(prefix)
+
+  for file_stat in file_stats:
+    database_file = file_stat.filename
+    clovis_logger.info('Loading trace database: ' + database_file)
+
+    with cloudstorage.open(database_file) as remote_file:
+      json_string = remote_file.read()
+    if not json_string:
+      clovis_logger.warning('Failed to download: ' + database_file)
+      continue
+
+    database = LoadingTraceDatabase.FromJsonString(json_string)
+    if not database:
+      clovis_logger.warning('Failed to parse: ' + database_file)
+      continue
+
+    for path in database.ToJsonDict():
+      traces.append(path)
+
+  return traces
+
+
 def StartFromJsonString(http_body_str):
   """Main function handling a JSON task posted by the user."""
   # Set up logging.
@@ -162,23 +248,31 @@
     return Render('Invalid JSON task:\n' + http_body_str, memory_logs)
 
   task_tag = task.BackendParams()['tag']
+  clovis_logger.info('Start processing %s task with tag %s.' % (task.Action(),
+                                                                task_tag))
 
   # Create the instance template if required.
   if not CreateInstanceTemplate(task):
     return Render('Template creation failed.', memory_logs)
 
-  # Split the task in smaller tasks.
-  sub_tasks = []
+  # Build the URL where the result will live.
   task_url = None
   if task.Action() == 'trace':
     bucket = task.BackendParams().get('storage_bucket')
     if bucket:
       task_url = 'https://console.cloud.google.com/storage/' + bucket
-    sub_tasks = SplitTraceTask(task)
+  elif task.Action() == 'report':
+    task_url = common.clovis_paths.GetBigQueryTableURL(project_name, task_tag)
   else:
     error_string = 'Unsupported action: %s.' % task.Action()
     clovis_logger.error(error_string)
     return Render(error_string, memory_logs)
+  clovis_logger.info('Task result URL: ' + task_url)
+
+  # Split the task in smaller tasks.
+  sub_tasks = SplitClovisTask(task)
+  if not sub_tasks:
+    return Render('Task split failed.', memory_logs)
 
   if not EnqueueTasks(sub_tasks, task_tag):
     return Render('Task creation failed.', memory_logs)
@@ -201,25 +295,6 @@
       memory_logs)
 
 
-def SplitTraceTask(task):
-  """Splits a tracing task with potentially many URLs into several tracing tasks
-  with few URLs.
-  """
-  clovis_logger.debug('Splitting trace task.')
-  action_params = task.ActionParams()
-  urls = action_params['urls']
-
-  # Split the task in smaller tasks with fewer URLs each.
-  urls_per_task = 1
-  sub_tasks = []
-  for i in range(0, len(urls), urls_per_task):
-    sub_task_params = action_params.copy()
-    sub_task_params['urls'] = [url for url in urls[i:i+urls_per_task]]
-    sub_tasks.append(ClovisTask(task.Action(), sub_task_params,
-                                task.BackendParams()))
-  return sub_tasks
-
-
 def EnqueueTasks(tasks, task_tag):
   """Enqueues a list of tasks in the Google Cloud task queue, for consumption by
   Google Compute Engine.
diff --git a/tools/android/loading/cloud/frontend/requirements.txt b/tools/android/loading/cloud/frontend/requirements.txt
index 483195b..4d9f882 100644
--- a/tools/android/loading/cloud/frontend/requirements.txt
+++ b/tools/android/loading/cloud/frontend/requirements.txt
@@ -1,2 +1,3 @@
 Flask==0.10
 google-api-python-client
+GoogleAppEngineCloudStorageClient
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml
index f7b2820..e47b6d4 100644
--- a/tools/metrics/actions/actions.xml
+++ b/tools/metrics/actions/actions.xml
@@ -8754,6 +8754,20 @@
   </description>
 </action>
 
+<action name="MobileNTP.Snippets.ScrolledAboveTheFold">
+  <owner>mastiz@chromium.org</owner>
+  <description>
+    Android: User scrolled above the fold (not reading snippets cards).
+  </description>
+</action>
+
+<action name="MobileNTP.Snippets.ScrolledBelowTheFold">
+  <owner>mastiz@chromium.org</owner>
+  <description>
+    Android: User scrolled to the snippet cards below the fold.
+  </description>
+</action>
+
 <action name="MobileNTP.Snippets.ShowLess">
   <owner>knn@chromium.org</owner>
   <description>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index d6e3b42e..84a2a43a 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -12341,6 +12341,12 @@
   </summary>
 </histogram>
 
+<histogram name="Event.Latency.X11EventSource.UpdateServerTime"
+    units="microseconds">
+  <owner>thomasanderson@chromium.org</owner>
+  <summary>Time to request a timestamp from the X server.</summary>
+</histogram>
+
 <histogram name="Event.PassiveListeners" enum="EventResultType">
   <owner>dtapuska@chromium.org</owner>
   <summary>
@@ -35567,6 +35573,35 @@
   <summary>Events related to Google CAPTCHA pages being seen by users.</summary>
 </histogram>
 
+<histogram
+    name="PageLoad.DocumentTiming.NavigationToDOMContentLoadedEventFired"
+    units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    DOMContentLoaded event is fired, for main frame documents.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.DocumentTiming.NavigationToFirstLayout" units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    first layout is performed, for main frame documents.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.DocumentTiming.NavigationToLoadEventFired" units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    load event is fired, for main frame documents.
+  </summary>
+</histogram>
+
 <histogram name="PageLoad.EventCounts" enum="PageLoadEvent">
   <owner>csharrison@chromium.org</owner>
   <owner>bmcquade@chromium.org</owner>
@@ -35670,6 +35705,88 @@
   </summary>
 </histogram>
 
+<histogram name="PageLoad.PaintTiming.NavigationToFirstContentfulPaint"
+    units="ms">
+  <owner>ksakamoto@chromium.org</owner>
+  <summary>
+    The time from navigation start to first &quot;contentful&quot; paint.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.PaintTiming.NavigationToFirstImagePaint" units="ms">
+  <owner>ksakamoto@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    first image is painted, for main frame documents. For images that render
+    progressively, this is recorded as soon as any image pixels have been drawn.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.PaintTiming.NavigationToFirstPaint" units="ms">
+  <owner>ksakamoto@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    first paint is performed, for main frame documents.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.PaintTiming.NavigationToFirstTextPaint" units="ms">
+  <owner>ksakamoto@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    first non-blank text is painted, for main frame documents.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.PaintTiming.ParseStartToFirstContentfulPaint"
+    units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time from when the HTML parser started, to when the page first
+    paints content.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.ParseTiming.NavigationToParseStart" units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time from navigation timing's navigation start to the time the
+    parser started, for main frame documents.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.ParseTiming.ParseBlockedOnScriptLoad" units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time that the HTML parser spent blocked on the load of scripts,
+    for main frame documents that finished parsing.
+  </summary>
+</histogram>
+
+<histogram
+    name="PageLoad.ParseTiming.ParseBlockedOnScriptLoadFromDocumentWrite"
+    units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time that the HTML parser spent blocked on the load of scripts
+    inserted from document.write, for main frame documents that finished
+    parsing.
+  </summary>
+</histogram>
+
+<histogram name="PageLoad.ParseTiming.ParseDuration" units="ms">
+  <owner>bmcquade@chromium.org</owner>
+  <owner>csharrison@chromium.org</owner>
+  <summary>
+    Measures the time that the HTML parser was active, for main frame documents
+    that finished parsing.
+  </summary>
+</histogram>
+
 <histogram name="PageLoad.Timing.NavigationToDOMContentLoadedEventFired"
     units="ms">
   <owner>bmcquade@chromium.org</owner>
@@ -35751,7 +35868,9 @@
   <owner>csharrison@chromium.org</owner>
   <summary>
     Measures the time from navigation timing's navigation start to the time the
-    DOMContentLoaded event is fired, for main frame documents.
+    DOMContentLoaded event is fired, for main frame documents. This metric is
+    being phased out in favor of the PageLoad.DocumentTiming equivalent and will
+    be deprecated in M54.
   </summary>
 </histogram>
 
@@ -35778,7 +35897,9 @@
 <histogram name="PageLoad.Timing2.NavigationToFirstContentfulPaint" units="ms">
   <owner>ksakamoto@chromium.org</owner>
   <summary>
-    The time from navigation start to first &quot;contentful&quot; paint.
+    The time from navigation start to first &quot;contentful&quot; paint.  This
+    metric is being phased out in favor of the PageLoad.PaintTiming equivalent
+    and will be deprecated in M54.
   </summary>
 </histogram>
 
@@ -35798,6 +35919,8 @@
     Measures the time from navigation timing's navigation start to the time the
     first image is painted, for main frame documents. For images that render
     progressively, this is recorded as soon as any image pixels have been drawn.
+    This metric is being phased out in favor of the PageLoad.PaintTiming
+    equivalent and will be deprecated in M54.
   </summary>
 </histogram>
 
@@ -35806,7 +35929,9 @@
   <owner>csharrison@chromium.org</owner>
   <summary>
     Measures the time from navigation timing's navigation start to the time the
-    first layout is performed, for main frame documents.
+    first layout is performed, for main frame documents. This metric is being
+    phased out in favor of the PageLoad.DocumentTiming equivalent and will be
+    deprecated in M54.
   </summary>
 </histogram>
 
@@ -35814,7 +35939,9 @@
   <owner>ksakamoto@chromium.org</owner>
   <summary>
     Measures the time from navigation timing's navigation start to the time the
-    first paint is performed, for main frame documents.
+    first paint is performed, for main frame documents. This metric is being
+    phased out in favor of the PageLoad.PaintTiming equivalent and will be
+    deprecated in M54.
   </summary>
 </histogram>
 
@@ -35822,7 +35949,9 @@
   <owner>ksakamoto@chromium.org</owner>
   <summary>
     Measures the time from navigation timing's navigation start to the time the
-    first non-blank text is painted, for main frame documents.
+    first non-blank text is painted, for main frame documents. This metric is
+    being phased out in favor of the PageLoad.PaintTiming equivalent and will be
+    deprecated in M54.
   </summary>
 </histogram>
 
@@ -35831,7 +35960,9 @@
   <owner>csharrison@chromium.org</owner>
   <summary>
     Measures the time from navigation timing's navigation start to the time the
-    load event is fired, for main frame documents.
+    load event is fired, for main frame documents. This metric is being phased
+    out in favor of the PageLoad.DocumentTiming equivalent and will be
+    deprecated in M54.
   </summary>
 </histogram>
 
@@ -35850,7 +35981,9 @@
   <owner>csharrison@chromium.org</owner>
   <summary>
     Measures the time that the HTML parser spent blocked on the load of scripts,
-    for main frame documents that finished parsing.
+    for main frame documents that finished parsing. This metric is being phased
+    out in favor of the PageLoad.ParseTiming equivalent and will be deprecated
+    in M54.
   </summary>
 </histogram>
 
@@ -35872,7 +36005,8 @@
   <summary>
     Measures the time that the HTML parser spent blocked on the load of scripts
     inserted from document.write, for main frame documents that finished
-    parsing.
+    parsing. This metric is being phased out in favor of the
+    PageLoad.ParseTiming equivalent and will be deprecated in M54.
   </summary>
 </histogram>
 
@@ -35881,7 +36015,8 @@
   <owner>csharrison@chromium.org</owner>
   <summary>
     Measures the time that the HTML parser was active, for main frame documents
-    that finished parsing.
+    that finished parsing. This metric is being phased out in favor of the
+    PageLoad.ParseTiming equivalent and will be deprecated in M54.
   </summary>
 </histogram>
 
@@ -35890,7 +36025,8 @@
   <owner>csharrison@chromium.org</owner>
   <summary>
     Measures the time from when the HTML parser started, to when the page first
-    paints content.
+    paints content. This metric is being phased out in favor of the
+    PageLoad.PaintTiming equivalent and will be deprecated in M54.
   </summary>
 </histogram>
 
@@ -51590,6 +51726,13 @@
   </summary>
 </histogram>
 
+<histogram name="Snackbar.Shown" enum="SnackbarIdentifier">
+  <owner>ianwen@chromium.org</owner>
+  <summary>
+    Records how many times a particular snackbar was shown to the user.
+  </summary>
+</histogram>
+
 <histogram name="SoftwareReporter.Cleaner.HasCompleted" enum="SRTCompleted">
   <owner>mad@chromium.org</owner>
   <summary>
@@ -85968,6 +86111,24 @@
   <int value="5" label="RGBA"/>
 </enum>
 
+<enum name="SnackbarIdentifier" type="int">
+  <int value="-2" label="TEST_SNACKBAR"/>
+  <int value="-1" label="UNKNOWN"/>
+  <int value="0" label="BOOKMARK_ADDED"/>
+  <int value="1" label="BOOKMARK_DELETE_UNDO"/>
+  <int value="2" label="NTP_MOST_VISITED_DELETE_UNDO"/>
+  <int value="3" label="OFFLINE_PAGE_RELOAD"/>
+  <int value="4" label="AUTO_LOGIN"/>
+  <int value="5" label="OMNIBOX_GEOLOCATION"/>
+  <int value="6" label="LOFI"/>
+  <int value="7" label="DATA_USE_STARTED"/>
+  <int value="8" label="DATA_USE_ENDED"/>
+  <int value="9" label="DOWNLOAD_SUCCEEDED"/>
+  <int value="10" label="DOWNLOAD_FAILED"/>
+  <int value="11" label="TAB_CLOSE_UNDO"/>
+  <int value="12" label="TAB_CLOSE_ALL_UNDO"/>
+</enum>
+
 <enum name="SnippetsInteractions" type="int">
   <int value="0" label="Snippets were shown to the user"/>
   <int value="1" label="User scrolled through the snippets"/>
@@ -85975,6 +86136,7 @@
   <int value="3" label="User swiped a snippet away (obsolete)"/>
   <int value="4" label="User swiped a snippet away after visiting"/>
   <int value="5" label="User swiped a snippet away without visiting"/>
+  <int value="6" label="User scrolled below the fold (max once per NTP load)"/>
 </enum>
 
 <enum name="SocketStreamConnectionType" type="int">
@@ -91549,6 +91711,9 @@
              help loading-dev to understand the impact of logging metrics at
              the end of a page load."/>
   <affected-histogram name="PageLoad.Timing2.NavigationToFirstContentfulPaint"/>
+  <obsolete>
+    Deprecated by PageLoad.PaintTiming.NavigationToFirstContentfulPaint.
+  </obsolete>
 </histogram_suffixes>
 
 <histogram_suffixes name="IndexedDBLevelDBErrnoMethods" separator=".">
@@ -93553,11 +93718,28 @@
       name="PageLoad.Clients.DocWrite.Evaluator.Timing2.ParseDuration"/>
   <affected-histogram
       name="PageLoad.Clients.ServiceWorker.Timing2.NavigationToFirstContentfulPaint"/>
+  <affected-histogram
+      name="PageLoad.DocumentTiming.NavigationToDOMContentLoadedEventFired"/>
+  <affected-histogram name="PageLoad.DocumentTiming.NavigationToFirstLayout"/>
+  <affected-histogram
+      name="PageLoad.DocumentTiming.NavigationToLoadEventFired"/>
   <suffix name="Background"
       label="The page was backgrounded at least once from navigation start to
              this event."/>
   <affected-histogram name="PageLoad.Events.Committed"/>
   <affected-histogram name="PageLoad.Events.Provisional"/>
+  <affected-histogram
+      name="PageLoad.PaintTiming.NavigationToFirstContentfulPaint"/>
+  <affected-histogram name="PageLoad.PaintTiming.NavigationToFirstImagePaint"/>
+  <affected-histogram name="PageLoad.PaintTiming.NavigationToFirstPaint"/>
+  <affected-histogram name="PageLoad.PaintTiming.NavigationToFirstTextPaint"/>
+  <affected-histogram
+      name="PageLoad.PaintTiming.ParseStartToFirstContentfulPaint"/>
+  <affected-histogram name="PageLoad.ParseTiming.NavigationToParseStart"/>
+  <affected-histogram name="PageLoad.ParseTiming.ParseBlockedOnScriptLoad"/>
+  <affected-histogram
+      name="PageLoad.ParseTiming.ParseBlockedOnScriptLoadFromDocumentWrite"/>
+  <affected-histogram name="PageLoad.ParseTiming.ParseDuration"/>
   <affected-histogram name="PageLoad.Timing2.NavigationToCommit"/>
   <affected-histogram
       name="PageLoad.Timing2.NavigationToDOMContentLoadedEventFired"/>
diff --git a/ui/app_list/presenter/BUILD.gn b/ui/app_list/presenter/BUILD.gn
index af36b7a..2977236b 100644
--- a/ui/app_list/presenter/BUILD.gn
+++ b/ui/app_list/presenter/BUILD.gn
@@ -30,6 +30,10 @@
     "//ui/compositor",
     "//ui/gfx/geometry",
     "//ui/views",
+
+    # Temporary dependency to fix compile flake in http://crbug.com/611898.
+    # TODO(tapted): Remove once http://crbug.com/612382 is fixed.
+    "//ui/accessibility:ax_gen",
   ]
 }
 
diff --git a/ui/app_list/presenter/app_list_presenter.gyp b/ui/app_list/presenter/app_list_presenter.gyp
index 98e0274f..3b178b8a 100644
--- a/ui/app_list/presenter/app_list_presenter.gyp
+++ b/ui/app_list/presenter/app_list_presenter.gyp
@@ -21,6 +21,10 @@
         '../../gfx/gfx.gyp:gfx_geometry',
         '../../views/views.gyp:views',
         '../app_list.gyp:app_list',
+
+        # Temporary dependency to fix compile flake in http://crbug.com/611898.
+        # TODO(tapted): Remove once http://crbug.com/612382 is fixed.
+        '../../accessibility/accessibility.gyp:ax_gen',
       ],
       'defines': [
         'APP_LIST_PRESENTER_IMPLEMENTATION',
diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc
index ff791a1..2d51c41 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -120,7 +120,6 @@
   item->AddObserver(this);
 
   set_context_menu_controller(this);
-  set_request_focus_on_press(false);
 
   SetAnimationDuration(0);
 }
diff --git a/ui/app_list/views/folder_header_view.cc b/ui/app_list/views/folder_header_view.cc
index d7d2d78..ba09c032d 100644
--- a/ui/app_list/views/folder_header_view.cc
+++ b/ui/app_list/views/folder_header_view.cc
@@ -73,6 +73,7 @@
                                     views::ImageButton::ALIGN_MIDDLE);
     AddChildView(back_button_);
     views::Button::ConfigureDefaultFocus(back_button_);
+    back_button_->set_request_focus_on_press(true);
     back_button_->SetAccessibleName(
         ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
             IDS_APP_LIST_FOLDER_CLOSE_FOLDER_ACCESSIBILE_NAME));
diff --git a/ui/events/BUILD.gn b/ui/events/BUILD.gn
index 1b6c3467..af10fbf 100644
--- a/ui/events/BUILD.gn
+++ b/ui/events/BUILD.gn
@@ -348,6 +348,7 @@
 test("events_unittests") {
   sources = [
     "android/scroller_unittest.cc",
+    "blink/blink_event_util_unittest.cc",
     "cocoa/events_mac_unittest.mm",
     "event_dispatcher_unittest.cc",
     "event_processor_unittest.cc",
diff --git a/ui/events/platform/x11/x11_event_source.cc b/ui/events/platform/x11/x11_event_source.cc
index a50cf739..76c7f48c 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -4,10 +4,12 @@
 
 #include "ui/events/platform/x11/x11_event_source.h"
 
+#include <X11/Xatom.h>
 #include <X11/XKBlib.h>
 #include <X11/Xlib.h>
 
 #include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
 #include "ui/events/devices/x11/device_data_manager_x11.h"
 #include "ui/events/devices/x11/touch_factory_x11.h"
 #include "ui/events/event_utils.h"
@@ -78,6 +80,13 @@
   DeviceDataManagerX11::GetInstance()->UpdateDeviceList(display);
 }
 
+Bool IsPropertyNotifyForTimestamp(Display* display,
+                                  XEvent* event,
+                                  XPointer arg) {
+  return event->type == PropertyNotify &&
+         event->xproperty.window == *reinterpret_cast<Window*>(arg);
+}
+
 }  // namespace
 
 X11EventSource* X11EventSource::instance_ = nullptr;
@@ -87,6 +96,7 @@
     : delegate_(delegate),
       display_(display),
       last_seen_server_time_(CurrentTime),
+      dummy_initialized_(false),
       continue_stream_(true) {
   DCHECK(!instance_);
   instance_ = this;
@@ -100,6 +110,8 @@
 X11EventSource::~X11EventSource() {
   DCHECK_EQ(this, instance_);
   instance_ = nullptr;
+  if (dummy_initialized_)
+    XDestroyWindow(display_, dummy_window_);
 }
 
 // static
@@ -134,6 +146,38 @@
   } while (event.type != MapNotify);
 }
 
+Time X11EventSource::UpdateLastSeenServerTime() {
+  base::TimeTicks start = base::TimeTicks::Now();
+
+  DCHECK(display_);
+
+  if (!dummy_initialized_) {
+    // Create a new Window and Atom that will be used for the property change.
+    dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_),
+                                        0, 0, 1, 1, 0, 0, 0);
+    dummy_atom_ = XInternAtom(display_, "CHROMIUM_TIMESTAMP", False);
+    XSelectInput(display_, dummy_window_, PropertyChangeMask);
+    dummy_initialized_ = true;
+  }
+
+  // Make a no-op property change on |dummy_window_|.
+  XChangeProperty(display_, dummy_window_, dummy_atom_, XA_STRING, 8,
+                  PropModeAppend, nullptr, 0);
+
+  // Observe the resulting PropertyNotify event to obtain the timestamp.
+  XEvent event;
+  XIfEvent(display_, &event, IsPropertyNotifyForTimestamp,
+           reinterpret_cast<XPointer>(&dummy_window_));
+
+  last_seen_server_time_ = event.xproperty.time;
+
+  UMA_HISTOGRAM_CUSTOM_COUNTS(
+      "Event.Latency.X11EventSource.UpdateServerTime",
+      (base::TimeTicks::Now() - start).InMicroseconds(), 0,
+      base::TimeDelta::FromMilliseconds(1).InMicroseconds(), 50);
+  return last_seen_server_time_;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // X11EventSource, protected
 
diff --git a/ui/events/platform/x11/x11_event_source.h b/ui/events/platform/x11/x11_event_source.h
index 5b74e635..99594e6 100644
--- a/ui/events/platform/x11/x11_event_source.h
+++ b/ui/events/platform/x11/x11_event_source.h
@@ -16,6 +16,7 @@
 using Time = unsigned long;
 using XEvent = union _XEvent;
 using XID = unsigned long;
+using XWindow = unsigned long;
 
 namespace ui {
 
@@ -62,6 +63,10 @@
   XDisplay* display() { return display_; }
   Time last_seen_server_time() const { return last_seen_server_time_; }
 
+  // Explicitly asks the X11 server for the current timestamp, and updates
+  // |last_seen_server_time| with this value.
+  Time UpdateLastSeenServerTime();
+
   void StopCurrentEventStream();
   void OnDispatcherListChanged();
 
@@ -85,6 +90,11 @@
   // The last timestamp seen in an XEvent.
   Time last_seen_server_time_;
 
+  // State necessary for UpdateLastSeenServerTime
+  bool dummy_initialized_;
+  XWindow dummy_window_;
+  XAtom dummy_atom_;
+
   // Keeps track of whether this source should continue to dispatch all the
   // available events.
   bool continue_stream_ = true;
diff --git a/ui/message_center/views/message_center_button_bar.cc b/ui/message_center/views/message_center_button_bar.cc
index 305aa04..bf4b040 100644
--- a/ui/message_center/views/message_center_button_bar.cc
+++ b/ui/message_center/views/message_center_button_bar.cc
@@ -77,7 +77,6 @@
     SetTooltipText(resource_bundle.GetLocalizedString(text_id));
 
   Button::ConfigureDefaultFocus(this);
-  set_request_focus_on_press(false);
 
   SetFocusPainter(views::Painter::CreateSolidFocusPainter(
       kFocusBorderColor,
diff --git a/ui/message_center/views/notification_button.cc b/ui/message_center/views/notification_button.cc
index 26a35bf..b043ba2 100644
--- a/ui/message_center/views/notification_button.cc
+++ b/ui/message_center/views/notification_button.cc
@@ -28,7 +28,6 @@
   // background changes to show touch feedback
   set_background(views::Background::CreateSolidBackground(
       kNotificationBackgroundColor));
-  set_request_focus_on_press(false);
   set_notify_enter_exit_on_child(true);
   SetLayoutManager(
       new views::BoxLayout(views::BoxLayout::kHorizontal,
diff --git a/ui/message_center/views/notifier_settings_view.cc b/ui/message_center/views/notifier_settings_view.cc
index 978e3b9..c8482d5 100644
--- a/ui/message_center/views/notifier_settings_view.cc
+++ b/ui/message_center/views/notifier_settings_view.cc
@@ -306,7 +306,6 @@
     // Create a more-info button that will be right-aligned.
     learn_more_ = new views::ImageButton(this);
     learn_more_->SetFocusPainter(CreateFocusPainter());
-    learn_more_->set_request_focus_on_press(false);
     views::Button::ConfigureDefaultFocus(learn_more_);
 
     ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -584,6 +583,7 @@
     notifier_group_selector_->SetFocusPainter(nullptr);
     notifier_group_selector_->set_animate_on_state_change(false);
     views::Button::ConfigureDefaultFocus(notifier_group_selector_);
+    notifier_group_selector_->set_request_focus_on_press(true);
     contents_title_view->AddChildView(notifier_group_selector_);
   }
 
diff --git a/ui/message_center/views/padded_button.cc b/ui/message_center/views/padded_button.cc
index 45c4827..8b66648 100644
--- a/ui/message_center/views/padded_button.cc
+++ b/ui/message_center/views/padded_button.cc
@@ -15,7 +15,6 @@
 PaddedButton::PaddedButton(views::ButtonListener* listener)
     : views::ImageButton(listener) {
   Button::ConfigureDefaultFocus(this);
-  set_request_focus_on_press(false);
   SetFocusPainter(views::Painter::CreateSolidFocusPainter(
       kFocusBorderColor,
       gfx::Insets(1, 2, 2, 2)));
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index 89cc907..02791d33 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -29,6 +29,7 @@
   button_border->set_insets(gfx::Insets(0, 0, 0, 2));
   SetBorder(std::move(button_border));
   Button::ConfigureDefaultFocus(this);
+  set_request_focus_on_press(true);
 
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
 
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 527a6d8..133f73f0 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -442,7 +442,7 @@
       animate_on_state_change_(true),
       is_throbbing_(false),
       triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON),
-      request_focus_on_press_(true),
+      request_focus_on_press_(false),
       ink_drop_delegate_(nullptr),
       notify_action_(NOTIFY_ON_RELEASE),
       has_ink_drop_action_on_click_(false),
diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h
index 7720b44..82ea752 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -60,7 +60,7 @@
   int triggerable_event_flags() const { return triggerable_event_flags_; }
 
   // Sets whether |RequestFocus| should be invoked on a mouse press. The default
-  // is true.
+  // is false.
   void set_request_focus_on_press(bool value) {
     request_focus_on_press_ = value;
   }
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index 3623bc2..6b42e0e 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -216,6 +216,7 @@
   SetFocusPainter(nullptr);
   SetHorizontalAlignment(gfx::ALIGN_CENTER);
   Button::ConfigureDefaultFocus(this);
+  set_request_focus_on_press(true);
   SetMinSize(gfx::Size(PlatformStyle::kMinLabelButtonWidth,
                        PlatformStyle::kMinLabelButtonHeight));
 
diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc
index b8a804748..fa13372a 100644
--- a/ui/views/examples/button_example.cc
+++ b/ui/views/examples/button_example.cc
@@ -45,6 +45,7 @@
 
   label_button_ = new LabelButton(this, ASCIIToUTF16(kLabelButton));
   Button::ConfigureDefaultFocus(label_button_);
+  label_button_->set_request_focus_on_press(true);
   container->AddChildView(label_button_);
 
   styled_button_ = new LabelButton(this, ASCIIToUTF16("Styled Button"));
@@ -72,6 +73,7 @@
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
   image_button_ = new ImageButton(this);
   Button::ConfigureDefaultFocus(image_button_);
+  image_button_->set_request_focus_on_press(true);
   image_button_->SetImage(ImageButton::STATE_NORMAL,
                           rb.GetImageNamed(IDR_CLOSE).ToImageSkia());
   image_button_->SetImage(ImageButton::STATE_HOVERED,
diff --git a/ui/views/examples/tree_view_example.cc b/ui/views/examples/tree_view_example.cc
index b67f5194..50a13576 100644
--- a/ui/views/examples/tree_view_example.cc
+++ b/ui/views/examples/tree_view_example.cc
@@ -48,10 +48,13 @@
   tree_view_->SetController(this);
   add_ = new LabelButton(this, ASCIIToUTF16("Add"));
   Button::ConfigureDefaultFocus(add_);
+  add_->set_request_focus_on_press(true);
   remove_ = new LabelButton(this, ASCIIToUTF16("Remove"));
   Button::ConfigureDefaultFocus(remove_);
+  remove_->set_request_focus_on_press(true);
   change_title_ = new LabelButton(this, ASCIIToUTF16("Change Title"));
   Button::ConfigureDefaultFocus(change_title_);
+  change_title_->set_request_focus_on_press(true);
 
   GridLayout* layout = new GridLayout(container);
   container->SetLayoutManager(layout);
diff --git a/ui/views/examples/tree_view_example.h b/ui/views/examples/tree_view_example.h
index 759efaf..fb0ccf93 100644
--- a/ui/views/examples/tree_view_example.h
+++ b/ui/views/examples/tree_view_example.h
@@ -15,6 +15,7 @@
 
 namespace views {
 
+class LabelButton;
 class MenuRunner;
 class TreeView;
 
@@ -70,9 +71,9 @@
   TreeView* tree_view_;
 
   // Control buttons to modify the model.
-  Button* add_;
-  Button* remove_;
-  Button* change_title_;
+  LabelButton* add_;
+  LabelButton* remove_;
+  LabelButton* change_title_;
 
   typedef ui::TreeNodeWithValue<int> NodeType;
 
diff --git a/ui/views/examples/widget_example.cc b/ui/views/examples/widget_example.cc
index 8d9e12c..8ef5e61 100644
--- a/ui/views/examples/widget_example.cc
+++ b/ui/views/examples/widget_example.cc
@@ -88,6 +88,7 @@
                                 int tag) {
   LabelButton* button = new LabelButton(this, ASCIIToUTF16(label));
   Button::ConfigureDefaultFocus(button);
+  button->set_request_focus_on_press(true);
   button->set_tag(tag);
   container->AddChildView(button);
 }
diff --git a/ui/views/touchui/touch_selection_menu_runner_views.cc b/ui/views/touchui/touch_selection_menu_runner_views.cc
index eff31f9..84a0a02 100644
--- a/ui/views/touchui/touch_selection_menu_runner_views.cc
+++ b/ui/views/touchui/touch_selection_menu_runner_views.cc
@@ -161,7 +161,6 @@
   LabelButton* button = new LabelButton(this, label);
   button->SetMinSize(gfx::Size(kMenuButtonMinWidth, kMenuButtonMinHeight));
   Button::ConfigureDefaultFocus(button);
-  button->set_request_focus_on_press(false);
   const gfx::FontList& font_list =
       ui::ResourceBundle::GetSharedInstance().GetFontList(
           ui::ResourceBundle::SmallFont);
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.cc b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
index 5ab84f9..8ec4b1e 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -43,7 +43,7 @@
     : xdisplay_(gfx::GetXDisplay()),
       x_root_window_(DefaultRootWindow(xdisplay_)),
       x_active_window_(None),
-      wm_user_time_ms_(0),
+      wm_user_time_ms_(CurrentTime),
       current_window_(None),
       current_window_active_state_(NOT_ACTIVE),
       atom_cache_(xdisplay_, kAtomsToCache),
@@ -91,6 +91,10 @@
 
     // If the window is not already active, send a hint to activate it
     if (x_active_window_ != window) {
+      if (wm_user_time_ms_ == CurrentTime) {
+        set_wm_user_time_ms(
+            ui::X11EventSource::GetInstance()->UpdateLastSeenServerTime());
+      }
       XEvent xclient;
       memset(&xclient, 0, sizeof(xclient));
       xclient.type = ClientMessage;
@@ -120,6 +124,18 @@
   }
 }
 
+void X11DesktopHandler::set_wm_user_time_ms(Time time_ms) {
+  if (time_ms != CurrentTime) {
+    int64_t event_time_64 = time_ms;
+    int64_t time_difference = wm_user_time_ms_ - event_time_64;
+    // Ignore timestamps that go backwards. However, X server time is a 32-bit
+    // millisecond counter, so if the time goes backwards by more than half the
+    // range of the 32-bit counter, treat it as a rollover.
+    if (time_difference < 0 || time_difference > (UINT32_MAX >> 1))
+      wm_user_time_ms_ = time_ms;
+  }
+}
+
 void X11DesktopHandler::DeactivateWindow(::Window window) {
   if (!IsActiveWindow(window))
     return;
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.h b/ui/views/widget/desktop_aura/x11_desktop_handler.h
index 947040e43..47a1ff1 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.h
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.h
@@ -15,6 +15,7 @@
 #include "base/macros.h"
 #include "ui/aura/env_observer.h"
 #include "ui/events/platform/platform_event_dispatcher.h"
+#include "ui/events/platform/x11/x11_event_source.h"
 #include "ui/gfx/x/x11_atom_cache.h"
 #include "ui/gfx/x/x11_types.h"
 #include "ui/views/views_export.h"
@@ -36,12 +37,8 @@
 
   // Gets/sets the X11 server time of the most recent mouse click, touch or
   // key press on a Chrome window.
-  int wm_user_time_ms() const {
-    return wm_user_time_ms_;
-  }
-  void set_wm_user_time_ms(unsigned long time_ms) {
-    wm_user_time_ms_ = time_ms;
-  }
+  int wm_user_time_ms() const { return wm_user_time_ms_; }
+  void set_wm_user_time_ms(Time time_ms);
 
   // Sends a request to the window manager to activate |window|.
   // This method should only be called if the window is already mapped.
@@ -95,7 +92,7 @@
 
   // The X11 server time of the most recent mouse click, touch, or key press
   // on a Chrome window.
-  unsigned long wm_user_time_ms_;
+  Time wm_user_time_ms_;
 
   // The active window according to X11 server.
   ::Window current_window_;