Commit Graph
367 Commits
Author SHA1 Message Date
Emmanuele Bassi 40d2aa3c8d Hide Appveyor YAML file
Like we do for the TravisCI YAML file, use the leading dot notation to
hide the Appveyor YAML file from directory listing on Unix-like OSes.
2017-02-15 12:09:06 +00:00
Emmanuele Bassi 9ccbac5adf Allow using Python3 to run gen_dispatch.py
This way, we don't have to depend on Python2 on newer OSes.
2017-02-13 09:34:51 +00:00
Emmanuele Bassi 6720306030 Remove the shebang from gen_dispatch.py
Instead of having Meson determine the invocator through the shebang
line we explicitly pass the script file to the Python interpreter.

This will allow us to either use Python3 or Python2, or whatever
Python.exe is available on Windows.
2017-02-13 09:34:51 +00:00
Emmanuele Bassi f1c038a54d Update the "why not GLEW" section
GLEW has grown support for OpenGL 3.2+ core contexts over the years.
Everything else has stayed pretty much the same, though, so you should
still use Epoxy over libGLEW.
2017-02-10 17:57:01 +00:00
Emmanuele Bassi 176db4b655 Add the Appveyor build badge
Gamifying the development experience, once achievement at a time.
2017-02-10 11:43:03 +00:00
Emmanuele Bassi 48ee13ed3c Define a macro directory in the autotools build
As libtool suggest we do; this also allows using ACLOCAL_AMFLAGS inside
build that create a separate environment with their own m4 macros, like
jhbuild and Cerberus.

In order to avoid a warning from autoreconf, we create the empty macros
directory during the autogen.sh step; aclocal would create the directory
for us anyway, but different versions of autotools may have different
behaviours.

Closes: #58
2017-02-10 11:23:35 +00:00
Emmanuele Bassi cf81586a6c Merge branch 'appveyor'
Closes #95
2017-02-10 11:12:16 +00:00
Tommy Marrinan f658588e12 Add Appveyor script
Appveyor is a CI infrastructure like Travis, but oriented at building on
Windows environment, as opposed to Linux and macOS.

By using Appveyor we can test changes to Epoxy and make sure that
Windows builds won't break.

Additionally, Appveyor allows to deploy build artefacts, which means we
can generate builds for Epoxy releases.

Signed-off-by: Emmanuele Bassi <[email protected]>
2017-02-10 11:12:09 +00:00
Emmanuele Bassi baa76b69c4 Remove unnecessary bits from the documentation build rules
We don't need to list the source files as we use a glob rule in the
Doxyfile itself.
2017-02-10 11:12:09 +00:00
Emmanuele Bassi ef1ef6cadb Remove unnecessary bits from the documentation build rules
We don't need to list the source files as we use a glob rule in the
Doxyfile itself.
2017-02-10 11:11:04 +00:00
Emmanuele Bassi 188d54271b Ignore non-build branches in Travis
The khronos-registry branch contains only the registry XML files.

The debian branch contains the Debian packaging files.
2017-02-09 17:09:40 +00:00
Emmanuele Bassi 87371e9005 Add TravisCI build badge to the README 2017-02-09 14:30:13 +00:00
Emmanuele Bassi 4b7b5422db Update the TravisCI environment to use Docker
The Travis environment is terribly outdated, and they are not really
subtly pushing people to use Docker to set up their own containerised CI
environments instead of pulling from Ubuntu 12.04 or 14.04.

Let's try using this approach:

  - create a Docker image that pulls from Debian Stretch
  - set up a build and test environment
  - push the image to the Docker Hub
  - create a derived Docker image that copies the Epoxy repo
    when running under Travis
  - run the build and test script inside the derived image

This is similar to what Meson does for its CI.
2017-02-09 14:20:51 +00:00
Emmanuele Bassi 9b56140962 Add compiler arguments for MSVC builds
We're using a bunch of compiler arguments when building with GCC and
compilers that expose a GCC compatibility layer, but we should also have
warnings when building with MSVC.

GLib has a bunch of compiler arguments, taken from the "Win32
Programming" book, that we can reuse.
2017-02-09 13:48:59 +00:00
Emmanuele Bassi 8a4f42a713 Add editorconfig file
The editorconfig[0] format is getting traction in various code editors.

