autoconfiscate.diff 20 KB

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