Commit Graph
82 Commits
Author SHA1 Message Date
Emmanuele Bassi 2432daf4cf Drop unnecessary inclusion of "config.h"
The WGL tests should not include "config.h", since we're trying to test
the use of Epoxy, not its internals.
2017-02-08 17:52:32 +00:00
Emmanuele Bassi 2b6f01b008 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.
2017-02-06 15:58:20 +00:00
Emmanuele Bassi 476851ba41 Allow enabling and disabling GLX support
Currently, GLX support in libepoxy at build time is hard coded, but
various platforms have expressed their preference for having a
configure-time option for it.

For instance:

 - various embedded distributors do not ship with X11, but wish to use
   libraries that depend on libepoxy now that Wayland is available
 - distributors for macOS still wish to retain the ability to ship
   their software with X11 enabled

By default, we want epoxy to build with GLX enabled pretty much
everywhere it makes sense, since it's only a build-time option and it's
not a run-time dependency.
2017-02-06 13:48:53 +00:00
Emmanuele Bassi 59318edf64 build: Rework the build rules for generated files in Meson
Instead of using a generator and having to deal with tweaking the
inclusion paths, we can use a custom target rule, which will do the
right thing and put the generate files where we expect them to be.

Due to how Meson and Ninja work we need to be a bit more careful as to
how we deal with dependencies and generated files, especially since
Epoxy is built on the assumption that the only inclusion path for the
headers lies under the 'include' sub-directory.

First of all, we need to split the dispatch table generation into two
separate steps, one for the headers and one for the source files.

Additionally, we need to munge the paths of the non-generated headers
so that we reference them by their correct path.

These changes are necessary to ensure that Epoxy can be built on a
system without Epoxy installed already; the previous Meson-based build
system relied on the headers being installed in a system directory.
2017-01-25 12:36:20 +00:00
Emmanuele Bassi 08cc4d021d build: Add Meson build files
Meson is a Python-based build system that generates build rules of
Ninja, Visual Studio, and XCode. It's designed to be fast, and have a
small, non-Turing complete language to describe the build process,
tests, and dependencies. It's simpler than CMake, and faster than
autotools.

As a direct comparison in terms of speed, three build and check runs for
libepoxy from a clean Git repository clone yield these results on my
Kabylake Core i7 7500U (nproc=4):

- Autotools (make)
Run #1 (cold)   real: 22.384s, user: 20.011s, sys: 3.689s
Run #2 (warm)   real: 22.429s, user: 20.220s, sys: 3.708s
Run #3 (warm)   real: 22.068s, user: 19.743s, sys: 3.594s

- Meson (ninja)
Run #1 (cold)   real: 5.932s, user:  9.371s, sys: 1.625s
Run #2 (warm)   real: 6.273s, user: 10.066,  sys: 1.740s
Run #3 (warm)   real: 5.796s, user:  9.233s, sys: 1.607s

Which means that Meson and ninja are approximately 4x faster than
autotools.

In terms of simplicity, the autotools build takes six files and a total
of 645 lines; Meson requires 3 files, and 361 lines to achieve the same
result. Additionally, Meson automatically builds in a separate build
directory and does not leave files inside the source directory; and Meson
does not use libtool.

Since Meson is quite new and still actively developed, we're going to
leave the autotools build in place for a while, with the intention of
switching to Meson in the future.
2017-01-25 12:36:20 +00:00
Emmanuele Bassi 4fe238e023 tests/wgl: Use the right array offsets
And avoid an out of bounds access warning.
2017-01-25 12:28:29 +00:00
Emmanuele Bassi 6b68ddeaa0 build: Skip GLESv1 tests if there's no GLESv1
It's pretty much pointless to build and run tests for a library that we
know is not available.

The Meson build already skips the GLES 1.0 test, so let's make the
Autotools build do the same.
2017-01-25 12:28:29 +00:00
Adam Jackson 2aec628eb0 test: Fix dlwrap on ppc64 and s390x
These have dlsym versions of GLIBC_2.3 and GLIBC_2.2, respectively.

Signed-off-by: Adam Jackson <[email protected]>
2017-01-25 12:28:29 +00:00
Olivier Blin f62c9d92d0 dlwrap: add GLIBC_2.4 version to be able to run tests from ARM
See sysdeps/unix/sysv/linux/arm/libdl.abilist in glibc

Signed-off-by: Emmanuele Bassi <[email protected]>
2016-12-07 15:09:02 +00:00
Emmanuele Bassi 8dead45cb3 Revert all changes since 8bbc0d40
Most of the changes that happened after commit 8bbc0d40 broke epoxy
pretty much irreparably because of the CMake build and the attempt at
making libepoxy a static library that can be copy-pasted into another
project without generating files.