[0]: http://editorconfig.org/
2017-02-08 23:03:04 +00:00
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 37eaaada97 Test compiler arguments for the appropriate compiler
MSVC does not expose GCC-compatible compiler arguments, so there's no
point in even trying.
2017-02-08 17:51:34 +00:00
Emmanuele Bassi d35870f3b6 Update the symbol visibility rules under MSVC
For the Visual Studio C compiler we need to annotate our public symbols
with `__declspec(dllimport)` to ensure they are visible when dynamically
linking to Epoxy's DLL.

This is needed because under Windows we use a dispatch table, instead of
wrapper functions, thus the symbol visibility rules change. Compiling
with MingW will automatically add `__declspec(dllimport)` for us.

Thanks to Nirbheek Chauhan for the help in debugging the issue.

Fixes #104
2017-02-08 16:52:01 +00:00
Emmanuele Bassi 0ab213bf88 Add Meson build files to the autotools dist
This way we can take a dist tarball created through autotools, and use
Meson to build it.

Once Meson gets support for disting, we'll do the same with the
autotools build files, and call the result a "Buildoboros".
2017-02-08 15:55:21 +00:00
Emmanuele Bassi 8a5f52eaff Document the process for updating the registry
This avoids each maintainer to transmit the knowledge orally to the next
maintainer.
2017-02-08 15:53:43 +00:00
Emmanuele Bassi d8b10c0a5a Do not use Python 3 to run gen_dispatch.py
It's still a Python 2.x script, even if it's mostly compatible with
Python 3.x.
2017-02-08 13:05:26 +00:00
Emmanuele Bassi 0727ae5d27 Update gen_dispatch after a pass of pylint
PyLint raises a bunch of issues on the dispatch generation script with
regards to best practices; most of those issues are real, so let's fix
the code to be more Pythonic.
2017-02-08 12:58:23 +00:00
Emmanuele Bassi 5c4a907687 Merge pull request #100 from centricular/fix-find_program
meson: Don't call find_program objects with python
2017-02-08 12:57:47 +00:00
Emmanuele Bassi 96286708a4 Bump version to 1.4 for release 1.4.0 v1.4 2017-02-06 16:00:20 +00:00
Emmanuele Bassi 7782509bdb Add API to allow for platform detection
On Linux and other Unix variants we may not have access to GLX and EGL
at run time. Dependent libraries can only discover this by using dlsym()
on various symbols, because as soon as they attempt to call those
symbols through Epoxy, Epoxy will abort. This means that a bunch of code
needs to be copy-pasted between projects, with the high chance of
somebody getting it wrong.

Epoxy already has all the internals needed to detect whether GLX and EGL
are available, so exposing a simple API is a better alternative.

Fixes #73
2017-02-06 15:59:24 +00:00
Emmanuele Bassi ec93dcd5a1 Allow enabling and disabling GLX support
Since X11 can be used on multiple platforms, or disabled in special
environments, we should provide a way to control whether or not Epoxy is
built with GLX support.

Fixes anholt/libepoxy#52
Fixes anholt/libepoxy#63
Closes anholt/libepoxy#80
Closes anholt/libepoxy#81
2017-02-06 15:58:53 +00:00
Emmanuele Bassi 7b52d33d86 Encode Epoxy capabilities into the pkg-config file
Since Epoxy can be built with different platform-specific API, having a
way for dependent projects to discover those capabilities without
necessarily crashing the minute they attempt to use them is a good
feature to have.

We strongly direct library and application developers to use pkg-config
in order to use Epoxy, so it makes sense to add variables to the
epoxy.pc file that can be easily extracted at configuration time.
2017-02-06 15:58:21 +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 6a2994d1ed doc: Ignore a private symbol 2017-02-06 15:44:19 +00:00
Emmanuele Bassi 2e2b96301d Generate a ChangeLog for the dist tarball
It's useful for people that like rummaging inside tarballs.
2017-02-06 15:44:06 +00:00
Emmanuele Bassi 43a66ca8d8 Generate xz tarballs on distcheck
Both gz and bz2 tarballs are discouraged, in this day and age.
2017-02-06 15:43:53 +00:00
Emmanuele Bassi d4104fbbcd Drop additional stdbool.h include directives 2017-02-06 15:43:34 +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 075172f485 Add epoxy_has_egl()
Similar to `epoxy_has_glx()`, but for the EGL windowing system API.
2017-02-03 16:19:30 +00:00
Emmanuele Bassi d94b9c28b5 Add epoxy_has_glx()
Libraries and applications that depend on Epoxy currently have no way to
safely degrade functionality if they are used on a platform without GLX
support; the only way to achieve that is to perform a symbol check
themselves, by essentially copying what Epoxy already does.

