gbm: work around mesa linkage issue

Mesa drivers such as i965_dri.so use symbols from libglapi but do not
pull in libglapi (https://bugs.freedesktop.org/show_bug.cgi?id=57702)
so dlopen libglapi before we need it.

Fixes #21: https://github.com/waffle-gl/waffle/pull/21
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch 'cooking/evelikov/wgl'

* cooking/evelikov/wgl: (53 commits)
  man: spelling fix
  man: spelling/grammar fix
  README: fix spelling typo
  wgl: s/glX/wgl/ in error message
  README: spelling fixes
  wflinfo: call get_proc_address after make_current
  cmake: ensure waffle-static name differs from the shared one
  cmake: Set default location for all artifacts to top-level directories
  core/tests: silence the final MSVC warning
  core/tests: correctly store the threads exit codes
  wgl: use correct dtor in wgl_window_priv_create error path
  core: silence MSVC compiler warning
  wgl: strings.h does not exist in MSVC
  cmake: misc fixes and cleanups
  test/gl_basic_test: implement windows version for run_testsuite()
  test/gl_basic_test: add PLATFORM_WGL support/tests
  test/gl_basic_test: deduplicate gl_(debug,fwdcompat) tests
  test/gl_basic_test: introduce linux_gles* tests
  test/gl_basic_test: introduce linux_gl(30_core - 43_compat) tests
  test/gl_basic_test: use all_gl_(10-21) tests for all platforms
  ...
pkg/archlinux: use configure autodetection

Since waffle 1.4 we have autodetection at configure time.
Let's use it and drop a couple of lines PKGBUILD magic.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
pkg/archlinux: waffle does not link against libegl

As such demote libegl to makedepend/optdepent, so that
one can build waffle, and optionally use x11_egl/gbm/wayland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
gbm: fetch the libgbm function pointers at wgbm_platform_init

Thus way with a follow up commit we can use them and eliminate the
link dependency from waffle.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
gbm: drop explicit linking against libgbm.so (v2)

Use the function pointers stored in wgbm_platform, to communicate
with the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
pkg/archlinux: demote libgbm to (make|opt)depend

Waffle no longer links or has hard requirement of the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glx: fetch the libGL function pointers at glx_platform_create

Thus way with a follow up commit we can use them and eliminate the
link dependency from waffle.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glx: drop explicit linking against libGL.so

Use the function pointers stored in glx_platform, to communicate
with the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch 'maint-1.4'

* maint-1.4:
  gbm: work around mesa linkage issue
Merge branch 'master' into next

* master:
  gbm: work around mesa linkage issue
Merge branch 'evelikov/remove-libgbm-libgl-libdeps-v2' into next

* evelikov/remove-libgbm-libgl-libdeps-v2:
  glx: drop explicit linking against libGL.so
  glx: fetch the libGL function pointers at glx_platform_create
  pkg/archlinux: demote libgbm to (make|opt)depend
  gbm: drop explicit linking against libgbm.so (v2)
  gbm: fetch the libgbm function pointers at wgbm_platform_init
  pkg/archlinux: waffle does not link against libegl
  pkg/archlinux: use configure autodetection

Conflicts:
  src/waffle/gbm/wgbm_display.c
    Due to 9a4f7c0 fjhenigman's workaround that dlopens libglapi.