Commit Graph

199 Commits

Author SHA1 Message Date
Xavier Claessens
4f3216d7c0 Merge branch 'nls' into 'master'
Meson: Add 'nls' option to disable translation

See merge request GNOME/glib!484
2018-11-27 14:32:25 +00:00
Xavier Claessens
c49ed610ed Check for zlib header
It is not enough to check for the library, we also need zlib.h installed
to be able to use it. Autotools were also checking for the header.
2018-11-22 20:14:30 -05:00
Thibault Saunier
8cc92bcca6 meson: Turn selinux into a meson feature and make it auto by default
Making it more user friendly when building on distro no deploying selinux
2018-11-20 15:58:58 -03:00
Xavier Claessens
7412011716 Meson: Add 'nls' option to disable translation
It is not always needed to generate and install gmo files, for example
when building for Android or Windows that often doesn't have libintl to
use them anyway.

At least all GStreamer modules have this same option.
2018-11-20 11:35:14 -05:00
Xavier Claessens
2ded434b40 Check for 'z' library before fallbacking to subproject 2018-11-19 15:22:16 -05:00
Xavier Claessens
9534447eb0 Merge branch 'fix-gio-test-build' into 'master'
Meson: Fix build error in gdbus-example-objectmanager

See merge request GNOME/glib!461
2018-11-14 15:37:05 +00:00
Xavier Claessens
ba2c519819 Meson: Rename test_c_args to avoid confusion with gio tests c_args 2018-11-14 09:38:33 -05:00
Niclas Moeslund Overby
704522c5fd meson: add aarch64 memory barrier handling
memory barriers for aarch64 ref: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/CJAIAJFI.html
2018-11-13 17:00:09 +01:00
Philip Withnall
b09a0df9a9 Merge branch '1576-meson-armv5-atomic' into 'master'
meson: Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 on GNU/Linux if needed

Closes #1576

See merge request GNOME/glib!434
2018-11-02 20:56:37 +00:00
Simon McVittie
a40ef2ff92 meson: Increase fast test timeout from 30s to 60s
This is enough for most Debian buildds, including embedded devices
like mips and powerpcspe. It is not enough for hppa (PA-RISC), but that
architecture is so uniquely slow that it might make more sense to
special-case it downstream.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-01 19:13:21 +00:00
Simon McVittie
13e206aaeb meson: Centralize test timeout values
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-01 19:13:21 +00:00
Simon McVittie
4e058a698a meson: Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 on GNU/Linux if needed
armv5 Linux systems implement __sync_bool_compare_and_swap() and
friends by calling a function provided by the kernel. This is not
technically an atomic intrinsic, so gcc doesn't define
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 in this case, but it's good
enough for us. Extend the current Android special case to cover
GNU/Linux too.

The possibilities are:

* __sync_foo detected and __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 predefined:
  calls to __atomic_foo or __sync_foo primitives are inlined into user
  code by gatomic.h

* __sync_foo detected but __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not
  predefined: user code has an extern reference to g_atomic_foo(),
  which calls __atomic_foo or __sync_foo because we defined
  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 when compiling GLib itself

* Windows: user code has an extern reference to g_atomic_foo(),
  which calls InterlockedFoo()

* !defined(G_ATOMIC_LOCK_FREE): user code has an extern reference to
  g_atomic_foo(), which emulates atomic operations with a mutex

Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1576
2018-10-30 17:20:43 +00:00
Ting-Wei Lan
295964a380 gutils: Check whether getauxval function exists
FreeBSD 12 adds a new header, sys/auxv.h, to declare a function, elf_aux_info,
for public use, which was considered an internal function in previous releases.
This new function provides similar functionality with glibc getauxval, which is
also declared in the same header, but their interfaces are not compatible. Since
the only usage of sys/auxv.h is in g_check_setuid and FreeBSD already has
issetugid to provide the required functionality, we fixes the compilation error
by adding a check for getauxval function to prevent g_check_setuid from calling
getauxval when sys/auxv.h is found but getauxval is not available.

https://reviews.freebsd.org/D12743
https://reviews.freebsd.org/rS324815
2018-10-29 14:57:24 +00:00
Nirbheek Chauhan
8b3590c231 meson: Add macOS libtool versioning for ABI compatibility
With this, the compatibility version and current version values in macOS
and iOS dylibs will match the values set by Autotools.

See: https://github.com/mesonbuild/meson/issues/1451
2018-10-22 06:51:32 +05:30
pdknsk
a2c09f57f6 Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
Ryan Schmidt
a187c89002 Fix build failure on systems without spawn.h 2018-09-28 23:50:40 -05:00
Xavier Claessens
24d7a73b93 Meson: Bump dependency to 0.48.0 2018-09-27 16:01:41 -04:00
Xavier Claessens
b512135fc6 Merge branch '1535-tap' into 'master'
Meson: Run in TAP mode installed tests that support it

