autoconfiscate.diff 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  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,273 @@
  6. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(SUITESPARSECONFIG_CFLAGS)
  7. +LDADD = $(top_builddir)/Source/libcxsparse.la
  8. +
  9. +check_PROGRAMS = \
  10. + cs_demo1 \
  11. + cs_demo2 \
  12. + cs_demo3 \
  13. + cs_di_demo1 \
  14. + cs_di_demo2 \
  15. + cs_di_demo3 \
  16. + cs_dl_demo1 \
  17. + cs_dl_demo2 \
  18. + cs_dl_demo3 \
  19. + cs_ci_demo1 \
  20. + cs_ci_demo2 \
  21. + cs_ci_demo3 \
  22. + cs_cl_demo1 \
  23. + cs_cl_demo2 \
  24. + cs_cl_demo3 \
  25. + cs_idemo \
  26. + cs_ldemo
  27. +
  28. +check_LTLIBRARIES = \
  29. + libcs_demo.la \
  30. + libcs_di_demo.la \
  31. + libcs_dl_demo.la \
  32. + libcs_ci_demo.la \
  33. + libcs_cl_demo.la
  34. +
  35. +cs_demo1_SOURCES = cs_demo1.c
  36. +cs_demo2_SOURCES = cs_demo2.c
  37. +cs_demo3_SOURCES = cs_demo3.c
  38. +libcs_demo_la_SOURCES = cs_demo.c cs_demo.h
  39. +cs_demo2_LDADD = libcs_demo.la $(LDADD)
  40. +cs_demo3_LDADD = libcs_demo.la $(LDADD)
  41. +
  42. +cs_di_demo1_SOURCES = cs_di_demo1.c
  43. +cs_di_demo2_SOURCES = cs_di_demo2.c
  44. +cs_di_demo3_SOURCES = cs_di_demo3.c
  45. +libcs_di_demo_la_SOURCES = cs_di_demo.c cs_di_demo.h
  46. +cs_di_demo2_LDADD = libcs_di_demo.la $(LDADD)
  47. +cs_di_demo3_LDADD = libcs_di_demo.la $(LDADD)
  48. +
  49. +cs_dl_demo1_SOURCES = cs_dl_demo1.c
  50. +cs_dl_demo2_SOURCES = cs_dl_demo2.c
  51. +cs_dl_demo3_SOURCES = cs_dl_demo3.c
  52. +libcs_dl_demo_la_SOURCES = cs_dl_demo.c cs_dl_demo.h
  53. +cs_dl_demo2_LDADD = libcs_dl_demo.la $(LDADD)
  54. +cs_dl_demo3_LDADD = libcs_dl_demo.la $(LDADD)
  55. +cs_dl_demo1_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG
  56. +cs_dl_demo2_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG
  57. +cs_dl_demo3_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG
  58. +libcs_dl_demo_la_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG
  59. +
  60. +cs_ci_demo1_SOURCES = cs_ci_demo1.c
  61. +cs_ci_demo2_SOURCES = cs_ci_demo2.c
  62. +cs_ci_demo3_SOURCES = cs_ci_demo3.c
  63. +libcs_ci_demo_la_SOURCES = cs_ci_demo.c cs_ci_demo.h
  64. +libcs_ci_demo_la_LIBADD = -lm
  65. +cs_ci_demo2_LDADD = libcs_ci_demo.la $(LDADD)
  66. +cs_ci_demo3_LDADD = libcs_ci_demo.la $(LDADD)
  67. +cs_ci_demo1_CPPFLAGS = $(AM_CPPFLAGS) -DCS_COMPLEX
  68. +cs_ci_demo2_CPPFLAGS = $(AM_CPPFLAGS) -DCS_COMPLEX
  69. +cs_ci_demo3_CPPFLAGS = $(AM_CPPFLAGS) -DCS_COMPLEX
  70. +libcs_ci_demo_la_CPPFLAGS = $(AM_CPPFLAGS) -DCS_COMPLEX
  71. +
  72. +cs_cl_demo1_SOURCES = cs_cl_demo1.c
  73. +cs_cl_demo2_SOURCES = cs_cl_demo2.c
  74. +cs_cl_demo3_SOURCES = cs_cl_demo3.c
  75. +libcs_cl_demo_la_SOURCES = cs_cl_demo.c cs_cl_demo.h
  76. +libcs_cl_demo_la_LIBADD = -lm
  77. +cs_cl_demo2_LDADD = libcs_cl_demo.la $(LDADD)
  78. +cs_cl_demo3_LDADD = libcs_cl_demo.la $(LDADD)
  79. +cs_cl_demo1_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG -DCS_COMPLEX
  80. +cs_cl_demo2_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG -DCS_COMPLEX
  81. +cs_cl_demo3_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG -DCS_COMPLEX
  82. +libcs_cl_demo_la_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG -DCS_COMPLEX
  83. +
  84. +cs_idemo_SOURCES = cs_idemo.c
  85. +
  86. +cs_ldemo_SOURCES = cs_ldemo.c
  87. +cs_ldemo_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG
  88. +
  89. +if !CODE_COVERAGE_ENABLED
  90. +MATRICES = \
  91. + $(top_srcdir)/Matrix/ash219 \
  92. + $(top_srcdir)/Matrix/bcsstk01 \
  93. + $(top_srcdir)/Matrix/bcsstk16 \
  94. + $(top_srcdir)/Matrix/c4 \
  95. + $(top_srcdir)/Matrix/c_mbeacxc \
  96. + $(top_srcdir)/Matrix/c_west0067 \
  97. + $(top_srcdir)/Matrix/fs_183_1 \
  98. + $(top_srcdir)/Matrix/lp_afiro \
  99. + $(top_srcdir)/Matrix/mbeacxc \
  100. + $(top_srcdir)/Matrix/mhd1280b \
  101. + $(top_srcdir)/Matrix/neumann \
  102. + $(top_srcdir)/Matrix/qc324 \
  103. + $(top_srcdir)/Matrix/t1 \
  104. + $(top_srcdir)/Matrix/t2 \
  105. + $(top_srcdir)/Matrix/t3 \
  106. + $(top_srcdir)/Matrix/t4 \
  107. + $(top_srcdir)/Matrix/west0067 \
  108. + $(top_srcdir)/Matrix/young1c
  109. +
  110. +check-local: $(check_PROGRAMS) $(MATRICES)
  111. + -./cs_demo1 < $(top_srcdir)/Matrix/t1
  112. + -./cs_demo2 < $(top_srcdir)/Matrix/t1
  113. + -./cs_demo2 < $(top_srcdir)/Matrix/fs_183_1
  114. + -./cs_demo2 < $(top_srcdir)/Matrix/west0067
  115. + -./cs_demo2 < $(top_srcdir)/Matrix/lp_afiro
  116. + -./cs_demo2 < $(top_srcdir)/Matrix/ash219
  117. + -./cs_demo2 < $(top_srcdir)/Matrix/mbeacxc
  118. + -./cs_demo2 < $(top_srcdir)/Matrix/bcsstk01
  119. + -./cs_demo3 < $(top_srcdir)/Matrix/bcsstk01
  120. + -./cs_demo2 < $(top_srcdir)/Matrix/bcsstk16
  121. + -./cs_demo3 < $(top_srcdir)/Matrix/bcsstk16
  122. + -./cs_di_demo1 < $(top_srcdir)/Matrix/t1
  123. + -./cs_di_demo2 < $(top_srcdir)/Matrix/t1
  124. + -./cs_di_demo2 < $(top_srcdir)/Matrix/fs_183_1
  125. + -./cs_di_demo2 < $(top_srcdir)/Matrix/west0067
  126. + -./cs_di_demo2 < $(top_srcdir)/Matrix/lp_afiro
  127. + -./cs_di_demo2 < $(top_srcdir)/Matrix/ash219
  128. + -./cs_di_demo2 < $(top_srcdir)/Matrix/mbeacxc
  129. + -./cs_di_demo2 < $(top_srcdir)/Matrix/bcsstk01
  130. + -./cs_di_demo3 < $(top_srcdir)/Matrix/bcsstk01
  131. + -./cs_di_demo2 < $(top_srcdir)/Matrix/bcsstk16
  132. + -./cs_di_demo3 < $(top_srcdir)/Matrix/bcsstk16
  133. + -./cs_dl_demo1 < $(top_srcdir)/Matrix/t1
  134. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/t1
  135. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/fs_183_1
  136. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/west0067
  137. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/lp_afiro
  138. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/ash219
  139. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/mbeacxc
  140. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/bcsstk01
  141. + -./cs_dl_demo3 < $(top_srcdir)/Matrix/bcsstk01
  142. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/bcsstk16
  143. + -./cs_dl_demo3 < $(top_srcdir)/Matrix/bcsstk16
  144. + -./cs_ci_demo1 < $(top_srcdir)/Matrix/t2
  145. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/t2
  146. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/t3
  147. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/t4
  148. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c_west0067
  149. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c_mbeacxc
  150. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/young1c
  151. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/qc324
  152. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/neumann
  153. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c4
  154. + -./cs_ci_demo3 < $(top_srcdir)/Matrix/c4
  155. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/mhd1280b
  156. + -./cs_ci_demo3 < $(top_srcdir)/Matrix/mhd1280b
  157. + -./cs_cl_demo1 < $(top_srcdir)/Matrix/t2
  158. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/t2
  159. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/t3
  160. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/t4
  161. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c_west0067
  162. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c_mbeacxc
  163. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/young1c
  164. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/qc324
  165. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/neumann
  166. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c4
  167. + -./cs_cl_demo3 < $(top_srcdir)/Matrix/c4
  168. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/mhd1280b
  169. + -./cs_cl_demo3 < $(top_srcdir)/Matrix/mhd1280b
  170. + -./cs_idemo < $(top_srcdir)/Matrix/t2
  171. + -./cs_ldemo < $(top_srcdir)/Matrix/t2
  172. +
  173. +else
  174. +MATRICES = \
  175. + $(top_srcdir)/Tcov/czero \
  176. + $(top_srcdir)/Tcov/nil \
  177. + $(top_srcdir)/Tcov/zero \
  178. + $(top_srcdir)/Matrix/ash219 \
  179. + $(top_srcdir)/Matrix/bcsstk01 \
  180. + $(top_srcdir)/Matrix/bcsstk16 \
  181. + $(top_srcdir)/Matrix/c4 \
  182. + $(top_srcdir)/Matrix/c_ibm32a \
  183. + $(top_srcdir)/Matrix/c_ibm32b \
  184. + $(top_srcdir)/Matrix/c_mbeacxc \
  185. + $(top_srcdir)/Matrix/c_west0067 \
  186. + $(top_srcdir)/Matrix/fs_183_1 \
  187. + $(top_srcdir)/Matrix/ibm32a \
  188. + $(top_srcdir)/Matrix/ibm32b \
  189. + $(top_srcdir)/Matrix/lp_afiro \
  190. + $(top_srcdir)/Matrix/mbeacxc \
  191. + $(top_srcdir)/Matrix/mhd1280b \
  192. + $(top_srcdir)/Matrix/neumann \
  193. + $(top_srcdir)/Matrix/qc324 \
  194. + $(top_srcdir)/Matrix/t1 \
  195. + $(top_srcdir)/Matrix/t2 \
  196. + $(top_srcdir)/Matrix/t3 \
  197. + $(top_srcdir)/Matrix/t4 \
  198. + $(top_srcdir)/Matrix/west0067 \
  199. + $(top_srcdir)/Matrix/young1c
  200. +
  201. +check-local: $(check_PROGRAMS) $(MATRICES)
  202. + -./cs_idemo < $(top_srcdir)/Matrix/t2
  203. + -./cs_ldemo < $(top_srcdir)/Matrix/t2
  204. + -./cs_di_demo1 < $(top_srcdir)/Matrix/t1
  205. + -./cs_di_demo1 < $(top_srcdir)/Tcov/nil
  206. + -./cs_di_demo1 < $(top_srcdir)/Tcov/zero
  207. + -./cs_di_demo2 < $(top_srcdir)/Tcov/nil
  208. + -./cs_di_demo2 < $(top_srcdir)/Tcov/zero
  209. + -./cs_di_demo2 < $(top_srcdir)/Matrix/t1
  210. + -./cs_di_demo2 < $(top_srcdir)/Matrix/bcsstk01
  211. + -./cs_di_demo2 < $(top_srcdir)/Matrix/fs_183_1
  212. + -./cs_di_demo2 < $(top_srcdir)/Matrix/west0067
  213. + -./cs_di_demo2 < $(top_srcdir)/Matrix/lp_afiro
  214. + -./cs_di_demo2 < $(top_srcdir)/Matrix/ash219
  215. + -./cs_di_demo2 < $(top_srcdir)/Matrix/mbeacxc
  216. + -./cs_di_demo2 < $(top_srcdir)/Matrix/bcsstk16
  217. + -./cs_di_demo2 < $(top_srcdir)/Matrix/ibm32a
  218. + -./cs_di_demo2 < $(top_srcdir)/Matrix/ibm32b
  219. + -./cs_di_demo3 < $(top_srcdir)/Tcov/nil
  220. + -./cs_di_demo3 < $(top_srcdir)/Matrix/bcsstk01
  221. + -./cs_di_demo3 < $(top_srcdir)/Matrix/bcsstk16
  222. + -./cs_dl_demo1 < $(top_srcdir)/Matrix/t1
  223. + -./cs_dl_demo1 < $(top_srcdir)/Tcov/nil
  224. + -./cs_dl_demo1 < $(top_srcdir)/Tcov/zero
  225. + -./cs_dl_demo2 < $(top_srcdir)/Tcov/nil
  226. + -./cs_dl_demo2 < $(top_srcdir)/Tcov/zero
  227. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/t1
  228. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/bcsstk01
  229. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/fs_183_1
  230. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/west0067
  231. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/lp_afiro
  232. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/ash219
  233. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/mbeacxc
  234. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/bcsstk16
  235. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/ibm32a
  236. + -./cs_dl_demo2 < $(top_srcdir)/Matrix/ibm32b
  237. + -./cs_dl_demo3 < $(top_srcdir)/Tcov/nil
  238. + -./cs_dl_demo3 < $(top_srcdir)/Matrix/bcsstk01
  239. + -./cs_dl_demo3 < $(top_srcdir)/Matrix/bcsstk16
  240. + -./cs_ci_demo1 < $(top_srcdir)/Matrix/t2
  241. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/t2
  242. + -./cs_ci_demo1 < $(top_srcdir)/Tcov/czero
  243. + -./cs_ci_demo2 < $(top_srcdir)/Tcov/czero
  244. + -./cs_ci_demo1 < $(top_srcdir)/Matrix/t3
  245. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/t3
  246. + -./cs_ci_demo1 < $(top_srcdir)/Matrix/t4
  247. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/t4
  248. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c_west0067
  249. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c_mbeacxc
  250. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c_ibm32a
  251. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c_ibm32b
  252. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/young1c
  253. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/qc324
  254. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/neumann
  255. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/c4
  256. + -./cs_ci_demo3 < $(top_srcdir)/Matrix/c4
  257. + -./cs_ci_demo2 < $(top_srcdir)/Matrix/mhd1280b
  258. + -./cs_ci_demo3 < $(top_srcdir)/Matrix/mhd1280b
  259. + -./cs_cl_demo1 < $(top_srcdir)/Matrix/t2
  260. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/t2
  261. + -./cs_cl_demo1 < $(top_srcdir)/Tcov/czero
  262. + -./cs_cl_demo2 < $(top_srcdir)/Tcov/czero
  263. + -./cs_cl_demo1 < $(top_srcdir)/Matrix/t3
  264. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/t3
  265. + -./cs_cl_demo1 < $(top_srcdir)/Matrix/t4
  266. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/t4
  267. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c_west0067
  268. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c_mbeacxc
  269. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c_ibm32a
  270. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c_ibm32b
  271. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/young1c
  272. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/qc324
  273. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/neumann
  274. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/c4
  275. + -./cs_cl_demo3 < $(top_srcdir)/Matrix/c4
  276. + -./cs_cl_demo2 < $(top_srcdir)/Matrix/mhd1280b
  277. + -./cs_cl_demo3 < $(top_srcdir)/Matrix/mhd1280b
  278. +endif
  279. diff --git a/Include/Makefile.am b/Include/Makefile.am
  280. new file mode 100644
  281. --- /dev/null
  282. +++ b/Include/Makefile.am
  283. @@ -0,0 +1 @@
  284. +pkginclude_HEADERS = cs.h
  285. diff --git a/Makefile.am b/Makefile.am
  286. new file mode 100644
  287. --- /dev/null
  288. +++ b/Makefile.am
  289. @@ -0,0 +1,9 @@
  290. +ACLOCAL_AMFLAGS = -I m4
  291. +
  292. +SUBDIRS = Include Source Matrix Demo Tcov
  293. +EXTRA_DIST = README.txt Doc/ChangeLog Doc/License.txt Doc/lesser.txt
  294. +
  295. +pkgconfig_DATA = cxsparse.pc
  296. +
  297. +CODE_COVERAGE_BRANCH_COVERAGE = 1
  298. +@CODE_COVERAGE_RULES@
  299. diff --git a/Matrix/Makefile.am b/Matrix/Makefile.am
  300. new file mode 100644
  301. --- /dev/null
  302. +++ b/Matrix/Makefile.am
  303. @@ -0,0 +1,23 @@
  304. +dist_noinst_DATA = \
  305. + ash219 \
  306. + bcsstk01 \
  307. + bcsstk16 \
  308. + c4 \
  309. + c_ibm32a \
  310. + c_ibm32b \
  311. + c_mbeacxc \
  312. + c_west0067 \
  313. + fs_183_1 \
  314. + ibm32a \
  315. + ibm32b \
  316. + lp_afiro \
  317. + mbeacxc \
  318. + mhd1280b \
  319. + neumann \
  320. + qc324 \
  321. + t1 \
  322. + t2 \
  323. + t3 \
  324. + t4 \
  325. + west0067 \
  326. + young1c
  327. diff --git a/Source/Makefile.am b/Source/Makefile.am
  328. new file mode 100644
  329. --- /dev/null
  330. +++ b/Source/Makefile.am
  331. @@ -0,0 +1,101 @@
  332. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(SUITESPARSECONFIG_CFLAGS)
  333. +
  334. +CS_SOURCE = \
  335. + cs_add.c \
  336. + cs_amd.c \
  337. + cs_chol.c \
  338. + cs_cholsol.c \
  339. + cs_compress.c \
  340. + cs_counts.c \
  341. + cs_cumsum.c \
  342. + cs_dfs.c \
  343. + cs_dmperm.c \
  344. + cs_droptol.c \
  345. + cs_dropzeros.c \
  346. + cs_dupl.c \
  347. + cs_entry.c \
  348. + cs_ereach.c \
  349. + cs_etree.c \
  350. + cs_fkeep.c \
  351. + cs_gaxpy.c \
  352. + cs_happly.c \
  353. + cs_house.c \
  354. + cs_ipvec.c \
  355. + cs_leaf.c \
  356. + cs_load.c \
  357. + cs_lsolve.c \
  358. + cs_ltsolve.c \
  359. + cs_lu.c \
  360. + cs_lusol.c \
  361. + cs_maxtrans.c \
  362. + cs_multiply.c \
  363. + cs_norm.c \
  364. + cs_permute.c \
  365. + cs_pinv.c \
  366. + cs_post.c \
  367. + cs_print.c \
  368. + cs_pvec.c \
  369. + cs_qr.c \
  370. + cs_qrsol.c \
  371. + cs_randperm.c \
  372. + cs_reach.c \
  373. + cs_scatter.c \
  374. + cs_scc.c \
  375. + cs_schol.c \
  376. + cs_spsolve.c \
  377. + cs_sqr.c \
  378. + cs_symperm.c \
  379. + cs_tdfs.c \
  380. + cs_transpose.c \
  381. + cs_updown.c \
  382. + cs_usolve.c \
  383. + cs_util.c \
  384. + cs_utsolve.c
  385. +
  386. +if !CODE_COVERAGE_ENABLED
  387. +CS_SOURCE += \
  388. + cs_malloc.c
  389. +else
  390. +CS_SOURCE += \
  391. + $(top_srcdir)/Tcov/cstcov_malloc_test.c \
  392. + $(top_srcdir)/Tcov/cstcov_malloc_test.h
  393. +endif
  394. +
  395. +lib_LTLIBRARIES = \
  396. + libcxsparse.la
  397. +
  398. +noinst_LTLIBRARIES = \
  399. + libcxsparse_di.la \
  400. + libcxsparse_dl.la \
  401. + libcxsparse_ci.la \
  402. + libcxsparse_cl.la \
  403. + libcs_convert.la
  404. +
  405. +libcxsparse_di_la_SOURCES = $(CS_SOURCE)
  406. +libcxsparse_di_la_LIBADD = -lm $(CODE_COVERAGE_LIBS)
  407. +libcxsparse_di_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS)
  408. +libcxsparse_di_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  409. +
  410. +libcxsparse_dl_la_SOURCES = $(CS_SOURCE)
  411. +libcxsparse_dl_la_LIBADD = -lm $(CODE_COVERAGE_LIBS)
  412. +libcxsparse_dl_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS) -DCS_LONG
  413. +libcxsparse_dl_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  414. +
  415. +libcxsparse_ci_la_SOURCES = $(CS_SOURCE)
  416. +libcxsparse_ci_la_LIBADD = -lm $(CODE_COVERAGE_LIBS)
  417. +libcxsparse_ci_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS) -DCS_COMPLEX
  418. +libcxsparse_ci_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  419. +
  420. +libcxsparse_cl_la_SOURCES = $(CS_SOURCE)
  421. +libcxsparse_cl_la_LIBADD = -lm $(CODE_COVERAGE_LIBS)
  422. +libcxsparse_cl_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS) -DCS_LONG -DCS_COMPLEX
  423. +libcxsparse_cl_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  424. +
  425. +libcs_convert_la_SOURCES = cs_convert.c
  426. +libcs_convert_la_LIBADD = $(CODE_COVERAGE_LIBS)
  427. +libcs_convert_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS)
  428. +libcs_convert_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  429. +
  430. +libcxsparse_la_SOURCES =
  431. +libcxsparse_la_LIBADD = libcxsparse_di.la libcxsparse_dl.la libcxsparse_ci.la libcxsparse_cl.la libcs_convert.la
  432. +libcxsparse_la_LDFLAGS = -no-undefined -release $(PACKAGE_VERSION)
  433. diff --git a/Tcov/Makefile.am b/Tcov/Makefile.am
  434. new file mode 100644
  435. --- /dev/null
  436. +++ b/Tcov/Makefile.am
  437. @@ -0,0 +1,78 @@
  438. +AM_CPPFLAGS = -I$(top_srcdir)/Include -I$(top_srcdir)/Demo $(SUITESPARSECONFIG_CFLAGS)
  439. +LDADD = $(top_builddir)/Source/libcxsparse.la
  440. +
  441. +EXTRA_DIST = \
  442. + README.txt
  443. +
  444. +dist_noinst_DATA = \
  445. + czero \
  446. + nil \
  447. + zero
  448. +
  449. +if CODE_COVERAGE_ENABLED
  450. +check_PROGRAMS = \
  451. + cstcov_di_test \
  452. + cstcov_dl_test \
  453. + cstcov_ci_test \
  454. + cstcov_cl_test
  455. +
  456. +cstcov_di_test_SOURCES = cstcov_test.c
  457. +cstcov_di_test_LDADD = $(top_builddir)/Demo/libcs_di_demo.la $(LDADD)
  458. +
  459. +cstcov_dl_test_SOURCES = cstcov_test.c
  460. +cstcov_dl_test_LDADD = $(top_builddir)/Demo/libcs_dl_demo.la $(LDADD)
  461. +cstcov_dl_test_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG
  462. +
  463. +cstcov_ci_test_SOURCES = cstcov_test.c
  464. +cstcov_ci_test_LDADD = $(top_builddir)/Demo/libcs_ci_demo.la $(LDADD)
  465. +cstcov_ci_test_CPPFLAGS = $(AM_CPPFLAGS) -DCS_COMPLEX
  466. +
  467. +cstcov_cl_test_SOURCES = cstcov_test.c
  468. +cstcov_cl_test_LDADD = $(top_builddir)/Demo/libcs_cl_demo.la $(LDADD)
  469. +cstcov_cl_test_CPPFLAGS = $(AM_CPPFLAGS) -DCS_LONG -DCS_COMPLEX
  470. +
  471. +MATRICES = \
  472. + $(top_srcdir)/Tcov/nil \
  473. + $(top_srcdir)/Tcov/zero \
  474. + $(top_srcdir)/Matrix/ash219 \
  475. + $(top_srcdir)/Matrix/bcsstk01 \
  476. + $(top_srcdir)/Matrix/fs_183_1 \
  477. + $(top_srcdir)/Matrix/lp_afiro \
  478. + $(top_srcdir)/Matrix/mhd1280b \
  479. + $(top_srcdir)/Matrix/neumann \
  480. + $(top_srcdir)/Matrix/qc324 \
  481. + $(top_srcdir)/Matrix/t1 \
  482. + $(top_srcdir)/Matrix/t2 \
  483. + $(top_srcdir)/Matrix/west0067 \
  484. + $(top_srcdir)/Matrix/young1c
  485. +
  486. +check-local: $(check_PROGRAMS) $(MATRICES)
  487. + -./cstcov_di_test $(top_srcdir)/Tcov/nil > test_di_nil.out
  488. + -./cstcov_di_test $(top_srcdir)/Tcov/zero > test_di_zero.out
  489. + -./cstcov_di_test $(top_srcdir)/Matrix/t1 > test_di_t1.out
  490. + -./cstcov_di_test $(top_srcdir)/Matrix/bcsstk01 > test_di_k1.out
  491. + -./cstcov_di_test $(top_srcdir)/Matrix/fs_183_1 > test_di_fs.out
  492. + -./cstcov_di_test $(top_srcdir)/Matrix/west0067 > test_di_we.out
  493. + -./cstcov_di_test $(top_srcdir)/Matrix/ash219 > test_di_ash.out
  494. + -./cstcov_di_test $(top_srcdir)/Matrix/lp_afiro > test_di_afiro.out
  495. + -./cstcov_dl_test $(top_srcdir)/Tcov/nil > test_dl_nil.out
  496. + -./cstcov_dl_test $(top_srcdir)/Tcov/zero > test_dl_zero.out
  497. + -./cstcov_dl_test $(top_srcdir)/Matrix/t1 > test_dl_t1.out
  498. + -./cstcov_dl_test $(top_srcdir)/Matrix/bcsstk01 > test_dl_k1.out
  499. + -./cstcov_dl_test $(top_srcdir)/Matrix/fs_183_1 > test_dl_fs.out
  500. + -./cstcov_dl_test $(top_srcdir)/Matrix/west0067 > test_dl_we.out
  501. + -./cstcov_dl_test $(top_srcdir)/Matrix/ash219 > test_dl_ash.out
  502. + -./cstcov_dl_test $(top_srcdir)/Matrix/lp_afiro > test_dl_afiro.out
  503. + -./cstcov_ci_test $(top_srcdir)/Matrix/t2 > test_ci_t2.out
  504. + -./cstcov_ci_test $(top_srcdir)/Matrix/young1c > test_ci_young1c.out
  505. + -./cstcov_ci_test $(top_srcdir)/Matrix/qc324 > test_ci_qc324.out
  506. + -./cstcov_ci_test $(top_srcdir)/Matrix/neumann > test_ci_neumann.out
  507. + -./cstcov_ci_test $(top_srcdir)/Matrix/mhd1280b > test_ci_mhd1280b.out
  508. + -./cstcov_cl_test $(top_srcdir)/Matrix/t2 > test_cl_t2.out
  509. + -./cstcov_cl_test $(top_srcdir)/Matrix/young1c > test_cl_young1c.out
  510. + -./cstcov_cl_test $(top_srcdir)/Matrix/qc324 > test_cl_qc324.out
  511. + -./cstcov_cl_test $(top_srcdir)/Matrix/neumann > test_cl_neumann.out
  512. + -./cstcov_cl_test $(top_srcdir)/Matrix/mhd1280b > test_cl_mhd1280b.out
  513. +endif
  514. +
  515. +CLEANFILES = *.out
  516. diff --git a/configure.ac b/configure.ac
  517. new file mode 100644
  518. --- /dev/null
  519. +++ b/configure.ac
  520. @@ -0,0 +1,50 @@
  521. +# -*- Autoconf -*-
  522. +# Process this file with autoconf to produce a configure script.
  523. +
  524. +AC_PREREQ([2.69])
  525. +AC_INIT([CXSparse],[3.2.0],[https://github.com/DrTimothyAldenDavis/SuiteSparse],[cxsparse],[http://www.suitesparse.com/])
  526. +AC_CONFIG_SRCDIR([Source/cs_print.c])
  527. +AC_CONFIG_AUX_DIR([build-aux])
  528. +AC_CONFIG_MACRO_DIR([m4])
  529. +AC_CONFIG_HEADERS([config.h])
  530. +AM_INIT_AUTOMAKE([foreign])
  531. +AM_SILENT_RULES([yes])
  532. +LT_INIT([disable-static])
  533. +
  534. +# Checks for programs.
  535. +PKG_PROG_PKG_CONFIG
  536. +AC_PROG_INSTALL
  537. +AC_PROG_CC
  538. +AX_CODE_COVERAGE
  539. +
  540. +AS_VAR_SET([LIBS_SAVED], [$LIBS])
  541. +
  542. +# Checks for libraries.
  543. +AC_CHECK_LIB([m], [sqrt])
  544. +
  545. +PKG_CHECK_MODULES([SUITESPARSECONFIG], [suitesparseconfig])
  546. +
  547. +# Checks for header files.
  548. +AC_CHECK_HEADERS([limits.h stdlib.h])
  549. +
  550. +# Checks for typedefs, structures, and compiler characteristics.
  551. +AC_TYPE_SIZE_T
  552. +
  553. +# Checks for library functions.
  554. +AC_FUNC_MALLOC
  555. +AC_FUNC_REALLOC
  556. +AC_CHECK_FUNCS([sqrt])
  557. +
  558. +AS_VAR_SET([LIBS], [$LIBS_SAVED])
  559. +
  560. +m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
  561. +AC_CONFIG_FILES([
  562. + cxsparse.pc
  563. + Makefile
  564. + Demo/Makefile
  565. + Include/Makefile
  566. + Matrix/Makefile
  567. + Source/Makefile
  568. + Tcov/Makefile
  569. +])
  570. +AC_OUTPUT
  571. diff --git a/cxsparse.pc.in b/cxsparse.pc.in
  572. new file mode 100644
  573. --- /dev/null
  574. +++ b/cxsparse.pc.in
  575. @@ -0,0 +1,13 @@
  576. +prefix=@prefix@
  577. +exec_prefix=@exec_prefix@
  578. +libdir=@libdir@
  579. +includedir=@includedir@
  580. +
  581. +Name: @PACKAGE_NAME@
  582. +Description: An extended version of CSparse
  583. +Version: @PACKAGE_VERSION@
  584. +URL: @PACKAGE_URL@
  585. +Requires.private: suitesparseconfig
  586. +Libs: -L${libdir} -lcxsparse
  587. +Libs.private: -lm
  588. +Cflags: -I${includedir}/cxsparse
  589. diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
  590. new file mode 100644
  591. --- /dev/null
  592. +++ b/m4/ax_code_coverage.m4
  593. @@ -0,0 +1,271 @@
  594. +# ===========================================================================
  595. +# https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
  596. +# ===========================================================================
  597. +#
  598. +# SYNOPSIS
  599. +#
  600. +# AX_CODE_COVERAGE()
  601. +#
  602. +# DESCRIPTION
  603. +#
  604. +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
  605. +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
  606. +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
  607. +# build target (program or library) which should be built with code
  608. +# coverage support. Also defines CODE_COVERAGE_RULES which should be
  609. +# substituted in your Makefile; and $enable_code_coverage which can be
  610. +# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
  611. +# and substituted, and corresponds to the value of the
  612. +# --enable-code-coverage option, which defaults to being disabled.
  613. +#
  614. +# Test also for gcov program and create GCOV variable that could be
  615. +# substituted.
  616. +#
  617. +# Note that all optimization flags in CFLAGS must be disabled when code
  618. +# coverage is enabled.
  619. +#
  620. +# Usage example:
  621. +#
  622. +# configure.ac:
  623. +#
  624. +# AX_CODE_COVERAGE
  625. +#
  626. +# Makefile.am:
  627. +#
  628. +# @CODE_COVERAGE_RULES@
  629. +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
  630. +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
  631. +# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
  632. +# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
  633. +#
  634. +# This results in a "check-code-coverage" rule being added to any
  635. +# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
  636. +# has been configured with --enable-code-coverage). Running `make
  637. +# check-code-coverage` in that directory will run the module's test suite
  638. +# (`make check`) and build a code coverage report detailing the code which
  639. +# was touched, then print the URI for the report.
  640. +#
  641. +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
  642. +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
  643. +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
  644. +# deprecated. They have the same value.
  645. +#
  646. +# This code was derived from Makefile.decl in GLib, originally licenced
  647. +# under LGPLv2.1+.
  648. +#
  649. +# LICENSE
  650. +#
  651. +# Copyright (c) 2012, 2016 Philip Withnall
  652. +# Copyright (c) 2012 Xan Lopez
  653. +# Copyright (c) 2012 Christian Persch
  654. +# Copyright (c) 2012 Paolo Borelli
  655. +# Copyright (c) 2012 Dan Winship
  656. +# Copyright (c) 2015 Bastien ROUCARIES
  657. +#
  658. +# This library is free software; you can redistribute it and/or modify it
  659. +# under the terms of the GNU Lesser General Public License as published by
  660. +# the Free Software Foundation; either version 2.1 of the License, or (at
  661. +# your option) any later version.
  662. +#
  663. +# This library is distributed in the hope that it will be useful, but
  664. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  665. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
  666. +# General Public License for more details.
  667. +#
  668. +# You should have received a copy of the GNU Lesser General Public License
  669. +# along with this program. If not, see <https://www.gnu.org/licenses/>.
  670. +
  671. +#serial 27
  672. +
  673. +AC_DEFUN([_AX_CODE_COVERAGE_ENABLED],[
  674. + # check for gcov
  675. + AC_CHECK_TOOL([GCOV],
  676. + [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
  677. + [:])
  678. + AS_IF([test "X$GCOV" = "X:"],
  679. + [AC_MSG_ERROR([gcov is needed to do coverage])])
  680. + AC_SUBST([GCOV])
  681. +
  682. + dnl Check if gcc is being used
  683. + AS_IF([ test "$GCC" = "no" ], [
  684. + AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
  685. + ])
  686. +
  687. + AC_CHECK_PROG([LCOV], [lcov], [lcov])
  688. + AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
  689. +
  690. + AS_IF([ test x"$LCOV" = x ], [
  691. + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
  692. + ])
  693. +
  694. + AS_IF([ test x"$GENHTML" = x ], [
  695. + AC_MSG_ERROR([Could not find genhtml from the lcov package])
  696. + ])
  697. +
  698. + dnl Build the code coverage flags
  699. + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
  700. + CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
  701. + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  702. + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  703. + CODE_COVERAGE_LIBS="-lgcov"
  704. + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
  705. +
  706. + AC_SUBST([CODE_COVERAGE_CPPFLAGS])
  707. + AC_SUBST([CODE_COVERAGE_CFLAGS])
  708. + AC_SUBST([CODE_COVERAGE_CXXFLAGS])
  709. + AC_SUBST([CODE_COVERAGE_LIBS])
  710. + AC_SUBST([CODE_COVERAGE_LDFLAGS])
  711. +
  712. + [CODE_COVERAGE_RULES_CHECK='
  713. + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
  714. + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
  715. +']
  716. + [CODE_COVERAGE_RULES_CAPTURE='
  717. + $(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)
  718. + $(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)
  719. + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
  720. + $(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)
  721. + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
  722. +']
  723. + [CODE_COVERAGE_RULES_CLEAN='
  724. +clean: code-coverage-clean
  725. +distclean: code-coverage-clean
  726. +code-coverage-clean:
  727. + -$(LCOV) --directory $(top_builddir) -z
  728. + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  729. + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
  730. +']
  731. +])
  732. +
  733. +AC_DEFUN([_AX_CODE_COVERAGE_DISABLED],[
  734. + [CODE_COVERAGE_RULES_CHECK='
  735. + @echo "Need to reconfigure with --enable-code-coverage"
  736. + ']
  737. + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
  738. + CODE_COVERAGE_RULES_CLEAN=''
  739. +])
  740. +
  741. +AC_DEFUN([AX_CODE_COVERAGE],[
  742. + dnl Check for --enable-code-coverage
  743. +
  744. + # allow to override gcov location
  745. + AC_ARG_WITH([gcov],
  746. + [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
  747. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
  748. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
  749. +
  750. + AC_MSG_CHECKING([whether to build with code coverage support])
  751. + AC_ARG_ENABLE([code-coverage],
  752. + AS_HELP_STRING([--enable-code-coverage],
  753. + [Whether to enable code coverage support]),,
  754. + enable_code_coverage=no)
  755. +
  756. + AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test "x$enable_code_coverage" = xyes])
  757. + AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
  758. + AC_MSG_RESULT($enable_code_coverage)
  759. +
  760. + AS_IF([ test "x$enable_code_coverage" = xyes ], [
  761. + _AX_CODE_COVERAGE_ENABLED
  762. + ], [
  763. + _AX_CODE_COVERAGE_DISABLED
  764. + ])
  765. +
  766. +[CODE_COVERAGE_RULES='
  767. +# Code coverage
  768. +#
  769. +# Optional:
  770. +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
  771. +# Multiple directories may be specified, separated by whitespace.
  772. +# (Default: $(top_builddir))
  773. +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
  774. +# by lcov for code coverage. (Default:
  775. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
  776. +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
  777. +# reports to be created. (Default:
  778. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
  779. +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
  780. +# set to 0 to disable it and leave empty to stay with the default.
  781. +# (Default: empty)
  782. +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
  783. +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  784. +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
  785. +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  786. +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
  787. +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
  788. +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  789. +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
  790. +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  791. +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
  792. +# lcov instance. (Default: empty)
  793. +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
  794. +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  795. +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
  796. +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  797. +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
  798. +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  799. +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
  800. +#
  801. +# The generated report will be titled using the $(PACKAGE_NAME) and
  802. +# $(PACKAGE_VERSION). In order to add the current git hash to the title,
  803. +# use the git-version-gen script, available online.
  804. +
  805. +# Optional variables
  806. +CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
  807. +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
  808. +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
  809. +CODE_COVERAGE_BRANCH_COVERAGE ?=
  810. +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  811. +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  812. +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  813. +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
  814. +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  815. +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  816. +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
  817. +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  818. +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
  819. +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  820. +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  821. +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  822. +CODE_COVERAGE_IGNORE_PATTERN ?=
  823. +
  824. +GITIGNOREFILES ?=
  825. +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  826. +
  827. +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
  828. +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
  829. +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
  830. + $(CODE_COVERAGE_OUTPUT_FILE);
  831. +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
  832. +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
  833. +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
  834. + $(CODE_COVERAGE_IGNORE_PATTERN);
  835. +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
  836. +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
  837. +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
  838. +code_coverage_quiet = $(code_coverage_quiet_$(V))
  839. +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
  840. +code_coverage_quiet_0 = --quiet
  841. +
  842. +# sanitizes the test-name: replaces with underscores: dashes and dots
  843. +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
  844. +
  845. +# Use recursive makes in order to ignore errors during check
  846. +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
  847. +
  848. +# Capture code coverage data
  849. +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
  850. +
  851. +# Hook rule executed before code-coverage-capture, overridable by the user
  852. +code-coverage-capture-hook:
  853. +
  854. +'"$CODE_COVERAGE_RULES_CLEAN"'
  855. +
  856. +A''M_DISTCHECK_CONFIGURE_FLAGS ?=
  857. +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
  858. +
  859. +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
  860. +']
  861. +
  862. + AC_SUBST([CODE_COVERAGE_RULES])
  863. + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
  864. +])