|
|
|
@ -58,41 +58,71 @@ AC_CHECK_HEADER([KHR/khrplatform.h], |
|
|
|
|
# uintptr_t to a void *") by default. Kill that. |
|
|
|
|
XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion]) |
|
|
|
|
|
|
|
|
|
has_znow=yes |
|
|
|
|
|
|
|
|
|
case $host_os in |
|
|
|
|
mingw*) |
|
|
|
|
build_egl=no |
|
|
|
|
build_glx=no |
|
|
|
|
build_wgl=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_glx=no |
|
|
|
|
build_wgl=no |
|
|
|
|
build_apple=yes |
|
|
|
|
has_znow=no |
|
|
|
|
EPOXY_LINK_LIBS="" |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
build_egl=yes |
|
|
|
|
build_glx=yes |
|
|
|
|
build_wgl=no |
|
|
|
|
# On platforms with dlopen, we load everything dynamically and |
|
|
|
|
# don't link against a specific window system or GL implementation. |
|
|
|
|
EPOXY_LINK_LIBS="" |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
AC_ARG_ENABLE([glx], |
|
|
|
|
[AC_HELP_STRING([--enable-glx=@<:@auto,yes,no@:>@], [Enable GLX support @<:@default=auto@:>@])], |
|
|
|
|
[enable_glx=$enableval], |
|
|
|
|
[enable_glx=auto]) |
|
|
|
|
|
|
|
|
|
# GLX can be used on different platforms, so we expose a |
|
|
|
|
# configure time switch to enable or disable it; in case |
|
|
|
|
# the "auto" default value is set, we only enable GLX |
|
|
|
|
# support on Linux and Unix |
|
|
|
|
AS_CASE([$enable_glx], |
|
|
|
|
[auto], [ |
|
|
|
|
AS_CASE([$host_os], |
|
|
|
|
[mingw*], [build_glx=no], |
|
|
|
|
[darwin*], [build_glx=no], |
|
|
|
|
[android*], [build_glx=no], |
|
|
|
|
[build_glx=yes]) |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[yes], [ |
|
|
|
|
build_glx=yes |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[no], [ |
|
|
|
|
build_glx=no |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[AC_MSG_ERROR([Invalid value "$enable_glx" for option "--enable-glx"])] |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
# The remaining platform specific API for GL/GLES are enabled |
|
|
|
|
# depending on the platform we're building for |
|
|
|
|
AS_CASE([$host_os], |
|
|
|
|
[mingw*], [ |
|
|
|
|
build_egl=no |
|
|
|
|
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) |
|
|
|
|
|
|
|
|
@ -161,15 +191,29 @@ AS_CASE(["$host"], |
|
|
|
|
|
|
|
|
|
AC_SUBST([VISIBILITY_CFLAGS]) |
|
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no]) |
|
|
|
|
if test x$x11 = xno -a x$build_glx = xyes; then |
|
|
|
|
AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support]) |
|
|
|
|
if test x$build_glx = xyes; then |
|
|
|
|
PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no]) |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes) |
|
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no]) |
|
|
|
|
|
|
|
|
|
# Variables for the pkg-config file; AC_SUBST does not do `test` substitutions, |
|
|
|
|
# so we need to specify the boolean values here |
|
|
|
|
AS_IF([test x$build_glx = xyes], [epoxy_has_glx=1], [epoxy_has_glx=0]) |
|
|
|
|
AS_IF([test x$build_egl = xyes], [epoxy_has_egl=1], [epoxy_has_egl=0]) |
|
|
|
|
AS_IF([test x$build_wgl = xyes], [epoxy_has_wgl=1], [epoxy_has_wgl=0]) |
|
|
|
|
AC_SUBST(epoxy_has_glx) |
|
|
|
|
AC_SUBST(epoxy_has_egl) |
|
|
|
|
AC_SUBST(epoxy_has_wgl) |
|
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([ |
|
|
|
|
epoxy.pc |
|
|
|
|
Makefile |
|
|
|
|