Meson build should somehow check if ./configure was run in the source dir
With commit 9a3ad1df, the meson build fails for me since cairo-gl was not properly disabled.
meson output
The Meson build system
Version: 0.55.3
Source dir: /home/psychon/projects/cairo
Build dir: /home/psychon/projects/cairo/build-meson
Build type: native build
Project name: cairo
Project version: 1.17.3
C compiler for the host machine: ccache cc (gcc 10.2.0 "cc (Debian 10.2.0-7) 10.2.0")
C linker for the host machine: cc ld.bfd 2.35
C++ compiler for the host machine: ccache c++ (gcc 10.2.0 "c++ (Debian 10.2.0-7) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.35
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/bin/python3)
Library m found: YES
Dependency gtk+-2.0 skipped: feature gtk2-utils disabled
Found pkg-config: /usr/bin/pkg-config (1.6.3)
Found CMake: /usr/bin/cmake (3.16.3)
Run-time dependency lzo2 found: NO (tried pkgconfig and cmake)
Library dl found: YES
Checking for function "dlsym" with dependency -ldl: YES
Run-time dependency zlib found: YES 1.2.11
Run-time dependency libpng found: YES 1.6.37
Run-time dependency freetype2 found: YES 23.2.17
Checking if "FT has color" with dependency freetype2 links: YES
Run-time dependency fontconfig found: YES 2.13.1
Run-time dependency x11 found: YES 1.6.10
Run-time dependency xext found: YES 1.3.3
Checking if "shmctl IPC_RMID allowes subsequent attaches" with dependencies x11, xext runs: YES
Run-time dependency xrender found: YES 0.9.10
Run-time dependency xcb found: YES 1.14
Run-time dependency xcb-render found: YES 1.14
Run-time dependency x11-xcb found: YES 1.6.10
Run-time dependency xcb-shm found: YES 1.14
Dependency QtGui skipped: feature qt disabled
Has header "ApplicationServices/ApplicationServices.h" : NO
Dependency libudev skipped: feature drm disabled
Dependency libdrm skipped: feature drm disabled
Run-time dependency gl found: YES 1.2
Has header "GL/gl.h" with dependency gl: YES
Has header "GL/glext.h" with dependency gl: YES
Dependency cogl-2.0-experimental skipped: feature cogl disabled
Dependency directfb skipped: feature directfb disabled
Library OpenVG skipped: feature openvg disabled
Run-time dependency egl found: YES 1.5
Has header "GL/glx.h" : YES
Has header "windows.h" : NO
Run-time dependency gobject-2.0 found: YES 2.66.0
Run-time dependency glib-2.0 found: YES 2.66.0
Library bfd found: NO
Program gs found: NO
Run-time dependency libspectre found: NO (tried pkgconfig and cmake)
Run-time dependency poppler-glib found: NO (tried pkgconfig and cmake)
Run-time dependency librsvg-2.0 found: NO (tried pkgconfig and cmake)
Run-time dependency pixman-1 found: YES 0.36.0
Checking for size of "void *" : 8
Checking for size of "int" : 4
Checking for size of "long" : 8
Checking for size of "long long" : 8
Checking for size of "size_t" : 8
Has header "stdint.h" : YES
Has header "inttypes.h" : YES
Has header "sys/int_types.h" : NO
Has header "fcntl.h" : YES
Has header "unistd.h" : YES
Has header "signal.h" : YES
Has header "sys/stat.h" : YES
Has header "sys/socket.h" : YES
Has header "poll.h" : YES
Has header "sys/poll.h" : YES
Has header "sys/un.h" : YES
Has header "sched.h" : YES
Has header "sys/mman.h" : YES
Has header "time.h" : YES
Has header "libgen.h" : YES
Has header "byteswap.h" : YES
Has header "signal.h" : YES (cached)
Has header "setjmp.h" : YES
Has header "fenv.h" : YES
Has header "sys/wait.h" : YES
Has header "sys/stat.h" : YES (cached)
Has header "io.h" : NO
Has header "fenv.h" : YES (cached)
Has header "xlocale.h" : NO
Has header "sys/ioctl.h" : YES
Has header "X11/extensions/XShm.h" : YES
Has header "X11/extensions/shmproto.h" : YES
Has header "X11/extensions/shmstr.h" : YES
Checking for type "uint64_t" : YES
Checking for type "uint128_t" : NO
Checking for type "__uint128_t" : YES
Checking for function "alarm" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "ctime_r" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "localtime_r" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "gmtime_r" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "drand48" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "flockfile" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "funlockfile" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "getline" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "link" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "strndup" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "fork" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "waitpid" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "raise" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "newlocale" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "strtod_l" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_Get_X11_Font_Format" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_GlyphSlot_Embolden" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_GlyphSlot_Oblique" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_Load_Sfnt_Table" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_Library_SetLcdFilter" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_Get_Var_Design_Coordinates" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FT_Done_MM_Var" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FcInit" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "FcFini" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "XRenderCreateSolidFill" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "XRenderCreateLinearGradient" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "XRenderCreateRadialGradient" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "XRenderCreateConicalGradient" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "sched_getaffinity" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "mmap" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "clock_gettime" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "feenableexcept" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "fedisableexcept" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking for function "feclearexcept" with dependencies -lm, -ldl, zlib, libpng, freetype2, fontconfig, x11, xext, xrender, xcb, xcb-render, x11-xcb, xcb-shm, gl, egl, pixman-1: YES
Checking if "pthreads" links: YES
Checking if "Atomic ops: cxx11" links: YES
Library rt found: YES
Checking for function "shm_open" with dependency -lrt: YES
Compiler for C supports arguments -Wno-attributes -Wattributes: YES
Compiler for C supports arguments -Wno-unused-but-set-variable -Wunused-but-set-variable: YES
Compiler for C supports arguments -Wno-missing-field-initializers -Wmissing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter -Wunused-parameter: YES
Compiler for C supports arguments -Wno-long-long -Wlong-long: YES
Configuring cairo-features.h using configuration
Configuring cairo-trace using configuration
Run-time dependency expat found: YES 2.2.9
Header <malloc.h> has symbol "__malloc_hook" : YES
Configuring config.h using configuration
Configuring cairo-png.pc using configuration
Configuring cairo-svg.pc using configuration
Configuring cairo-ft.pc using configuration
Configuring cairo-fc.pc using configuration
Configuring cairo-xlib.pc using configuration
Configuring cairo-xlib-xrender.pc using configuration
Configuring cairo-xcb.pc using configuration
Configuring cairo-xlib-xcb.pc using configuration
Configuring cairo-xcb-shm.pc using configuration
Configuring cairo-gl.pc using configuration
Configuring cairo-egl.pc using configuration
Configuring cairo-glx.pc using configuration
Configuring cairo-gobject.pc using configuration
Configuring cairo-script.pc using configuration
Configuring cairo-ps.pc using configuration
Configuring cairo-pdf.pc using configuration
Configuring cairo-xml.pc using configuration
WARNING: Project targeting '>= 0.50.0' but tried to use feature introduced in '0.53.0': summary.
Build targets in project: 19
WARNING: Project specifies a minimum meson_version '>= 0.50.0' but uses features which were added in newer versions:
* 0.53.0: {'summary'}
cairo 1.17.3
Surface Backends
Image: YES
Recording: YES
Observer: YES
Mime: YES
Tee: NO
XML: YES
Xlib: YES
Xlib Xrender: YES
Qt: NO
Quartz: NO
Quartz-image: NO
XCB: YES
Win32: NO
OS2: NO
CairoScript: YES
PostScript: YES
PDF: YES
SVG: YES
OpenGL: YES
OpenGL ES 2.0: NO
OpenGL ES 3.0: NO
BeOS: NO
DirectFB: NO
OpenVG: NO
DRM: NO
Cogl: NO
Font Backends
User: YES
FreeType: YES
Fontconfig: YES
Win32: NO
Quartz: NO
Functions
PNG functions: YES
GLX functions: YES
WGL functions: NO
EGL functions: YES
X11-xcb: YES
XCB-shm: YES
Features and Utilities
cairo-trace:: YES
cairo-script-interpreter: YES
Found ninja-1.10.1 at /usr/bin/ninja
The build fails with (this is just the first part of the output; there are a total of 5024 lines of output):
[1/33] Compiling C object src/libcairo.so.2.1173.0.p/cairo-gl-shaders.c.o
FAILED: src/libcairo.so.2.1173.0.p/cairo-gl-shaders.c.o
ccache cc -Isrc/libcairo.so.2.1173.0.p -Isrc -I../src -I. -I.. -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/uuid -I/usr/include/pixman-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -fPIC -Wno-attributes -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -D_REENTRANT -DHAVE_CONFIG_H -MD -MQ src/libcairo.so.2.1173.0.p/cairo-gl-shaders.c.o -MF src/libcairo.so.2.1173.0.p/cairo-gl-shaders.c.o.d -o src/libcairo.so.2.1173.0.p/cairo-gl-shaders.c.o -c ../src/cairo-gl-shaders.c
In file included from ../src/cairo-gl-private.h:51,
from ../src/cairo-gl-shaders.c:43:
../src/cairo-gl.h:152:3: error: #error Cairo was not compiled with support for the GL backend
152 | # error Cairo was not compiled with support for the GL backend
| ^~~~~
In file included from ../src/cairo-gl-private.h:52,
from ../src/cairo-gl-shaders.c:43:
../src/cairo-gl-gradient-private.h:74:5: error: unknown type name ‘GLuint’
74 | GLuint tex;
| ^~~~~~
In file included from ../src/cairo-gl-shaders.c:43:
I'm not sure what is going on here. Hm...
Oh, noes. I previously ran ./configure
in the top source dir and apparently didn't have GL headers back then. So, the cairo-features.h
from that is found and included, instead of the correct one. That took me way too long to notice and perhaps meson could at least warn about this?