autoconfiscate.diff 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. diff --git a/Demo/Makefile.am b/Demo/Makefile.am
  2. new file mode 100644
  3. --- /dev/null
  4. +++ b/Demo/Makefile.am
  5. @@ -0,0 +1,57 @@
  6. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(AMD_CFLAGS) $(SUITESPARSECONFIG_CFLAGS)
  7. +LDADD = $(top_builddir)/Source/libldl.la
  8. +
  9. +EXTRA_DIST = \
  10. + ldlamd.out \
  11. + ldllamd.out \
  12. + ldlmain.out \
  13. + ldllmain.out \
  14. + ldlsimple.out \
  15. + ldllsimple.out
  16. +
  17. +# Disable the .out implicit pattern rule. Prevents GNU make from
  18. +# adding bogus dependencies for the .out files listed above.
  19. +%.out: %
  20. +
  21. +check_PROGRAMS = \
  22. + ldlmain \
  23. + ldllmain \
  24. + ldlsimple \
  25. + ldllsimple
  26. +
  27. +if AMD
  28. +check_PROGRAMS += \
  29. + ldlamd \
  30. + ldllamd
  31. +
  32. +ldlamd_SOURCES = ldlmain.c
  33. +ldlamd_LDADD = $(LDADD) $(AMD_LIBS)
  34. +ldlamd_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_AMD
  35. +
  36. +ldllamd_SOURCES = ldlmain.c
  37. +ldllamd_LDADD = $(LDADD) $(AMD_LIBS)
  38. +ldllamd_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_AMD -DLDL_LONG
  39. +endif
  40. +
  41. +ldlmain_SOURCES = ldlmain.c
  42. +
  43. +ldllmain_SOURCES = ldlmain.c
  44. +ldllmain_CPPFLAGS = $(AM_CPPFLAGS) -DLDL_LONG
  45. +
  46. +ldlsimple_SOURCES = ldlsimple.c
  47. +
  48. +ldllsimple_SOURCES = ldlsimple.c
  49. +ldllsimple_CPPFLAGS = $(AM_CPPFLAGS) -DLDL_LONG
  50. +
  51. +check-local: $(check_PROGRAMS) $(check_PROGRAMS:=.out)
  52. + @for i in $(check_PROGRAMS); do \
  53. + echo "Testing $$i"; \
  54. + (cd $(srcdir) && $(abs_builddir)/$$i$(EXEEXT)) > my_$$i.out; \
  55. + if diff -u $(srcdir)/$$i.out my_$$i.out; then \
  56. + echo "Test $$i PASSED."; \
  57. + else \
  58. + echo "Test $$i FAILED."; \
  59. + fi; \
  60. + done
  61. +
  62. +CLEANFILES = my_*.out
  63. diff --git a/Doc/Makefile.am b/Doc/Makefile.am
  64. new file mode 100644
  65. --- /dev/null
  66. +++ b/Doc/Makefile.am
  67. @@ -0,0 +1,23 @@
  68. +EXTRA_DIST = ChangeLog License.txt lesser.txt
  69. +
  70. +dist_noinst_DATA = ldl_userguide.tex ldl.bib
  71. +dist_pdf_DATA = ldl_userguide.pdf
  72. +
  73. +.INTERMEDIATE: ldl_userguide.bib
  74. +ldl_userguide.bib: ldl.bib
  75. + $(LN_S) -f $< $@
  76. +
  77. +TEX = TEXINPUTS="$(srcdir):" pdflatex -interaction nonstopmode -file-line-error
  78. +BIB = BIBINPUTS="$(srcdir):" bibtex
  79. +%.pdf: %.tex %.bbl
  80. + $(TEX) $*
  81. + while grep -q "Rerun to get cross-references right" $*.log; do \
  82. + $(TEX) $*; \
  83. + done
  84. +%.bbl: %.aux %.bib
  85. + $(BIB) $*
  86. +%.aux: %.tex
  87. + $(TEX) $*
  88. +
  89. +CLEANFILES = *.aux *.bbl *.blg *.log *.toc
  90. +MAINTAINERCLEANFILES = $(dist_pdf_DATA)
  91. diff --git a/Include/Makefile.am b/Include/Makefile.am
  92. new file mode 100644
  93. --- /dev/null
  94. +++ b/Include/Makefile.am
  95. @@ -0,0 +1 @@
  96. +pkginclude_HEADERS = ldl.h
  97. diff --git a/Makefile.am b/Makefile.am
  98. new file mode 100644
  99. --- /dev/null
  100. +++ b/Makefile.am
  101. @@ -0,0 +1,9 @@
  102. +ACLOCAL_AMFLAGS = -I m4
  103. +
  104. +SUBDIRS = Include Source Matrix Demo Doc
  105. +EXTRA_DIST = README.txt
  106. +
  107. +pkgconfig_DATA = ldl.pc
  108. +
  109. +CODE_COVERAGE_BRANCH_COVERAGE = 1
  110. +@CODE_COVERAGE_RULES@
  111. diff --git a/Matrix/Makefile.am b/Matrix/Makefile.am
  112. new file mode 100644
  113. --- /dev/null
  114. +++ b/Matrix/Makefile.am
  115. @@ -0,0 +1,4 @@
  116. +dist_noinst_DATA = \
  117. + A01 A02 A03 A04 A05 A06 A07 A08 A09 A10 \
  118. + A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 \
  119. + A21 A22 A23 A24 A25 A26 A27 A28 A29 A30
  120. diff --git a/Source/Makefile.am b/Source/Makefile.am
  121. new file mode 100644
  122. --- /dev/null
  123. +++ b/Source/Makefile.am
  124. @@ -0,0 +1,21 @@
  125. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(SUITESPARSECONFIG_CFLAGS)
  126. +
  127. +LDLSRC = \
  128. + ldl.c
  129. +
  130. +lib_LTLIBRARIES = libldl.la
  131. +noinst_LTLIBRARIES = libldli.la libldll.la
  132. +
  133. +libldli_la_SOURCES = $(LDLSRC)
  134. +libldli_la_LIBADD = $(CODE_COVERAGE_LIBS)
  135. +libldli_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS)
  136. +libldli_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  137. +
  138. +libldll_la_SOURCES = $(LDLSRC)
  139. +libldll_la_LIBADD = $(CODE_COVERAGE_LIBS)
  140. +libldll_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS) -DLDL_LONG
  141. +libldll_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  142. +
  143. +libldl_la_SOURCES =
  144. +libldl_la_LIBADD = libldli.la libldll.la
  145. +libldl_la_LDFLAGS = -no-undefined -release $(PACKAGE_VERSION)
  146. diff --git a/configure.ac b/configure.ac
  147. new file mode 100644
  148. --- /dev/null
  149. +++ b/configure.ac
  150. @@ -0,0 +1,52 @@
  151. +# -*- Autoconf -*-
  152. +# Process this file with autoconf to produce a configure script.
  153. +
  154. +AC_PREREQ([2.69])
  155. +AC_INIT([LDL],[2.2.6],[https://github.com/DrTimothyAldenDavis/SuiteSparse],[ldl],[http://www.suitesparse.com/])
  156. +AC_CONFIG_SRCDIR([Source/ldl.c])
  157. +AC_CONFIG_AUX_DIR([build-aux])
  158. +AC_CONFIG_MACRO_DIR([m4])
  159. +AC_CONFIG_HEADERS([config.h])
  160. +AM_INIT_AUTOMAKE([foreign])
  161. +AM_SILENT_RULES([yes])
  162. +LT_INIT([disable-static])
  163. +
  164. +# Checks for programs.
  165. +PKG_PROG_PKG_CONFIG
  166. +AC_PROG_INSTALL
  167. +AC_PROG_CC
  168. +AC_PROG_LN_S
  169. +AX_CODE_COVERAGE
  170. +
  171. +AS_VAR_SET([LIBS_SAVED], [$LIBS])
  172. +
  173. +# Checks for libraries.
  174. +PKG_CHECK_MODULES([SUITESPARSECONFIG], [suitesparseconfig])
  175. +PKG_CHECK_MODULES([AMD], [amd],
  176. + [AS_VAR_SET([have_amd], [yes])],
  177. + [AS_VAR_SET([have_amd], [no])
  178. + AC_MSG_WARN([$AMD_PKG_ERRORS (required by some demos), disabling some functionality])])
  179. +
  180. +# Checks for header files.
  181. +AC_CHECK_HEADERS([stdlib.h])
  182. +
  183. +# Checks for typedefs, structures, and compiler characteristics.
  184. +
  185. +# Checks for library functions.
  186. +AC_FUNC_MALLOC
  187. +
  188. +AS_VAR_SET([LIBS], [$LIBS_SAVED])
  189. +
  190. +AM_CONDITIONAL([AMD], [test "x$have_amd" = "xyes"])
  191. +
  192. +m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
  193. +AC_CONFIG_FILES([
  194. + ldl.pc
  195. + Makefile
  196. + Demo/Makefile
  197. + Doc/Makefile
  198. + Include/Makefile
  199. + Matrix/Makefile
  200. + Source/Makefile
  201. +])
  202. +AC_OUTPUT
  203. diff --git a/ldl.pc.in b/ldl.pc.in
  204. new file mode 100644
  205. --- /dev/null
  206. +++ b/ldl.pc.in
  207. @@ -0,0 +1,12 @@
  208. +prefix=@prefix@
  209. +exec_prefix=@exec_prefix@
  210. +libdir=@libdir@
  211. +includedir=@includedir@
  212. +
  213. +Name: @PACKAGE_NAME@
  214. +Description: A simple LDL^T factorization
  215. +Version: @PACKAGE_VERSION@
  216. +URL: @PACKAGE_URL@
  217. +Requires.private: suitesparseconfig
  218. +Libs: -L${libdir} -lldl
  219. +Cflags: -I${includedir}/ldl
  220. diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
  221. new file mode 100644
  222. --- /dev/null
  223. +++ b/m4/ax_code_coverage.m4
  224. @@ -0,0 +1,271 @@
  225. +# ===========================================================================
  226. +# https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
  227. +# ===========================================================================
  228. +#
  229. +# SYNOPSIS
  230. +#
  231. +# AX_CODE_COVERAGE()
  232. +#
  233. +# DESCRIPTION
  234. +#
  235. +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
  236. +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
  237. +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
  238. +# build target (program or library) which should be built with code
  239. +# coverage support. Also defines CODE_COVERAGE_RULES which should be
  240. +# substituted in your Makefile; and $enable_code_coverage which can be
  241. +# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
  242. +# and substituted, and corresponds to the value of the
  243. +# --enable-code-coverage option, which defaults to being disabled.
  244. +#
  245. +# Test also for gcov program and create GCOV variable that could be
  246. +# substituted.
  247. +#
  248. +# Note that all optimization flags in CFLAGS must be disabled when code
  249. +# coverage is enabled.
  250. +#
  251. +# Usage example:
  252. +#
  253. +# configure.ac:
  254. +#
  255. +# AX_CODE_COVERAGE
  256. +#
  257. +# Makefile.am:
  258. +#
  259. +# @CODE_COVERAGE_RULES@
  260. +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
  261. +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
  262. +# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
  263. +# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
  264. +#
  265. +# This results in a "check-code-coverage" rule being added to any
  266. +# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
  267. +# has been configured with --enable-code-coverage). Running `make
  268. +# check-code-coverage` in that directory will run the module's test suite
  269. +# (`make check`) and build a code coverage report detailing the code which
  270. +# was touched, then print the URI for the report.
  271. +#
  272. +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
  273. +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
  274. +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
  275. +# deprecated. They have the same value.
  276. +#
  277. +# This code was derived from Makefile.decl in GLib, originally licenced
  278. +# under LGPLv2.1+.
  279. +#
  280. +# LICENSE
  281. +#
  282. +# Copyright (c) 2012, 2016 Philip Withnall
  283. +# Copyright (c) 2012 Xan Lopez
  284. +# Copyright (c) 2012 Christian Persch
  285. +# Copyright (c) 2012 Paolo Borelli
  286. +# Copyright (c) 2012 Dan Winship
  287. +# Copyright (c) 2015 Bastien ROUCARIES
  288. +#
  289. +# This library is free software; you can redistribute it and/or modify it
  290. +# under the terms of the GNU Lesser General Public License as published by
  291. +# the Free Software Foundation; either version 2.1 of the License, or (at
  292. +# your option) any later version.
  293. +#
  294. +# This library is distributed in the hope that it will be useful, but
  295. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  296. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
  297. +# General Public License for more details.
  298. +#
  299. +# You should have received a copy of the GNU Lesser General Public License
  300. +# along with this program. If not, see <https://www.gnu.org/licenses/>.
  301. +
  302. +#serial 27
  303. +
  304. +AC_DEFUN([_AX_CODE_COVERAGE_ENABLED],[
  305. + # check for gcov
  306. + AC_CHECK_TOOL([GCOV],
  307. + [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
  308. + [:])
  309. + AS_IF([test "X$GCOV" = "X:"],
  310. + [AC_MSG_ERROR([gcov is needed to do coverage])])
  311. + AC_SUBST([GCOV])
  312. +
  313. + dnl Check if gcc is being used
  314. + AS_IF([ test "$GCC" = "no" ], [
  315. + AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
  316. + ])
  317. +
  318. + AC_CHECK_PROG([LCOV], [lcov], [lcov])
  319. + AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
  320. +
  321. + AS_IF([ test x"$LCOV" = x ], [
  322. + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
  323. + ])
  324. +
  325. + AS_IF([ test x"$GENHTML" = x ], [
  326. + AC_MSG_ERROR([Could not find genhtml from the lcov package])
  327. + ])
  328. +
  329. + dnl Build the code coverage flags
  330. + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
  331. + CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
  332. + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  333. + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  334. + CODE_COVERAGE_LIBS="-lgcov"
  335. + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
  336. +
  337. + AC_SUBST([CODE_COVERAGE_CPPFLAGS])
  338. + AC_SUBST([CODE_COVERAGE_CFLAGS])
  339. + AC_SUBST([CODE_COVERAGE_CXXFLAGS])
  340. + AC_SUBST([CODE_COVERAGE_LIBS])
  341. + AC_SUBST([CODE_COVERAGE_LDFLAGS])
  342. +
  343. + [CODE_COVERAGE_RULES_CHECK='
  344. + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
  345. + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
  346. +']
  347. + [CODE_COVERAGE_RULES_CAPTURE='
  348. + $(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)
  349. + $(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)
  350. + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
  351. + $(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)
  352. + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
  353. +']
  354. + [CODE_COVERAGE_RULES_CLEAN='
  355. +clean: code-coverage-clean
  356. +distclean: code-coverage-clean
  357. +code-coverage-clean:
  358. + -$(LCOV) --directory $(top_builddir) -z
  359. + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  360. + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
  361. +']
  362. +])
  363. +
  364. +AC_DEFUN([_AX_CODE_COVERAGE_DISABLED],[
  365. + [CODE_COVERAGE_RULES_CHECK='
  366. + @echo "Need to reconfigure with --enable-code-coverage"
  367. + ']
  368. + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
  369. + CODE_COVERAGE_RULES_CLEAN=''
  370. +])
  371. +
  372. +AC_DEFUN([AX_CODE_COVERAGE],[
  373. + dnl Check for --enable-code-coverage
  374. +
  375. + # allow to override gcov location
  376. + AC_ARG_WITH([gcov],
  377. + [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
  378. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
  379. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
  380. +
  381. + AC_MSG_CHECKING([whether to build with code coverage support])
  382. + AC_ARG_ENABLE([code-coverage],
  383. + AS_HELP_STRING([--enable-code-coverage],
  384. + [Whether to enable code coverage support]),,
  385. + enable_code_coverage=no)
  386. +
  387. + AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test "x$enable_code_coverage" = xyes])
  388. + AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
  389. + AC_MSG_RESULT($enable_code_coverage)
  390. +
  391. + AS_IF([ test "x$enable_code_coverage" = xyes ], [
  392. + _AX_CODE_COVERAGE_ENABLED
  393. + ], [
  394. + _AX_CODE_COVERAGE_DISABLED
  395. + ])
  396. +
  397. +[CODE_COVERAGE_RULES='
  398. +# Code coverage
  399. +#
  400. +# Optional:
  401. +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
  402. +# Multiple directories may be specified, separated by whitespace.
  403. +# (Default: $(top_builddir))
  404. +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
  405. +# by lcov for code coverage. (Default:
  406. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
  407. +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
  408. +# reports to be created. (Default:
  409. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
  410. +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
  411. +# set to 0 to disable it and leave empty to stay with the default.
  412. +# (Default: empty)
  413. +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
  414. +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  415. +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
  416. +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  417. +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
  418. +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
  419. +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  420. +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
  421. +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  422. +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
  423. +# lcov instance. (Default: empty)
  424. +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
  425. +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  426. +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
  427. +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  428. +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
  429. +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  430. +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
  431. +#
  432. +# The generated report will be titled using the $(PACKAGE_NAME) and
  433. +# $(PACKAGE_VERSION). In order to add the current git hash to the title,
  434. +# use the git-version-gen script, available online.
  435. +
  436. +# Optional variables
  437. +CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
  438. +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
  439. +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
  440. +CODE_COVERAGE_BRANCH_COVERAGE ?=
  441. +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  442. +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  443. +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  444. +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
  445. +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  446. +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  447. +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
  448. +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  449. +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
  450. +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  451. +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  452. +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  453. +CODE_COVERAGE_IGNORE_PATTERN ?=
  454. +
  455. +GITIGNOREFILES ?=
  456. +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  457. +
  458. +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
  459. +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
  460. +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
  461. + $(CODE_COVERAGE_OUTPUT_FILE);
  462. +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
  463. +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
  464. +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
  465. + $(CODE_COVERAGE_IGNORE_PATTERN);
  466. +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
  467. +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
  468. +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
  469. +code_coverage_quiet = $(code_coverage_quiet_$(V))
  470. +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
  471. +code_coverage_quiet_0 = --quiet
  472. +
  473. +# sanitizes the test-name: replaces with underscores: dashes and dots
  474. +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
  475. +
  476. +# Use recursive makes in order to ignore errors during check
  477. +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
  478. +
  479. +# Capture code coverage data
  480. +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
  481. +
  482. +# Hook rule executed before code-coverage-capture, overridable by the user
  483. +code-coverage-capture-hook:
  484. +
  485. +'"$CODE_COVERAGE_RULES_CLEAN"'
  486. +
  487. +A''M_DISTCHECK_CONFIGURE_FLAGS ?=
  488. +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
  489. +
  490. +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
  491. +']
  492. +
  493. + AC_SUBST([CODE_COVERAGE_RULES])
  494. + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
  495. +])