Closes #1535

See merge request GNOME/glib!343
2018-09-24 14:49:40 +00:00
Xavier Claessens
8391219e4c Meson: Run in TAP mode installed tests that support it 2018-09-23 13:44:15 -04:00
Xavier Claessens
3896bc3659 Meson: define G_HAVE_GROWING_STACK to 0 or 1 2018-09-23 12:59:40 -04:00
Emmanuele Bassi
e8fde0b9e7 Install m4 macros unconditionally
Partial revert of commit a7a6449f4d.

Checking for the availability of m4 for installing m4 macro files
creates an implicit dependency on m4 even if GLib does not need it; this
prevents building GLib and then installing Autotools in order to build a
project that depends on GLib.

Closes #1520
2018-09-10 12:44:59 +01:00
Emmanuele Bassi
fd2d94dca5 Merge branch '656-format-security' into 'master'
build: Set -Wformat when testing for -Wformat-security

Closes #656

See merge request GNOME/glib!300
2018-09-05 09:42:33 +00:00
Philip Withnall
98f326a020 Merge branch 'wip/otte/fallthrough' into 'master'
Add G_GNUC_FALLTHROUGH for __attribute__(fallthrough))

See merge request GNOME/glib!296
2018-09-04 22:06:26 +00:00
Benjamin Otte
93b9f22369 build: Enable -Wimplicit-fallthrough by default 2018-09-04 20:24:25 +02:00
Philip Withnall
9e9db46a49 build: Drop pointless -Wformat-security warning flag
We already set -Wformat=2, which implies -Wformat-security, so there’s
no need to test for and set -Wformat-security separately.

The test for -Wformat-security never worked anyway, since gcc complains
if it’s specified without also setting -Wformat to some value. The
complaint causes configure.ac/meson.build to assume the option doesn’t
work.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/656
2018-09-04 09:51:49 +01:00
Philip Withnall
b79bafccfe Merge branch 'glib-gettextize' into 'master'
meson: fix typo

See merge request GNOME/glib!295
2018-09-03 12:18:36 +00:00
Jan Tojnar
b3da2b4064
meson: install glib-gettextize to bindir 2018-09-02 20:36:04 +02:00
Jan Tojnar
48821a50b4
meson: fix typo 2018-09-02 20:35:26 +02:00
Rasmus Thomsen
44704b7a49
build: fix installation dir of glib-gettextize 2018-08-31 15:58:38 +02:00
Xavier Claessens
b2375471cc Merge branch '1313-config-cleanups' into 'master'
More config.h fixups for Meson

Closes #1313

See merge request GNOME/glib!283
2018-08-31 12:56:26 +00:00
Philip Withnall
3fd9f83ae4 build: Bump version to 2.59.0
Ready for the new unstable release series.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-08-31 12:51:38 +01:00
Philip Withnall
8271263af3 Merge branch 'require-python34' into 'master'
[RFC] build: Drop Python 2 support and require Python 3.4+

See merge request GNOME/glib!196
2018-08-31 10:48:11 +00:00
Philip Withnall
41a3951c8f Merge branch 'simplify-alloca-checks' into 'master'
build: simplify alloca checks. See #1313

See merge request GNOME/glib!268
2018-08-31 10:45:29 +00:00
Philip Withnall
ee2b3c5e97 build: Remove SIZEOF___INT64 definition from meson.build
This was a leftover from use of the __int64 type, which was removed
recently in commit 7e821441c4.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-08-31 11:41:12 +01:00
Philip Withnall
b707c71ce4 build: Stop defining STDC_HEADERS
This was previously defined by the AC_HEADER_STDC macro in configure.ac,
but we don’t use that any more. Nothing in GLib depends on this macro,
and neither does anything in my /usr/include which we might care about.

The autoconf documentation for AC_HEADER_STDC says it’s deprecated:
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Particular-Headers.html#index-AC_005fHEADER_005fSTDC-621

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-08-31 11:41:12 +01:00
Philip Withnall
8759582716 build: Drop unused HAVE_DLFCN_H definition
I can’t see this being used anywhere in GLib, or in my /usr/include
directory. I’m also not sure how configure.ac ends up defining it — it’s
certainly as a side-effect of something, and not deliberate.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-08-31 11:41:12 +01:00
Philip Withnall
3032b5ed5b build: Check for bind_textdomain_codeset() properly
Previously we weren’t checking for it in meson.build (but were checking
for it in configure.ac, courtesy of glib-gettext.m4). Roughly emulate
the checks from glib-gettext.m4, checking for bind_textdomain_codeset()
in whichever libintl implementation we found ngettext() in.

