Allow enabling and disabling GLX support, part II

After doing this for Meson in commit fc014fa1, let's do the same dance
for the Autotools build.
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent 476851ba41
commit 2b6f01b008
  1. 111
      configure.ac
  2. 7
      test/Makefile.am

@ -58,41 +58,71 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
# uintptr_t to a void *") by default. Kill that. # uintptr_t to a void *") by default. Kill that.
XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion]) XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
has_znow=yes AC_ARG_ENABLE([glx],
[AC_HELP_STRING([--enable-glx=@<:@auto,yes,no@:>@], [Enable GLX support @<:@default=auto@:>@])],
case $host_os in [enable_glx=$enableval],
mingw*) [enable_glx=auto])
build_egl=no
build_glx=no # GLX can be used on different platforms, so we expose a
build_wgl=yes # configure time switch to enable or disable it; in case
# On windows, the DLL has to have all of its functions # the "auto" default value is set, we only enable GLX
# resolved at link time, so we have to link directly aginst # support on Linux and Unix
# opengl32.dll. But that's the only GL provider, anyway. AS_CASE([$enable_glx],
EPOXY_LINK_LIBS="-lopengl32" [auto], [
AS_CASE([$host_os],
# Testing our built windows binaries requires that they be run [mingw*], [build_glx=no],
# under wine. Yeah, we should be nice and autodetect, but [darwin*], [build_glx=no],
# there's lots of missing autodetection for the testsuite [android*], [build_glx=no],
# (like checking for EGL and GLX libs in non-windows.). [build_glx=yes])
AC_SUBST([LOG_COMPILER], [wine]) ],
;;
darwin*) [yes], [
build_egl=no build_glx=yes
build_glx=no ],
build_wgl=no
build_apple=yes [no], [
has_znow=no build_glx=no
EPOXY_LINK_LIBS="" ],
;;
*) [AC_MSG_ERROR([Invalid value "$enable_glx" for option "--enable-glx"])]
build_egl=yes ])
build_glx=yes
build_wgl=no # The remaining platform specific API for GL/GLES are enabled
# On platforms with dlopen, we load everything dynamically and # depending on the platform we're building for
# don't link against a specific window system or GL implementation. AS_CASE([$host_os],
EPOXY_LINK_LIBS="" [mingw*], [
;; build_egl=no
esac build_wgl=yes
has_znow=yes
# On windows, the DLL has to have all of its functions
# resolved at link time, so we have to link directly aginst
# opengl32.dll. But that's the only GL provider, anyway.
EPOXY_LINK_LIBS="-lopengl32"
# Testing our built windows binaries requires that they be run
# under wine. Yeah, we should be nice and autodetect, but
# there's lots of missing autodetection for the testsuite
# (like checking for EGL and GLX libs in non-windows.).
AC_SUBST([LOG_COMPILER], [wine])
],
[darwin*], [
build_egl=no
build_wgl=no
build_apple=yes
has_znow=no
EPOXY_LINK_LIBS=""
],
[
build_egl=yes
build_wgl=no
has_znow=yes
# On platforms with dlopen, we load everything dynamically and
# don't link against a specific window system or GL implementation.
EPOXY_LINK_LIBS=""
]
)
AC_SUBST(EPOXY_LINK_LIBS) AC_SUBST(EPOXY_LINK_LIBS)
@ -161,9 +191,14 @@ AS_CASE(["$host"],
AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([VISIBILITY_CFLAGS])
PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no]) if test x$build_glx = xyes; then
if test x$x11 = xno -a x$build_glx = xyes; then PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support]) if test x$x11 = xno -a x$build_glx = xyes; then
AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
fi
AC_DEFINE(ENABLE_GLX, [1], [Whether GLX support is enabled])
else
x11=no
fi fi
AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes) AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)

@ -72,8 +72,11 @@ check_PROGRAMS = $(TESTS)
if BUILD_EGL if BUILD_EGL
EGL_TESTS = \ EGL_TESTS = \
$()
if HAVE_X11
EGL_TESTS += \
egl_has_extension_nocontext \ egl_has_extension_nocontext \
egl_gl \
egl_gles2_without_glx \ egl_gles2_without_glx \
$() $()
@ -83,6 +86,7 @@ endif
EGL_UTIL_LIB = libegl_common.la EGL_UTIL_LIB = libegl_common.la
endif endif
endif
if BUILD_GLX if BUILD_GLX
if HAS_ZNOW if HAS_ZNOW
@ -93,6 +97,7 @@ if BUILD_EGL
if BUILD_GLX if BUILD_GLX
if !BUILD_APPLE if !BUILD_APPLE
EGL_AND_GLX_TESTS = \ EGL_AND_GLX_TESTS = \
egl_gl \
egl_and_glx_different_pointers_egl_glx \ egl_and_glx_different_pointers_egl_glx \
egl_and_glx_different_pointers_egl \ egl_and_glx_different_pointers_egl \
egl_and_glx_different_pointers_glx \ egl_and_glx_different_pointers_glx \

Loading…
Cancel
Save