Commit 98f5ce52 authored by Jeremy Bicha's avatar Jeremy Bicha

Update upstream source from tag 'upstream/1.5.3'

Update to upstream version '1.5.3'
with Debian dir b182d7b138e780f8f4ce26bbeec584ccc2767b8a
parents a2af2b37 bf97360b
#
# X.Org module default exclusion patterns
# The next section if for module specific patterns
#
# Do not edit the following section
# GNU Build System (Autotools)
aclocal.m4
autom4te.cache/
autoscan.log
ChangeLog
compile
config.guess
config.h
config.h.in
config.log
config-ml.in
config.py
config.status
config.status.lineno
config.sub
configure
configure.scan
depcomp
.deps/
INSTALL
install-sh
.libs/
libtool
libtool.m4
ltmain.sh
lt~obsolete.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
Makefile
Makefile.in
mdate-sh
missing
mkinstalldirs
*.pc
py-compile
stamp-h?
symlink-tree
texinfo.tex
ylwrap
src/sna/git_version.h
src/sna/brw/brw_test
# Do not edit the following section
# Edit Compile Debug Document Distribute
*~
*.[0-9]
*.[0-9]x
*.bak
*.bin
core
*.dll
*.exe
*-ISO*.bdf
*-JIS*.bdf
*-KOI8*.bdf
*.kld
*.ko
*.ko.cmd
*.lai
*.l[oa]
*.[oa]
*.obj
*.so
*.pcf.gz
*.pdb
*.tar.bz2
*.tar.gz
#
# Add & Override patterns for gldispatch
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
configure.lineno
.dirstamp
test-driver
gl_generated_dispatch.c
gl_generated.h
glx_generated_dispatch.c
glx_generated.h
egl_generated_dispatch.c
egl_generated.h
wgl_generated_dispatch.c
wgl_generated.h
......@@ -7,6 +7,7 @@ branches:
os:
- linux
- osx
compiler:
- gcc
......@@ -18,13 +19,29 @@ language:
services:
- docker
matrix:
exclude:
- os: osx
compiler: gcc
before_install:
- docker pull ebassi/epoxyci
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install python@3 meson
# Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219
mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull ebassi/epoxyci ; fi
before_script:
- echo FROM ebassi/epoxyci > Dockerfile
- echo ADD . /root >> Dockerfile
- docker build -t withgit .
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo FROM ebassi/epoxyci > Dockerfile
echo ADD . /root >> Dockerfile
echo WORKDIR /root >> Dockerfile
docker build -t withgit .
fi
env:
- BUILD_OPTS=""
......@@ -33,4 +50,5 @@ env:
- BUILD_OPTS="-Dx11=false"
script:
- docker run withgit /bin/sh -c "CC=$CC ./epoxy-run-tests.sh $BUILD_OPTS"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "CC=$CC .travis/epoxy-ci-linux.sh $BUILD_OPTS" ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /bin/sh -c "CC=$CC .travis/epoxy-ci-osx.sh $BUILD_OPTS" ; fi
......@@ -27,5 +27,3 @@ ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
RUN pip3 install meson
WORKDIR /root
COPY epoxy-run-tests.sh .
#!/bin/bash
dump_log_and_quit() {
local exitcode=$1
cat meson-logs/testlog.txt
exit $exitcode
}
# Start Xvfb
XVFB_WHD=${XVFB_WHD:-1280x720x16}
......@@ -8,13 +16,17 @@ xvfb=$!
export DISPLAY=:99
mkdir _build
srcdir=$( pwd )
builddir=$( mktemp -d build_XXXXXX )
meson --prefix /usr "$@" $builddir $srcdir || exit $?
cd $builddir
meson --prefix /usr "$@" _build . || exit $?
ninja -C _build || exit $?
meson test -C _build || exit $?
ninja || exit $?
meson test || dump_log_and_quit $?
rm -rf _build
cd ..
# Stop Xvfb
kill -9 ${xvfb}
#!/bin/sh
dump_log_and_quit() {
local exitcode=$1
cat meson-logs/testlog.txt
exit $exitcode
}
export SDKROOT=$( xcodebuild -version -sdk macosx Path )
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
export OBJC=$CC
export PATH=$HOME/tools:$PATH
srcdir=$( pwd )
builddir=$( mktemp -d build_XXXXXX )
meson ${BUILDOPTS} $builddir $srcdir || exit $?
cd $builddir
ninja || exit $?
meson test || dump_log_and_quit $?
cd ..
......@@ -22,7 +22,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libepoxy],
[1.5.2],
[1.5.3],
[https://github.com/anholt/libepoxy],
[libepoxy])
AC_CONFIG_SRCDIR([Makefile.am])
......@@ -157,6 +157,8 @@ if test x$enable_x11 = xno; then
AC_MSG_ERROR([GLX support is explicitly enabled, but X11 was disabled])
fi
build_glx=no
else
AC_DEFINE([ENABLE_X11], [1], [Whether X11 support is enabled])
fi
AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes)
......
project('libepoxy', 'c', version: '1.5.2',
project('libepoxy', 'c', version: '1.5.3',
default_options: [
'buildtype=debugoptimized',
'c_std=gnu99',
'warning_level=1',
],
license: 'MIT',
meson_version: '>= 0.44.0')
meson_version: '>= 0.47.0')
epoxy_version = meson.project_version().split('.')
epoxy_major_version = epoxy_version[0].to_int()
......
......@@ -173,26 +173,24 @@
#include "dispatch_common.h"
#ifdef __APPLE__
#if defined(__APPLE__)
#define GLX_LIB "/opt/X11/lib/libGL.1.dylib"
#define OPENGL_LIB "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
#define GLES1_LIB "libGLESv1_CM.so"
#define GLES2_LIB "libGLESv2.so"
#elif defined(__ANDROID__)
#define GLX_LIB "libGLESv2.so"
#else
#define GLVND_GLX_LIB "libGLX.so.1"
#define GLX_LIB "libGL.so.1"
#endif
#ifdef __ANDROID__
#define EGL_LIB "libEGL.so"
#define GLES1_LIB "libGLESv1_CM.so"
#define GLES2_LIB "libGLESv2.so"
#elif defined _WIN32
#elif defined(_WIN32)
#define EGL_LIB "libEGL.dll"
#define GLES1_LIB "libGLES_CM.dll"
#define GLES2_LIB "libGLESv2.dll"
#define OPENGL_LIB "OPENGL32"
#else
#define GLVND_GLX_LIB "libGLX.so.1"
#define GLX_LIB "libGL.so.1"
#define EGL_LIB "libEGL.so.1"
#define GLES1_LIB "libGLESv1_CM.so.1"
#define GLES2_LIB "libGLESv2.so.2"
......@@ -553,23 +551,25 @@ epoxy_internal_has_gl_extension(const char *ext, bool invalid_op_mode)
bool
epoxy_load_glx(bool exit_if_fails, bool load)
{
#ifdef GLVND_GLX_LIB
#if PLATFORM_HAS_GLX
# ifdef GLVND_GLX_LIB
/* prefer the glvnd library if it exists */
if (!api.glx_handle)
get_dlopen_handle(&api.glx_handle, GLVND_GLX_LIB, false, load);
#endif
# endif
if (!api.glx_handle)
get_dlopen_handle(&api.glx_handle, GLX_LIB, exit_if_fails, load);
#endif
return api.glx_handle != NULL;
}
void *
epoxy_conservative_glx_dlsym(const char *name, bool exit_if_fails)
{
#if PLATFORM_HAS_GLX
if (epoxy_load_glx(exit_if_fails, exit_if_fails))
return do_dlsym(&api.glx_handle, name, exit_if_fails);
#endif
return NULL;
}
......@@ -636,15 +636,20 @@ epoxy_conservative_has_gl_extension(const char *ext)
bool
epoxy_load_egl(bool exit_if_fails, bool load)
{
#if PLATFORM_HAS_EGL
return get_dlopen_handle(&api.egl_handle, EGL_LIB, exit_if_fails, load);
#else
return false;
#endif
}
void *
epoxy_conservative_egl_dlsym(const char *name, bool exit_if_fails)
{
#if PLATFORM_HAS_EGL
if (epoxy_load_egl(exit_if_fails, exit_if_fails))
return do_dlsym(&api.egl_handle, name, exit_if_fails);
#endif
return NULL;
}
......@@ -727,7 +732,7 @@ epoxy_gles3_dlsym(const char *name)
return epoxy_get_proc_address(name);
} else {
if (get_dlopen_handle(&api.gles2_handle, GLES2_LIB, false, true)) {
void *func = do_dlsym(&api.gles2_handle, GLES2_LIB, false);
void *func = do_dlsym(&api.gles2_handle, name, false);
if (func)
return func;
......
......@@ -28,7 +28,7 @@
#define PLATFORM_HAS_GLX ENABLE_GLX
#define PLATFORM_HAS_WGL 1
#elif defined(__APPLE__)
#define PLATFORM_HAS_EGL ENABLE_EGL
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX ENABLE_GLX
#define PLATFORM_HAS_WGL 0
#elif defined(ANDROID)
......
......@@ -50,11 +50,7 @@ epoxy_sources = sources + gen_sources
common_ldflags = []
if host_system == 'linux' and cc.get_id() == 'gcc'
if meson.version().version_compare('>= 0.46.0')
common_ldflags += cc.get_supported_link_arguments([ '-Wl,-Bsymbolic-functions', '-Wl,-z,relro' ])
else
common_ldflags += [ '-Wl,-Bsymbolic-functions', '-Wl,-z,relro', ]
endif
common_ldflags += cc.get_supported_link_arguments([ '-Wl,-Bsymbolic-functions', '-Wl,-z,relro' ])
endif
# Maintain compatibility with autotools; see: https://github.com/anholt/libepoxy/issues/108
......
/* This is a copy of the test used by HomeBrew's libepoxy recipe,
* originally written by Mikko Lehtonen.
*
* The Homebrew recipe is released under the BSD 2-Clause license.
*
* Copyright (c) 2009-present, Homebrew contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <epoxy/gl.h>
#include <Carbon/Carbon.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLTypes.h>
#include <OpenGL/CGLCurrent.h>
#include <OpenGL/CGLContext.h>
int
main (void)
{
CGLPixelFormatAttribute attribs[] = {0};
CGLPixelFormatObj pix;
CGLContextObj ctx;
int npix;
CGLChoosePixelFormat(attribs, &pix, &npix);
CGLCreateContext(pix, (void *) 0, &ctx);
glClear(GL_COLOR_BUFFER_BIT);
CGLReleaseContext(ctx);
CGLReleasePixelFormat(pix);
return 0;
}
/*
* Copyright 2018 Emmanuele Bassi
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/**
* @file cgl_epoxy_api.c
*
* Tests the Epoxy API using the CoreGraphics OpenGL framework.
*/
#include <epoxy/gl.h>
#include <Carbon/Carbon.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLTypes.h>
#include <OpenGL/CGLCurrent.h>
#include <OpenGL/CGLContext.h>
int
main (void)
{
CGLPixelFormatAttribute attribs[] = {0};
CGLPixelFormatObj pix;
CGLContextObj ctx;
const char *string;
bool pass = true;
int npix;
GLint shader;
CGLChoosePixelFormat(attribs, &pix, &npix);
CGLCreateContext(pix, (void *) 0, &ctx);
CGLSetCurrentContext(ctx);
if (!epoxy_is_desktop_gl()) {
fputs("Claimed not to be desktop\n", stderr);
pass = false;
}
if (epoxy_gl_version() < 20) {
fprintf(stderr, "Claimed to be GL version %d\n",
epoxy_gl_version());
pass = false;
}
if (epoxy_glsl_version() < 100) {
fprintf(stderr, "Claimed to have GLSL version %d\n",
epoxy_glsl_version());
pass = false;
}
string = (const char *)glGetString(GL_VERSION);
printf("GL version: %s - Epoxy: %d\n", string, epoxy_gl_version());
string = (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION);
printf("GLSL version: %s - Epoxy: %d\n", string, epoxy_glsl_version());
shader = glCreateShader(GL_FRAGMENT_SHADER);
pass = glIsShader(shader);
CGLSetCurrentContext(NULL);
CGLReleaseContext(ctx);
CGLReleasePixelFormat(pix);
return pass != true;
}
......@@ -27,6 +27,7 @@
* Tests the Epoxy API using EGL.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
......
......@@ -28,6 +28,7 @@
* no context bound would fail out in dispatch.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
......
......@@ -152,3 +152,27 @@ if build_wgl
test(test_name, test_bin)
endforeach
endif
# Apple
if host_machine.system().contains('darwin')
opengl_dep = dependency('appleframeworks', modules: ['OpenGL', 'Carbon'], required: true)
cgl_tests = [
[ 'cgl_core', [ 'cgl_core.c' ] ],
[ 'cgl_epoxy_api', [ 'cgl_epoxy_api.c' ] ],
]
foreach t: cgl_tests
test_name = t[0]
test_sources = t[1]
test(test_name,
executable(
test_name, test_sources,
c_args: test_cflags,
include_directories: libepoxy_inc,
dependencies: [ libepoxy_dep, opengl_dep ],
),
)
endforeach
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment