Add Android.mk to aid integration with FirefoxOS

This Android.mk is part of "Bug 831147 - Integrate apitrace into build"
https://bugzilla.mozilla.org/831147 With this addition, when apitrace
sources are cloned into B2GROOT/external/apitrace, then the FirefoxOS
build system picks up automatically apitrace, compiles and installs it
to the right place.

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
Set tabstops to 8
Move default argument to declaration.

Fixes clang warning "addition of default argument on redeclaration makes
this constructor a default constructor".
Revert "Remove os::thread_specific_ptr"

This reverts commit 67ec200baea241d55bea33c43fd5194d90d9e401.
os: Simplify os::thread_specific_ptr.

Instead of mimicking boost::thread_specific_ptr, do something that allows
to mimick more closely compiler TLS support.
os: Fallback to OS TLS when compiler does not support it (issue #120).
glretrace: Use OS_THREAD_SPECIFIC_PTR on glws_cocoa.mm
os: Bring back the compiler TLS check.

Seems better than fiddling with pre-defined macros.
os: Be more concise with the semantics of os::abort.
d3dretrace: Give more helpful messages for d3d debug layer failures.
Add option '--snapshot-format=' to allow write raw RGB directly to stdout

This allows to create h264 video with gstreamer-vaapi very fast, and save much more disk space.
Using PNM format couldn't reach same performance, since PNM decoding seems inefficient in gstreamer.
Following are some experiment data with smokinguns demo 1920x1080 resolution on Ivybridge:
1. With png saving, it runs at around 4.5 FPS, which has compression rate 5.15x against raw RGB data
   Reference command:
        glretrace -s snapshot/ smokinguns.trace

2. Using PNM with gstreamer-vaapi, which could run at around 9 FPS, which has compression rate
   485x (QP dependent) against raw RGB data.
   Reference command:
        glretrace -s - smokinguns.trace | gst-launch-0.10 fdsrc blocksize=409600 ! queue \
        ! pnmdec ! videoparse format=rgb width=1920 height=1080 ! ffmpegcolorspace ! queue \
	! vaapiupload direct-rendering=0 ! queue ! vaapiencodeh264 ! filesink location=xxx.264

3. With following command that directly write raw RGB stream and encoded into H264 video, it
   runs at around 18.5 FPS, which has compression rate 485x (QP dependent) against raw RGB data,
   Reference command:
        glretrace --snapshot-format=RGB -s - smokinguns.trace | gst-launch-0.10 fdsrc blocksize=409600 ! queue \
	! videoparse format=rgb width=1920 height=1080 ! queue ! ffmpegcolorspace ! queue \
	! vaapiupload direct-rendering=0 ! queue ! vaapiencodeh264 ! filesink location=xxx.264

v2: Use --snapshot-format= option to specify which format is used to write to stdout output
v3: Use enum for snapshotFormat and add example in README.markdown
gltrace: Recognize GL_*_INTEGER in _gl_format_channels (issue #123).
gltrace: Handle even more formats in _gl_format_channels().

The valid formats can be found by grepping 'Accepted by the <format> ' in
OpenGL extension specs.

These were all I could find.
scripts/convert: Allow converting from PIX.
d3d9trace: Fix wrapping of IDirect3DSwapChain9Ex pointers.

PIX will complain without this.
convert: Add a few notes.
glstate: Fallback to GLX when there is no current EGL context (issue #124).
Tag a new release 4.0.

Mostly for the benefit of those who prefer a tagged release instead of
master.

Anyway, it has been too long since the last one.  The output of
`git shortlog..HEAD` was impressive.  Thanks to all of them who
contributed.
d3d9trace: Fix D3DPT_TRIANGLEFAN vertex count computation.
Fix Android target build on Apple hosts.

Currently CMakeLists.txt forces CMAKE_C_COMPILER to clang whenever
compiling on an APPLE host.  Unfortunately, this prevents the
android.toolchain.cmake script from selecting the correct cross
compiler. See [line 1136][].

To avoid this problem, only force clang if ANDROID_NDK is not set.  This
is one of the variables used by Android.mk.

[line 1136]: https://github.com/apitrace/apitrace/blob/master/cmake/toolchain/android.toolchain.cmake#L1136