+commit bffbb4b1f823de5035e51e013dc6da5a973045aa
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Mar 20 14:23:59 2017 +0100
+
+ configure.ac: pre-release version bump to 3.24.0
+
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 78defd2ab5f1935a6226336eaa08727e7516fb02
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Mar 13 20:14:37 2017 +0100
+
+ release 3.23.92
+
+ NEWS | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+commit 4ccabfec0cececba935339ea8449ec51b4aeef5e
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Mar 13 20:13:13 2017 +0100
+
+ Version bump to 3.23.92
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit ebc245c477c36fa1f65f80d2e75792b82d837611
+Author: Fabian Orccon <cfoch.fabian@gmail.com>
+Date: Tue Jan 24 00:00:12 2017 -0500
+
+ overrides: Update for Gdk-4.0 and Gtk+-4.0
+
+ Override Gdk.Color and Gdk.RGBA according version.
+ Use properly Gtk.init_check in Gtk+-4.0
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=777680
+
+ gi/overrides/Gdk.py | 74
+ ++++++++++++++++++++++++++++-------------------------
+ gi/overrides/Gtk.py | 7 +++--
+ 2 files changed, 44 insertions(+), 37 deletions(-)
+
+commit d005df9645fd5fb2f19bd09384355f45591f1e58
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Jan 23 21:26:05 2017 +0100
+
+ Disable -Werror=missing-prototypes
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=760056
+ added some code triggering "missing-prototype" which we by default
+ treat as an error. This disables that specific error by default.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=777534
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6695931a0dfb7d9db9ea14a128108342c3d0be89
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Jan 9 20:44:11 2017 +0100
+
+ Fix new PEP8 errors
+
+ Two new errors popped up:
+
+ * E305 expected 2 blank lines after class or function definition
+ * E741 ambiguous variable name
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=776009
+
+ examples/cairo-demo.py | 1 +
+ examples/properties.py | 1 +
+ gi/_option.py | 1 +
+ gi/overrides/GIMarshallingTests.py | 2 ++
+ gi/overrides/GLib.py | 19 +++++++++++++++++++
+ gi/overrides/GObject.py | 12 ++++++++++++
+ gi/overrides/Gdk.py | 3 +++
+ gi/overrides/Gio.py | 2 ++
+ gi/overrides/Gtk.py | 35
+ +++++++++++++++++++++++++++++++++++
+ gi/overrides/Pango.py | 2 ++
+ gi/types.py | 1 +
+ pygtkcompat/pygtkcompat.py | 1 +
+ tests/test_generictreemodel.py | 1 +
+ tests/test_interface.py | 4 ++++
+ tests/test_iochannel.py | 1 +
+ tests/test_overrides_gtk.py | 10 +++++-----
+ tests/test_properties.py | 12 ++++++------
+ tests/test_signal.py | 1 +
+ 18 files changed, 98 insertions(+), 11 deletions(-)
+
+commit 3f68e0a352abc12e1990e82e3134c48f0be2b3c9
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Wed Mar 23 17:07:53 2016 +0100
+
+ Move pep8/pyflakes tests from 'make check' to 'make check.quality'
+
+ The current behaviour is problematic because new versions of
+ pep8/pyflakes
+ add new warnings or get more picky. This makes testing
+ hard in case newly added code is developed on an older version
+ or when testing old branches/releases.
+
+ This moves the pep8/pyflakes tests to a new "make check.quality"
+ command.
+
+ This also removes the SKIP_PEP8 flag which was added in
+ 25d12afd06863ce
+ to speed up make check.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=764087
+
+ HACKING | 2 +-
+ Makefile.am | 12 +++++-------
+ 2 files changed, 6 insertions(+), 8 deletions(-)
+
+commit 222f5581c38551bdd5c6c9ca4e895d1f44397ad1
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Fri Oct 21 13:59:54 2016 +0200
+
+ overrides: Update for Gtk-4.0
+
+ Skip things which are gone since 4.0.
+ This only fixes importing and doesn't add any tests for now.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=773315
+
+ gi/overrides/Gtk.py | 482
+ ++++++++++++++++++++++++++--------------------------
+ 1 file changed, 242 insertions(+), 240 deletions(-)
+
+commit 8694e4dd42565f07b6f9ba1221fb03146be333a0
+Author: Dan Nicholson <nicholson@endlessm.com>
+Date: Wed Dec 21 12:02:14 2016 -0600
+
+ Handle exception unreffing Variant at exit
+
+ Calling unref will cause gi and gi.repository.GLib to be imported.
+ However, if the program is exiting, then these modules have likely
+ been
+ removed from sys.modules and will raise an exception. Assume
+ that's the
+ case for ImportError and ignore the exception since everything will be
+ cleaned up, anyways.
+
+ This can be triggered with the following trivial program:
+
+ $ python3 -c 'from gi.repository import GLib; v = GLib.Variant("s",
+ "foo")'
+ Exception ignored in:
+
+ Adding some debug code to show the full exception revealed this:
+
+ Traceback (most recent call last):
+ File "/home/dan/src/pygobject/build3/gi/overrides/GLib.py", line
+ 265, in __del__
+ self.unref()
+ ImportError: import of 'gi.repository.GLib' halted; None in
+ sys.modules
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=776092
+
+ gi/overrides/GLib.py | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+commit 54c623ba639654716ca475f75c92cc8ed673d9f5
+Author: Dan Nicholson <nicholson@endlessm.com>
+Date: Wed Dec 21 11:50:08 2016 -0600
+
+ Handle multiple deinit of callable cache
+
+ In python3, it seems that the callable cache deinit can be called
+ multiple times when the program is exiting. Make that safer by
+ clearing
+ the various pointers in the structure using g_clear_pointer and
+ Py_CLEAR. A subsequent call will skip all the deinit by seeing NULL
+ pointers for the members.
+
+ This was causing a critical warning when destroying the arg name hash
+ table multiple times with the following trivial program:
+
+ $ python3 -c 'from gi.repository import GLib; v = GLib.Variant("s",
+ "foo")'
+
+ (process:32378): GLib-CRITICAL **: g_hash_table_destroy: assertion
+ 'hash_table != NULL' failed
+
+ (process:32378): GLib-CRITICAL **: g_hash_table_destroy: assertion
+ 'hash_table != NULL' failed
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=776092
+
+ gi/pygi-cache.c | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+commit 94226b8eb63dd985def8501168572ee16e02acad
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Sep 19 15:31:57 2016 +0200
+
+ configure.ac: post-release version bump to 3.23.0
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit fb1b8fa8a67f2c7ea7ad4b53076496a8f2b4afdb
+Author: Christoph Reiter <creiter@src.gnome.org>
+Date: Mon Sep 19 15:27:35 2016 +0200
+
+ release 3.22.0
+
+ NEWS | 3 +++
+ 1 file changed, 3 insertions(+)
+
commit b93523fcdb6bc04b42709ecd30b8cd11de80f0c5
Author: Christoph Reiter <creiter@src.gnome.org>
Date: Mon Sep 19 15:24:35 2016 +0200
3 files changed, 1 insertion(+), 1050 deletions(-)
commit 2937cfe5bb7122dd3783c7919294d6a34a3dfc05
-Merge: 519e556 917ea2d
+Merge: 519e556d 917ea2df
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Mon Jul 18 10:45:18 2011 -0400
Merge branch 'master' into invoke-rewrite
commit 519e556dc1e5874e1668bad93043fb9258c7ee79
-Merge: bab7e88 38cca3c
+Merge: bab7e882 38cca3c1
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Mon Jul 18 10:37:20 2011 -0400
1 file changed, 16 insertions(+), 8 deletions(-)
commit fbf5382fbc1aed49ed491d2255d616a1643a45fc
-Merge: 499b68d 1491f62
+Merge: 499b68d6 1491f622
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Mon Jun 13 17:28:23 2011 -0400
Merge branch 'master' into invoke-rewrite
commit 499b68d6c9040cffc6e43dc87789d68446564a92
-Merge: 4c9bced 426c710
+Merge: 4c9bcedb 426c7109
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Mon Jun 13 17:26:37 2011 -0400
2 files changed, 337 insertions(+), 267 deletions(-)
commit 17cb714cfdaf45b6d7dd627b0189bd24e6578f74
-Merge: 7332a1b 01596a9
+Merge: 7332a1b9 01596a9b
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Tue Mar 22 13:34:36 2011 -0400
2 files changed, 43 insertions(+), 1 deletion(-)
commit 71dd03261fc06b8180c14cd31b54d8e4b200be3a
-Merge: bc29600 bd002c7
+Merge: bc29600a bd002c72
Author: Dieter Verfaillie <dieterv@optionexplicit.be>
Date: Fri Jan 21 09:33:16 2011 +0100
1 file changed, 24 insertions(+), 18 deletions(-)
commit f56d85a7f39c2088bf9fd50b1b1e5b67c03104d3
-Merge: 84d6142 7d997b6
+Merge: 84d6142c 7d997b6f
Author: Sebastian Pölsterl <sebp@k-d-w.org>
Date: Tue Jan 18 13:14:45 2011 +0100
7 files changed, 84 insertions(+), 12 deletions(-)
commit 878b8f630acd2146bee364054acd45cd33eea37a
-Merge: cdacaa9 e317838
+Merge: cdacaa95 e3178381
Author: John Stowers <john.stowers@gmail.com>
Date: Fri Nov 5 11:40:22 2010 +1300
1 file changed, 3 insertions(+), 2 deletions(-)
commit fb1ee243493616d7a7e4f6924c574db39f5a423d
-Merge: acf7b43 5f9cb91
+Merge: acf7b43a 5f9cb91c
Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
Date: Wed Jun 23 12:53:05 2010 +0200
39 files changed, 75 insertions(+), 137 deletions(-)
commit 597bd64319d7966045b5b8613ca6fc85668c3f56
-Merge: ec8d148 fa91dfd
+Merge: ec8d148e fa91dfd3
Author: Johan Dahlin <johan@gnome.org>
Date: Sun Jun 20 10:53:46 2010 -0300
# pycheck_subdirs =
-check-local:
+check.quality:
@echo " CHECK Pyflakes" $(pycheck_dirs)
@if type pyflakes >/dev/null 2>&1; then \
(cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \
else echo "skipped, pyflakes not installed"; \
fi
- @if test -z "$$SKIP_PEP8"; then \
- echo " CHECK PEP8"; \
- if type pep8 >/dev/null 2>&1; then \
- (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \
- else echo "skipped, pep8 not installed"; \
- fi; \
+ @echo " CHECK PEP8";
+ @if type pep8 >/dev/null 2>&1; then \
+ (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \
+ else echo "skipped, pep8 not installed"; \
fi
check.gdb:
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
# pycheck_subdirs =
-check-local:
+check.quality:
@echo " CHECK Pyflakes" $(pycheck_dirs)
@if type pyflakes >/dev/null 2>&1; then \
(cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \
else echo "skipped, pyflakes not installed"; \
fi
- @if test -z "$$SKIP_PEP8"; then \
- echo " CHECK PEP8"; \
- if type pep8 >/dev/null 2>&1; then \
- (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \
- else echo "skipped, pep8 not installed"; \
- fi; \
+ @echo " CHECK PEP8";
+ @if type pep8 >/dev/null 2>&1; then \
+ (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \
+ else echo "skipped, pep8 not installed"; \
fi
check.gdb:
+3.24.0 20-Mar-2017
+ - configure.ac: pre-release version bump to 3.24.0 (Christoph Reiter)
+
+3.23.92 13-Mar-2017
+ - overrides: Update for Gdk-4.0 and Gtk+-4.0 (Fabian Orccon) (#777680)
+ - Disable -Werror=missing-prototypes (Christoph Reiter) (#777534)
+ - Fix new PEP8 errors (Christoph Reiter) (#776009)
+ - Move pep8/pyflakes tests from 'make check' to 'make check.quality' (Christoph Reiter) (#764087)
+ - overrides: Update for Gtk-4.0 (Christoph Reiter) (#773315)
+ - Handle exception unreffing Variant at exit (Dan Nicholson) (#776092)
+ - Handle multiple deinit of callable cache (Dan Nicholson) (#776092)
+ - configure.ac: post-release version bump to 3.23.0 (Christoph Reiter)
+
3.22.0 19-Sep-2016
- configure.ac: pre-release version bump to 3.22.0 (Christoph Reiter)
Metadata-Version: 1.0
Name: PyGObject
-Version: 3.22.0
+Version: 3.24.0
Summary: Python bindings for GObject
Home-page: http://www.pygtk.org/
Author: James Henstridge
Maintainer: Simon Feltman
Maintainer-email: sfeltman@src.gnome.org
License: GNU LGPL
-Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.22/pygobject-3.22.0.tar.gz
+Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.24/pygobject-3.24.0.tar.gz
Description: Python bindings for GLib and GObject
Platform: POSIX, Windows
Classifier: Development Status :: 5 - Production/Stable
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CODE_COVERAGE()
-#
-# DESCRIPTION
-#
-# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
-# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LDFLAGS which should be
-# included in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LDFLAGS variables of
-# every build target (program or library) which should be built with code
-# coverage support. Also defines CODE_COVERAGE_RULES which should be
-# substituted in your Makefile; and $enable_code_coverage which can be
-# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
-# and substituted, and corresponds to the value of the
-# --enable-code-coverage option, which defaults to being disabled.
-#
-# Test also for gcov program and create GCOV variable that could be
-# substituted.
-#
-# Note that all optimisation flags in CFLAGS must be disabled when code
-# coverage is enabled.
-#
-# Usage example:
-#
-# configure.ac:
-#
-# AX_CODE_COVERAGE
-#
-# Makefile.am:
-#
-# @CODE_COVERAGE_RULES@
-# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ...
-# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
-# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
-# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
-#
-# This results in a "check-code-coverage" rule being added to any
-# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
-# has been configured with --enable-code-coverage). Running `make
-# check-code-coverage` in that directory will run the module's test suite
-# (`make check`) and build a code coverage report detailing the code which
-# was touched, then print the URI for the report.
-#
-# This code was derived from Makefile.decl in GLib, originally licenced
-# under LGPLv2.1+.
-#
-# LICENSE
-#
-# Copyright (c) 2012, 2016 Philip Withnall
-# Copyright (c) 2012 Xan Lopez
-# Copyright (c) 2012 Christian Persch
-# Copyright (c) 2012 Paolo Borelli
-# Copyright (c) 2012 Dan Winship
-# Copyright (c) 2015 Bastien ROUCARIES
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or (at
-# your option) any later version.
-#
-# This library is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
-# General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
-#serial 15
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
-AC_DEFUN([AX_CODE_COVERAGE],[
- dnl Check for --enable-code-coverage
- AC_REQUIRE([AC_PROG_SED])
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
- # allow to override gcov location
- AC_ARG_WITH([gcov],
- [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
- [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
- [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
- AC_MSG_CHECKING([whether to build with code coverage support])
- AC_ARG_ENABLE([code-coverage],
- AS_HELP_STRING([--enable-code-coverage],
- [Whether to enable code coverage support]),,
- enable_code_coverage=no)
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
- AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
- AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
- AC_MSG_RESULT($enable_code_coverage)
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
- AS_IF([ test "$enable_code_coverage" = "yes" ], [
- # check for gcov
- AC_CHECK_TOOL([GCOV],
- [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
- [:])
- AS_IF([test "X$GCOV" = "X:"],
- [AC_MSG_ERROR([gcov is needed to do coverage])])
- AC_SUBST([GCOV])
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
- dnl Check if gcc is being used
- AS_IF([ test "$GCC" = "no" ], [
- AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
- ])
- # List of supported lcov versions.
- lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12"
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
- AC_CHECK_PROG([LCOV], [lcov], [lcov])
- AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
- AS_IF([ test "$LCOV" ], [
- AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [
- ax_cv_lcov_version=invalid
- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
- for lcov_check_version in $lcov_version_list; do
- if test "$lcov_version" = "$lcov_check_version"; then
- ax_cv_lcov_version="$lcov_check_version (ok)"
- fi
- done
- ])
- ], [
- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
- AC_MSG_ERROR([$lcov_msg])
- ])
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
- case $ax_cv_lcov_version in
- ""|invalid[)]
- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
- AC_MSG_ERROR([$lcov_msg])
- LCOV="exit 0;"
- ;;
- esac
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
- AS_IF([ test -z "$GENHTML" ], [
- AC_MSG_ERROR([Could not find genhtml from the lcov package])
- ])
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
- dnl Build the code coverage flags
- CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
- CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
- CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
- CODE_COVERAGE_LDFLAGS="-lgcov"
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CODE_COVERAGE()
+#
+# DESCRIPTION
+#
+# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
+# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
+# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
+# build target (program or library) which should be built with code
+# coverage support. Also defines CODE_COVERAGE_RULES which should be
+# substituted in your Makefile; and $enable_code_coverage which can be
+# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
+# and substituted, and corresponds to the value of the
+# --enable-code-coverage option, which defaults to being disabled.
+#
+# Test also for gcov program and create GCOV variable that could be
+# substituted.
+#
+# Note that all optimisation flags in CFLAGS must be disabled when code
+# coverage is enabled.
+#
+# Usage example:
+#
+# configure.ac:
+#
+# AX_CODE_COVERAGE
+#
+# Makefile.am:
+#
+# @CODE_COVERAGE_RULES@
+# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
+# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
+# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
+# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
+#
+# This results in a "check-code-coverage" rule being added to any
+# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
+# has been configured with --enable-code-coverage). Running `make
+# check-code-coverage` in that directory will run the module's test suite
+# (`make check`) and build a code coverage report detailing the code which
+# was touched, then print the URI for the report.
+#
+# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
+# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
+# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
+# deprecated. They have the same value.
+#
+# This code was derived from Makefile.decl in GLib, originally licenced
+# under LGPLv2.1+.
+#
+# LICENSE
+#
+# Copyright (c) 2012, 2016 Philip Withnall
+# Copyright (c) 2012 Xan Lopez
+# Copyright (c) 2012 Christian Persch
+# Copyright (c) 2012 Paolo Borelli
+# Copyright (c) 2012 Dan Winship
+# Copyright (c) 2015 Bastien ROUCARIES
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#serial 20
+
+AC_DEFUN([AX_CODE_COVERAGE],[
+ dnl Check for --enable-code-coverage
+ AC_REQUIRE([AC_PROG_SED])
+
+ # allow to override gcov location
+ AC_ARG_WITH([gcov],
+ [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
+ [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
+ [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
+
+ AC_MSG_CHECKING([whether to build with code coverage support])
+ AC_ARG_ENABLE([code-coverage],
+ AS_HELP_STRING([--enable-code-coverage],
+ [Whether to enable code coverage support]),,
+ enable_code_coverage=no)
+
+ AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
+ AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
+ AC_MSG_RESULT($enable_code_coverage)
+
+ AS_IF([ test "$enable_code_coverage" = "yes" ], [
+ # check for gcov
+ AC_CHECK_TOOL([GCOV],
+ [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
+ [:])
+ AS_IF([test "X$GCOV" = "X:"],
+ [AC_MSG_ERROR([gcov is needed to do coverage])])
+ AC_SUBST([GCOV])
+
+ dnl Check if gcc is being used
+ AS_IF([ test "$GCC" = "no" ], [
+ AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
+ ])
+
+ AC_CHECK_PROG([LCOV], [lcov], [lcov])
+ AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
+
+ AS_IF([ test -z "$LCOV" ], [
+ AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
+ ])
+
+ AS_IF([ test -z "$GENHTML" ], [
+ AC_MSG_ERROR([Could not find genhtml from the lcov package])
+ ])
+
+ dnl Build the code coverage flags
+ dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
+ CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
+ CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+ CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+ CODE_COVERAGE_LIBS="-lgcov"
+ CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
AC_SUBST([CODE_COVERAGE_CPPFLAGS])
AC_SUBST([CODE_COVERAGE_CFLAGS])
AC_SUBST([CODE_COVERAGE_CXXFLAGS])
+ AC_SUBST([CODE_COVERAGE_LIBS])
AC_SUBST([CODE_COVERAGE_LDFLAGS])
+
+ [CODE_COVERAGE_RULES_CHECK='
+ -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
+']
+ [CODE_COVERAGE_RULES_CAPTURE='
+ $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
+ $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
+ -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
+ $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
+ @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
+']
+ [CODE_COVERAGE_RULES_CLEAN='
+clean: code-coverage-clean
+distclean: code-coverage-clean
+code-coverage-clean:
+ -$(LCOV) --directory $(top_builddir) -z
+ -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+ -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
+']
+ ], [
+ [CODE_COVERAGE_RULES_CHECK='
+ @echo "Need to reconfigure with --enable-code-coverage"
+']
+ CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
+ CODE_COVERAGE_RULES_CLEAN=''
])
[CODE_COVERAGE_RULES='
code_coverage_quiet_0 = --quiet
# sanitizes the test-name: replaces with underscores: dashes and dots
-code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
-
-# Use recursive makes in order to ignore errors during check
-check-code-coverage:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
- $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
-
-# Capture code coverage data
-code-coverage-capture: code-coverage-capture-hook
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
- $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
- -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
- $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
- @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
-
-# Hook rule executed before code-coverage-capture, overridable by the user
-code-coverage-capture-hook:
-
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
-clean: code-coverage-clean
-code-coverage-clean:
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
- -find . -name "*.gcda" -o -name "*.gcov" -delete
-endif
-
-GITIGNOREFILES ?=
-GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-
-A''M_DISTCHECK_CONFIGURE_FLAGS ?=
-A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
-
-.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
-']
-
- AC_SUBST([CODE_COVERAGE_RULES])
- m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
-])
-
-# Configure paths for GLIB
-# Owen Taylor 1997-2001
-
-dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
-dnl gthread, or gio is specified in MODULES, pass to pkg-config
-dnl
-AC_DEFUN([AM_PATH_GLIB_2_0],
-[dnl
-dnl Get the cflags and libraries from pkg-config
-dnl
-AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
- , enable_glibtest=yes)
-
- pkg_config_args=glib-2.0
- for module in . $4
- do
- case "$module" in
- gmodule)
- pkg_config_args="$pkg_config_args gmodule-2.0"
- ;;
- gmodule-no-export)
- pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
- ;;
- gobject)
- pkg_config_args="$pkg_config_args gobject-2.0"
- ;;
- gthread)
- pkg_config_args="$pkg_config_args gthread-2.0"
- ;;
- gio*)
- pkg_config_args="$pkg_config_args $module-2.0"
- ;;
- esac
- done
-
- PKG_PROG_PKG_CONFIG([0.16])
-
- no_glib=""
-
- if test "x$PKG_CONFIG" = x ; then
- no_glib=yes
- PKG_CONFIG=no
- fi
-
- min_glib_version=ifelse([$1], ,2.0.0,$1)
- AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
-
- if test x$PKG_CONFIG != xno ; then
- ## don't try to run the test against uninstalled libtool libs
- if $PKG_CONFIG --uninstalled $pkg_config_args; then
- echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
- enable_glibtest=no
- fi
-
- if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
- :
- else
- no_glib=yes
- fi
- fi
-
- if test x"$no_glib" = x ; then
- GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
- GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
- GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
- GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
-
- GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
- GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
- glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_glibtest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
- LIBS="$GLIB_LIBS $LIBS"
-dnl
-dnl Now check if the installed GLIB is sufficiently new. (Also sanity
-dnl checks the results of pkg-config to some extent)
-dnl
- rm -f conf.glibtest
- AC_TRY_RUN([
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
- unsigned int major, minor, micro;
-
- fclose (fopen ("conf.glibtest", "w"));
-
- if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, µ) != 3) {
- printf("%s, bad version string\n", "$min_glib_version");
- exit(1);
- }
-
- if ((glib_major_version != $glib_config_major_version) ||
- (glib_minor_version != $glib_config_minor_version) ||
- (glib_micro_version != $glib_config_micro_version))
- {
- printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
- $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
- glib_major_version, glib_minor_version, glib_micro_version);
- printf ("*** was found! If pkg-config was correct, then it is best\n");
- printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
- printf("*** required on your system.\n");
- printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
- printf("*** to point to the correct configuration files\n");
- }
- else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
- (glib_minor_version != GLIB_MINOR_VERSION) ||
- (glib_micro_version != GLIB_MICRO_VERSION))
- {
- printf("*** GLIB header files (version %d.%d.%d) do not match\n",
- GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
- printf("*** library (version %d.%d.%d)\n",
- glib_major_version, glib_minor_version, glib_micro_version);
- }
- else
- {
- if ((glib_major_version > major) ||
- ((glib_major_version == major) && (glib_minor_version > minor)) ||
- ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
- glib_major_version, glib_minor_version, glib_micro_version);
- printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
- major, minor, micro);
- printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
- printf("***\n");
- printf("*** If you have already installed a sufficiently new version, this error\n");
- printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
- printf("*** being found. The easiest way to fix this is to remove the old version\n");
- printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
- printf("*** correct copy of pkg-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
- printf("*** so that the correct libraries are found at run-time))\n");
- }
- }
- return 1;
-}
-],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_glib" = x ; then
- AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$PKG_CONFIG" = "no" ; then
- echo "*** A new enough version of pkg-config was not found."
- echo "*** See http://www.freedesktop.org/software/pkgconfig/"
- else
- if test -f conf.glibtest ; then
- :
- else
- echo "*** Could not run GLIB test program, checking why..."
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
- LIBS="$LIBS $GLIB_LIBS"
- AC_TRY_LINK([
-#include <glib.h>
-#include <stdio.h>
-], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding GLIB or finding the wrong"
- echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- GLIB_CFLAGS=""
- GLIB_LIBS=""
- GLIB_GENMARSHAL=""
- GOBJECT_QUERY=""
- GLIB_MKENUMS=""
- GLIB_COMPILE_RESOURCES=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
- AC_SUBST(GLIB_GENMARSHAL)
- AC_SUBST(GOBJECT_QUERY)
- AC_SUBST(GLIB_MKENUMS)
- AC_SUBST(GLIB_COMPILE_RESOURCES)
- rm -f conf.glibtest
-])
-
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
-dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
-dnl (program or library) which should be built with code coverage support.
-dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
-dnl Makefile; and $enable_code_coverage which can be used in subsequent
-dnl configure output.
-dnl
-dnl Note that all optimisation flags in CFLAGS must be disabled when code
-dnl coverage is enabled.
-dnl
-dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
-dnl This file is licenced under LGPLv2.1+.
-dnl
-dnl Usage example:
-dnl configure.ac:
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Makefile.am:
-dnl @GNOME_CODE_COVERAGE_RULES@
-dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
-dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
-dnl
-dnl This results in a “check-code-coverage” rule being added to any Makefile.am
-dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
-dnl configured with --enable-code-coverage). Running `make check-code-coverage`
-dnl in that directory will run the module’s test suite (`make check`) and build
-dnl a code coverage report detailing the code which was touched, then print the
-dnl URI for the report.
-
-AU_DEFUN([GNOME_CODE_COVERAGE],[
- AX_CODE_COVERAGE
- GNOME_CODE_COVERAGE_RULES=$CODE_COVERAGE_RULES
-
- AC_SUBST([GNOME_CODE_COVERAGE_RULES])
- m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
-],
-[[$0: This macro is deprecated. You should use AX_CODE_COVERAGE instead and
-replace uses of GNOME_CODE_COVERAGE_RULES with CODE_COVERAGE_RULES.
-See: http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html#ax_code_coverage]])
-
-# gnome-compiler-flags.m4
-#
-# serial 4
-#
-
-dnl GNOME_COMPILE_WARNINGS
-dnl Turn on many useful compiler warnings and substitute the result into
-dnl WARN_CFLAGS
-dnl For now, only works on GCC
-dnl Pass the default value of the --enable-compile-warnings configure option as
-dnl the first argument to the macro, defaulting to 'yes'.
-dnl Additional warning/error flags can be passed as an optional second argument.
-dnl
-dnl For example: GNOME_COMPILE_WARNINGS([maximum],[-Werror=some-flag -Wfoobar])
-AU_DEFUN([GNOME_COMPILE_WARNINGS],[
- dnl ******************************
- dnl More compiler warnings
- dnl ******************************
-
- AC_ARG_ENABLE(compile-warnings,
- AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
- [Turn on compiler warnings]),,
- [enable_compile_warnings="m4_default([$1],[yes])"])
-
- if test "x$GCC" != xyes; then
- enable_compile_warnings=no
- fi
-
- warning_flags=
- realsave_CFLAGS="$CFLAGS"
-
- dnl These are warning flags that aren't marked as fatal. Can be
- dnl overridden on a per-project basis with -Wno-foo.
- base_warn_flags=" \
- -Wall \
- -Wstrict-prototypes \
- -Wnested-externs \
- "
-
- dnl These compiler flags typically indicate very broken or suspicious
- dnl code. Some of them such as implicit-function-declaration are
- dnl just not default because gcc compiles a lot of legacy code.
- dnl We choose to make this set into explicit errors.
- base_error_flags=" \
- -Werror=missing-prototypes \
- -Werror=implicit-function-declaration \
- -Werror=pointer-arith \
- -Werror=init-self \
- -Werror=format-security \
- -Werror=format=2 \
- -Werror=missing-include-dirs \
- -Werror=return-type \
- "
+code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
- dnl Additional warning or error flags provided by the module author to
- dnl allow stricter standards to be imposed on a per-module basis.
- dnl The author can pass -W or -Werror flags here as they see fit.
- additional_flags="m4_default([$2],[])"
+# Use recursive makes in order to ignore errors during check
+check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
- case "$enable_compile_warnings" in
- no)
- warning_flags="-w"
- ;;
- minimum)
- warning_flags="-Wall"
- ;;
- yes|maximum|error)
- warning_flags="$base_warn_flags $base_error_flags $additional_flags"
- ;;
- *)
- AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
- ;;
- esac
+# Capture code coverage data
+code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
- if test "$enable_compile_warnings" = "error" ; then
- warning_flags="$warning_flags -Werror"
- fi
+# Hook rule executed before code-coverage-capture, overridable by the user
+code-coverage-capture-hook:
- dnl Check whether GCC supports the warning options
- for option in $warning_flags; do
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $option"
- AC_MSG_CHECKING([whether gcc understands $option])
- AC_TRY_COMPILE([], [],
- has_option=yes,
- has_option=no,)
- CFLAGS="$save_CFLAGS"
- AC_MSG_RESULT([$has_option])
- if test $has_option = yes; then
- tested_warning_flags="$tested_warning_flags $option"
- fi
- unset has_option
- unset save_CFLAGS
- done
- unset option
- CFLAGS="$realsave_CFLAGS"
- AC_MSG_CHECKING(what warning flags to pass to the C compiler)
- AC_MSG_RESULT($tested_warning_flags)
+'"$CODE_COVERAGE_RULES_CLEAN"'
- AC_ARG_ENABLE(iso-c,
- AS_HELP_STRING([--enable-iso-c],
- [Try to warn if code is not ISO C ]),,
- [enable_iso_c=no])
+GITIGNOREFILES ?=
+GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
- AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
- complCFLAGS=
- if test "x$enable_iso_c" != "xno"; then
- if test "x$GCC" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-ansi[\ \ ]*) ;;
- *) complCFLAGS="$complCFLAGS -ansi" ;;
- esac
- case " $CFLAGS " in
- *[\ \ ]-pedantic[\ \ ]*) ;;
- *) complCFLAGS="$complCFLAGS -pedantic" ;;
- esac
- fi
- fi
- AC_MSG_RESULT($complCFLAGS)
+A''M_DISTCHECK_CONFIGURE_FLAGS ?=
+A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
- WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
- AC_SUBST(WARN_CFLAGS)
-],
-[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and
-eliminate use of --enable-iso-c.
-See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]])
+.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
+']
-dnl For C++, do basically the same thing.
+ AC_SUBST([CODE_COVERAGE_RULES])
+ m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
+])
-AU_DEFUN([GNOME_CXX_WARNINGS],[
- AC_ARG_ENABLE(cxx-warnings,
- AS_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
- [Turn on compiler warnings.]),,
- [enable_cxx_warnings="m4_default([$1],[minimum])"])
+# Configure paths for GLIB
+# Owen Taylor 1997-2001
- AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
- warnCXXFLAGS=
- if test "x$GXX" != xyes; then
- enable_cxx_warnings=no
- fi
- if test "x$enable_cxx_warnings" != "xno"; then
- if test "x$GXX" = "xyes"; then
- case " $CXXFLAGS " in
- *[\ \ ]-Wall[\ \ ]*) ;;
- *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
+dnl gthread, or gio is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
+ , enable_glibtest=yes)
+
+ pkg_config_args=glib-2.0
+ for module in . $4
+ do
+ case "$module" in
+ gmodule)
+ pkg_config_args="$pkg_config_args gmodule-2.0"
+ ;;
+ gmodule-no-export)
+ pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+ ;;
+ gobject)
+ pkg_config_args="$pkg_config_args gobject-2.0"
+ ;;
+ gthread)
+ pkg_config_args="$pkg_config_args gthread-2.0"
+ ;;
+ gio*)
+ pkg_config_args="$pkg_config_args $module-2.0"
+ ;;
esac
+ done
- ## -W is not all that useful. And it cannot be controlled
- ## with individual -Wno-xxx flags, unlike -Wall
- if test "x$enable_cxx_warnings" = "xyes"; then
- warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
- fi
+ PKG_PROG_PKG_CONFIG([0.16])
+
+ no_glib=""
+
+ if test "x$PKG_CONFIG" = x ; then
+ no_glib=yes
+ PKG_CONFIG=no
+ fi
+
+ min_glib_version=ifelse([$1], ,2.0.0,$1)
+ AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+ if test x$PKG_CONFIG != xno ; then
+ ## don't try to run the test against uninstalled libtool libs
+ if $PKG_CONFIG --uninstalled $pkg_config_args; then
+ echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+ enable_glibtest=no
+ fi
+
+ if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+ :
+ else
+ no_glib=yes
fi
fi
- AC_MSG_RESULT($warnCXXFLAGS)
- AC_ARG_ENABLE(iso-cxx,
- AS_HELP_STRING([--enable-iso-cxx],
- [Try to warn if code is not ISO C++ ]),,
- [enable_iso_cxx=no])
+ if test x"$no_glib" = x ; then
+ GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+ GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+ GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+ GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
- AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
- complCXXFLAGS=
- if test "x$enable_iso_cxx" != "xno"; then
- if test "x$GXX" = "xyes"; then
- case " $CXXFLAGS " in
- *[\ \ ]-ansi[\ \ ]*) ;;
- *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
- esac
+ GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+ GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+ glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_glibtest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GLIB_CFLAGS"
+ LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+ rm -f conf.glibtest
+ AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
- case " $CXXFLAGS " in
- *[\ \ ]-pedantic[\ \ ]*) ;;
- *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
- esac
+int
+main ()
+{
+ unsigned int major, minor, micro;
+
+ fclose (fopen ("conf.glibtest", "w"));
+
+ if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, µ) != 3) {
+ printf("%s, bad version string\n", "$min_glib_version");
+ exit(1);
+ }
+
+ if ((glib_major_version != $glib_config_major_version) ||
+ (glib_minor_version != $glib_config_minor_version) ||
+ (glib_micro_version != $glib_config_micro_version))
+ {
+ printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
+ $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+ glib_major_version, glib_minor_version, glib_micro_version);
+ printf ("*** was found! If pkg-config was correct, then it is best\n");
+ printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+ printf("*** required on your system.\n");
+ printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+ printf("*** to point to the correct configuration files\n");
+ }
+ else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+ (glib_minor_version != GLIB_MINOR_VERSION) ||
+ (glib_micro_version != GLIB_MICRO_VERSION))
+ {
+ printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+ GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+ printf("*** library (version %d.%d.%d)\n",
+ glib_major_version, glib_minor_version, glib_micro_version);
+ }
+ else
+ {
+ if ((glib_major_version > major) ||
+ ((glib_major_version == major) && (glib_minor_version > minor)) ||
+ ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
+ glib_major_version, glib_minor_version, glib_micro_version);
+ printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
+ major, minor, micro);
+ printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+ printf("***\n");
+ printf("*** If you have already installed a sufficiently new version, this error\n");
+ printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+ printf("*** being found. The easiest way to fix this is to remove the old version\n");
+ printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+ printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+ printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+ printf("*** so that the correct libraries are found at run-time))\n");
+ }
+ }
+ return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
fi
- fi
- AC_MSG_RESULT($complCXXFLAGS)
-
- WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
- AC_SUBST(WARN_CXXFLAGS)
-],
-[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and
-eliminate use of --enable-iso-cxx.
-See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]])
-
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29)
-dnl
-dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-dnl 02111-1307, USA.
-dnl
-dnl As a special exception to the GNU General Public License, if you
-dnl distribute this file as part of a program that contains a
-dnl configuration script generated by Autoconf, you may include it under
-dnl the same distribution terms that you use for the rest of that
-dnl program.
+ fi
+ if test "x$no_glib" = x ; then
+ AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** A new enough version of pkg-config was not found."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+ else
+ if test -f conf.glibtest ; then
+ :
+ else
+ echo "*** Could not run GLIB test program, checking why..."
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GLIB_CFLAGS"
+ LIBS="$LIBS $GLIB_LIBS"
+ AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+ echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ GLIB_CFLAGS=""
+ GLIB_LIBS=""
+ GLIB_GENMARSHAL=""
+ GOBJECT_QUERY=""
+ GLIB_MKENUMS=""
+ GLIB_COMPILE_RESOURCES=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+ AC_SUBST(GLIB_GENMARSHAL)
+ AC_SUBST(GOBJECT_QUERY)
+ AC_SUBST(GLIB_MKENUMS)
+ AC_SUBST(GLIB_COMPILE_RESOURCES)
+ rm -f conf.glibtest
+])
-dnl PKG_PREREQ(MIN-VERSION)
-dnl -----------------------
-dnl Since: 0.29
+dnl GNOME_CODE_COVERAGE
dnl
-dnl Verify that the version of the pkg-config macros are at least
-dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
-dnl installed version of pkg-config, this checks the developer's version
-dnl of pkg.m4 when generating configure.
+dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
+dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
+dnl (program or library) which should be built with code coverage support.
+dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
+dnl Makefile; and $enable_code_coverage which can be used in subsequent
+dnl configure output.
dnl
-dnl To ensure that this macro is defined, also add:
-dnl m4_ifndef([PKG_PREREQ],
-dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl Note that all optimisation flags in CFLAGS must be disabled when code
+dnl coverage is enabled.
dnl
-dnl See the "Since" comment for each macro you use to see what version
-dnl of the macros you require.
-m4_defun([PKG_PREREQ],
-[m4_define([PKG_MACROS_VERSION], [0.29])
-m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
- [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
-])dnl PKG_PREREQ
-
-dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
-dnl ----------------------------------
-dnl Since: 0.16
+dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
+dnl This file is licenced under LGPLv2.1+.
dnl
-dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
-dnl first found in the path. Checks that the version of pkg-config found
-dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
-dnl used since that's the first version where most current features of
-dnl pkg-config existed.
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
- fi
-fi[]dnl
-])dnl PKG_PROG_PKG_CONFIG
-
-dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl -------------------------------------------------------------------
-dnl Since: 0.18
+dnl Usage example:
+dnl configure.ac:
+dnl GNOME_CODE_COVERAGE
dnl
-dnl Check to see whether a particular set of modules exists. Similar to
-dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl Makefile.am:
+dnl @GNOME_CODE_COVERAGE_RULES@
+dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
+dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
dnl
-dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-dnl only at the first occurence in configure.ac, so if the first place
-dnl it's called might be skipped (such as if it is within an "if", you
-dnl have to call PKG_CHECK_EXISTS manually
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_default([$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
+dnl This results in a “check-code-coverage” rule being added to any Makefile.am
+dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
+dnl configured with --enable-code-coverage). Running `make check-code-coverage`
+dnl in that directory will run the module’s test suite (`make check`) and build
+dnl a code coverage report detailing the code which was touched, then print the
+dnl URI for the report.
-dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-dnl ---------------------------------------------
-dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
-dnl pkg_failed based on the result.
-m4_define([_PKG_CONFIG],
-[if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- elif test -n "$PKG_CONFIG"; then
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes ],
- [pkg_failed=yes])
- else
- pkg_failed=untried
-fi[]dnl
-])dnl _PKG_CONFIG
+AU_DEFUN([GNOME_CODE_COVERAGE],[
+ AX_CODE_COVERAGE
+ GNOME_CODE_COVERAGE_RULES=$CODE_COVERAGE_RULES
-dnl _PKG_SHORT_ERRORS_SUPPORTED
-dnl ---------------------------
-dnl Internal check to see if pkg-config supports short errors.
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])dnl _PKG_SHORT_ERRORS_SUPPORTED
+ AC_SUBST([GNOME_CODE_COVERAGE_RULES])
+ m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
+],
+[[$0: This macro is deprecated. You should use AX_CODE_COVERAGE instead and
+replace uses of GNOME_CODE_COVERAGE_RULES with CODE_COVERAGE_RULES.
+See: http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html#ax_code_coverage]])
+# gnome-compiler-flags.m4
+#
+# serial 4
+#
-dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-dnl [ACTION-IF-NOT-FOUND])
-dnl --------------------------------------------------------------
-dnl Since: 0.4.0
+dnl GNOME_COMPILE_WARNINGS
+dnl Turn on many useful compiler warnings and substitute the result into
+dnl WARN_CFLAGS
+dnl For now, only works on GCC
+dnl Pass the default value of the --enable-compile-warnings configure option as
+dnl the first argument to the macro, defaulting to 'yes'.
+dnl Additional warning/error flags can be passed as an optional second argument.
dnl
-dnl Note that if there is a possibility the first call to
-dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
-dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+dnl For example: GNOME_COMPILE_WARNINGS([maximum],[-Werror=some-flag -Wfoobar])
+AU_DEFUN([GNOME_COMPILE_WARNINGS],[
+ dnl ******************************
+ dnl More compiler warnings
+ dnl ******************************
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
+ AC_ARG_ENABLE(compile-warnings,
+ AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
+ [Turn on compiler warnings]),,
+ [enable_compile_warnings="m4_default([$1],[yes])"])
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
+ warning_flags=
+ realsave_CFLAGS="$CFLAGS"
-if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+ dnl These are warning flags that aren't marked as fatal. Can be
+ dnl overridden on a per-project basis with -Wno-foo.
+ base_warn_flags=" \
+ -Wall \
+ -Wstrict-prototypes \
+ -Wnested-externs \
+ "
- m4_default([$4], [AC_MSG_ERROR(
-[Package requirements ($2) were not met:
+ dnl These compiler flags typically indicate very broken or suspicious
+ dnl code. Some of them such as implicit-function-declaration are
+ dnl just not default because gcc compiles a lot of legacy code.
+ dnl We choose to make this set into explicit errors.
+ base_error_flags=" \
+ -Werror=missing-prototypes \
+ -Werror=implicit-function-declaration \
+ -Werror=pointer-arith \
+ -Werror=init-self \
+ -Werror=format-security \
+ -Werror=format=2 \
+ -Werror=missing-include-dirs \
+ -Werror=return-type \
+ "
-$$1_PKG_ERRORS
+ dnl Additional warning or error flags provided by the module author to
+ dnl allow stricter standards to be imposed on a per-module basis.
+ dnl The author can pass -W or -Werror flags here as they see fit.
+ additional_flags="m4_default([$2],[])"
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+ case "$enable_compile_warnings" in
+ no)
+ warning_flags="-w"
+ ;;
+ minimum)
+ warning_flags="-Wall"
+ ;;
+ yes|maximum|error)
+ warning_flags="$base_warn_flags $base_error_flags $additional_flags"
+ ;;
+ *)
+ AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
+ ;;
+ esac
-_PKG_TEXT])[]dnl
- ])
-elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
- m4_default([$4], [AC_MSG_FAILURE(
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+ if test "$enable_compile_warnings" = "error" ; then
+ warning_flags="$warning_flags -Werror"
+ fi
-_PKG_TEXT
+ dnl Check whether GCC supports the warning options
+ for option in $warning_flags; do
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $option"
+ AC_MSG_CHECKING([whether gcc understands $option])
+ AC_TRY_COMPILE([], [],
+ has_option=yes,
+ has_option=no,)
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT([$has_option])
+ if test $has_option = yes; then
+ tested_warning_flags="$tested_warning_flags $option"
+ fi
+ unset has_option
+ unset save_CFLAGS
+ done
+ unset option
+ CFLAGS="$realsave_CFLAGS"
+ AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+ AC_MSG_RESULT($tested_warning_flags)
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
- ])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- $3
-fi[]dnl
-])dnl PKG_CHECK_MODULES
+ AC_ARG_ENABLE(iso-c,
+ AS_HELP_STRING([--enable-iso-c],
+ [Try to warn if code is not ISO C ]),,
+ [enable_iso_c=no])
+ AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
+ complCFLAGS=
+ if test "x$enable_iso_c" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -ansi" ;;
+ esac
+ case " $CFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCFLAGS)
-dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-dnl [ACTION-IF-NOT-FOUND])
-dnl ---------------------------------------------------------------------
-dnl Since: 0.29
-dnl
-dnl Checks for existence of MODULES and gathers its build flags with
-dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
-dnl and VARIABLE-PREFIX_LIBS from --libs.
-dnl
-dnl Note that if there is a possibility the first call to
-dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
-dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
-dnl configure.ac.
-AC_DEFUN([PKG_CHECK_MODULES_STATIC],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-_save_PKG_CONFIG=$PKG_CONFIG
-PKG_CONFIG="$PKG_CONFIG --static"
-PKG_CHECK_MODULES($@)
-PKG_CONFIG=$_save_PKG_CONFIG[]dnl
-])dnl PKG_CHECK_MODULES_STATIC
+ WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
+ AC_SUBST(WARN_CFLAGS)
+],
+[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and
+eliminate use of --enable-iso-c.
+See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]])
+dnl For C++, do basically the same thing.
-dnl PKG_INSTALLDIR([DIRECTORY])
-dnl -------------------------
-dnl Since: 0.27
-dnl
-dnl Substitutes the variable pkgconfigdir as the location where a module
-dnl should install pkg-config .pc files. By default the directory is
-dnl $libdir/pkgconfig, but the default can be changed by passing
-dnl DIRECTORY. The user can override through the --with-pkgconfigdir
-dnl parameter.
-AC_DEFUN([PKG_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
-m4_pushdef([pkg_description],
- [pkg-config installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([pkgconfigdir],
- [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
- [with_pkgconfigdir=]pkg_default)
-AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
-m4_popdef([pkg_default])
-m4_popdef([pkg_description])
-])dnl PKG_INSTALLDIR
+AU_DEFUN([GNOME_CXX_WARNINGS],[
+ AC_ARG_ENABLE(cxx-warnings,
+ AS_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
+ [Turn on compiler warnings.]),,
+ [enable_cxx_warnings="m4_default([$1],[minimum])"])
+ AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
+ warnCXXFLAGS=
+ if test "x$GXX" != xyes; then
+ enable_cxx_warnings=no
+ fi
+ if test "x$enable_cxx_warnings" != "xno"; then
+ if test "x$GXX" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+ esac
-dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
-dnl --------------------------------
-dnl Since: 0.27
-dnl
-dnl Substitutes the variable noarch_pkgconfigdir as the location where a
-dnl module should install arch-independent pkg-config .pc files. By
-dnl default the directory is $datadir/pkgconfig, but the default can be
-dnl changed by passing DIRECTORY. The user can override through the
-dnl --with-noarch-pkgconfigdir parameter.
-AC_DEFUN([PKG_NOARCH_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
-m4_pushdef([pkg_description],
- [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([noarch-pkgconfigdir],
- [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
- [with_noarch_pkgconfigdir=]pkg_default)
-AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
-m4_popdef([pkg_default])
-m4_popdef([pkg_description])
-])dnl PKG_NOARCH_INSTALLDIR
+ ## -W is not all that useful. And it cannot be controlled
+ ## with individual -Wno-xxx flags, unlike -Wall
+ if test "x$enable_cxx_warnings" = "xyes"; then
+ warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($warnCXXFLAGS)
+ AC_ARG_ENABLE(iso-cxx,
+ AS_HELP_STRING([--enable-iso-cxx],
+ [Try to warn if code is not ISO C++ ]),,
+ [enable_iso_cxx=no])
-dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl -------------------------------------------
-dnl Since: 0.28
-dnl
-dnl Retrieves the value of the pkg-config variable for the given module.
-AC_DEFUN([PKG_CHECK_VAR],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+ AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
+ complCXXFLAGS=
+ if test "x$enable_iso_cxx" != "xno"; then
+ if test "x$GXX" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
+ esac
-_PKG_CONFIG([$1], [variable="][$3]["], [$2])
-AS_VAR_COPY([$1], [pkg_cv_][$1])
+ case " $CXXFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCXXFLAGS)
-AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])dnl PKG_CHECK_VAR
+ WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
+ AC_SUBST(WARN_CXXFLAGS)
+],
+[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and
+eliminate use of --enable-iso-cxx.
+See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# Attempt to guess a canonical system name.
# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2016-04-02'
+timestamp='2016-10-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
+ # to ELF recently (or will in the future) and ABI.
case "${UNAME_MACHINE_ARCH}" in
- arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ earm*)
+ os=netbsdelf
+ ;;
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ mips64el:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
cat >&2 <<EOF
$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
# Configuration validation subroutine script.
# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2016-03-30'
+timestamp='2016-11-04'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | \
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pru-* \
| pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
basic_machine=m68k-bull
os=-sysv3
;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
+ ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos*)
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pygobject 3.22.0.
+# Generated by GNU Autoconf 2.69 for pygobject 3.24.0.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
#
# Identity of this package.
PACKAGE_NAME='pygobject'
PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='3.22.0'
-PACKAGE_STRING='pygobject 3.22.0'
+PACKAGE_VERSION='3.24.0'
+PACKAGE_STRING='pygobject 3.24.0'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
PACKAGE_URL='https://wiki.gnome.org/Projects/PyGObject/'
GNOME_CODE_COVERAGE_RULES
CODE_COVERAGE_RULES
CODE_COVERAGE_LDFLAGS
+CODE_COVERAGE_LIBS
CODE_COVERAGE_CXXFLAGS
CODE_COVERAGE_CFLAGS
CODE_COVERAGE_CPPFLAGS
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pygobject 3.22.0 to adapt to many kinds of systems.
+\`configure' configures pygobject 3.24.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pygobject 3.22.0:";;
+ short | recursive ) echo "Configuration of pygobject 3.24.0:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pygobject configure 3.22.0
+pygobject configure 3.24.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pygobject $as_me 3.22.0, which was
+It was created by pygobject $as_me 3.24.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
PYGOBJECT_MAJOR_VERSION=3
-$as_echo "#define PYGOBJECT_MINOR_VERSION 22" >>confdefs.h
+$as_echo "#define PYGOBJECT_MINOR_VERSION 24" >>confdefs.h
-PYGOBJECT_MINOR_VERSION=22
+PYGOBJECT_MINOR_VERSION=24
$as_echo "#define PYGOBJECT_MICRO_VERSION 0" >>confdefs.h
# Define the identity of the package.
PACKAGE='pygobject'
- VERSION='3.22.0'
+ VERSION='3.24.0'
cat >>confdefs.h <<_ACEOF
-Werror=return-type \
"
- additional_flags=""
+ additional_flags="-Wno-error=missing-prototypes"
case "$enable_compile_warnings" in
no)
fi
- # List of supported lcov versions.
- lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12"
-
# Extract the first word of "lcov", so it can be a program name with args.
set dummy lcov; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- if test "$LCOV" ; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lcov version" >&5
-$as_echo_n "checking for lcov version... " >&6; }
-if ${ax_cv_lcov_version+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_cv_lcov_version=invalid
- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
- for lcov_check_version in $lcov_version_list; do
- if test "$lcov_version" = "$lcov_check_version"; then
- ax_cv_lcov_version="$lcov_check_version (ok)"
- fi
- done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lcov_version" >&5
-$as_echo "$ax_cv_lcov_version" >&6; }
-
-else
+ if test -z "$LCOV" ; then :
- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
- as_fn_error $? "$lcov_msg" "$LINENO" 5
+ as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5
fi
- case $ax_cv_lcov_version in
- ""|invalid)
- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
- as_fn_error $? "$lcov_msg" "$LINENO" 5
- LCOV="exit 0;"
- ;;
- esac
-
if test -z "$GENHTML" ; then :
as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5
fi
- CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
+ CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
- CODE_COVERAGE_LDFLAGS="-lgcov"
+ CODE_COVERAGE_LIBS="-lgcov"
+ CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
+
+
+ CODE_COVERAGE_RULES_CHECK='
+ -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
+'
+ CODE_COVERAGE_RULES_CAPTURE='
+ $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
+ $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
+ -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
+ $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
+ @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
+'
+ CODE_COVERAGE_RULES_CLEAN='
+clean: code-coverage-clean
+distclean: code-coverage-clean
+code-coverage-clean:
+ -$(LCOV) --directory $(top_builddir) -z
+ -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+ -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
+'
+
+else
+
+ CODE_COVERAGE_RULES_CHECK='
+ @echo "Need to reconfigure with --enable-code-coverage"
+'
+ CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
+ CODE_COVERAGE_RULES_CLEAN=''
fi
code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
# Use recursive makes in order to ignore errors during check
-check-code-coverage:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
- $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
+check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
# Capture code coverage data
-code-coverage-capture: code-coverage-capture-hook
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
- $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
- $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
- -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
- $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
- @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
-else
- @echo "Need to reconfigure with --enable-code-coverage"
-endif
+code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
# Hook rule executed before code-coverage-capture, overridable by the user
code-coverage-capture-hook:
-ifeq ($(CODE_COVERAGE_ENABLED),yes)
-clean: code-coverage-clean
-code-coverage-clean:
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
- -find . -name "*.gcda" -o -name "*.gcov" -delete
-endif
+'"$CODE_COVERAGE_RULES_CLEAN"'
GITIGNOREFILES ?=
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pygobject $as_me 3.22.0, which was
+This file was extended by pygobject $as_me 3.24.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pygobject config.status 3.22.0
+pygobject config.status 3.24.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
dnl the pygobject version number
m4_define(pygobject_major_version, 3)
-m4_define(pygobject_minor_version, 22)
+m4_define(pygobject_minor_version, 24)
m4_define(pygobject_micro_version, 0)
m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
AC_SUBST(INTROSPECTION_COMPILER)
# compiler warnings, errors, required cflags, and code coverage support
-GNOME_COMPILE_WARNINGS([maximum])
+GNOME_COMPILE_WARNINGS([maximum], [-Wno-error=missing-prototypes])
AC_MSG_CHECKING(for Gnome code coverage support)
m4_ifdef([GNOME_CODE_COVERAGE],
[AC_MSG_RESULT(yes)
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
win.show_all()
Gtk.main()
+
if __name__ == '__main__':
main()
def readonly(self):
return 'readonly'
+
GObject.type_register(MyObject)
print("MyObject properties: ", list(MyObject.props))
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
args = args[2:-len(old_args)]
return options, args
+
make_option = Option
def method(self):
return GIMarshallingTests.OverridesStruct.method(self) / 7
+
OverridesStruct = override(OverridesStruct)
__all__.append('OverridesStruct')
"""Overridden doc string."""
return GIMarshallingTests.OverridesObject.method(self) / 7
+
OverridesObject = override(OverridesObject)
__all__.append('OverridesObject')
return GLib.Variant.new_tuple(elements)
def __del__(self):
- self.unref()
+ try:
+ self.unref()
+ except ImportError:
+ # Calling unref will cause gi and gi.repository.GLib to be
+ # imported. However, if the program is exiting, then these
+ # modules have likely been removed from sys.modules and will
+ # raise an exception. Assume that's the case for ImportError
+ # and ignore the exception since everything will be cleaned
+ # up, anyways.
+ pass
def __str__(self):
return self.print_(True)
value, length = GLib.Variant.get_string(self)
return value
+
setattr(Variant, 'get_string', get_string)
__all__.append('Variant')
return GLib.markup_escape_text(text.decode('UTF-8'), length)
else:
return GLib.markup_escape_text(text, length)
+
+
__all__.append('markup_escape_text')
# caught by _main_loop_sigint_handler()
raise KeyboardInterrupt
+
MainLoop = override(MainLoop)
__all__.append('MainLoop')
def iteration(self, may_block=True):
return super(MainContext, self).iteration(may_block)
+
MainContext = override(MainContext)
__all__.append('MainContext')
can_recurse = property(__get_can_recurse, __set_can_recurse)
+
Source = override(Source)
__all__.append('Source')
if priority != GLib.PRIORITY_DEFAULT:
self.set_priority(priority)
+
__all__.append('Idle')
if priority != GLib.PRIORITY_DEFAULT:
self.set_priority(priority)
+
__all__.append('Timeout')
priority = kwargs.get('priority', GLib.PRIORITY_DEFAULT_IDLE)
return GLib.idle_add(priority, function, *user_data)
+
__all__.append('idle_add')
priority = kwargs.get('priority', GLib.PRIORITY_DEFAULT)
return GLib.timeout_add(priority, interval, function, *user_data)
+
__all__.append('timeout_add')
priority = kwargs.get('priority', GLib.PRIORITY_DEFAULT)
return GLib.timeout_add_seconds(priority, interval, function, *user_data)
+
__all__.append('timeout_add_seconds')
return real_channel, priority_, condition, func_fdtransform, user_data
+
__all__.append('_io_add_watch_get_args')
channel, priority, condition, func, user_data = _io_add_watch_get_args(*args, **kwargs)
return GLib.io_add_watch(channel, priority, condition, func, *user_data)
+
__all__.append('io_add_watch')
# Python 2.x compatibility
next = __next__
+
IOChannel = override(IOChannel)
__all__.append('IOChannel')
self.fd = fd
self.events = events
+
PollFD = override(PollFD)
__all__.append('PollFD')
return priority, pid, callback, user_data
+
# we need this to be accessible for unit testing
__all__.append('_child_watch_add_get_args')
priority, pid, function, data = _child_watch_add_get_args(*args, **kwargs)
return GLib.child_watch_add(priority, pid, function, *data)
+
__all__.append('child_watch_add')
def get_current_time():
return GLib.get_real_time() * 0.000001
+
get_current_time = deprecated(get_current_time, 'GLib.get_real_time()')
__all__.append('get_current_time')
def filename_from_utf8(utf8string, len=-1):
return GLib.filename_from_utf8(utf8string, len)[0]
+
__all__.append('filename_from_utf8')
def __repr__(self):
return '<Value (%s) %s>' % (self.g_type.name, self.get_value())
+
Value = override(Value)
__all__.append('Value')
raise RuntimeError('unknown type name: %s' % name)
return type_
+
__all__.append('type_from_name')
raise RuntimeError('no parent for type')
return parent
+
__all__.append('type_parent')
_validate_type_for_signal_method(type_)
return GObjectModule.signal_list_ids(type_)
+
__all__.append('signal_list_ids')
ids = signal_list_ids(type_)
return tuple(GObjectModule.signal_name(i) for i in ids)
+
__all__.append('signal_list_names')
_validate_type_for_signal_method(type_)
return GObjectModule.signal_lookup(name, type_)
+
__all__.append('signal_lookup')
res.signal_flags, res.return_type,
tuple(res.param_types))
+
__all__.append('signal_query')
GObjectModule.signal_handler_block(obj, handler_id)
return _HandlerBlockManager(obj, handler_id)
+
__all__.append('signal_handler_block')
else:
raise ValueError('%s: unknown signal name: %s' % (itype, detailed_signal))
+
__all__.append('signal_parse_name')
signal_id, detail = signal_parse_name(detailed_signal, obj, True)
GObjectModule.signal_remove_emission_hook(signal_id, hook_id)
+
__all__.append('remove_emission_hook')
# Stop emission but return the result of the last handler
return (False, handler_return)
+
__all__.append('signal_accumulator_first_wins')
# Stop emission if the last handler returns True
return (not handler_return, handler_return)
+
__all__.append('signal_accumulator_true_handled')
except (ValueError, ImportError):
pass
+if hasattr(Gdk, 'Color'):
+ # Gdk.Color was deprecated since 3.14 and dropped in Gtk+-4.0
+ class Color(Gdk.Color):
+ MAX_VALUE = 65535
-class Color(Gdk.Color):
- MAX_VALUE = 65535
+ def __init__(self, red, green, blue):
+ Gdk.Color.__init__(self)
+ self.red = red
+ self.green = green
+ self.blue = blue
- def __init__(self, red, green, blue):
- Gdk.Color.__init__(self)
- self.red = red
- self.green = green
- self.blue = blue
+ def __eq__(self, other):
+ return self.equal(other)
- def __eq__(self, other):
- return self.equal(other)
+ def __repr__(self):
+ return 'Gdk.Color(red=%d, green=%d, blue=%d)' % (self.red, self.green, self.blue)
- def __repr__(self):
- return 'Gdk.Color(red=%d, green=%d, blue=%d)' % (self.red, self.green, self.blue)
+ red_float = property(fget=lambda self: self.red / float(self.MAX_VALUE),
+ fset=lambda self, v: setattr(self, 'red', int(v * self.MAX_VALUE)))
- red_float = property(fget=lambda self: self.red / float(self.MAX_VALUE),
- fset=lambda self, v: setattr(self, 'red', int(v * self.MAX_VALUE)))
+ green_float = property(fget=lambda self: self.green / float(self.MAX_VALUE),
+ fset=lambda self, v: setattr(self, 'green', int(v * self.MAX_VALUE)))
- green_float = property(fget=lambda self: self.green / float(self.MAX_VALUE),
- fset=lambda self, v: setattr(self, 'green', int(v * self.MAX_VALUE)))
+ blue_float = property(fget=lambda self: self.blue / float(self.MAX_VALUE),
+ fset=lambda self, v: setattr(self, 'blue', int(v * self.MAX_VALUE)))
- blue_float = property(fget=lambda self: self.blue / float(self.MAX_VALUE),
- fset=lambda self, v: setattr(self, 'blue', int(v * self.MAX_VALUE)))
+ def to_floats(self):
+ """Return (red_float, green_float, blue_float) triple."""
- def to_floats(self):
- """Return (red_float, green_float, blue_float) triple."""
+ return (self.red_float, self.green_float, self.blue_float)
- return (self.red_float, self.green_float, self.blue_float)
+ @staticmethod
+ def from_floats(red, green, blue):
+ """Return a new Color object from red/green/blue values from 0.0 to 1.0."""
- @staticmethod
- def from_floats(red, green, blue):
- """Return a new Color object from red/green/blue values from 0.0 to 1.0."""
+ return Color(int(red * Color.MAX_VALUE),
+ int(green * Color.MAX_VALUE),
+ int(blue * Color.MAX_VALUE))
- return Color(int(red * Color.MAX_VALUE),
- int(green * Color.MAX_VALUE),
- int(blue * Color.MAX_VALUE))
-Color = override(Color)
-__all__.append('Color')
+ Color = override(Color)
+ __all__.append('Color')
-if Gdk._version == '3.0':
+if hasattr(Gdk, 'RGBA'):
+ # Introduced since Gtk+-3.0
class RGBA(Gdk.RGBA):
def __init__(self, red=1.0, green=1.0, blue=1.0, alpha=1.0):
Gdk.RGBA.__init__(self)
base_repr = Gdk.Event.__repr__(self).strip("><")
return "<%s type=%r>" % (base_repr, self.type)
+
Event = override(Event)
__all__.append('Event')
Gtk = get_introspection_module('Gtk')
Gtk.drag_finish(self, success, del_, time)
+
DragContext = override(DragContext)
__all__.append('DragContext')
Cursor = override(Cursor)
__all__.append('Cursor')
-color_parse = strip_boolean_result(Gdk.color_parse)
-__all__.append('color_parse')
+if hasattr(Gdk, 'color_parse'):
+ # Gdk.Color was deprecated since 3.14 and dropped in Gtk+-4.0
+ color_parse = strip_boolean_result(Gdk.color_parse)
+ __all__.append('color_parse')
# Note, we cannot override the entire class as Gdk.Atom has no gtype, so just
SELECTION_TYPE_STRING = Gdk.atom_intern('STRING', True)
__all__.append('SELECTION_TYPE_STRING')
-import sys
-
-initialized, argv = Gdk.init_check(sys.argv)
+if Gdk._version in ('2.0', '3.0'):
+ import sys
+ initialized, argv = Gdk.init_check(sys.argv)
def keys(self):
return self.list_keys()
+
Settings = override(Settings)
__all__.append('Settings')
def __getattr__(self, name):
return _DBusProxyMethodCall(self, name)
+
DBusProxy = override(DBusProxy)
__all__.append('DBusProxy')
class PyGTKDeprecationWarning(PyGIDeprecationWarning):
pass
+
__all__.append('PyGTKDeprecationWarning')
target_entries.append(entry)
return target_entries
+
__all__.append('_construct_target_list')
__all__.append("Editable")
-class Action(Gtk.Action):
- __init__ = deprecated_init(Gtk.Action.__init__,
- arg_names=('name', 'label', 'tooltip', 'stock_id'),
- category=PyGTKDeprecationWarning)
-
-Action = override(Action)
-__all__.append("Action")
-
-
-class RadioAction(Gtk.RadioAction):
- __init__ = deprecated_init(Gtk.RadioAction.__init__,
- arg_names=('name', 'label', 'tooltip', 'stock_id', 'value'),
- category=PyGTKDeprecationWarning)
-
-RadioAction = override(RadioAction)
-__all__.append("RadioAction")
+if Gtk._version in ("2.0", "3.0"):
+ class Action(Gtk.Action):
+ __init__ = deprecated_init(Gtk.Action.__init__,
+ arg_names=('name', 'label', 'tooltip', 'stock_id'),
+ category=PyGTKDeprecationWarning)
+
+ Action = override(Action)
+ __all__.append("Action")
+
+ class RadioAction(Gtk.RadioAction):
+ __init__ = deprecated_init(Gtk.RadioAction.__init__,
+ arg_names=('name', 'label', 'tooltip', 'stock_id', 'value'),
+ category=PyGTKDeprecationWarning)
+
+ RadioAction = override(RadioAction)
+ __all__.append("RadioAction")
+
+ class ActionGroup(Gtk.ActionGroup):
+ __init__ = deprecated_init(Gtk.ActionGroup.__init__,
+ arg_names=('name',),
+ category=PyGTKDeprecationWarning)
+
+ def add_actions(self, entries, user_data=None):
+ """
+ The add_actions() method is a convenience method that creates a number
+ of gtk.Action objects based on the information in the list of action
+ entry tuples contained in entries and adds them to the action group.
+ The entry tuples can vary in size from one to six items with the
+ following information:
+
+ * The name of the action. Must be specified.
+ * The stock id for the action. Optional with a default value of None
+ if a label is specified.
+ * The label for the action. This field should typically be marked
+ for translation, see the set_translation_domain() method. Optional
+ with a default value of None if a stock id is specified.
+ * The accelerator for the action, in the format understood by the
+ gtk.accelerator_parse() function. Optional with a default value of
+ None.
+ * The tooltip for the action. This field should typically be marked
+ for translation, see the set_translation_domain() method. Optional
+ with a default value of None.
+ * The callback function invoked when the action is activated.
+ Optional with a default value of None.
+
+ The "activate" signals of the actions are connected to the callbacks and
+ their accel paths are set to <Actions>/group-name/action-name.
+ """
+ try:
+ iter(entries)
+ except (TypeError):
+ raise TypeError('entries must be iterable')
+
+ def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None):
+ action = Action(name=name, label=label, tooltip=tooltip, stock_id=stock_id)
+ if callback is not None:
+ if user_data is None:
+ action.connect('activate', callback)
+ else:
+ action.connect('activate', callback, user_data)
+
+ self.add_action_with_accel(action, accelerator)
+
+ for e in entries:
+ # using inner function above since entries can leave out optional arguments
+ _process_action(*e)
+
+ def add_toggle_actions(self, entries, user_data=None):
+ """
+ The add_toggle_actions() method is a convenience method that creates a
+ number of gtk.ToggleAction objects based on the information in the list
+ of action entry tuples contained in entries and adds them to the action
+ group. The toggle action entry tuples can vary in size from one to seven
+ items with the following information:
+
+ * The name of the action. Must be specified.
+ * The stock id for the action. Optional with a default value of None
+ if a label is specified.
+ * The label for the action. This field should typically be marked
+ for translation, see the set_translation_domain() method. Optional
+ with a default value of None if a stock id is specified.
+ * The accelerator for the action, in the format understood by the
+ gtk.accelerator_parse() function. Optional with a default value of
+ None.
+ * The tooltip for the action. This field should typically be marked
+ for translation, see the set_translation_domain() method. Optional
+ with a default value of None.
+ * The callback function invoked when the action is activated.
+ Optional with a default value of None.
+ * A flag indicating whether the toggle action is active. Optional
+ with a default value of False.
+
+ The "activate" signals of the actions are connected to the callbacks and
+ their accel paths are set to <Actions>/group-name/action-name.
+ """
+ try:
+ iter(entries)
+ except (TypeError):
+ raise TypeError('entries must be iterable')
+
+ def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False):
+ action = Gtk.ToggleAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id)
+ action.set_active(is_active)
+ if callback is not None:
+ if user_data is None:
+ action.connect('activate', callback)
+ else:
+ action.connect('activate', callback, user_data)
+
+ self.add_action_with_accel(action, accelerator)
+
+ for e in entries:
+ # using inner function above since entries can leave out optional arguments
+ _process_action(*e)
+
+ def add_radio_actions(self, entries, value=None, on_change=None, user_data=None):
+ """
+ The add_radio_actions() method is a convenience method that creates a
+ number of gtk.RadioAction objects based on the information in the list
+ of action entry tuples contained in entries and adds them to the action
+ group. The entry tuples can vary in size from one to six items with the
+ following information:
+
+ * The name of the action. Must be specified.
+ * The stock id for the action. Optional with a default value of None
+ if a label is specified.
+ * The label for the action. This field should typically be marked
+ for translation, see the set_translation_domain() method. Optional
+ with a default value of None if a stock id is specified.
+ * The accelerator for the action, in the format understood by the
+ gtk.accelerator_parse() function. Optional with a default value of
+ None.
+ * The tooltip for the action. This field should typically be marked
+ for translation, see the set_translation_domain() method. Optional
+ with a default value of None.
+ * The value to set on the radio action. Optional with a default
+ value of 0. Should be specified in applications.
+
+ The value parameter specifies the radio action that should be set
+ active. The "changed" signal of the first radio action is connected to
+ the on_change callback (if specified and not None) and the accel paths
+ of the actions are set to <Actions>/group-name/action-name.
+ """
+ try:
+ iter(entries)
+ except (TypeError):
+ raise TypeError('entries must be iterable')
-class ActionGroup(Gtk.ActionGroup):
- __init__ = deprecated_init(Gtk.ActionGroup.__init__,
- arg_names=('name',),
- category=PyGTKDeprecationWarning)
+ first_action = None
- def add_actions(self, entries, user_data=None):
- """
- The add_actions() method is a convenience method that creates a number
- of gtk.Action objects based on the information in the list of action
- entry tuples contained in entries and adds them to the action group.
- The entry tuples can vary in size from one to six items with the
- following information:
-
- * The name of the action. Must be specified.
- * The stock id for the action. Optional with a default value of None
- if a label is specified.
- * The label for the action. This field should typically be marked
- for translation, see the set_translation_domain() method. Optional
- with a default value of None if a stock id is specified.
- * The accelerator for the action, in the format understood by the
- gtk.accelerator_parse() function. Optional with a default value of
- None.
- * The tooltip for the action. This field should typically be marked
- for translation, see the set_translation_domain() method. Optional
- with a default value of None.
- * The callback function invoked when the action is activated.
- Optional with a default value of None.
-
- The "activate" signals of the actions are connected to the callbacks and
- their accel paths are set to <Actions>/group-name/action-name.
- """
- try:
- iter(entries)
- except (TypeError):
- raise TypeError('entries must be iterable')
+ def _process_action(group_source, name, stock_id=None, label=None, accelerator=None, tooltip=None, entry_value=0):
+ action = RadioAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id, value=entry_value)
- def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None):
- action = Action(name=name, label=label, tooltip=tooltip, stock_id=stock_id)
- if callback is not None:
- if user_data is None:
- action.connect('activate', callback)
- else:
- action.connect('activate', callback, user_data)
+ # FIXME: join_group is a patch to Gtk+ 3.0
+ # otherwise we can't effectively add radio actions to a
+ # group. Should we depend on 3.0 and error out here
+ # or should we offer the functionality via a compat
+ # C module?
+ if hasattr(action, 'join_group'):
+ action.join_group(group_source)
- self.add_action_with_accel(action, accelerator)
+ if value == entry_value:
+ action.set_active(True)
- for e in entries:
- # using inner function above since entries can leave out optional arguments
- _process_action(*e)
+ self.add_action_with_accel(action, accelerator)
+ return action
- def add_toggle_actions(self, entries, user_data=None):
- """
- The add_toggle_actions() method is a convenience method that creates a
- number of gtk.ToggleAction objects based on the information in the list
- of action entry tuples contained in entries and adds them to the action
- group. The toggle action entry tuples can vary in size from one to seven
- items with the following information:
-
- * The name of the action. Must be specified.
- * The stock id for the action. Optional with a default value of None
- if a label is specified.
- * The label for the action. This field should typically be marked
- for translation, see the set_translation_domain() method. Optional
- with a default value of None if a stock id is specified.
- * The accelerator for the action, in the format understood by the
- gtk.accelerator_parse() function. Optional with a default value of
- None.
- * The tooltip for the action. This field should typically be marked
- for translation, see the set_translation_domain() method. Optional
- with a default value of None.
- * The callback function invoked when the action is activated.
- Optional with a default value of None.
- * A flag indicating whether the toggle action is active. Optional
- with a default value of False.
-
- The "activate" signals of the actions are connected to the callbacks and
- their accel paths are set to <Actions>/group-name/action-name.
- """
+ for e in entries:
+ # using inner function above since entries can leave out optional arguments
+ action = _process_action(first_action, *e)
+ if first_action is None:
+ first_action = action
- try:
- iter(entries)
- except (TypeError):
- raise TypeError('entries must be iterable')
-
- def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False):
- action = Gtk.ToggleAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id)
- action.set_active(is_active)
- if callback is not None:
+ if first_action is not None and on_change is not None:
if user_data is None:
- action.connect('activate', callback)
+ first_action.connect('changed', on_change)
else:
- action.connect('activate', callback, user_data)
-
- self.add_action_with_accel(action, accelerator)
-
- for e in entries:
- # using inner function above since entries can leave out optional arguments
- _process_action(*e)
-
- def add_radio_actions(self, entries, value=None, on_change=None, user_data=None):
- """
- The add_radio_actions() method is a convenience method that creates a
- number of gtk.RadioAction objects based on the information in the list
- of action entry tuples contained in entries and adds them to the action
- group. The entry tuples can vary in size from one to six items with the
- following information:
-
- * The name of the action. Must be specified.
- * The stock id for the action. Optional with a default value of None
- if a label is specified.
- * The label for the action. This field should typically be marked
- for translation, see the set_translation_domain() method. Optional
- with a default value of None if a stock id is specified.
- * The accelerator for the action, in the format understood by the
- gtk.accelerator_parse() function. Optional with a default value of
- None.
- * The tooltip for the action. This field should typically be marked
- for translation, see the set_translation_domain() method. Optional
- with a default value of None.
- * The value to set on the radio action. Optional with a default
- value of 0. Should be specified in applications.
-
- The value parameter specifies the radio action that should be set
- active. The "changed" signal of the first radio action is connected to
- the on_change callback (if specified and not None) and the accel paths
- of the actions are set to <Actions>/group-name/action-name.
- """
- try:
- iter(entries)
- except (TypeError):
- raise TypeError('entries must be iterable')
-
- first_action = None
-
- def _process_action(group_source, name, stock_id=None, label=None, accelerator=None, tooltip=None, entry_value=0):
- action = RadioAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id, value=entry_value)
-
- # FIXME: join_group is a patch to Gtk+ 3.0
- # otherwise we can't effectively add radio actions to a
- # group. Should we depend on 3.0 and error out here
- # or should we offer the functionality via a compat
- # C module?
- if hasattr(action, 'join_group'):
- action.join_group(group_source)
-
- if value == entry_value:
- action.set_active(True)
-
- self.add_action_with_accel(action, accelerator)
- return action
-
- for e in entries:
- # using inner function above since entries can leave out optional arguments
- action = _process_action(first_action, *e)
- if first_action is None:
- first_action = action
-
- if first_action is not None and on_change is not None:
- if user_data is None:
- first_action.connect('changed', on_change)
- else:
- first_action.connect('changed', on_change, user_data)
+ first_action.connect('changed', on_change, user_data)
-ActionGroup = override(ActionGroup)
-__all__.append('ActionGroup')
+ ActionGroup = override(ActionGroup)
+ __all__.append('ActionGroup')
+ class UIManager(Gtk.UIManager):
+ def add_ui_from_string(self, buffer):
+ if not isinstance(buffer, _basestring):
+ raise TypeError('buffer must be a string')
-class UIManager(Gtk.UIManager):
- def add_ui_from_string(self, buffer):
- if not isinstance(buffer, _basestring):
- raise TypeError('buffer must be a string')
+ length = len(buffer.encode('UTF-8'))
- length = len(buffer.encode('UTF-8'))
+ return Gtk.UIManager.add_ui_from_string(self, buffer, length)
- return Gtk.UIManager.add_ui_from_string(self, buffer, length)
+ def insert_action_group(self, buffer, length=-1):
+ return Gtk.UIManager.insert_action_group(self, buffer, length)
- def insert_action_group(self, buffer, length=-1):
- return Gtk.UIManager.insert_action_group(self, buffer, length)
-
-UIManager = override(UIManager)
-__all__.append('UIManager')
+ UIManager = override(UIManager)
+ __all__.append('UIManager')
class ComboBox(Gtk.ComboBox, Container):
get_active_iter = strip_boolean_result(Gtk.ComboBox.get_active_iter)
+
ComboBox = override(ComboBox)
__all__.append('ComboBox')
arg_names=('homogeneous', 'spacing'),
category=PyGTKDeprecationWarning)
+
Box = override(Box)
__all__.append('Box')
deprecated_defaults={'mode': Gtk.SizeGroupMode.VERTICAL},
category=PyGTKDeprecationWarning)
+
SizeGroup = override(SizeGroup)
__all__.append('SizeGroup')
arg_names=('label',),
category=PyGTKDeprecationWarning)
+
MenuItem = override(MenuItem)
__all__.append('MenuItem')
return Gtk.Builder.add_objects_from_string(self, buffer, length, object_ids)
+
Builder = override(Builder)
__all__.append('Builder')
arg_names=('type',),
category=PyGTKDeprecationWarning)
+
Window = override(Window)
__all__.append('Window')
except (IndexError):
raise TypeError('Must pass an even number of arguments')
+
Dialog = override(Dialog)
__all__.append('Dialog')
self.set_property('secondary-use-markup', True)
self.set_property('secondary-text', message_format)
+
MessageDialog = override(MessageDialog)
__all__.append('MessageDialog')
-class ColorSelectionDialog(Gtk.ColorSelectionDialog):
- __init__ = deprecated_init(Gtk.ColorSelectionDialog.__init__,
- arg_names=('title',),
- category=PyGTKDeprecationWarning)
+if Gtk._version in ("2.0", "3.0"):
+ class ColorSelectionDialog(Gtk.ColorSelectionDialog):
+ __init__ = deprecated_init(Gtk.ColorSelectionDialog.__init__,
+ arg_names=('title',),
+ category=PyGTKDeprecationWarning)
-ColorSelectionDialog = override(ColorSelectionDialog)
-__all__.append('ColorSelectionDialog')
+ ColorSelectionDialog = override(ColorSelectionDialog)
+ __all__.append('ColorSelectionDialog')
class FileChooserDialog(Gtk.FileChooserDialog):
arg_names=('title', 'parent', 'action', 'buttons'),
category=PyGTKDeprecationWarning)
+
FileChooserDialog = override(FileChooserDialog)
__all__.append('FileChooserDialog')
-class FontSelectionDialog(Gtk.FontSelectionDialog):
- __init__ = deprecated_init(Gtk.FontSelectionDialog.__init__,
- arg_names=('title',),
- category=PyGTKDeprecationWarning)
+if Gtk._version in ("2.0", "3.0"):
+ class FontSelectionDialog(Gtk.FontSelectionDialog):
+ __init__ = deprecated_init(Gtk.FontSelectionDialog.__init__,
+ arg_names=('title',),
+ category=PyGTKDeprecationWarning)
-FontSelectionDialog = override(FontSelectionDialog)
-__all__.append('FontSelectionDialog')
+ FontSelectionDialog = override(FontSelectionDialog)
+ __all__.append('FontSelectionDialog')
class RecentChooserDialog(Gtk.RecentChooserDialog):
deprecated_aliases={'recent_manager': 'manager'},
category=PyGTKDeprecationWarning)
+
RecentChooserDialog = override(RecentChooserDialog)
__all__.append('RecentChooserDialog')
get_visible_range = strip_boolean_result(Gtk.IconView.get_visible_range)
get_dest_item_at_pos = strip_boolean_result(Gtk.IconView.get_dest_item_at_pos)
+
IconView = override(IconView)
__all__.append('IconView')
arg_names=('stock_id',),
category=PyGTKDeprecationWarning)
+
ToolButton = override(ToolButton)
__all__.append('ToolButton')
class IMContext(Gtk.IMContext):
get_surrounding = strip_boolean_result(Gtk.IMContext.get_surrounding)
+
IMContext = override(IMContext)
__all__.append('IMContext')
class RecentInfo(Gtk.RecentInfo):
get_application_info = strip_boolean_result(Gtk.RecentInfo.get_application_info)
+
RecentInfo = override(RecentInfo)
__all__.append('RecentInfo')
get_selection_bounds = strip_boolean_result(Gtk.TextBuffer.get_selection_bounds, fail_ret=())
+
TextBuffer = override(TextBuffer)
__all__.append('TextBuffer')
forward_search = strip_boolean_result(Gtk.TextIter.forward_search)
backward_search = strip_boolean_result(Gtk.TextIter.backward_search)
+
TextIter = override(TextIter)
__all__.append('TextIter')
def set_default_sort_func(self, sort_func, user_data=None):
super(TreeSortable, self).set_default_sort_func(sort_func, user_data)
+
TreeSortable = override(TreeSortable)
__all__.append('TreeSortable')
arg_names=('model',),
category=PyGTKDeprecationWarning)
+
TreeModelSort = override(TreeModelSort)
__all__.append('TreeModelSort')
else:
raise TypeError('Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.')
+
ListStore = override(ListStore)
__all__.append('ListStore')
child_iter = self.model.iter_children(self.iter)
return TreeModelRowIter(self.model, child_iter)
+
__all__.append('TreeModelRow')
def __iter__(self):
return self
+
__all__.append('TreeModelRowIter')
def __getitem__(self, index):
return self.get_indices()[index]
+
TreePath = override(TreePath)
__all__.append('TreePath')
else:
raise TypeError('Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.')
+
TreeStore = override(TreeStore)
__all__.append('TreeStore')
self.insert_column(column, position)
column.set_attributes(cell, **kwargs)
+
TreeView = override(TreeView)
__all__.append('TreeView')
else:
self._init(*args, **kwargs)
+
Button = override(Button)
__all__.append('Button')
arg_names=('uri', 'label'),
category=PyGTKDeprecationWarning)
+
LinkButton = override(LinkButton)
__all__.append('LinkButton')
arg_names=('label',),
category=PyGTKDeprecationWarning)
+
Label = override(Label)
__all__.append('Label')
if 'value' in kwargs:
self.set_value(kwargs['value'])
+
Adjustment = override(Adjustment)
__all__.append('Adjustment')
-class Table(Gtk.Table, Container):
- __init__ = deprecated_init(Gtk.Table.__init__,
- arg_names=('n_rows', 'n_columns', 'homogeneous'),
- deprecated_aliases={'n_rows': 'rows', 'n_columns': 'columns'},
- category=PyGTKDeprecationWarning)
+if Gtk._version in ("2.0", "3.0"):
+ class Table(Gtk.Table, Container):
+ __init__ = deprecated_init(Gtk.Table.__init__,
+ arg_names=('n_rows', 'n_columns', 'homogeneous'),
+ deprecated_aliases={'n_rows': 'rows', 'n_columns': 'columns'},
+ category=PyGTKDeprecationWarning)
- def attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, xpadding=0, ypadding=0):
- Gtk.Table.attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding)
+ def attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, xpadding=0, ypadding=0):
+ Gtk.Table.attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding)
-Table = override(Table)
-__all__.append('Table')
+ Table = override(Table)
+ __all__.append('Table')
class ScrolledWindow(Gtk.ScrolledWindow):
arg_names=('hadjustment', 'vadjustment'),
category=PyGTKDeprecationWarning)
+
ScrolledWindow = override(ScrolledWindow)
__all__.append('ScrolledWindow')
-class HScrollbar(Gtk.HScrollbar):
- __init__ = deprecated_init(Gtk.HScrollbar.__init__,
- arg_names=('adjustment',),
- category=PyGTKDeprecationWarning)
-
-HScrollbar = override(HScrollbar)
-__all__.append('HScrollbar')
+if Gtk._version in ("2.0", "3.0"):
+ class HScrollbar(Gtk.HScrollbar):
+ __init__ = deprecated_init(Gtk.HScrollbar.__init__,
+ arg_names=('adjustment',),
+ category=PyGTKDeprecationWarning)
+ HScrollbar = override(HScrollbar)
+ __all__.append('HScrollbar')
-class VScrollbar(Gtk.VScrollbar):
- __init__ = deprecated_init(Gtk.VScrollbar.__init__,
- arg_names=('adjustment',),
- category=PyGTKDeprecationWarning)
+ class VScrollbar(Gtk.VScrollbar):
+ __init__ = deprecated_init(Gtk.VScrollbar.__init__,
+ arg_names=('adjustment',),
+ category=PyGTKDeprecationWarning)
-VScrollbar = override(VScrollbar)
-__all__.append('VScrollbar')
+ VScrollbar = override(VScrollbar)
+ __all__.append('VScrollbar')
class Paned(Gtk.Paned):
def pack2(self, child, resize=True, shrink=True):
super(Paned, self).pack2(child, resize, shrink)
+
Paned = override(Paned)
__all__.append('Paned')
-class Arrow(Gtk.Arrow):
- __init__ = deprecated_init(Gtk.Arrow.__init__,
- arg_names=('arrow_type', 'shadow_type'),
- category=PyGTKDeprecationWarning)
+if Gtk._version in ("2.0", "3.0"):
+ class Arrow(Gtk.Arrow):
+ __init__ = deprecated_init(Gtk.Arrow.__init__,
+ arg_names=('arrow_type', 'shadow_type'),
+ category=PyGTKDeprecationWarning)
-Arrow = override(Arrow)
-__all__.append('Arrow')
+ Arrow = override(Arrow)
+ __all__.append('Arrow')
+ class IconSet(Gtk.IconSet):
+ def __new__(cls, pixbuf=None):
+ if pixbuf is not None:
+ warnings.warn('Gtk.IconSet(pixbuf) has been deprecated. Please use: '
+ 'Gtk.IconSet.new_from_pixbuf(pixbuf)',
+ PyGTKDeprecationWarning, stacklevel=2)
+ iconset = Gtk.IconSet.new_from_pixbuf(pixbuf)
+ else:
+ iconset = Gtk.IconSet.__new__(cls)
+ return iconset
-class IconSet(Gtk.IconSet):
- def __new__(cls, pixbuf=None):
- if pixbuf is not None:
- warnings.warn('Gtk.IconSet(pixbuf) has been deprecated. Please use: '
- 'Gtk.IconSet.new_from_pixbuf(pixbuf)',
- PyGTKDeprecationWarning, stacklevel=2)
- iconset = Gtk.IconSet.new_from_pixbuf(pixbuf)
- else:
- iconset = Gtk.IconSet.__new__(cls)
- return iconset
-
- def __init__(self, *args, **kwargs):
- return super(IconSet, self).__init__()
+ def __init__(self, *args, **kwargs):
+ return super(IconSet, self).__init__()
-IconSet = override(IconSet)
-__all__.append('IconSet')
+ IconSet = override(IconSet)
+ __all__.append('IconSet')
class Viewport(Gtk.Viewport):
arg_names=('hadjustment', 'vadjustment'),
category=PyGTKDeprecationWarning)
+
Viewport = override(Viewport)
__all__.append('Viewport')
iter = self.convert_iter_to_child_iter(iter)
self.get_model().set_value(iter, column, value)
+
TreeModelFilter = override(TreeModelFilter)
__all__.append('TreeModelFilter')
def main_quit(*args):
_Gtk_main_quit()
-stock_lookup = strip_boolean_result(Gtk.stock_lookup)
-__all__.append('stock_lookup')
-initialized, argv = Gtk.init_check(sys.argv)
-sys.argv = list(argv)
+if Gtk._version in ("2.0", "3.0"):
+ stock_lookup = strip_boolean_result(Gtk.stock_lookup)
+ __all__.append('stock_lookup')
+
+if Gtk._version == "4.0":
+ Gtk.init_check()
+else:
+ initialized, argv = Gtk.init_check(sys.argv)
+ sys.argv = list(argv)
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
def __init__(self, *args, **kwargs):
return super(FontDescription, self).__init__()
+
FontDescription = override(FontDescription)
__all__.append('FontDescription')
def set_markup(self, text, length=-1):
super(Layout, self).set_markup(text, length)
+
Layout = override(Layout)
__all__.append('Layout')
static void
_callable_cache_deinit_real (PyGICallableCache *cache)
{
- g_slist_free (cache->to_py_args);
- g_slist_free (cache->arg_name_list);
- g_hash_table_destroy (cache->arg_name_hash);
- g_ptr_array_unref (cache->args_cache);
- Py_XDECREF (cache->resulttuple_type);
-
- if (cache->return_cache != NULL)
- pygi_arg_cache_free (cache->return_cache);
+ g_clear_pointer (&cache->to_py_args, g_slist_free);
+ g_clear_pointer (&cache->arg_name_list, g_slist_free);
+ g_clear_pointer (&cache->arg_name_hash, g_hash_table_unref);
+ g_clear_pointer (&cache->args_cache, g_ptr_array_unref);
+ Py_CLEAR (cache->resulttuple_type);
+
+ g_clear_pointer (&cache->return_cache, pygi_arg_cache_free);
}
static gboolean
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
_gobject.type_register(cls, namespace.get('__gtype_name__'))
+
_gobject._install_metaclass(_GObjectMetaBase)
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
from gi.repository import Gio
sys.modules['gio'] = Gio
+
_unset = object()
CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
res = self.model.iter_parent(child)
self.assertEqual(res, None)
+
if __name__ == '__main__':
unittest.main()
def do_iface_method(self):
self.called = True
Unknown.do_iface_method(self)
+
+
GObject.type_register(MyUnknown)
def do_iface_method(self):
self.called = True
+
+
GObject.type_register(MyObject)
self.assertEqual(GLib.IOFlags.IS_SEEKABLE, GLib.IO_FLAG_IS_SEEKABLE)
self.assertEqual(GLib.IOStatus.NORMAL, GLib.IO_STATUS_NORMAL)
+
if __name__ == '__main__':
unittest.main()
self.assertTrue(label2 in box)
self.assertEqual(len(box), 2)
self.assertTrue(box)
- l = [x for x in box]
- self.assertEqual(l, [label, label2])
+ labels = [x for x in box]
+ self.assertEqual(labels, [label, label2])
def test_actions(self):
self.assertEqual(Gtk.Action, gi.overrides.Gtk.Action)
self.assertEqual(viewport.props.hadjustment, hadjustment)
def test_stock_lookup(self):
- l = Gtk.stock_lookup('gtk-ok')
- self.assertEqual(type(l), Gtk.StockItem)
- self.assertEqual(l.stock_id, 'gtk-ok')
+ stock_item = Gtk.stock_lookup('gtk-ok')
+ self.assertEqual(type(stock_item), Gtk.StockItem)
+ self.assertEqual(stock_item.stock_id, 'gtk-ok')
self.assertEqual(Gtk.stock_lookup('nosuchthing'), None)
def test_gtk_main(self):
def test_boxed_glist(self):
self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), [])
- l = [GLib.MININT, 42, GLib.MAXINT]
- self.set_prop(self.obj, 'some-boxed-glist', l)
- self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), l)
+ list_ = [GLib.MININT, 42, GLib.MAXINT]
+ self.set_prop(self.obj, 'some-boxed-glist', list_)
+ self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), list_)
self.set_prop(self.obj, 'some-boxed-glist', [])
self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), [])
@unittest.expectedFailure
def test_boxed_glist_ctor(self):
- l = [GLib.MININT, 42, GLib.MAXINT]
- obj = GIMarshallingTests.PropertiesObject(some_boxed_glist=l)
- self.assertEqual(self.get_prop(obj, 'some-boxed-glist'), l)
+ list_ = [GLib.MININT, 42, GLib.MAXINT]
+ obj = GIMarshallingTests.PropertiesObject(some_boxed_glist=list_)
+ self.assertEqual(self.get_prop(obj, 'some-boxed-glist'), list_)
def test_variant(self):
self.assertEqual(self.get_prop(self.obj, 'some-variant'), None)
self.assertEqual(self.obj.emit("test-gvalue-ret", GObject.TYPE_STRING),
"hello")
+
if 'generic-c-marshaller' in GObject.features:
class TestCMarshaller(_TestCMarshaller, unittest.TestCase):
pass