glean: use piglit-util and initialize GLEW.

Later patches in this series will introduce a new mechanism for
binding Piglit to GL functions, called piglit-dispatch.  This
mechanism will reside in the piglit-util library, and will require
initialization.

To ease the transition, this patch causes Glean to link to
piglit-util, and initializes GLEW using the glewInit() function.  When
GLEW is replaced with piglit-dispatch, the call to glewInit() will
serve to initialize new piglit-dispatch mechanism.
Add glewInit() calls to glx tests.

Previously these tests didn't initialize GLEW, presumably because they
only use GL 1.0 functions, and those functions bypass GLEW.  But once
we switch to using piglit-dispatch instead of GLEW, we will need to
initialize it in order for any GL functions to work.  This patch adds
a call to glewInit() in the place where a call to
piglit_dispatch_default_init() will eventually be needed.
Add glewInit() calls to GLX_ARB_create_context tests.

Previously these tests didn't initialize GLEW, presumably because they
only use GL 1.0 functions, and those functions bypass GLEW.  But once
we switch to using piglit-dispatch instead of GLEW, we will need to
initialize it in order for any GL functions to work.  This patch adds
a call to glewInit() in the place where a call to
piglit_dispatch_default_init() will eventually be needed.
New spec files
Fix spec files
WIP: piglit-dispatch: Code generation script

This is the first in a series of patches that replaces GLEW with a new
mechanism called "piglit-dispatch".  This patch adds the script that
will be used by piglit-dispatch to build its generated code.

The input to the code generation script is a set of XML files
describing the GL API, in the same form as used by Mesa.  For the time
being, these files can be found at
git://github.com/stereotype441/glapi.git.

v2: Ensure that a copyright notice appears in the generated file.

Whoops, wasn't actually uniquifying the functions

Sort enums by value and eliminate duplicates.

Declare types in a uniform way

Experiment: generate code from json

Remove unused gen_dispatch stuff

Add parse_glspec.py

parse_glspec fixup

WIP: piglit-dispatch: CMake code to build generated files

This patch adds the necessary build infrastructure to build
piglit-dispatch's two generated files, generated_dispatch.c and
generated_dispatch.h.

These files can be built by invoking "make piglit_dispatch_gen" from
the toplevel source directory.

Rework code generation CMake

Cmake fixup

Generated code

WIP: piglit-dispatch: Remaining infrastructure

Previous patches introduced code generation for the auto-generated
portions of the piglit-dispatch mechanism.  This patch supplies the
remaining hand-written code, which includes:

- Code to initialize piglit-dispatch.

- The actions to be taken when looking up a function, when function
  lookup fails, or when a function is unsupported.

- Code to determine whether piglit-dispatch has been initialized,
  which GL version is supported, and whether a given extension is
  supported.

- Definitions of basic GL types.

Mac workaround

Mac workaround

Mac GetProcAddress

Mac GetProcAddress fix

Mac GetProcAddress fix

Mac workaround for APIENTRY/GLAPIENTRY

Oops, GLhalfNV needed

Change to piglit_dispatch_function_ptr

Use other function pointers in the conventional way too

Use APIENTRY everywhere

Split out resolve functions and make tables

Add piglit_dispatch_resolve_function

Regenerate
Switch to using piglit-dispatch instead of GLEW.

Previous patches set up the piglit-dispatch infrastructure but did not
use it.  This patch enables piglit-dispatch and uses it instead of
GLEW.

No piglit regressions on Intel SandyBridge (Linux).

Make piglit_get_proc_address point to piglit_dispatch_resolve_function()
Remove GLEW.

This patch removes the files glew.c and glew.h, which are no longer
used.  The "piglit-dispatch" mechanism is used instead.
WIP: glean: use piglit_get_proc_address()

Previously glean got the address of GL functions by directly calling
an OS-specific function (e.g. glXGetProcAddressARB(), dlsym(), or
wglGetProcAddress()).  This patch changes it to use
piglit_get_proc_address(), which is OS-independent.  This paves the
way for switching to the piglit-dispatch mechanism of accessing GL
functions.

TODO: split out stuff?
Check initialized when resolving a function by name
Correction: StencilFuncSeparateATI is not the same as StencilFuncSeparate
Fix more aliases