By exposing `epoxy_has_glx()`, those libraries and applications now have
the chance of querying Epoxy itself and gracefully handle failure.
2017-02-03 16:16:13 +00:00
Emmanuele Bassi 30b8a4cd2d Add conservative functions for checking platform symbols
When checking whether GLX or EGL are available on the system, we don't
want to use the internal API that forces an exit() on missing libraries
and symbols — as that would defeat the point.

Instead, we should have safe functions to call internally that simply
return a NULL pointer, so we can bail out ourselves in a controlled
fashion.
2017-02-03 16:13:45 +00:00
Emmanuele Bassi acdd6d8bf8 Drop additional stdbool.h include directives 2017-02-03 16:03:15 +00:00
Emmanuele Bassi 6af57b0745 Write the API reference
Now that we have Doxygen generating it, we should fill out the API
reference for Epoxy.
2017-02-03 11:13:30 +00:00
Emmanuele Bassi 59d9c2d83d Generate the Epoxy API reference using Doxygen
The build is conditional on:

 * using the Meson build
 * passing the `-Denable-docs=true` configuration switch
 * having `doxygen` installed

Currently, the generated HTML is kind of empty, but it works.
2017-02-03 11:03:13 +00:00
Emmanuele Bassi 3d1193fd30 Use container based CI on Travis
We don't really use `sudo` anywhere, except for installing packages;
this means we should be able to use the faster container-based
environment on Travis, instead of the VM-based one.
2017-02-01 12:36:07 +00:00
Emmanuele Bassi 6973dd5db3 Add a fallback for missing stdbool.h
Older versions of the Microsoft Visual C compiler do not support C99 and
do not have stdbool.h.

Additionally, Epoxy is pretty much C89 compliant, and stdbool.h is part
of C99.

We can add a simple fallback for MSVC, in case we end up getting built
with it.
2017-02-01 00:02:16 +00:00
Emmanuele Bassi 5bcc550a6c Merge branch 'symbol-visibility' 2017-01-31 18:09:34 +00:00
Emmanuele Bassi 39a10ca79b Revert "Use Trusty for Travis"
This reverts commit a11c76e1fa.

Return to the default of Precise, and keep Epoxy under CI.
2017-01-31 17:57:28 +00:00
Emmanuele Bassi 136d3cde83 Revert "build: Tell autoconf to use a macro dir"
This reverts commit de84448e3a.

In order to make Epoxy build on Travis with the Precise package set, we
need to revert this commit, as the autotools version shipped on Ubuntu
12.04 bail out at the missing macro directory — whereas newer versions
just create it if needed.

Updating the Travis environment to Trusty allows the build to finish,
but have the knock-on effect of making more tests run — and the
EGL-without-GLX tests fail. Since there's nothing newer than Trusty on
Travis, we should back out this change until we have the ability to
build a suitable test/CI environment.
2017-01-31 17:54:00 +00:00
Emmanuele Bassi a11c76e1fa Use Trusty for Travis
Trusty (14.04) is outdated, but at least not as terribly outdated as the
Precise (12.04) default.
2017-01-31 13:22:40 +00:00
Emmanuele Bassi 061cc48f40 Update README
The OpenGL registry has been updated with the 4.5 API.
2017-01-31 13:00:06 +00:00
Emmanuele Bassi d1b5f3becb Merge branch 'khronos-registry' 2017-01-31 12:59:50 +00:00
Emmanuele Bassi aab6092f65 gen_dispatch: Ignore 'glsc2' API
The new GL registry XML contains the 'glsc2' identifier for the OpenGL
SC 2.0 API. We can safely ignore it, since we don't really know what to
do with it, at the moment.
2017-01-31 12:59:46 +00:00
Emmanuele Bassi de84448e3a build: Tell autoconf to use a macro dir
This avoids warnings coming from libtoolize and recent versions of
autoconf.
2017-01-31 12:59:46 +00:00
Emmanuele Bassi aef80bc9e1 build: Ensure that autogen exits with the right code
Since autogen.sh calls other commands that may fail, we should return
the exit code from those commands.
2017-01-31 12:59:46 +00:00