diff options
author | Kyle Brenneman <[email protected]> | 2016-05-11 14:01:53 -0400 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-05-30 16:29:49 +0100 |
commit | 22a9e00aab66d3dd6890e9eaac3f429c0ddec17e (patch) | |
tree | cd4568b2381dd25cfa611bc6bc676016d89b6f2f /configure.ac | |
parent | cee459d84de7533d0e0a74a37f7fc4c0f2b77bcf (diff) |
glx: Implement the libglvnd interface.
With reference to the libglvnd branch:
https://cgit.freedesktop.org/mesa/mesa/log/?h=libglvnd
This is a squashed commit containing all of Kyle's commits, all but two
of Emil's commits (to follow), and a small fixup from myself to mark the
rest of the glX* functions as _GLX_PUBLIC so they are not exported when
building for libglvnd. I (ajax) squashed them together both for ease of
review, and because most of the changes are un-useful intermediate
states representing the evolution of glvnd's internal API.
Co-author: Emil Velikov <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index fc0b1db2eb5..35fe99a0176 100644 --- a/configure.ac +++ b/configure.ac @@ -528,6 +528,34 @@ else DEFINES="$DEFINES -DNDEBUG" fi +DEFAULT_GL_LIB_NAME=GL + +dnl +dnl Libglvnd configuration +dnl +AC_ARG_ENABLE([libglvnd], + [AS_HELP_STRING([--enable-libglvnd], + [Build for libglvnd @<:@default=disabled@:>@])], + [enable_libglvnd="$enableval"], + [enable_libglvnd=no]) +AM_CONDITIONAL(USE_LIBGLVND_GLX, test "x$enable_libglvnd" = xyes) +if test "x$enable_libglvnd" = xyes ; then + dnl XXX: update once we can handle more than libGL/glx. + dnl Namely: we should error out if neither of the glvnd enabled libraries + dnl are built + if test "x$enable_glx" = xno; then + AC_MSG_ERROR([cannot build libglvnd without GLX]) + fi + + if test "x$enable_xlib_glx" = xyes; then + AC_MSG_ERROR([cannot build libgvnd when Xlib-GLX is enabled]) + fi + + PKG_CHECK_MODULES([GLVND], libglvnd >= 0.1.0) + DEFINES="${DEFINES} -DUSE_LIBGLVND_GLX=1" + DEFAULT_GL_LIB_NAME=GLX_mesa +fi + dnl dnl Check if linker supports -Bsymbolic dnl @@ -625,6 +653,23 @@ esac AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes) +DEFAULT_GL_LIB_NAME=GL + +dnl +dnl Libglvnd configuration +dnl +AC_ARG_ENABLE([libglvnd], + [AS_HELP_STRING([--enable-libglvnd], + [Build for libglvnd @<:@default=disabled@:>@])], + [enable_libglvnd="$enableval"], + [enable_libglvnd=no]) +AM_CONDITIONAL(USE_LIBGLVND_GLX, test "x$enable_libglvnd" = xyes) +#AM_COND_IF([USE_LIBGLVND_GLX], [DEFINES="${DEFINES} -DUSE_LIBGLVND_GLX=1"]) +if test "x$enable_libglvnd" = xyes ; then + DEFINES="${DEFINES} -DUSE_LIBGLVND_GLX=1" + DEFAULT_GL_LIB_NAME=GLX_mesa +fi + dnl dnl library names dnl @@ -662,13 +707,13 @@ AC_ARG_WITH([gl-lib-name], [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@], [specify GL library name @<:@default=GL@:>@])], [GL_LIB=$withval], - [GL_LIB=GL]) + [GL_LIB="$DEFAULT_GL_LIB_NAME"]) AC_ARG_WITH([osmesa-lib-name], [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@], [specify OSMesa library name @<:@default=OSMesa@:>@])], [OSMESA_LIB=$withval], [OSMESA_LIB=OSMesa]) -AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL]) +AS_IF([test "x$GL_LIB" = xyes], [GL_LIB="$DEFAULT_GL_LIB_NAME"]) AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa]) dnl |