Since all the commits are entangled, and are full of unrelated changes,
we cannot simply do a localized set of reverts; instead, we need to hit
the reset button.

From this point forward, we're going to improve libepoxy's build while
attempting to keep the existing build system working. This may mean
reinstating the CMake build system at a later date.
2016-12-07 14:45:14 +00:00
Emmanuele Bassi d5dfe2bd96 build: Drop autogenerated autotools files from Git
These files should not be under revision control.

This commit partially reverts:

  * 06fd4a271a
  * 62e384129b
2016-11-07 20:20:04 +00:00
Yaron Cohen-Tal c342cba2a1 Add glibc versions 2.2 and 2.3 to "dlwrap_real_dlsym". 2015-11-05 17:51:01 +02:00
Yaron Cohen-Tal 2bf2468502 Merge branch "blino/master". 2015-09-21 14:15:44 +03:00
Olivier Blin fe7a96e077 dlwrap: add GLIBC_2.4 version to be able to run tests from ARM
See sysdeps/unix/sysv/linux/arm/libdl.abilist in glibc
2015-09-21 13:05:33 +02:00
Yaron Cohen-Tal 2af1715fbf Fix "FindGLESv1.cmake" and "FindGLESv2.cmake". 2015-09-04 12:51:13 +03:00
Yaron Cohen-Tal 44d51f2844 Fix support for a static build of Epoxy. Add support building and running tests with CMake. Add support for linking with the static run-time library with MSVC. 2015-09-03 23:17:39 +03:00
Yaron Cohen-Tal 62e384129b Add some files to the repo so that it's possible to build without running "autogen.sh". 2015-08-26 22:08:16 +03:00
Yaron Cohen-Tal 540952010b Fix tests to work with some OpenGL ES / EGL implementations. 2015-08-24 12:36:35 +03:00
Yaron Cohen-Tal 773dd02f59 Added makefiles to build with MSVC 2013, and fixed errors and warnings. 2015-07-18 17:39:12 +03:00
Eric Anholt 8bbc0d40c6 Make the glx_alias_prefer_same_name test work, and hook it up.
Apparently I started writing it, and didn't notice I wasn't building
my code when I committed the library support.
2015-07-16 11:24:34 -07:00
Chun-wei Fan a2a51904b0 test/wgl_per_context_funcptrs.c: Fix build on Visual Studio
Ensure that we do __stdcall only after the return type, as Visual Studio
will not like it otherwise.
2015-06-05 17:51:39 -07:00
Eric Anholt b2ae054b3a Avoid name conflicts between pkgconfig's EGL_LIBS and a temporary var.
I felt a little uncomfortable knowing I had two things defining
EGL_LIBS, but it worked on my system.  It failed on the travis ci
build.
2014-06-13 15:57:11 -07:00
Eric Anholt d56f21c494 Use the EGL pkgconfig for finding eglplatform.h.
We don't ever explicity link against libEGL, so no need to make use of
EGL_LIBS.

Fixes #30.
2014-06-13 14:59:37 -07:00
Eric Anholt 27298ee31b tests: Fix the passing of the "-z now" arg to the linker.
These LDFLAGS go to the compiler, and getting the arg to the linker
requires -Wl or -Xlinker.  gcc apparently was passing this through
anyway, while clang was getting angry.
2014-06-13 14:44:54 -07:00
Eric Anholt 6eb075c70e Fix EGL context detection for non-GLES2-core functions.
Fixes failure of the X Server with glamor using desktop GL on EGL, and
the associated testcase in the tree.  This was clearly just
copy-and-paste failure on my part in
b251e3ae33.
2014-04-08 23:54:26 -07:00
Eric Anholt bb94003b78 Add a test for a failure I found with the X Server after my last fixes. 2014-04-08 23:54:25 -07:00
Eric Anholt 756dcaf6a5 Disable the dlwrap-based tests on apple.
We'd need a dlvsym() equivalent.
2014-03-28 16:45:26 -07:00
Eric Anholt 11a946cbf5 Prefer non-aliased functions when resolving.
This increases the size of the library, but avoids some of the
concerns that have been brought up with the library silently switching
you from glWhateverEXT() to glWhatever() if there might be slight
behavior differences between the two that hadn't been identified.  The
downside is that it means we can't share the resolver functions among aliases.
2014-03-28 16:33:53 -07:00
Eric Anholt ea12f935c1 wgl: Add a test for MakeCurrent returning different function pointers.
Huh, my old rule of "untested code is broken code" didn't hold up, for once.
2014-03-28 16:33:19 -07:00
Eric Anholt db5b939f98 Ask glXGetProcAddress for ES symbols when we're on a GLX context.
Fixes #24
2014-03-27 23:17:02 -07:00
Eric Anholt e230042ffe test: Add a test using GLX_EXT_create_context_es2_profile.
This is based on a bug report from Steinar H. Gunderson about using
GLES3 with SDL and epoxy.
2014-03-27 23:17:02 -07:00
Eric Anholt 46da7790b2 test: Avoid segfaulting when nvidia driver does a dlopen(RTLD_DEFAULT) 2014-03-27 17:32:16 -07:00
Eric Anholt 7f5fc047da win32: Fix a C90 compiler warning. 2014-03-27 15:37:32 -07:00
Eric Anholt 5a37cf88b5 win32: Add a test for wglUseFontBitmaps(). 2014-03-27 15:33:21 -07:00
Eric Anholt e6d9bb971b Try to use glXGPA() for core funcs if the current context is GLX.
Fixes the GLX-only subtest of egl_and_glx_different_pointers.  Now
what remains is dispatch tables for when you're actively using both.

