Commit Graph

100 Commits

Author SHA1 Message Date
Marc-André Lureau
f52dfe02cb m4macros: drop unused m4 files
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-07-30 17:03:07 +04:00
Simon McVittie
25f297111e m4macros: Increment serial number of glib-2.0.m4
aclocal's ability to compare the version of macros and use the latest
version relies on the serial number being incremented on every change,
or at least on every functional change.

Fixes: 6f26637e "m4macros: replace obsolete macros AC_TRY_RUN and AC_TRY_LINK in glib-2.0.m4"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-01-27 11:55:37 +00:00
Simon Marchi
6f26637e83 m4macros: replace obsolete macros AC_TRY_RUN and AC_TRY_LINK in glib-2.0.m4
Running autoconf 2.70 with -Wall,error on a configure.ac that uses
AM_PATH_GLIB_2_0 gives:

    configure.ac:261: warning: The macro `AC_TRY_RUN' is obsolete.
    configure.ac:261: You should run autoupdate.
    ./lib/autoconf/general.m4:2996: AC_TRY_RUN is expanded from...
    /usr/share/aclocal/glib-2.0.m4:11: AM_PATH_GLIB_2_0 is expanded from...
    configure.ac:261: the top level
    configure.ac:261: warning: The macro `AC_TRY_LINK' is obsolete.
    configure.ac:261: You should run autoupdate.
    ./lib/autoconf/general.m4:2919: AC_TRY_LINK is expanded from...
    /usr/share/aclocal/glib-2.0.m4:11: AM_PATH_GLIB_2_0 is expanded from...
    configure.ac:261: the top level

Run autoupdate on glib-2.0.m4 to change AC_TRY_RUN and AC_TRY_LINK into
the suggested alternative, and adjust the formatting a little bit.