meson.build still doesn’t implement the full set and order of checks in
glib-gettext.m4; there’s still a FIXME about that in meson.build.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-08-31 11:41:12 +01:00
Philip Withnall
7bc3edd1e5 build: Define GLIB_USING_SYSTEM_PRINTF properly
Previously it was hard-coded to true, rather than being based on the
calculations actually made by meson.build.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-08-31 11:36:14 +01:00
Philip Withnall
f35c4d5d42 build: Check for Unix98 positional parameter support in printf()
This is equivalent to the AC_FUNC_PRINTF_UNIX98 macro which we use in
configure.ac. There may still be some obscure Unix platforms which don’t
natively support positional parameters, 20 years on.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1313
2018-08-31 11:36:13 +01:00
Philip Withnall
c138b98e36 2.58.0
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-30 18:11:13 +01:00
Nirbheek Chauhan
64f789c6e2 meson: Always set G_MODULE_SUFFIX to so on macOS
This is what Autotools does, and it's what all consumers of the
GModule API expect. Without this change, people on macOS upgrading to
a GLib built with Meson will find that their plugins no longer load.

Projects that use Meson and the `g_module_build_path()` API such as
glib-networking should pass `name_suffix:` to `shared_module()` to
ensure that plugins continue to be called libfoo.so on macOS.

New GModule API will eventually be added to address this.

See also:
https://gitlab.gnome.org/GNOME/glib/issues/1413
a3d81719fe/meson.build (L108)
2018-08-29 15:38:38 +05:30
Christoph Reiter
11fcc2f1ac build: simplify alloca checks. See #1313
The goal of this commit is to reduce differences between the autotools and meson build.

With autotools AC_FUNC_ALLOCA was used which defines HAVE_ALLOCA_H, HAVE_ALLOCA,
C_ALLOCA. meson tried to replicate that with has_function() but alloca can be a macro
and and is named _alloca under Windows. Since we require a working alloca anyway
and only need to know if the header exists replace AC_FUNC_ALLOCA with a simple
AC_CHECK_HEADERS.

There is still one user of HAVE_ALLOCA in the embedded gnulib, but since alloca is
always provided through galloca.h just force define HAVE_ALLOCA there and add a comment.

The docs were mentioning alloca as an example for cross compiling. Since that variable no
longer exists now replace it with another one.
2018-08-24 10:57:10 +02:00
Philip Withnall
f2504be625 2.57.3
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-23 18:48:14 +01:00
John Ralls
5df3f42d7b build: Mismatch between gint64 and int64_t in OSX 64-bit
Check for compile warnings when assigning an int64_t* to a long*,
make gint64 a long long if they occur and assigning an int64_t* to
a long long* doesn't.

Modified by Philip Withnall <withnall@endlessm.com> to support Meson as
well as autotools.

https://gitlab.gnome.org/GNOME/glib/issues/972
2018-08-21 10:25:47 +01:00
Christoph Reiter
7e6fb333f7 meson: define _FILE_OFFSET_BITS=64 for MinGW. See #1476
The autotools build set it by default and we use off_t in various places,
even on Windows. Also set it with the meson build to avoid any regressions.

Ideally we shouldn't use off_t and use 64bit capable API on Windows instead, so
we get large file support with MSVC as well.
2018-08-05 22:04:17 +02:00
Christoph Reiter
93261e307b build: Drop Python 2 support and require Python 3.4+
See https://mail.gnome.org/archives/desktop-devel-list/2018-July/msg00004.html
for a discussion on if/when we can start relying on Python 3 only.

Use Python 3.4 as a new requirement because that's the version used in
SLES 12 and Debian 8 and there is no good reason to require something newer
right now.
2018-07-24 12:30:25 +02:00
Nirbheek Chauhan
4e1488eebb Merge branch 'meson-python-module' into 'master'
meson: use the new 'python' module instead of the 'python3' one

Closes #1455

See merge request GNOME/glib!187
2018-07-23 11:17:47 +00:00
Matthias Clasen
a486923001 2.57.2 2018-07-19 06:42:58 -04:00
Christoph Reiter
631c3534b7 meson: use the new 'python' module instead of the 'python3' one. Closes #1455
The new python module, added with 0.46, works with Python 2 and 3 and
allows to pass a path for the interpreter to use, if the need arises.

Previously the meson build set PYTHON, used in the shebang line of
the scripts installed by glib, to the full path of the interpreter.
The new meson module doesn't expose that atm, but we should set it to
a executable name anyway, and not a full path.
2018-07-19 12:32:29 +02:00
Xavier Claessens
1bba3276bb Meson: Install glib tests
Fixes: #1444.
2018-07-16 15:36:20 -04:00