openfimg: Add support for Android build

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: Get around missing qsort_r() in Bionic

Refactor vertex element sorting to use normal qsort().

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
st/egl: Include drm_gallium public header

It is needed for DRM specific extensions, such as custom surface formats
and perform operations.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
util: Include in Android builds

This patch fixes Android build failures by including src/util directory
in compilation. Files inside of this directory are compiled into
libmesa_util static library and linked with resulting libGLES_mesa.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
st/mesa: Generate format_info.c in Android builds

Current Android makefiles lack generation of format_info.c, which is
a dependency of main/format.c. This patch adds necessary code to
Android.gen.mk.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
st/mesa: Fix paths used in Android builds

With current makefiles the build fails because source and build paths
are generated incorrectly. With Android build system the top_srcdir and
top_builddir variables are undefined and all paths are relative to where
Android.mk is located. This ends up with path likes
external/mesa/src/mesa/src/mesa/ for both source and build paths, which
are obviously wrong.

This patch fixes this by overriding resulting SRCDIR and BUILDDIR
variables with empty string, so that paths end up being relative to
Android.mk file again. Appending correct build path to generated files
is already done in Android.gen.mk.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Android: Silence warnings about void pointer arithmetics

Standalone Mesa compilation does not complain about this, so make
Android consistent.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>