Skip to content
Commits on Source (70)
root = true
[*]
indent_size = 4
indent_style = space
[{Makefile.am,*.mk}]
indent_size = 8
indent_style = tab
[{meson.build,meson_options.txt}]
indent_size = 2
indent_style = space
# vim: set expandtab shiftwidth=2 tabstop=2 textwidth=0:
variables:
UBUNTU_TAG: "2019-12-05-01"
UBUNTU_VERSION: "18.04"
UBUNTU_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu/$UBUNTU_VERSION:$UBUNTU_TAG"
UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh"
# Include the templates to create an image to run the tests.
include:
- project: 'wayland/ci-templates'
ref: b4b098a707c8f39d18f1a98d4bcbe65372ff9e17
file: '/templates/ubuntu.yml'
stages:
- containers-build
- build
# CONTAINERS creation stage
container_build:
extends: .ubuntu@container-ifnot-exists
stage: containers-build
variables:
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
build-distcheck:
stage: build
image: $UBUNTU_CONTAINER_IMAGE
script:
- bash .gitlab-ci/run_distcheck.sh
artifacts:
paths:
- build/libglvnd-*.tar.gz
# This is a common definition for testing the other types of dispatch stubs.
# We only need to do these for changes that might affect something specific to
# those stub types.
.build-check:
stage: build
image: $UBUNTU_CONTAINER_IMAGE
only:
changes:
- src/GLdispatch/vnd-glapi/**
- src/util/glvnd_genentry.*
- tests/**
- .gitlab-ci.yml
- .gitlab-ci/**
.build-check-at:
extends:
- .build-check
script:
- bash .gitlab-ci/run_build.sh
.build-check-meson:
extends:
- .build-check
script:
- bash .gitlab-ci/run_meson.sh
artifacts:
when: always
paths:
- build/meson-logs/*.txt
build-i386:
extends:
- .build-check-at
variables:
CONFIGURE_OPTIONS: --build=i686-pc-linux-gnu CFLAGS=-m32
build-i386-meson:
extends:
- .build-check-meson
variables:
CONFIGURE_OPTIONS: --cross-file .gitlab-ci/i686-linux-gnu
build-x86-64-tsd:
extends:
- .build-check-at
variables:
CONFIGURE_OPTIONS: --disable-tls
build-x86_64-tsd-meson:
extends:
- .build-check-meson
variables:
CONFIGURE_OPTIONS: -Dtls=disabled
build-i386-tsd:
extends:
- .build-check-at
variables:
CONFIGURE_OPTIONS: --build=i686-pc-linux-gnu CFLAGS=-m32 --disable-tls
build-i386-tsd-meson:
extends:
- .build-check-meson
variables:
CONFIGURE_OPTIONS: -Dtls=disabled --cross-file .gitlab-ci/i686-linux-gnu
build-pure-c-tls:
extends:
- .build-check-at
variables:
CONFIGURE_OPTIONS: --disable-asm
build-pure-c-tls-meson:
extends:
- .build-check-meson
variables:
CONFIGURE_OPTIONS: -Dasm=disabled
build-pure-c-tsd:
extends:
- .build-check-at
variables:
CONFIGURE_OPTIONS: --disable-asm --disable-tls
build-pure-c-tld-meson:
extends:
- .build-check-meson
variables:
CONFIGURE_OPTIONS: -Dasm=disabled -Dtls=disabled
[binaries]
c = '/usr/bin/gcc'
cpp = '/usr/bin/g++'
ar = '/usr/bin/ar'
strip = '/usr/bin/strip'
pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'
[properties]
c_args = ['-m32']
c_link_args = ['-m32']
cpp_args = ['-m32']
cpp_link_args = ['-m32']
needs_exe_wrapper = false
[host_machine]
system = 'linux'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
#!/bin/bash
set -e
set -o xtrace
./autogen.sh
mkdir build
cd build
../configure $CONFIGURE_OPTIONS
make V=1 VERBOSE=1
Xvfb :99 &
set +e
DISPLAY=:99 make check V=1 VERBOSE=1
RESULT=$?
set -e
kill %Xvfb
exit $RESULT
#!/bin/bash
set -e
set -o xtrace
./autogen.sh
mkdir build
cd build
../configure
Xvfb :99 &
set +e
DISPLAY=:99 make distcheck V=1 VERBOSE=1
RESULT=$?
set -e
# If make distcheck failed don't even bother with the meson check, the tarball
# may be invalid and it's just a waste
if [ $RESULT -ne 0 ]; then
kill %Xvfb
exit $RESULT
fi
# Also check that the meson build works from the dist tarball
# We don't have a good way to know what the name of the archive will be (since
# it has the version in it). Therefore, write the tarball to a place we know
# the name of and work from there.
mkdir libglvnd
tar -xf libglvnd-*.tar.gz -C libglvnd --strip-components 1
pushd libglvnd
meson builddir --auto-features=enabled
set +e
DISPLAY=:99 ninja -C builddir test
RESULT=$?
set -e
popd
kill %Xvfb
exit $RESULT
#!/bin/bash
set -e
set -o xtrace
# Running a unity build (sometimes called a jumbo build) is both a useful thing
# to test and reduces compile time.
#
# Enable all auto-features to ensure that we're proprely testing all optional
# dependencies.
meson build --unity=on --auto-features=enabled $CONFIGURE_OPTIONS
ninja -C build
Xvfb :99 &
set +e
DISPLAY=:99 ninja -C build test
RESULT=$?
set -e
kill %Xvfb
exit $RESULT
#!/bin/bash
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture i386
apt-get update
apt-get install -y --no-remove --no-install-recommends \
autoconf \
automake \
gcc-multilib \
libtool \
libx11-dev \
libx11-dev:i386 \
libxext-dev \
libxext-dev:i386 \
ninja-build \
pkg-config \
pkg-config-i686-linux-gnu \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
x11proto-gl-dev \
xvfb
# We need a version of meson later than the 0.45 in ubuntu 18.04
pip3 install meson
\ No newline at end of file
SUBDIRS = src tests include
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = autogen.sh README.md
EXTRA_DIST = \
autogen.sh \
README.md \
bin/symbols-check.py \
meson.build \
meson_options.txt
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libglvnd.pc
......@@ -24,6 +24,16 @@ On Debian and derivatives, run:
Run `./autogen.sh`, then run `./configure` and `make`.
Alternatively you can use meson and ninja, which is much faster but should be
otherwise the same (You will need packages from above too):
sudo apt-get install ninja-build meson
meson builddir
ninja -C builddir
Meson 0.48.0 is currently required, if your distro doesn't have meson 0.48 in
the repos you can try the methods suggested
[here](https://mesonbuild.com/Getting-meson.html).
Code overview
-------------
......
#!/usr/bin/env python
# encoding=utf-8
# Copyright © 2018-2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Materials, and to
# permit persons to whom the Materials are furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be included
# unaltered in all copies or substantial portions of the Materials.
# Any additions, deletions, or changes to the original source files
# must be clearly indicated in accompanying documentation.
# THE MATERIALS ARE 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
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
import argparse
import os
import platform
import subprocess
# This list contains symbols that _might_ be exported for some platforms
PLATFORM_SYMBOLS = [
'__bss_end__',
'__bss_start__',
'__bss_start',
'__end__',
'_bss_end__',
'_edata',
'_end',
'_fini',
'_init',
]
def get_symbols(nm, lib):
'''
List all the (non platform-specific) symbols exported by the library
'''
symbols = []
platform_name = platform.system()
output = subprocess.check_output([nm, '-gP', lib],
stderr=open(os.devnull, 'w')).decode("ascii")
for line in output.splitlines():
fields = line.split()
if len(fields) == 2 or fields[1] == 'U':
continue
symbol_name = fields[0]
if platform_name == 'Linux':
if symbol_name in PLATFORM_SYMBOLS:
continue
elif platform_name == 'Darwin':
assert symbol_name[0] == '_'
symbol_name = symbol_name[1:]
symbols.append(symbol_name)
return symbols
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--symbols-file',
action='store',
required=True,
help='path to file containing symbols')
parser.add_argument('--lib',
action='store',
required=True,
help='path to library')
parser.add_argument('--nm',
action='store',
type=lambda s: s.split()[0], # autotools may pass "nm -B", but we just want nm
required=True,
help='path to binary (or name in $PATH)')
args = parser.parse_args()
try:
lib_symbols = get_symbols(args.nm, args.lib)
except:
# We can't run this test, but we haven't technically failed it either
# Return the GNU "skip" error code
exit(77)
mandatory_symbols = []
optional_symbols = []
with open(args.symbols_file) as symbols_file:
qualifier_optional = '(optional)'
for line in symbols_file.readlines():
# Strip comments
line = line.split('#')[0]
line = line.strip()
if not line:
continue
# Line format:
# [qualifier] symbol
qualifier = None
symbol = None
fields = line.split()
if len(fields) == 1:
symbol = fields[0]
elif len(fields) == 2:
qualifier = fields[0]
symbol = fields[1]
else:
print(args.symbols_file + ': invalid format: ' + line)
exit(1)
# The only supported qualifier is 'optional', which means the
# symbol doesn't have to be exported by the library
if qualifier and not qualifier == qualifier_optional:
print(args.symbols_file + ': invalid qualifier: ' + qualifier)
exit(1)
if qualifier == qualifier_optional:
optional_symbols.append(symbol)
else:
mandatory_symbols.append(symbol)
unknown_symbols = []
for symbol in lib_symbols:
if symbol in mandatory_symbols:
continue
if symbol in optional_symbols:
continue
if symbol[:2] == '_Z':
# Ignore random C++ symbols
#TODO: figure out if there's any way to avoid exporting them in the first place
continue
unknown_symbols.append(symbol)
missing_symbols = [
sym for sym in mandatory_symbols if sym not in lib_symbols
]
for symbol in unknown_symbols:
print(args.lib + ': unknown symbol exported: ' + symbol)
for symbol in missing_symbols:
print(args.lib + ': missing symbol: ' + symbol)
if unknown_symbols or missing_symbols:
exit(1)
exit(0)
if __name__ == '__main__':
main()
......@@ -2,7 +2,7 @@ dnl configure.ac
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([libglvnd], [1.2.0], [kbrenneman@nvidia.com])
AC_INIT([libglvnd], [1.3.0], [kbrenneman@nvidia.com])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
......@@ -28,6 +28,7 @@ AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_MKDIR_P
PKG_PROG_PKG_CONFIG
AC_PROG_NM
# The tarball from "make dist" already contains all of the generated files. If
# we're building from that, then we won't need Python.
......@@ -70,13 +71,19 @@ if test "x$enable_x11" != "xyes" -a "x$enable_glx" = "xyes" ; then
AC_MSG_ERROR([Can't build GLX without X11.])
fi
AC_ARG_ENABLE([gles],
[AS_HELP_STRING([--disable-gles],
[Do not build the libGLES*.so libraries @<:@default=enabled@:>@])],
[enable_gles="$enableval"],
[enable_gles=yes]
)
AM_CONDITIONAL([ENABLE_GLES], [test "x$enable_gles" = "xyes"])
AC_ARG_ENABLE([gles1],
[AS_HELP_STRING([--disable-gles1],
[disable support for OpenGL ES 1.x API @<:@default=enabled@:>@])],
[enable_gles1="$enableval"],
[enable_gles1=yes])
AM_CONDITIONAL([ENABLE_GLES1], [test "x$enable_gles1" = "xyes"])
AC_ARG_ENABLE([gles2],
[AS_HELP_STRING([--disable-gles2],
[disable support for OpenGL ES 2.x and 3.x API @<:@default=enabled@:>@])],
[enable_gles2="$enableval"],
[enable_gles2=yes])
AM_CONDITIONAL([ENABLE_GLES2], [test "x$enable_gles2" = "xyes"])
AC_ARG_ENABLE([headers],
[AS_HELP_STRING([--disable-headers],
......@@ -87,7 +94,8 @@ AC_ARG_ENABLE([headers],
AM_CONDITIONAL([ENABLE_GL_HEADERS], [test "x$enable_headers" = "xyes"])
AM_CONDITIONAL([ENABLE_EGL_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_egl" = "xyes"])
AM_CONDITIONAL([ENABLE_GLX_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_glx" = "xyes"])
AM_CONDITIONAL([ENABLE_GLES_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_gles" = "xyes"])
AM_CONDITIONAL([ENABLE_GLES1_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_gles1" = "xyes"])
AM_CONDITIONAL([ENABLE_GLES2_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_gles2" = "xyes"])
dnl
dnl Arch/platform-specific settings. Copied from mesa
......@@ -135,7 +143,7 @@ if test "x$enable_asm" = xyes; then
case "$asm_arch" in
x86)
DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
DEFINES="$DEFINES -DUSE_X86_ASM"
AC_MSG_RESULT([yes, x86])
;;
x86_64)
......@@ -264,6 +272,9 @@ AM_CONDITIONAL([GLDISPATCH_TYPE_ARMV7_TSD], [test "x$gldispatch_entry_type" = "x
AM_CONDITIONAL([GLDISPATCH_TYPE_AARCH64_TSD], [test "x$gldispatch_entry_type" = "xaarch64_tsd"])
AM_CONDITIONAL([GLDISPATCH_TYPE_PURE_C], [test "x$gldispatch_entry_type" = "xpure_c"])
AS_IF([test "x$gldispatch_entry_type" != "xpure_c"],
[AC_DEFINE([USE_DISPATCH_ASM], 1,
[Define to 1 if libGLdispatch and libGLX should use assembly dispatch functions.])])
AC_MSG_CHECKING([for constructor attributes])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
......@@ -356,6 +367,10 @@ AS_IF([test "x$GLDISPATCH_PAGE_SIZE" != "x"],
[AC_DEFINE_UNQUOTED([GLDISPATCH_PAGE_SIZE], [$GLDISPATCH_PAGE_SIZE],
[Page size to align static dispatch stubs.])])
# Set EGL_NO_X11 unconditionally. Libglvnd doesn't make any assumptions about
# native display or drawable types, so we don't need X11-specific typedefs for
# them.
DEFINES="$DEFINES -DEGL_NO_X11"
dnl default CFLAGS
CFLAGS="$CFLAGS -Wall -Werror -include config.h -fvisibility=hidden $DEFINES"
......
......@@ -116,6 +116,12 @@ typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType;
#elif defined(__unix__) && defined(EGL_NO_X11)
typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;
#elif defined(__unix__) || defined(USE_X11)
/* X11 (tentative) */
......
......@@ -27,38 +27,22 @@
#ifndef __gl_h_
#define __gl_h_
#if defined(USE_MGL_NAMESPACE)
#include "gl_mangle.h"
#endif
/**********************************************************************
* Begin system-specific stuff. Do not do any of this when building
* for SciTech SNAP, as this is all done before this header file is
* included.
* Begin system-specific stuff.
*/
#if !defined(__SCITECH_SNAP__)
#if defined(__BEOS__)
#include <stdlib.h> /* to get some BeOS-isms */
#endif
#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
#define OPENSTEP
#endif
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
#define __WIN32__
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
#if defined(__WIN32__) && !defined(__CYGWIN__)
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# endif /* _STATIC_MESA support */
# endif
# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
# define GLAPIENTRY
# else
......@@ -72,10 +56,6 @@
# define GLAPIENTRY
#endif /* WIN32 && !CYGWIN */
#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
# define PRAGMA_EXPORT_SUPPORTED 1
#endif
/*
* WINDOWS: Include windows.h here to define APIENTRY.
* It is also useful when applications include this file by
......@@ -91,10 +71,6 @@
#include <windows.h>
#endif
#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
......@@ -116,15 +92,6 @@
#define GLAPIENTRYP GLAPIENTRY *
#endif
#ifdef CENTERLINE_CLPP
#define signed
#endif
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export on
#endif
#endif /* !__SCITECH_SNAP__ */
/*
* End system-specific stuff.
**********************************************************************/
......@@ -718,7 +685,7 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_LIST_BIT 0x00020000
#define GL_TEXTURE_BIT 0x00040000
#define GL_SCISSOR_BIT 0x00080000
#define GL_ALL_ATTRIB_BITS 0x000FFFFF
#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
/* OpenGL 1.1 */
......@@ -1738,6 +1705,7 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
/*
* OpenGL 1.3
*/
......@@ -2085,26 +2053,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
#if GL_ARB_shader_objects
#ifndef GL_MESA_shader_debug
#define GL_MESA_shader_debug 1
#define GL_DEBUG_OBJECT_MESA 0x8759
#define GL_DEBUG_PRINT_MESA 0x875A
#define GL_DEBUG_ASSERT_MESA 0x875B
GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
GLsizei *length, GLcharARB *debugLog);
GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
#endif /* GL_MESA_shader_debug */
#endif /* GL_ARB_shader_objects */
/*
* ???. GL_MESA_packed_depth_stencil
* XXX obsolete
......@@ -2121,60 +2069,6 @@ GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logTyp
#endif /* GL_MESA_packed_depth_stencil */
#ifndef GL_MESA_program_debug
#define GL_MESA_program_debug 1
#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
#endif /* GL_MESA_program_debug */
#ifndef GL_MESA_texture_array
#define GL_MESA_texture_array 1
/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array.
*/
#ifndef GL_EXT_texture_array
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target,
GLenum attachment, GLuint texture, GLint level, GLint layer);
#endif /* GL_GLEXT_PROTOTYPES */
#if 0
/* (temporarily) disabled because of collision with typedef in glext.h
* that happens if apps include both gl.h and glext.h
*/
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target,
GLenum attachment, GLuint texture, GLint level, GLint layer);
#endif
#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
#endif
#endif
#ifndef GL_ATI_blend_equation_separate
#define GL_ATI_blend_equation_separate 1
......@@ -2186,27 +2080,20 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
#endif /* GL_ATI_blend_equation_separate */
/**
** NOTE!!!!! If you add new functions to this file, or update
** glext.h be sure to regenerate the gl_mangle.h file. See comments
** in that file for details.
**/
/**********************************************************************
* Begin system-specific stuff
*/
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export off
/* GL_OES_EGL_image */
#if !defined(GL_OES_EGL_image) && !defined(GL_EXT_EGL_image_storage)
typedef void* GLeglImageOES;
#endif
#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
#pragma import off
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
/*
* End system-specific stuff
**********************************************************************/
#ifdef __cplusplus
......
#ifndef __gl3ext_h_
#define __gl3ext_h_
/*
* This file is intentionally empty and is provided for source compatibility
* with Mesa.
*/
#endif /* __gl3ext_h_ */
......@@ -17,16 +17,21 @@ GL_HEADER_FILES = \
GL/glext.h \
KHR/khrplatform.h
GLES_HEADER_FILES = \
GLES1_HEADER_FILES = \
GLES/egl.h \
GLES/gl.h \
GLES/glext.h \
GLES/glplatform.h \
GLES/glplatform.h
GLES2_HEADER_FILES = \
GLES2/gl2ext.h \
GLES2/gl2.h \
GLES2/gl2platform.h \
GLES2/gl2platform.h
GLES3_HEADER_FILES = \
GLES3/gl31.h \
GLES3/gl32.h \
GLES3/gl3ext.h \
GLES3/gl3.h \
GLES3/gl3platform.h
......@@ -39,16 +44,24 @@ EGL_HEADER_FILES = \
EGL/eglext.h \
EGL/eglplatform.h
if ENABLE_EGL_HEADERS
if ENABLE_GL_HEADERS
nobase_include_HEADERS += $(GL_HEADER_FILES)
else
noinst_HEADERS += $(GL_HEADER_FILES)
endif
if ENABLE_GLES_HEADERS
nobase_include_HEADERS += $(GLES_HEADER_FILES)
if ENABLE_GLES1_HEADERS
nobase_include_HEADERS += $(GLES1_HEADER_FILES)
else
noinst_HEADERS += $(GLES1_HEADER_FILES)
endif
if ENABLE_GLES2_HEADERS
nobase_include_HEADERS += $(GLES2_HEADER_FILES)
nobase_include_HEADERS += $(GLES3_HEADER_FILES)
else
noinst_HEADERS += $(GLES_HEADER_FILES)
noinst_HEADERS += $(GLES2_HEADER_FILES)
noinst_HEADERS += $(GLES3_HEADER_FILES)
endif
if ENABLE_GLX_HEADERS
......@@ -63,3 +76,4 @@ else
noinst_HEADERS += $(EGL_HEADER_FILES)
endif
EXTRA_DIST = meson.build
\ No newline at end of file
# Copyright © 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Materials, and to
# permit persons to whom the Materials are furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be included
# unaltered in all copies or substantial portions of the Materials.
# Any additions, deletions, or changes to the original source files
# must be clearly indicated in accompanying documentation.
# If only executable code is distributed, then the accompanying
# documentation must state that "this software is based in part on the
# work of the Khronos Group."
# THE MATERIALS ARE 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
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
inc_include = include_directories('.')
install_headers(
'glvnd/GLdispatchABI.h',
'glvnd/libglxabi.h',
'glvnd/libeglabi.h',
subdir : 'glvnd'
)
_headers = get_option('headers')
if _headers
install_headers(
'GL/gl.h',
'GL/glcorearb.h',
'GL/glext.h',
subdir : 'GL',
)
install_headers(
'KHR/khrplatform.h',
subdir : 'KHR',
)
endif
if with_glx and _headers
install_headers(
'GL/glx.h',
'GL/glxext.h',
subdir : 'GL',
)
endif
if get_option('gles1') and _headers
install_headers(
'GLES/egl.h',
'GLES/gl.h',
'GLES/glext.h',
'GLES/glplatform.h',
subdir : 'GLES'
)
endif
if get_option('gles2') and _headers
install_headers(
'GLES2/gl2ext.h',
'GLES2/gl2.h',
'GLES2/gl2platform.h',
subdir : 'GLES2',
)
install_headers(
'GLES3/gl31.h',
'GLES3/gl32.h',
'GLES3/gl3.h',
'GLES3/gl3ext.h',
'GLES3/gl3platform.h',
subdir : 'GLES3',
)
endif
if get_option('egl') and _headers
install_headers(
'EGL/egl.h',
'EGL/eglext.h',
'EGL/eglplatform.h',
subdir : 'EGL',
)
endif
# Copyright © 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Materials, and to
# permit persons to whom the Materials are furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be included
# unaltered in all copies or substantial portions of the Materials.
# Any additions, deletions, or changes to the original source files
# must be clearly indicated in accompanying documentation.
# If only executable code is distributed, then the accompanying
# documentation must state that "this software is based in part on the
# work of the Khronos Group."
# THE MATERIALS ARE 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
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
project(
'glvnd',
'c',
version : '1.3.0',
meson_version : '>= 0.48',
default_options : ['c_std=gnu99']
)
dep_null = dependency('', required : false)
cc = meson.get_compiler('c')
prog_py = import('python').find_installation()
files_symbols_check = files('bin/symbols-check.py')
prog_nm = find_program('nm')
with_asm = get_option('asm')
use_asm = false
if not with_asm.disabled()
use_asm = true
if (host_machine.cpu_family() == 'x86' and
['gnu', 'freebsd', 'dragonfly', 'linux',
'netbsd'].contains(host_machine.system()))
add_project_arguments('-DUSE_X86_ASM', language : 'c')
elif (host_machine.cpu_family() == 'x86_64' and
['freebsd', 'dragonfly', 'linux',
'netbsd'].contains(host_machine.system()))
add_project_arguments('-DUSE_X86_64_ASM', language : 'c')
elif host_machine.cpu_family() == 'arm'
add_project_arguments('-DUSE_ARMV7_ASM', language : 'c')
elif host_machine.cpu_family() == 'aarch64'
add_project_arguments('-DUSE_AARCH64_ASM', language : 'c')
elif host_machine.cpu_family() == 'ppc' and host_machine.endian() == 'little'
add_project_arguments('-DUSE_PPC64LE_ASM', language : 'c')
elif with_asm.enabled()
error('No ASM available for @0@ (@1@ endian)'.format(host_machine.system(), host_machine.endian()))
else
use_asm = false
endif
endif
if use_asm
add_project_arguments('-DUSE_DISPATCH_ASM', language : 'c')
endif
dep_dl = cc.find_library('dl', required : false)
dep_m = cc.find_library('m', required : false)
dep_threads = dependency('threads')
dep_x11 = dependency('x11', required : get_option('x11'))
dep_x11_headers = dep_x11.partial_dependency(compile_args : true, includes : true)
if dep_x11.found()
add_project_arguments('-DUSE_X11', language : ['c'])
endif
dep_xext = dep_null
dep_glproto = dep_null
with_glx = false
if get_option('glx').enabled() and not dep_x11.found()
error('Cannot build GLX support without X11.')
elif not get_option('glx').disabled() and dep_x11.found()
dep_xext = dependency('xext', required : get_option('glx'))
dep_glproto = dependency('glproto', required : get_option('glx'))
with_glx = true
endif
dep_glx = [dep_xext, dep_glproto]
if cc.compiles('typeof(int *);', name : 'typeof')
add_project_arguments('-DHAVE_TYPEOF', language : ['c'])
endif
with_tls = get_option('tls')
have_tls = false
if not with_tls.disabled()
have_tls = cc.compiles(
'__thread int foo __attribute__((tls_model("initial-exec")));',
name : 'initial-exec TLS',
)
endif
if have_tls
add_project_arguments('-DGLDISPATCH_USE_TLS', language : ['c'])
endif
gl_dispatch_type = 'pure_c'
if use_asm
if host_machine.cpu_family().startswith('x86')
gl_dispatch_type = '@0@_@1@'.format(
host_machine.cpu_family(),
have_tls ? 'tls' : 'tsd',
)
elif host_machine.cpu_family() == 'arm'
gl_dispatch_type = 'armv7_tsd'
elif host_machine.cpu_family() == 'aarch64'
gl_dispatch_type = 'aarch64_tsd'
elif host_machine.cpu_family() == 'ppc64' and host_machine.endian() == 'little'
gl_dispatch_type = 'ppc64le_@1@'.format(have_tls ? 'tls' : 'tsd')
endif
endif
add_project_arguments('-DGLDISPATCH_TYPE_@0@'.format(gl_dispatch_type.to_upper()), language : ['c'])
if cc.has_function_attribute('constructor')
add_project_arguments('-DUSE_ATTRIBUTE_CONSTRUCTOR', language : ['c'])
endif
if cc.compiles('''
#include <pthread.h>
void foo(void)
{
pthread_rwlock_t lock;
pthread_rwlock_init(&lock, NULL);
}''',
name : 'pthread rwlock')
add_project_arguments('-DHAVE_PTHREAD_RWLOCK', language : ['c'])
endif
if cc.compiles('''
int foo(int volatile *val, int oldVal, int newVal)
{
return __sync_add_and_fetch(val, 1);
return __sync_lock_test_and_set(val, newVal);
return __sync_val_compare_and_swap(val, oldVal, newVal);
}''',
name : 'sync intrinsics')
add_project_arguments('-DHAVE_SYNC_INTRINSICS', language : ['c'])
endif
if cc.has_function('mincore')
add_project_arguments('-DHAVE_MINCORE', language : ['c'])
endif
if cc.has_header_symbol('dlfcn.h', 'RTLD_NOLOAD')
add_project_arguments('-DHAVE_RTLD_NOLOAD', language : ['c'])
endif
if cc.has_member('struct dirent', 'd_type', prefix : '#include <dirent.h>')
add_project_arguments('-DHAVE_DIRENT_DTYPE', language : ['c'])
endif
_p = get_option('dispatch-page-size')
if _p != 0
add_project_arguments('-DGLDISPATCH_PAGE_SIZE=' + _p, language : ['c'])
endif
# Set EGL_NO_X11 unconditionally, Libglvnd doesn't make any assumptions about
# native display or drawable types, so we don't need X11-specific typedefs for
# them
add_project_arguments('-DEGL_NO_X11', language : ['c'])
pkg = import('pkgconfig')
subdir('include')
subdir('src')
subdir('tests')
pkg.generate(
name : 'libglvnd',
description : 'Vendor-neutral OpenGL dispatch library vendor interface',
version : meson.project_version(),
)
# Copyright © 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Materials, and to
# permit persons to whom the Materials are furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be included
# unaltered in all copies or substantial portions of the Materials.
# Any additions, deletions, or changes to the original source files
# must be clearly indicated in accompanying documentation.
# If only executable code is distributed, then the accompanying
# documentation must state that "this software is based in part on the
# work of the Khronos Group."
# THE MATERIALS ARE 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
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
option(
'asm',
type : 'feature',
description : 'Use ASM when compiling.'
)
option(
'x11',
type : 'feature',
description : 'Support the X11 window system.'
)
option(
'egl',
type : 'boolean',
value : true,
description : 'Support the EGL platform.'
)
option(
'glx',
type : 'feature',
description : 'Support the GLX platform.'
)
option(
'gles1',
type : 'boolean',
value : true,
description : 'Support OpenGL ES 1.x.'
)
option(
'gles2',
type : 'boolean',
value : true,
description : 'Support OpenGL ES 2.x and 3.x.'
)
option(
'tls',
type : 'feature',
description : 'Use Thread Local Storage.'
)
option(
'dispatch-page-size',
type : 'integer',
value : 0,
description : 'Page size to align static dispatch stubs.'
)
option(
'headers',
type : 'boolean',
value : true,
description : 'Install headers for enabled APIs.'
)
......@@ -110,5 +110,18 @@ g_egldispatchstubs.h : $(GENERATE_DEPS)
$(AM_V_GEN)$(PYTHON) $(GENERATE_DISPATCH_SCRIPT) header $(GENERATE_LIST_FILES) > $@
endif
AM_TESTS_ENVIRONMENT = \
TOP_SRCDIR='$(top_srcdir)' \
TOP_BUILDDIR='$(top_builddir)' \
NM='$(NM)' \
PYTHON='$(PYTHON)'
TESTS = egl-symbol-check.sh
EXTRA_DIST = \
egl-symbol-check.sh \
egl.symbols \
meson.build
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = egl.pc
#!/bin/sh
test "${PYTHON}" = ":" && exit 77
test "x${NM}" = "x" && exit 77
exec "${PYTHON}" "${TOP_SRCDIR}/bin/symbols-check.py" \
--nm "${NM}" \
--lib "${TOP_BUILDDIR}/src/EGL/.libs/libEGL.so" \
--symbols-file "${TOP_SRCDIR}/src/EGL/egl.symbols"