The macros used in the alternative existed for long enough that there
shouldn't be a problem with backwards compatibility.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2021-01-25 16:13:08 -05:00
Philip Withnall
00bfb3ab44 tree: Fix various typos and outdated terminology
This was mostly machine generated with the following command:
```
codespell \
    --builtin clear,rare,usage \
    --skip './po/*' --skip './.git/*' --skip './NEWS*' \
    --write-changes .
```
using the latest git version of `codespell` as per [these
instructions](https://github.com/codespell-project/codespell#user-content-updating).

Then I manually checked each change using `git add -p`, made a few
manual fixups and dropped a load of incorrect changes.

There are still some outdated or loaded terms used in GLib, mostly to do
with git branch terminology. They will need to be changed later as part
of a wider migration of git terminology.

If I’ve missed anything, please file an issue!

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-12 15:01:08 +01:00
Philip Withnall
b3efef5b6f build: Drop autotools support
So long, and thanks for everything. We’re a Meson-only shop now.

glib-2-58 will remain the last stable GLib release series which is
buildable using autotools.

We continue to install autoconf macros for autotools-using projects
which depend on GLib; they are stable API.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Simon McVittie
54cbc9bccf m4macros: Fix detection of glib-2.0 alone
We unconditionally appended ">= $min_glib_version" to the modules to
look for, even though we had already included
"glib-2.0 >= $min_glib_version" in our list. When requesting additional
modules, this was fine, for example

    AM_PATH_GLIB_2_0([2.58], [:], [:], [gobject gio])

ended up asking pkg-config for

    glib-2.0 >= 2.58 gobject-2.0 gio-2.0 >= 2.58

which is redundant (since they all share a version number) but
otherwise OK.

However,

    AM_PATH_GLIB_2_0([2.58], [:], [:], [])

ended up asking pkg-config for

    glib-2.0 >= 2.58 >= 2.58

which is not OK; the second ">=" was parsed as a bizarrely-named package
to check for, and obviously few people have ">=.pc" installed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: 4bb16f48 "m4macros: Allow information from pkg-config to be overridden"
2018-10-11 12:50:21 +01:00
Simon McVittie
4bb16f4845 m4macros: Allow information from pkg-config to be overridden
By using PKG_CHECK_VAR, we declare $GLIB_COMPILE_SCHEMAS,
$GLIB_GENMARSHAL, $GOBJECT_QUERY, $GLIB_MKENUMS and
$GLIB_COMPILE_RESOURCES as Autoconf "precious variables" with AC_ARG_VAR,
similar to $PKG_CONFIG and $CC, so that they can be put on a configure
command line:

    ./configure GLIB_COMPILE_RESOURCES=my-glib-compile-resources

If they are set to a non-empty value, PKG_CHECK_VAR will use that
instead of auto-detecting from pkg-config, so that builders can
override them, for example when cross-compiling.

Similarly, use the standard PKG_CHECK_MODULES macro to get GLib's CFLAGS
and LIBS.

It's possible that most of the rest of each macro can also disappear,
but for the moment I've given them the benefit of the doubt.

This does result in printing "checking for GLIB" twice (once for
PKG_CHECK_MODULES and once for GLib's custom checks), but if you're
using Autotools, you probably don't have a strong objection to overly
verbose output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-04 20:47:29 +01:00
Philip Withnall
e130d2e511 build: Add #serial lines to m4 files
This helps prevent outdated copies of the m4 files being used if
multiple copies are available in the search path.

See https://www.gnu.org/software/automake/manual/html_node/Serials.html

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

https://bugzilla.gnome.org/show_bug.cgi?id=765552
2017-10-26 12:26:14 +01:00
Philip Withnall
3a3af3d2d3 build: Fix -Wstrict-prototypes warning in glib-2.0.m4
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=705331
2017-10-26 12:25:22 +01:00
Philip Withnall
3a926db37b build: Include gettext libraries for static compilation on Mac OS X
When compiling statically against the system-provided gettext on Mac OS
X, GLib needs to be linked against CoreFramework, which provides some
functions used by gettext.

Fix this by including the necessary macro magic from upstream gettext.

https://bugzilla.gnome.org/show_bug.cgi?id=725894
2017-04-03 10:32:55 +01:00
Javier Jardón
6b577196ee Deprecate GLIB_GNU_GETTEXT macro, use upstream gettext instead
https://bugzilla.gnome.org/show_bug.cgi?id=624186
2016-01-11 16:07:06 +00:00
Javier Jardón
4e78a0a9df Revert "Use upstream gettext instead the glib one"
This causes several problems:
- Compilation in FreeBSD with --enable-gtk-doc broke
- Modules that still use the AM_GLIB_GNU_GETTEXT macro
  doesnt compile anymore because /usr/share/glib-2.0/gettext
  is not filled with the correct files, as this was done in
  the glib custom po/Makefile.in.in

See https://bugzilla.gnome.org/show_bug.cgi?id=622991

This reverts commit e5c752371c.
2016-01-10 22:44:24 +00:00
Javier Jardón
e5c752371c Use upstream gettext instead the glib one
https://bugzilla.gnome.org/show_bug.cgi?id=622991
2016-01-09 18:49:22 +00:00
Colin Walters
d7f885b1f3 Revert "gsettings m4: check for .xml in src/builddir"
This reverts commit b3593693d9.

See: https://bugzilla.gnome.org/show_bug.cgi?id=712171#c3
See: https://bugzilla.gnome.org/show_bug.cgi?id=712171#c4

Tested using both srcdir == builddir and srcdir != builddir in hotssh.

Conflicts:
	m4macros/gsettings.m4

https://bugzilla.gnome.org/show_bug.cgi?id=712630
2013-12-23 11:28:26 -05:00
Dan Winship
7f5b2901cf Remove alleged support for last-millennium Unixes
Remove workarounds for NeXTStep (last released in 1995), SunOS (1994),
HP-UX 9.x (1992) and 10.x (1995), OSF/1 / Digital UNIX / Tru64 UNIX
4.x (1999), and AIX 4.x (1999).

HP-UX 11 implements dlopen(), so dropping support for earlier versions
also lets us remove the HP-UX-specific gmodule-dld.

https://bugzilla.gnome.org/show_bug.cgi?id=710519
2013-11-20 09:16:16 -05:00
Colin Walters
3c2d52cc96 gsettings.m4: @GSETTINGS_RULES@: Support srcdir != builddir with nonrecursive make
In hotssh I use nonrecursive make.  gnome-continuous uses srcdir !=
builddir by default.  @GSETTINGS_RULES@ will then attempt to touch a
nonexistent path.

This patch fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=712171
2013-11-18 14:19:19 -05:00
Patrick Welche
838b49ead7 configure: test(1) uses = to test for string equality
https://bugzilla.gnome.org/show_bug.cgi?id=711600
2013-11-07 07:28:27 -05:00
Ryan Lortie
f9eb9eed10 Rework the build system for a new tests approach
Perform a substantial cleanup of the build system with respect to
building and installing testcases.

First, Makefile.decl has been renamed glib.mk and substantially
expanded.  We intend to add more stuff here in the future, like canned
rules for mkenums, marshallers, resources, etc.

By default, tests are no longer compiled as part of 'make'.  They will
be built when 'make check' is run.  The old behaviour can be obtained
with --enable-always-build-tests.

--disable-modular-tests is gone (because tests are no longer built by
default).  There is no longer any way to cause 'make check' to be a
no-op, but that's not very useful anyway.

A new glibtests.m4 file is introduced.  Along with glib.mk, this
provides for consistent handling of --enable-installed-tests and
--enable-always-build-tests (mentioned above).

Port our various test-installing Makefiles to the new framework.

This patch substantially improves the situation in the toplevel tests/
directory.  Things are now somewhat under control there.  There were
some tests being built that weren't even being run and we run those now.
The long-running GObject performance tests in this directory have been
removed from 'make check' because they take too long.

As an experiment, 'make check' now runs the testcases on win32 builds,
by default.  We can't run them under gtester (since it uses a pipe to
communicate with the subprocess) so just toss them in TESTS.  Most of
them are passing on win32.

Things are not quite done here, but this patch is already a substantial
improvement.  More to come.
2013-05-31 23:12:15 -04:00
Adrian Bunk
c81a9556ff m4macros/glib-gettext.m4: Don't use AC_HEADER_STDC
AC_HEADER_STDC is obsolete (pre-C89 headers are no longer an issue),
and the resulting STDC_HEADERS define is anyway not used.

https://bugzilla.gnome.org/show_bug.cgi?id=700263
2013-05-15 15:43:50 -04:00
Colin Walters
28b30caecb configure: Enable set of standard -Werror=foo flags
We're not going to depend on gnome-common (I assume) so this patch
nicks the systemd macro to test for compiler flags, and uses it to set
a similar set of -Werror=foo as the gnome-common one does.

See https://bugzilla.gnome.org/show_bug.cgi?id=608953
See https://mail.gnome.org/archives/desktop-devel-list/2012-July/msg00100.html

If we're going to be setting more strict compiler flags for GNOME, we
should really ensure GLib builds with them first, as it's kind of the
model citizen.

In particular, you can see several times that downstreams such as
Debian have come in and fixed -Wformat-security bugs.  We should never
let those get into tarballs, or even commits.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-02 09:03:52 -04:00
Alexander Larsson
186e2d2078 Add GLIB_COMPILE_RESOURCES to glib m4 macros 2012-01-13 17:12:57 +01:00
Antoine Jacoutot
8f58c2c0c4 Fix DATADIRNAME on OpenBSD.
On OpenBSD translation files are always installed under PREFIX/share/locale,
there is no such thing as PREFIX/lib/locale; according to that, set
DATADIRNAME to "share".
2011-10-04 16:30:18 +02:00
Javier Jardón
014b4b5ae9 m4macros/gsettings.m4: Use AS_HELP_STRING instead the deprecated AC_HELP_STRING 2011-05-16 12:51:59 +01:00
Ryan Lortie
7a752e0817 Improve .gitignore 2011-03-31 15:51:01 +05:30
Christian Persch
78c34bb34f Fix gsettings enum rule to work with non-srcdir builds
Bug #635007.
2010-12-12 13:26:02 +01:00
Dan Winship
393834ac6f gsettings.m4: Fix rules to work when there are no schemas
If there are no schemas, don't try to install "" at install time.
(In particular, automake conditionals don't work properly with
@-expanded rules, so if you conditionally build a schema, you'll
still unconditionally get the install rule.)

https://bugzilla.gnome.org/show_bug.cgi?id=633381
2010-11-04 17:21:09 -04:00
Ryan Lortie
9126f1afae gsettings m4: Use --strict for checking
A while ago we allowed glib-compile-schemas to return a 'success' status
in the case that just one schema file contained errors.  Of course, this
is the exact opposite of what we want in the case that we are checking
schema validity at compile time.

Use the --strict flag for that case.

This closes #633115.
2010-10-26 12:02:12 -04:00
Ryan Lortie
136e705e83 Bug 627126 - gsettings schemas on FreeBSD
Rewrite the install rule for GSettings schemas to not depend on an
obscure chunk of non-portable sed that nobody understands the purpose
of.

Instead, use make's VPATH feature to resolve the paths of the files that
need to be installed.  No need to depend on the .valid targets here
since automake already ensures that 'make all' is complete before 'make
install' is permitted to run.
2010-10-04 01:51:11 -04:00
Benjamin Otte
99d57b5ce9 glib-2.0.m4: Use unsigned variables for version numbers
When using signed, we get complaints from gcc about comparing signed to
unsigned with -Wsign-compare. And combined with -Werror in users' CFLAGS
it breaks configure runs.
2010-09-23 13:57:22 +02:00
Emmanuele Bassi
b3de028a43 Update the Git ignore files 2010-08-03 14:21:02 +01:00
Ryan Lortie
3a8ab85d96 rename configure.in to configure.ac 2010-07-13 11:59:16 -04:00
Ryan Lortie
e73b631f6e gsettings.m4: add support for enums 2010-06-30 13:12:57 -04:00
Ryan Lortie
8a7d990698 Bug 622565 - compile-schemas fails when no schemas
Neutralise and deprecate the --uninstall option in the schema compiler
and remove it from gsettings.m4.

Make the new default behaviour a compromise between the old default
behaviour and the previous --uninstall option:

  - never return a failure code if no schema files are found

  - issue a warning instead

  - remove the gschemas.compiled file if it exists
2010-06-28 14:06:32 -04:00
Ryan Lortie
6217c9b41e Conditional gsettings.m4 support, AC_PATH_PROG
Add new support for conditional enabling of GSettings (as per
bug #616718) and use AC_PATH_PROG instead of AC_PATH_TOOL (as per
bug #621172).
2010-06-18 23:02:32 -04:00
Hib Eris
a500de8202 Let GLIB_SETTINGS macro use glib-compile-schemas from PATH when cross compiling
See bug #621172
2010-06-15 00:39:46 -04:00
Ryan Lortie
b3593693d9 gsettings m4: check for .xml in src/builddir
This checks for the .gschema.xml file in the srcdir and builddir and
runs the schema validation on which one it finds.  This handles
non-srcdir builds in both cases: .gschema.xml is in the tarball and
.gschema.xml is generated.
2010-05-27 11:58:54 -04:00
Ryan Lortie
d818bebf49 add .SECONDARY: rule to preserve generated schemas
If the .gschema.xml file was generated as the result of an implicit make
rule then make would 'rm' it after creating the validity stamp.  This
would cause 'make install' to fail.
2010-05-21 20:10:02 -04:00
Ryan Lortie
caae8ac57a Add --uninstall option to glib-compile-schemas
If --uninstall is given then don't give an error if the schema directory
is empty.  Instead, erase the gschemas.compiled file, if it exists.
This is the right thing to do in the 'make uninstall' rule, where the
schema directory could very well be left empty as a result.

Modify gsettings.m4 to use this option.
2010-05-19 16:02:05 -04:00
Ryan Lortie
b59a5551ec Bug 619038 - increase gsettings.m4 power
handle schema checking, installation, uninstallation, cleaning
2010-05-19 08:55:57 -04:00
Christian Persch
63d74caabe Use the new option name
It's --schema-file now, not --schema-files.
Bug #616864.
2010-05-15 12:00:38 +02:00
Matthias Clasen
2ed13de153 Fix issues with GSETTINGS_CHECK_RULE
Rename the --schema-files option to --schema-file, since it only
accepts one file at a time. Change the GSETTINGS_CHECK_RULE to
use it that way, too. And also make it work better with !srcdir
builds.

Bugs #616731 and #616864
2010-05-14 21:58:08 -04:00
Matthias Clasen
08b5f86697 Make GSETTINGS_CHECK_RULE work in !srcdir builds
This problem was reported in bug 617823.
2010-05-08 21:18:48 -04:00
Matthias Clasen
ec664445a9 Rename gschema-compile to glib-compile-schemas
And clean up the autofoo a bit: use an uppercase variable,
check for pkg-config, check for presence of glib-compile-schemas.
2010-04-23 17:27:26 -04:00
Javier Jardón
f68dc4d97d [gsettings] Change AM_GSETTINGS macro to GLIB_GSETTINGS
So we don't use Automake's macro namespace

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=616648
2010-04-23 17:36:35 +02:00
Matthias Clasen
3bfd739154 Rename gsettingsschemaupdatecache to the more sane gschema_compile
To follow existing glib pc variables for binaries.
2010-04-21 11:55:00 -04:00
Bastien Nocera
0d322e77a5 Add GSettings m4 macros helper
https://bugzilla.gnome.org/show_bug.cgi?id=616312
2010-04-21 16:19:09 +01:00
Paolo Bonzini
0d6b1ab42a Don't run system("touch conf.glibtest)" in the AM_PATH_GLIB_2_0 macro
Just use the C library instead to create the file. Helps building
using Wine. Not that I think we want to endorse that, but accepting
this minimal patch doesn't hurt. From bug #590016.

Signed-off-by: Tor Lillqvist <tml@iki.fi>
2009-11-03 18:43:30 +02:00
Matthias Clasen
65ac7d4034 Bug 552861 – glib-2.0.m4 calls system(3) without storing its result
2008-10-10  Matthias Clasen  <mclasen@redhat.com>

        Bug 552861 – glib-2.0.m4 calls system(3) without storing its result

        * m4macros/glib-2.0.m4: Cosmetic change to make -Werror happy.
        Patch by Andreas Köhler


svn path=/trunk/; revision=7584
2008-10-10 04:44:53 +00:00
Matthias Clasen
69c903e5b2 Remove AC_CANONICAL_HOST from GLIB_WITH_NLS again. (#385132)
2008-01-27  Matthias Clasen  <mclasen@redhat.com>

        * m4macros/glib-gettext.m4: Remove AC_CANONICAL_HOST from
        GLIB_WITH_NLS again.  (#385132)



svn path=/trunk/; revision=6388
2008-01-27 23:01:43 +00:00
Dan Winship
5fa9ff14a9 Support gio in AM_PATH_GLIB_2_0 (#509465)
2008-01-14  Dan Winship  <danw@gnome.org>

	* m4macros/glib-2.0.m4: Support gio in AM_PATH_GLIB_2_0 (#509465)



svn path=/trunk/; revision=6315
2008-01-15 10:12:58 +00:00