50
54
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51
55
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52
56
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53
[AM_AUTOMAKE_VERSION([1.11.1])dnl
57
[AM_AUTOMAKE_VERSION([1.11.5])dnl
54
58
m4_ifndef([AC_AUTOCONF_VERSION],
55
59
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56
60
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58
62
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
60
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
64
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
62
66
# This file is free software; the Free Software Foundation
63
67
# gives unlimited permission to copy and/or distribute it,
64
68
# with or without modifications, as long as this notice is preserved.
66
72
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67
73
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
68
74
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
167
173
Usually this means the macro was only invoked conditionally.]])
170
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
171
# Free Software Foundation, Inc.
176
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
177
# 2010, 2011 Free Software Foundation, Inc.
173
179
# This file is free software; the Free Software Foundation
174
180
# gives unlimited permission to copy and/or distribute it,
175
181
# with or without modifications, as long as this notice is preserved.
179
185
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
180
186
# written in clear, in which case automake, when reading aclocal.m4,
907
926
no) AM_DEFAULT_VERBOSITY=1;;
908
927
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
930
dnl A few `make' implementations (e.g., NonStop OS and NextStep)
931
dnl do not support nested variable expansions.
932
dnl See automake bug#9928 and bug#10237.
934
AC_CACHE_CHECK([whether $am_make supports nested variables],
935
[am_cv_make_support_nested_variables],
936
[if AS_ECHO([['TRUE=$(BAR$(V))
942
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
943
am_cv_make_support_nested_variables=yes
945
am_cv_make_support_nested_variables=no
947
if test $am_cv_make_support_nested_variables = yes; then
948
dnl Using `$V' instead of `$(V)' breaks IRIX make.
950
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
952
AM_V=$AM_DEFAULT_VERBOSITY
953
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
956
AM_SUBST_NOTMAKE([AM_V])dnl
957
AC_SUBST([AM_DEFAULT_V])dnl
958
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
910
959
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
912
961
AC_SUBST([AM_BACKSLASH])dnl
913
962
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
916
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
965
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
918
967
# This file is free software; the Free Software Foundation
919
968
# gives unlimited permission to copy and/or distribute it,
920
969
# with or without modifications, as long as this notice is preserved.
922
973
# AM_PROG_INSTALL_STRIP
923
974
# ---------------------
924
975
# One issue with vendor `install' (even GNU) is that you can't
1739
dnl GNOME_CODE_COVERAGE
1741
dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
1742
dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
1743
dnl (program or library) which should be built with code coverage support.
1744
dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
1745
dnl Makefile; and $enable_code_coverage which can be used in subsequent
1746
dnl configure output.
1748
dnl Note that all optimisation flags in CFLAGS must be disabled when code
1749
dnl coverage is enabled.
1751
dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
1752
dnl This file is licenced under GPLv3. For the full gnome-common licence
1753
dnl (GPLv3), see the COPYING file.
1757
dnl GNOME_CODE_COVERAGE
1760
dnl @GNOME_CODE_COVERAGE_RULES@
1761
dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
1762
dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
1764
AC_DEFUN([GNOME_CODE_COVERAGE],[
1765
dnl Check for --enable-code-coverage
1766
AC_MSG_CHECKING([whether to build with code coverage support])
1767
AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
1768
AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
1769
AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
1770
AC_MSG_RESULT($enable_code_coverage)
1772
AS_IF([ test "$enable_code_coverage" = "yes" ], [
1773
dnl Check if gcc is being used
1774
AS_IF([ test "$GCC" = "no" ], [
1775
AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
1778
# List of supported lcov versions.
1779
lcov_version_list="1.6 1.7 1.8 1.9"
1781
AC_CHECK_PROG([LCOV], [lcov], [lcov])
1782
AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
1784
AS_IF([ test "$LCOV" ], [
1785
AC_CACHE_CHECK([for lcov version], gnome_cv_lcov_version, [
1786
gnome_cv_lcov_version=invalid
1787
lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
1788
for lcov_check_version in $lcov_version_list; do
1789
if test "$lcov_version" = "$lcov_check_version"; then
1790
gnome_cv_lcov_version="$lcov_check_version (ok)"
1795
lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
1796
AC_MSG_ERROR([$lcov_msg])
1799
case $gnome_cv_lcov_version in
1801
lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
1802
AC_MSG_ERROR([$lcov_msg])
1807
AS_IF([ test -z "$GENHTML" ], [
1808
AC_MSG_ERROR([Could not find genhtml from the lcov package])
1811
dnl Build the code coverage flags
1812
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
1813
CODE_COVERAGE_LDFLAGS="-lgcov"
1815
AC_SUBST([CODE_COVERAGE_CFLAGS])
1816
AC_SUBST([CODE_COVERAGE_LDFLAGS])
1819
GNOME_CODE_COVERAGE_RULES='
1823
# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
1824
# (Default: $(top_builddir))
1825
# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
1826
# by lcov for code coverage. (Default:
1827
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
1828
# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
1829
# reports to be created. (Default:
1830
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
1831
# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
1833
# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
1834
# instance. (Default: empty)
1836
# The generated report will be titled using the $(PACKAGE_NAME) and
1837
# $(PACKAGE_VERSION). In order to add the current git hash to the title,
1838
# use the git-version-gen script, available online.
1840
# Optional variables
1841
CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
1842
CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
1843
CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
1844
CODE_COVERAGE_LCOV_OPTIONS ?=
1845
CODE_COVERAGE_GENHTML_OPTIONS ?=
1847
# Use recursive makes in order to ignore errors during check
1848
check-code-coverage:
1849
ifdef CODE_COVERAGE_ENABLED
1850
-$(MAKE) $(AM_MAKEFLAGS) -k check
1851
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
1853
@echo "Need to reconfigure with --enable-code-coverage"
1856
# Capture code coverage data
1857
code-coverage-capture: code-coverage-capture-hook
1858
ifdef CODE_COVERAGE_ENABLED
1859
$(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
1860
$(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
1861
-rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
1862
LANG=C $(GENHTML) --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)
1863
@echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
1865
@echo "Need to reconfigure with --enable-code-coverage"
1868
# Hook rule executed before code-coverage-capture, overridable by the user
1869
code-coverage-capture-hook:
1871
clean: code-coverage-clean
1872
code-coverage-clean:
1873
-$(LCOV) --directory $(top_builddir) -z
1874
-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
1875
-find . -name "*.gcda" -o -name "*.gcov" -delete
1878
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
1880
DISTCHECK_CONFIGURE_FLAGS ?=
1881
DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
1883
.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
1886
AC_SUBST([GNOME_CODE_COVERAGE_RULES])
1887
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
1687
1890
# gnome-common.m4