Conditionalize building GLX and EGL tests and headers.

Note that the generated code is still generated, they just aren't
built and installed.  The goal with that is that someone could take
the built .c and .h files and drop it into their own project, if they
want to avoid shared libs.
macos/v1.5.9
Eric Anholt 11 years ago
parent 19053c4d6f
commit 0d7d26537d
  1. 21
      configure.ac
  2. 5
      include/epoxy/Makefile.am
  3. 12
      src/Makefile.am
  4. 27
      test/Makefile.am
  5. 13
      test/headerguards.c
  6. 6
      test/miscdefines.c

@ -47,6 +47,27 @@ AC_DISABLE_STATIC
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
case $host_os in
mingw*)
build_egl=no
build_glx=no
;;
*)
build_egl=yes
build_glx=yes
;;
esac
AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes)
if test x$build_egl = xyes; then
AC_DEFINE([BUILD_EGL], [1], [build EGL tests])
fi
AM_CONDITIONAL(BUILD_GLX, test x$build_glx = xyes)
if test x$build_glx = xyes; then
AC_DEFINE([BUILD_GLX], [1], [build GLX tests])
fi
if test "x$GCC" = xyes; then if test "x$GCC" = xyes; then
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])

@ -26,5 +26,10 @@ epoxyinclude_HEADERS = \
$(GLX_INCLUDES) \ $(GLX_INCLUDES) \
$() $()
if BUILD_EGL
EGL_INCLUDES = egl.h EGL_INCLUDES = egl.h
endif
if BUILD_GLX
GLX_INCLUDES = glx.h GLX_INCLUDES = glx.h
endif

@ -30,10 +30,18 @@ lib_LTLIBRARIES = libepoxy.la
epoxyinclude_DATA = \ epoxyinclude_DATA = \
$(GENERATED_GL_INCLUDES) \ $(GENERATED_GL_INCLUDES) \
$(GENERATED_GLX_INCLUDES) \ $(INSTALL_GLX_INCLUDES) \
$(GENERATED_EGL_INCLUDES) \ $(INSTALL_EGL_INCLUDES) \
$() $()
if BUILD_EGL
INSTALL_EGL_INCLUDES = $(GENERATED_EGL_INCLUDES)
endif
if BUILD_GLX
INSTALL_GLX_INCLUDES = $(GENERATED_GLX_INCLUDES)
endif
GENERATED_GL_INCLUDES = \ GENERATED_GL_INCLUDES = \
$(builddir)/../include/epoxy/gl_generated.h \ $(builddir)/../include/epoxy/gl_generated.h \
$(builddir)/../include/epoxy/gl_generated_vtable_defines.h \ $(builddir)/../include/epoxy/gl_generated_vtable_defines.h \

@ -21,8 +21,8 @@
EPOXY = $(builddir)/../src/libepoxy.la EPOXY = $(builddir)/../src/libepoxy.la
check_LTLIBRARIES = \ check_LTLIBRARIES = \
libegl_common.la \ $(EGL_LIBS) \
libglx_common.la \ $(GLX_LIBS) \
$() $()
libegl_common_la_SOURCES = \ libegl_common_la_SOURCES = \
@ -41,17 +41,33 @@ AM_CPPFLAGS = \
$(X11_CFLAGS) $(X11_CFLAGS)
TESTS = \ TESTS = \
$(EGL_TESTS) \
$(GLX_TESTS) \
headerguards \
miscdefines \
$()
check_PROGRAMS = $(TESTS)
if BUILD_EGL
EGL_TESTS = \
egl_has_extension_nocontext \ egl_has_extension_nocontext \
$()
EGL_LIBS = libegl_common.la
endif
if BUILD_GLX
GLX_TESTS = \
glx_beginend \ glx_beginend \
glx_public_api \ glx_public_api \
glx_public_api_core \ glx_public_api_core \
glx_glxgetprocaddress_nocontext \ glx_glxgetprocaddress_nocontext \
glx_has_extension_nocontext \ glx_has_extension_nocontext \
headerguards \
miscdefines \
$() $()
check_PROGRAMS = $(TESTS) GLX_LIBS = libglx_common.la
endif
egl_has_extension_nocontext_LDFLAGS = $(X11_LIBS) $(EPOXY) libegl_common.la egl_has_extension_nocontext_LDFLAGS = $(X11_LIBS) $(EPOXY) libegl_common.la
egl_has_extension_nocontext_DEPENDENCIES = libegl_common.la egl_has_extension_nocontext_DEPENDENCIES = libegl_common.la
@ -70,4 +86,3 @@ glx_glxgetprocaddress_nocontext_DEPENDENCIES = libglx_common.la
glx_has_extension_nocontext_LDFLAGS = $(X11_LIBS) $(EPOXY) libglx_common.la glx_has_extension_nocontext_LDFLAGS = $(X11_LIBS) $(EPOXY) libglx_common.la
glx_has_extension_nocontext_DEPENDENCIES = libglx_common.la glx_has_extension_nocontext_DEPENDENCIES = libglx_common.la

@ -21,16 +21,29 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <config.h>
#include <epoxy/gl.h> #include <epoxy/gl.h>
#ifdef BUILD_EGL
#include <epoxy/egl.h> #include <epoxy/egl.h>
#endif
#ifdef BUILD_GLX
#include <epoxy/glx.h> #include <epoxy/glx.h>
#endif
#ifdef BUILD_EGL
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#endif
#ifdef BUILD_GLX
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glext.h> #include <GL/glext.h>
#include <GL/glx.h> #include <GL/glx.h>
#include <GL/glxext.h> #include <GL/glxext.h>
#endif
int main(int argc, char **argv) int main(int argc, char **argv)
{ {

@ -22,8 +22,14 @@
*/ */
#include <epoxy/gl.h> #include <epoxy/gl.h>
#ifdef BUILD_EGL
#include <epoxy/egl.h> #include <epoxy/egl.h>
#endif
#ifdef BUILD_GLX
#include <epoxy/glx.h> #include <epoxy/glx.h>
#endif
#if GL_VERSION_3_2 != 1 #if GL_VERSION_3_2 != 1
#error bad GL_VERSION_3_2 #error bad GL_VERSION_3_2

Loading…
Cancel
Save