GNOME Bugzilla – Bug 783431
Cannot build clutter-gtk with meson on FreeBSD because -D_XOPEN_SOURCE=500 is too old
Last modified: 2017-06-05 14:24:10 UTC
_XOPEN_SOURCE=500 on FreeBSD means _POSIX_C_SOURCE=199506 and C89, but ceilf is a new function added in C99. This causes compilation error because ceilf is not declared. [1/15] Compiling c object 'clutter-gtk/clutter-gtk-1.0@sha/gtk-clutter-actor.c.o' FAILED: clutter-gtk/clutter-gtk-1.0@sha/gtk-clutter-actor.c.o clang '-Iclutter-gtk/clutter-gtk-1.0@sha' '-Iclutter-gtk' '-I../../source/clutter-gtk/clutter-gtk' '-I.' '-I../../source/clutter-gtk/' '-I/home/lantw44/gnome/devinstall/include/clutter-1.0' '-I/home/lantw44/gnome/devinstall/include/cogl' '-I/usr/local/include/cairo' '-I/home/lantw44/gnome/devinstall/include/glib-2.0' '-I/home/lantw44/gnome/devinstall/lib/glib-2.0/include' '-I/usr/local/include/pixman-1' '-I/usr/local/include/freetype2' '-I/usr/local/include/libdrm' '-I/usr/local/include/libpng16' '-I/home/lantw44/gnome/devinstall/include/gdk-pixbuf-2.0' '-I/home/lantw44/gnome/devinstall/include/atk-1.0' '-I/home/lantw44/gnome/devinstall/include/pango-1.0' '-I/home/lantw44/gnome/devinstall/include/harfbuzz' '-I/home/lantw44/gnome/devinstall/include/json-glib-1.0' '-I/home/lantw44/gnome/devinstall/include/gtk-3.0' '-I/home/lantw44/gnome/devinstall/include/gio-unix-2.0/' '-I/home/lantw44/gnome/devinstall/include/at-spi2-atk/2.0' '-I/home/lantw44/gnome/devinstall/include/at-spi-2.0' '-I/usr/local/include/dbus-1.0' '-I/usr/local/lib/dbus-1.0/include' '-Xclang' '-fcolor-diagnostics' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Wall' '-Winvalid-pch' '-std=c99' '-O2' '-g' '-D_XOPEN_SOURCE=500' '-march=corei7' '-B/home/lantw44/.local/bin' '-g3' '-O1' '-fPIC' '-pthread' '-D_THREAD_SAFE' '-ffast-math' '-fstrict-aliasing' '-Wpointer-arith' '-Wmissing-declarations' '-Wformat=2' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wnested-externs' '-Wold-style-definition' '-Wunused' '-Wuninitialized' '-Wshadow' '-Wmissing-noreturn' '-Wmissing-format-attribute' '-Wredundant-decls' '-Wcast-align' '-Wno-unused-local-typedefs' '-Werror=implicit' '-Werror=init-self' '-Werror=main' '-Werror=missing-braces' '-Werror=return-type' '-Werror=array-bounds' '-Werror=write-strings' '-fvisibility=hidden' '-DCLUTTER_GTK_ENABLE_DEBUG' '-DGLIB_DISABLE_DEPRECATION_WARNINGS' '-DCLUTTER_DISABLE_DEPRECATION_WARNINGS' '-DGDK_DISABLE_DEPRECATION_WARNINGS' '-DPREFIX="/home/lantw44/gnome/devinstall"' '-DLIBDIR="/home/lantw44/gnome/devinstall/lib"' '-DG_LOG_DOMAIN="Clutter-Gtk"' '-DG_LOG_USE_STRUCTURED=1' '-DCLUTTER_GTK_COMPILATION' '-MMD' '-MQ' 'clutter-gtk/clutter-gtk-1.0@sha/gtk-clutter-actor.c.o' '-MF' 'clutter-gtk/clutter-gtk-1.0@sha/gtk-clutter-actor.c.o.d' -o 'clutter-gtk/clutter-gtk-1.0@sha/gtk-clutter-actor.c.o' -c ../../source/clutter-gtk/clutter-gtk/gtk-clutter-actor.c ../../source/clutter-gtk/clutter-gtk/gtk-clutter-actor.c:250:20: error: implicitly declaring library function 'ceilf' with type 'float (float)' [-Werror,-Wimplicit-function-declaration] for_height = ceilf (for_height); ^ ../../source/clutter-gtk/clutter-gtk/gtk-clutter-actor.c:250:20: note: include the header <math.h> or explicitly provide a declaration for 'ceilf' 1 error generated.
Created attachment 353186 [details] [review] build: Use newer version of X/Open system interface Defining _XOPEN_SOURCE to 500 on FreeBSD means a C89 environment with _POSIX_C_SOURCE set to 199506, which disables C99 functions. Since ceilf is a new function added in C99, we should set _XOPEN_SOURCE to a higher value.
Review of attachment 353186 [details] [review]: Looks good to me, thanks!
Attachment 353186 [details] pushed as ef95dd7 - build: Use newer version of X/Open system interface