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>
wflinfo: Fix glGetStringi on Mali

On Mali EGL 1.4, you can't obtain non-extension functions (including
OpenGL ES 3.0 functions) with eglGetProcAddress. You must use dlsym.

This patch carefully avoids breaking glGetStringi on other platforms,
which may expose glGetStringi dynamically (as in eglGetProcAddress) but
not statically (as in dlsym).

Fixes #20: https://github.com/waffle-gl/waffle/pull/20
Fixes: chromium:428061 [https://code.google.com/p/chromium/issues/detail?id=428061]
See: https://github.com/anholt/libepoxy/issues/21
Reported-by: Frank Henigman <fjhenigman@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch 'maint-1.4'

* maint-1.4:
  wflinfo: Fix glGetStringi on Mali
Merge branch 'evelikov/remove-libgbm-libgl-libdeps-v2'

* cooking/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
    Minor conflict due to 9a4f7c0, the libglapi workaround.