Fixes #23
2014-03-19 18:34:30 -07:00
Eric Anholt 698185e24a Try to avoid looking up bootstrap functions in the wrong library.
Fixes the EGL-only subtest of egl_and_glx_different_pointers.
2014-03-19 18:34:30 -07:00
Eric Anholt 037ac7f566 Add a test for EGL and GLX returning different function pointers.
This is the case on the nvidia binary driver's GL, or when you've got
a system mixing nvidia binary GL and Mesa EGL.
2014-03-19 17:39:52 -07:00
Eric Anholt dae231680e Import a copy of dlwrap from libfips.
This is just cworth's code, reindented for this project.
2014-03-19 12:56:22 -07:00
Eric Anholt 053ac5f457 Fix test build.
I was initially planning on having a separate file of the overrides
when I'd forgotten I couldn't rely on ELF symbol lookup.
2014-03-17 11:19:15 -07:00
Eric Anholt 53b87c33e4 Catch eglBindAPI() failures in looking up bootstrap functions.
This fixes crashes on ARM's Mali drivers, where desktop GL isn't
supported, and epoxy didn't notice the error and tried to dlsym() on
libGL.so.1.

An alternative would have been to look at the response from
eglQueryAPI() first, but that would have meant that we still need to
BindAPI in the case that eglQueryAPI returns something like VG or CL,
and so we needed to handle these errors regardless.

Fixes #22
2014-03-17 11:02:41 -07:00
Eric Anholt f15c169cad Extend the egl_without_glx test for another quirk of the platform.
Epoxy dlsym()s directly into libEGL instead of using dlsym() on a NULL
handle, so we can't relying on ELF resolution like we do for dlopen().
Instead, just override epoxy's function pointers for the functions
epoxy will call in the process of getting one of these bootstrap
functions.
2014-03-17 09:55:46 -07:00
Eric Anholt 9998c39e8d Fix a bad error message in an EGL test. 2014-02-06 13:34:35 -08:00
Eric Anholt eb7a99d1bd Add missing '\n's to wgl test errors.
Like some of the other missing '\n's, I'd originally used errx(), then
just done a sed job to fprintf when I found that win32 lacked errx().
2014-02-06 13:34:25 -08:00
Eric Anholt e4f5da9539 Add a test that khrplatform.h (if present) agrees with us. 2014-02-06 11:16:18 -08:00
Matt Turner 5a39b7abe2 List X11_LIBS after lib{egl,glx}_common.
Fixes linking with --as-needed.
2014-02-01 12:32:42 -08:00
Matt Turner 309f2d2020 Use LDADD instead of LDFLAGS/DEPENDENCIES.
This is a lot shorter to type, and still gets the dependencies to work
(tested with touch src/dispatch_common.c; make check, and touch
src/egl_common.c; make check).
2014-02-01 12:32:09 -08:00
Eric Anholt c761908c3e Enable compiler warnings in the tests. 2014-01-31 15:52:43 -08:00
Eric Anholt 36847f88a7 Fix compiler warnings in the tests.
I didn't have CWARNFLAGS in the Makefile.am, so lots of things that
would generate warnings had crept in.
2014-01-31 15:52:28 -08:00
Eric Anholt 1064406814 Fix using epoxy on systems with only EGL and GLES1 or GLES2.
Fixes #19
2014-01-31 15:51:53 -08:00
Eric Anholt dbf940dabc Test for using GLES1/2 without GLX installed. 2014-01-31 15:30:36 -08:00