diff options
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 |