After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783431 - Cannot build clutter-gtk with meson on FreeBSD because -D_XOPEN_SOURCE=500 is too old
Cannot build clutter-gtk with meson on FreeBSD because -D_XOPEN_SOURCE=500 is...
Status: RESOLVED FIXED
Product: clutter-gtk
Classification: Platform
Component: general
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: clutter-gtk maintainer(s)
clutter-gtk maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-06-05 13:53 UTC by Ting-Wei Lan
Modified: 2017-06-05 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Use newer version of X/Open system interface (991 bytes, patch)
2017-06-05 13:59 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2017-06-05 13:53:45 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.
Comment 1 Ting-Wei Lan 2017-06-05 13:59:54 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2017-06-05 14:18:24 UTC
Review of attachment 353186 [details] [review]:

Looks good to me, thanks!
Comment 3 Ting-Wei Lan 2017-06-05 14:24:06 UTC
Attachment 353186 [details] pushed as ef95dd7 - build: Use newer version of X/Open system interface