Encode URLs when passing to JS: issues #12216 and #11035.

 * Use QUrl::toEncoded() instead of QUrl::toString() to compute
   WebPage.url, WebPage.frameUrl, the first argument to an
   onNavigationRequested hook, and the 'url' property of the object
   passed to an onResourceError hook.  This makes them consistent with
   the data passed to the onResourceRequested, onResourceReceived,
   and onResourceTimeout hooks, and with the semantics of WebPage.open(),
   WebPage.openUrl(), and the cookie jar.  (Issue #12216.)

 * Use m_currentFrame->baseUrl() instead of m_currentFrame->url() for
   WebPage.frameUrl; this is a partial workaround for a bug in QtWebKit
   which is the root cause of issue #11035.  Noticed while attempting to
   test the above changes.

 * Take care not to mangle the encoding of the url passed to the
   WebServer.listen callback function.  Necessary in order to test the
   above changes: not only should JS receive %-encoded URLs, the server's
   encoding of non-ASCII characters in URLs should be preserved; to test
   this thoroughly, a heinously non-Unicode-compatible encoding (Shift_JIS)
   is deliberately used for the URLs in all the new tests.
Add phantom.resolveRelativeUrl and phantom.fullyDecodeUrl.

These utility functions make it easier to work with encoded URLs.
See issues #12216 and #11035.
Improve handling of crash dumps (issue #12236).

 * If the environment variable PHANTOMJS_DISABLE_CRASH_DUMPS
   is set to any value, do not initialize Breakpad.

 * On Mac and Linux, if the environment variable TMPDIR is set,
   put the crash dumps there instead of in /tmp.

 * On Windows, %TEMP% was already being honored, but streamline
   the code for that.

 * Move the code that initializes Breakpad, and the code to print
   the crash messages, to their own module (src/crashdump.{h,cpp})
   and RAII class (CrashHandler).

 * Better wording of the crash message, particularly in the case where
   Breakpad failed to write a minidump file; update URL of crash-reporting
   guide.

 * Generally less repetitive code.  (Still way too many #ifdefs.)
Convert Utils into a namespace and remove dead code.

Post-cleanup for #12236.
Merge branch 'encode-all-the-urls'
Make it possible to disable ALSA and PulseAudio in qtbase. (#12518)

Cherry-picked configure script changes from upstream Qt5.3.
More adjustments to system library usage on Unix (incl. Darwin) (#12518).

The affected libraries are fontconfig, freetype, harfbuzz, libpng, libjpeg,
sqlite, pcre, and zlib.

* On Darwin, by default, fontconfig is disabled and all of the other
  libraries are bundled.
* On non-Darwin, by default, fontconfig is enabled and system-provided
  freetype, libpng, libjpeg, and zlib are used.  Harfbuzz, pcre, and sqlite
  continue to be bundled.

* Individual libraries from the above list may now be enabled or disabled
  on the build.sh command line with e.g. --freetype=system or
  --freetype=bundled.

* The existing --system-qtdeps, --system-qt, --system-qtwebkit options
  have been renamed --qtdeps=system, --qt=system, --qtwebkit=system
  respectively.  New option --qtdeps=bundled forces all available
  bundled libraries to be used.

Also:

* Slight adjustments to organization of preconfig.sh.
* Can now disable PulseAudio and ALSA.
* Directly link OpenSSL instead of loading it at runtime.
* Clarify the pkg-config situation (it must be enabled if and only if
  sqlite comes from the system).
Explicitly suppress video and audio when building QtWebkit. (#12518)

This mostly matters when system sqlite is selected; that has the side
effect of enabling pkg-config which in turn causes QtWebkit to detect
the presence of system GStreamer and/or QtMultimedia and turn video on.
This way, the build is consistent across the board.
Merge branch 'config-tweaks-round-2'